On date Sunday 2011-07-03 19:24:12 +0200, Diego Biurrun encoded:
> ---
>  libavformat/rdt.h             |   14 +++++++-------
>  libavformat/rtsp.h            |    4 ++--
>  libavformat/url.h             |    6 +++---
>  libavutil/parseutils.c        |   16 ++++++++--------
>  libavutil/parseutils.h        |    2 +-
>  libswscale/swscale.h          |    7 ++++---
>  libswscale/swscale_unscaled.c |   11 ++++++-----
>  libswscale/utils.c            |    8 ++++++--
>  8 files changed, 37 insertions(+), 31 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);

I prefer the old names (bikeshed, so not strong on this).

>  /**
>   * 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.c b/libavutil/parseutils.c
> index 0272c3e..6d5ad7c 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -484,7 +484,7 @@ static time_t mktimegm(struct tm *tm)
>      return t;
>  }
>  
> -int av_parse_time(int64_t *timeval, const char *datestr, int duration)
> +int av_parse_time(int64_t *timeval, const char *timestr, int duration)
>  {
>      const char *p;
>      int64_t t;
> @@ -506,19 +506,19 @@ int av_parse_time(int64_t *timeval, const char 
> *datestr, int duration)
>  #undef time
>      time_t now = time(0);
>  
> -    len = strlen(datestr);
> +    len = strlen(timestr);
>      if (len > 0)
> -        lastch = datestr[len - 1];
> +        lastch = timestr[len - 1];
>      else
>          lastch = '\0';
>      is_utc = (lastch == 'z' || lastch == 'Z');
>  
>      memset(&dt, 0, sizeof(dt));
>  
> -    p = datestr;
> +    p = timestr;
>      q = NULL;
>      if (!duration) {
> -        if (!strncasecmp(datestr, "now", len)) {
> +        if (!strncasecmp(timestr, "now", len)) {
>              *timeval = (int64_t) now * 1000000;
>              return 0;
>          }
> @@ -555,15 +555,15 @@ int av_parse_time(int64_t *timeval, const char 
> *datestr, int duration)
>              }
>          }
>      } else {
> -        /* parse datestr as a duration */
> +        /* parse timestr as a duration */
>          if (p[0] == '-') {
>              negative = 1;
>              ++p;
>          }
> -        /* parse datestr as HH:MM:SS */
> +        /* parse timestr as HH:MM:SS */
>          q = small_strptime(p, time_fmt[0], &dt);
>          if (!q) {
> -            /* parse datestr as S+ */
> +            /* parse timestr as S+ */
>              dt.tm_sec = strtol(p, (char **)&q, 10);
>              if (q == p) {
>                  /* the parsing didn't succeed */
> diff --git a/libavutil/parseutils.h b/libavutil/parseutils.h
> index befbbb5..0d78b3e 100644
> --- a/libavutil/parseutils.h
> +++ b/libavutil/parseutils.h
> @@ -83,7 +83,7 @@ int av_parse_color(uint8_t *rgba_color, const char 
> *color_string, int slen,
>   * January, 1970 up to the time of the parsed date.  If timestr cannot
>   * be successfully parsed, set *time to INT64_MIN.
>  
> - * @param datestr a string representing a date or a duration.
> + * @param timestr a string representing a date or a duration.
>   * - If a date the syntax is:
>   * @code
>   * [{YYYY-MM-DD|YYYYMMDD}[T|t| 
> ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
> diff --git a/libswscale/swscale.h b/libswscale/swscale.h
> index 3899596..3ea51dc 100644
> --- a/libswscale/swscale.h
> +++ b/libswscale/swscale.h

> @@ -213,7 +213,7 @@ 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
>   *                  the source slice
> @@ -230,8 +230,9 @@ 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(struct SwsContext *c, const uint8_t* const srcSlice[],
> +              const int srcStride[], int srcSliceY, int srcSliceH,
> +              uint8_t* const dst[], const int dstStride[]);

I still prefer "context" over "c", but that's bikeshed so this is
acceptable if you prefer this way.

>  
>  /**
>   * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
> diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
> index 87cd655..4489372 100644
> --- a/libswscale/swscale_unscaled.c
> +++ b/libswscale/swscale_unscaled.c
> @@ -733,18 +733,19 @@ static int check_image_pointers(uint8_t *data[4], enum 
> PixelFormat pix_fmt,
>   * swscale wrapper, so we don't need to export the SwsContext.
>   * Assumes planar YUV to be in YUV order instead of YVU.
>   */
> -int sws_scale(SwsContext *c, const uint8_t* const src[], const int 
> srcStride[], int srcSliceY,
> -              int srcSliceH, uint8_t* const dst[], const int dstStride[])
> +int sws_scale(struct SwsContext *c, const uint8_t* const srcSlice[],
> +              const int srcStride[], int srcSliceY, int srcSliceH,
> +              uint8_t* const dst[], const int dstStride[])
>  {
>      int i;
> -    const uint8_t* src2[4]= {src[0], src[1], src[2], src[3]};
> +    const uint8_t* src2[4]= {srcSlice[0], srcSlice[1], srcSlice[2], 
> srcSlice[3]};
>      uint8_t* dst2[4]= {dst[0], dst[1], dst[2], dst[3]};
>  
>      // do not mess up sliceDir if we have a "trailing" 0-size slice
>      if (srcSliceH == 0)
>          return 0;
>  
> -    if (!check_image_pointers(src, c->srcFormat, srcStride)) {
> +    if (!check_image_pointers(srcSlice, c->srcFormat, srcStride)) {
>          av_log(c, AV_LOG_ERROR, "bad src image pointers\n");
>          return 0;
>      }
> @@ -765,7 +766,7 @@ int sws_scale(SwsContext *c, const uint8_t* const src[], 
> const int srcStride[],
>          for (i=0; i<256; i++) {
>              int p, r, g, b,y,u,v;
>              if(c->srcFormat == PIX_FMT_PAL8) {
> -                p=((const uint32_t*)(src[1]))[i];
> +                p=((const uint32_t*)(srcSlice[1]))[i];
>                  r= (p>>16)&0xFF;
>                  g= (p>> 8)&0xFF;
>                  b=  p     &0xFF;
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index 9f0bb7a..9ecba7d 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -711,7 +711,9 @@ static void getSubSampleFactors(int *h, int *v, enum 
> PixelFormat format)
>      *v = av_pix_fmt_descriptors[format].log2_chroma_h;
>  }
>  

> -int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int 
> srcRange, const int table[4], int dstRange, int brightness, int contrast, int 
> saturation)
> +int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
> +                             int srcRange, const int table[4], int dstRange,
> +                             int brightness, int contrast, int saturation)
>  {
>      memcpy(c->srcColorspaceTable, inv_table, sizeof(int)*4);
>      memcpy(c->dstColorspaceTable,     table, sizeof(int)*4);
> @@ -734,7 +736,9 @@ int sws_setColorspaceDetails(SwsContext *c, const int 
> inv_table[4], int srcRange
>      return 0;
>  }
>  
> -int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, 
> int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
> +int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
> +                             int *srcRange, int **table, int *dstRange,
> +                             int *brightness, int *contrast, int *saturation)

Maybe the cosmetics part in a separate patch (so the patch is more
readable).

[...]
-- 
God was satisfied with his own work, and that is fatal.
                -- Samuel Butler
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to