On date Sunday 2011-07-03 16:42:11 +0200, Diego Biurrun encoded:
> ---
>  libavformat/rdt.h      |   14 +++++++-------
>  libavformat/rtsp.h     |    4 ++--
>  libavformat/url.h      |    6 +++---
>  libavutil/parseutils.h |    2 +-
>  libswscale/swscale.h   |   14 +++++++-------
>  5 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/libavformat/rdt.h b/libavformat/rdt.h
> index 08b17bc..a393299 100644
> --- a/libavformat/rdt.h
> +++ b/libavformat/rdt.h
> @@ -80,16 +80,16 @@ void ff_rdt_subscribe_rule(char *cmd, int size,
>   *
>   * @param buf input buffer
>   * @param len length of input buffer
> - * @param set_id will be set to the set ID this packet belongs to
> - * @param seq_no will be set to the sequence number of the packet
> - * @param stream_id will be set to the stream ID this packet belongs to
> - * @param is_keyframe will be whether this packet belongs to a keyframe
> - * @param timestamp will be set to the timestamp of the packet
> + * @param pset_id will be set to the set ID this packet belongs to
> + * @param pseq_no will be set to the sequence number of the packet
> + * @param pstream_id will be set to the stream ID this packet belongs to
> + * @param pis_keyframe will be whether this packet belongs to a keyframe
> + * @param ptimestamp will be set to the timestamp of the packet
>   * @return the amount of bytes consumed, or negative on error
>   */
>  int ff_rdt_parse_header(const uint8_t *buf, int len,
> -                        int *set_id, int *seq_no, int *stream_id,
> -                        int *is_keyframe, uint32_t *timestamp);
> +                        int *pset_id, int *pseq_no, int *pstream_id,
> +                        int *pis_keyframe, uint32_t *ptimestamp);
>  
>  /**
>   * Parse RDT-style packet data (header + media data).
> diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
> index 5eae6bf..0625692 100644
> --- a/libavformat/rtsp.h
> +++ b/libavformat/rtsp.h
> @@ -488,9 +488,9 @@ void ff_rtsp_close_streams(AVFormatContext *s);
>  /**
>   * Close all connection handles within the RTSP (de)muxer
>   *
> - * @param rt RTSP (de)muxer context
> + * @param s RTSP (de)muxer context
>   */
> -void ff_rtsp_close_connections(AVFormatContext *rt);
> +void ff_rtsp_close_connections(AVFormatContext *s);
>  
>  /**
>   * Get the description of the stream and set up the RTSPStream child
> diff --git a/libavformat/url.h b/libavformat/url.h
> index caafe07..d69d0bc 100644
> --- a/libavformat/url.h
> +++ b/libavformat/url.h
> @@ -74,12 +74,12 @@ typedef struct URLProtocol {
>   * @return 0 in case of success, a negative value corresponding to an
>   * AVERROR code in case of failure
>   */
> -int ffurl_alloc(URLContext **h, const char *url, int flags);
> +int ffurl_alloc(URLContext **puc, const char *filename, int flags);
>  
>  /**
>   * Connect an URLContext that has been allocated by ffurl_alloc
>   */
> -int ffurl_connect(URLContext *h);
> +int ffurl_connect(URLContext *uc);
>  
>  /**
>   * Create an URLContext for accessing to the resource indicated by
> @@ -92,7 +92,7 @@ int ffurl_connect(URLContext *h);
>   * @return 0 in case of success, a negative value corresponding to an
>   * AVERROR code in case of failure
>   */
> -int ffurl_open(URLContext **h, const char *url, int flags);
> +int ffurl_open(URLContext **puc, const char *filename, int flags);
>  
>  /**
>   * Read up to size bytes from the resource accessed by h, and store
> diff --git a/libavutil/parseutils.h b/libavutil/parseutils.h
> index befbbb5..7fd78b3 100644
> --- a/libavutil/parseutils.h
> +++ b/libavutil/parseutils.h
> @@ -104,7 +104,7 @@ int av_parse_color(uint8_t *rgba_color, const char 
> *color_string, int slen,
>   * @return 0 in case of success, a negative value corresponding to an
>   * AVERROR code otherwise
>   */

> -int av_parse_time(int64_t *timeval, const char *timestr, int duration);
> +int av_parse_time(int64_t *timeval, const char *datestr, int duration);

timestr is a better name than "datestr" (timestr is not always a
date, may be a duration), better to change to other way around.

>  
>  /**
>   * Attempt to find a specific tag in a URL.
> diff --git a/libswscale/swscale.h b/libswscale/swscale.h
> index 3899596..0c2b500 100644
> --- a/libswscale/swscale.h
> +++ b/libswscale/swscale.h
> @@ -146,7 +146,7 @@ typedef struct {
>      SwsVector *chrV;
>  } SwsFilter;
>  
> -struct SwsContext;
> +typedef struct SwsContext SwsContext;

unrelated?

>  
>  /**
>   * Returns a positive value if pix_fmt is a supported input format, 0
> @@ -213,9 +213,9 @@ struct SwsContext *sws_getContext(int srcW, int srcH, 
> enum PixelFormat srcFormat
>   * top-bottom or bottom-top order. If slices are provided in
>   * non-sequential order the behavior of the function is undefined.
>   *
> - * @param context   the scaling context previously created with
> + * @param c         the scaling context previously created with
>   *                  sws_getContext()
> - * @param srcSlice  the array containing the pointers to the planes of
> + * @param src       the array containing the pointers to the planes of
>   *                  the source slice
>   * @param srcStride the array containing the strides for each plane of
>   *                  the source image
> @@ -230,21 +230,21 @@ struct SwsContext *sws_getContext(int srcW, int srcH, 
> enum PixelFormat srcFormat
>   *                  the destination image
>   * @return          the height of the output slice
>   */
> -int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], 
> const int srcStride[],
> -              int srcSliceY, int srcSliceH, uint8_t* const dst[], const int 
> dstStride[]);
> +int sws_scale(SwsContext *c, const uint8_t* const src[], const int 
> srcStride[], int srcSliceY,
> +              int srcSliceH, uint8_t* const dst[], const int dstStride[]);

"context" is better than "c", in general names in the headers are
better designed than names in the implementation, src -> srcSlice was
a change done by me for making more apparent the use of the variable.

Also sometimes the implementation names differ because you try to
avoid clashes with internal variable names and you want to keep sweet
and short the declaration names (or the opposite: you want to keep
short some vars), so there are some cases when it makes sense to have
.c/.h differ.
  
>  /**
>   * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
>   * @return -1 if not supported
>   */
> -int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
> +int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4],
>                               int srcRange, const int table[4], int dstRange,
>                               int brightness, int contrast, int saturation);
>  
>  /**
>   * @return -1 if not supported
>   */
> -int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
> +int sws_getColorspaceDetails(SwsContext *c, int **inv_table,
>                               int *srcRange, int **table, int *dstRange,
>                               int *brightness, int *contrast, int 
> *saturation);

This looks ok but unrelated.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to