[FFmpeg-devel] [RFC] libavfilter audio framework - split patches

Michael Niedermayer michaelni
Wed Jul 14 16:40:19 CEST 2010


On Mon, Jul 12, 2010 at 09:26:04AM -0700, S.N. Hemanth Meenakshisundaram wrote:
[...]
> Also attached are the new patches for generalization that go on top of
> existing libavfilter code before any audio stuff.
> 
> First patch makes formats an int in the avfilter structures instead of
> enum PixelFormat.
> 
> Second patch (on top of first) makes AVFilterPic into AVFilterBuffer,
> removes w and h from it, makes required code changes and makes the
> AVFilterBUffer's format field an int instead of PixelFormat.
> 
> Regards,
> 

[...]
> @@ -181,7 +181,7 @@ typedef struct AVFilterFormats AVFilterFormats;
>  struct AVFilterFormats
>  {
>      unsigned format_count;      ///< number of formats
> -    enum PixelFormat *formats;  ///< list of pixel formats
> +    int *formats;               ///< list of pixel formats
>  
>      unsigned refcount;          ///< number of references to this list
>      AVFilterFormats ***refs;    ///< references to this list
> @@ -193,7 +193,7 @@ struct AVFilterFormats
>   * @param pix_fmt list of pixel formats, terminated by PIX_FMT_NONE
>   * @return the format list, with no existing references
>   */
> -AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
> +AVFilterFormats *avfilter_make_format_list(const int *pix_fmts);
>  
>  /**
>   * Adds pix_fmt to the list of pixel formats contained in *avff.
> @@ -500,7 +500,7 @@ struct AVFilterLink
>  
>      int w;                      ///< agreed upon image width
>      int h;                      ///< agreed upon image height
> -    enum PixelFormat format;    ///< agreed upon image colorspace
> +    int format;                 ///< agreed upon image colorspace
>  
>      /**
>       * Lists of formats supported by the input and output filters respectively.
> diff --git a/libavfilter/formats.c b/libavfilter/formats.c

the comments should be updated too


> index 2a9bdb0..330ba20 100644
> --- a/libavfilter/formats.c
> +++ b/libavfilter/formats.c
> @@ -70,7 +70,7 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
>      return ret;
>  }
>  
> -AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts)
> +AVFilterFormats *avfilter_make_format_list(const int *pix_fmts)
>  {
>      AVFilterFormats *formats;
>      int count;
>  avfilter.h |   13 ++++++-------
>  defaults.c |    8 ++++----
>  2 files changed, 10 insertions(+), 11 deletions(-)
> dd5840aba678d0769ec52064cc56d837ef56df34  pic2buffer.diff
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index fbe8d77..6f7e274 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -67,11 +67,11 @@ typedef struct AVFilterPad     AVFilterPad;
>   * should not store pointers to this structure directly, but instead use the
>   * AVFilterPicRef structure below.
>   */
> -typedef struct AVFilterPic
> +typedef struct AVFilterBuffer
>  {
>      uint8_t *data[4];           ///< picture data for each plane
>      int linesize[4];            ///< number of bytes per line
> -    enum PixelFormat format;    ///< colorspace
> +    int format;                 ///< colorspace
>  
>      unsigned refcount;          ///< number of references to this image
>  

this mixes in changes that belong to the first patch


[...]
> @@ -34,14 +34,14 @@ static void avfilter_default_free_video_buffer(AVFilterPic *pic)
>   * alloc & free cycle currently implemented. */
>  AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
>  {
> -    AVFilterPic *pic = av_mallocz(sizeof(AVFilterPic));
> +    AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
>      AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef));
>      int i, tempsize;
>      char *buf;
>  
>      ref->pic   = pic;
> -    ref->w     = pic->w = w;
> -    ref->h     = pic->h = h;
> +    ref->w     = w;
> +    ref->h     = h;

variable renaming and functional changes belong to seperate patches


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100714/2fd2a3eb/attachment.pgp>



More information about the ffmpeg-devel mailing list