[FFmpeg-devel] [RFC] libavfilter audio framework - split patches
Stefano Sabatini
stefano.sabatini-lala
Fri Jul 16 19:30:59 CEST 2010
On date Friday 2010-07-16 00:58:57 -0700, S.N. Hemanth Meenakshisundaram encoded:
> On 07/15/2010 04:52 AM, S.N. Hemanth Meenakshisundaram wrote:
>> On 07/14/2010 07:51 AM, Michael Niedermayer wrote:
>>> On Wed, Jul 14, 2010 at 04:45:39PM +0200, Michael Niedermayer wrote:
>>>
>>>> On Tue, Jul 13, 2010 at 02:38:16AM -0700, S.N. Hemanth Meenakshisundaram wrote:
>>>>
>>>>> Stefano Sabatini wrote:
>>>>>
>>>> doesnt apply to svn
>>>>
>>> to elaborate on this, we need patches that apply to svn.
>>> you can send a patch series so that patch n depends on patches 0..n-1
>>> to be applied before it.
>>> but if patch x (x<n) is changed due to discussions all later patches
>>> must be rebased on the new code. We dont apply bad patches and then
>>> apply fixes on top.
>>>
>>>
>
> The doxy changes were interfering with applying of patch to avfilter.h
>
> Am sending the series of patches again with the changes pointed out
> earlier. These applied directly to SVN revision 24040 which is the one
> used by soc libavfilter repo. Tested with valgrind and by manually
> modifying SDL specs for different sample/channel formats.
>
> The changes were;
>
> 1. Separate variable naming & functional changes.
>
> 2. Put all enum to int changes in one patch
>
> 3. Fix af_resample to use separate primary and duplicate pointers so
> that uninit etc is easier.
>
> This first patch is variable and function renaming.
>
> Regards,
> Hemanth
>
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index f8b7654..96df532 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -67,7 +67,7 @@ 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
> @@ -83,13 +83,13 @@ typedef struct AVFilterPic
> * back into a memory pool to be reused later without the overhead of
> * reallocating it from scratch.
> */
> - void (*free)(struct AVFilterPic *pic);
> + void (*free)(struct AVFilterBuffer *pic);
>
> int w, h; ///< width and height of the allocated buffer
> -} AVFilterPic;
> +} AVFilterBuffer;
>
> /**
> - * A reference to an AVFilterPic. Since filters can manipulate the origin of
> + * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
> * a picture to, for example, crop image without any memcpy, the picture origin
> * and dimensions are per-reference properties. Linesize is also useful for
> * image flipping, frame to field filters, etc, and so is also per-reference.
> @@ -98,7 +98,7 @@ typedef struct AVFilterPic
> */
> typedef struct AVFilterPicRef
> {
> - AVFilterPic *pic; ///< the picture that this is a reference to
> + AVFilterBuffer *pic; ///< the picture that this is a reference to
> uint8_t *data[4]; ///< picture data for each plane
> int linesize[4]; ///< number of bytes per line
> int w; ///< image width
> diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
> index 0ac88f8..cef45b2 100644
> --- a/libavfilter/defaults.c
> +++ b/libavfilter/defaults.c
> @@ -23,10 +23,10 @@
> #include "avfilter.h"
>
> /* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */
> -static void avfilter_default_free_video_buffer(AVFilterPic *pic)
> +static void avfilter_default_free_buffer(AVFilterBuffer *ptr)
> {
> - av_free(pic->data[0]);
> - av_free(pic);
> + av_free(ptr->data[0]);
> + av_free(ptr);
> }
>
> /* TODO: set the buffer's priv member to a context structure for the whole
> @@ -34,7 +34,7 @@ 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;
> @@ -48,7 +48,7 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms,
>
> pic->refcount = 1;
> pic->format = link->format;
> - pic->free = avfilter_default_free_video_buffer;
> + pic->free = avfilter_default_free_buffer;
> ff_fill_linesize((AVPicture *)pic, pic->format, ref->w);
>
> for (i=0; i<4;i++)
Looks fine to me, OK to apply?
More information about the ffmpeg-devel
mailing list