[FFmpeg-devel] [PATCH] Resize AVFilterBuffer data pointers, linesizes. Adjust pic refs to use only four.

S.N. Hemanth Meenakshisundaram smeenaks
Fri Jul 23 06:59:50 CEST 2010


>>  avfilter.h |    4 ++--
>>  defaults.c |   16 +++++++++++-----
>>  2 files changed, 13 insertions(+), 7 deletions(-)
>> ea6500130cae103756bee2d2ddd8e23fc879fa3b  0001-Resize-AVFilterBuffer-data-pointers-linesizes.-Adjus.patch
>> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
>> index 066bdc3..a9bec02 100644
>> --- a/libavfilter/avfilter.h
>> +++ b/libavfilter/avfilter.h
>> @@ -66,8 +66,8 @@ typedef struct AVFilterPad     AVFilterPad;
>>   */
>>  typedef struct AVFilterBuffer
>>  {
>> -    uint8_t *data[4];           ///< buffer data for each plane
>> -    int linesize[4];            ///< number of bytes per line
>> +    uint8_t *data[8];           ///< buffer data for each plane
>> +    int linesize[8];            ///< number of bytes per line
>>      int format;                 ///< media format
>>  
>>      unsigned refcount;          ///< number of references to this buffer
>> diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
>> index 27c8a3b..4253bb3 100644
>> --- a/libavfilter/defaults.c
>> +++ b/libavfilter/defaults.c
>> @@ -38,6 +38,8 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms,
>>      AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef));
>>      int i, tempsize;
>>      char *buf;
>> +    /* first four plane pointers and last four linesizes are unused for video */
>> +    uint8_t *newpic = (uint8_t *)pic + 4*sizeof(uint8_t *);
>>     
> this is a ugly hack, the first 4 plane pointers should be used for video
>
>
> [...]
>   

To fix this is it enough to pass the regular pic pointer as AVPicture *
and then copy the linesizes to the right location? Or should I write
versions of ff_fill_pointers and ff_fill_linesize that will fill the new
AVFilterBuffer instead of AVPicture?

Regards,




More information about the ffmpeg-devel mailing list