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

Michael Niedermayer michaelni
Thu Jul 22 13:41:56 CEST 2010


On Thu, Jul 22, 2010 at 01:15:23AM -0700, S.N. Hemanth Meenakshisundaram wrote:
> Splitting out the AVFilterBuffer data[4] -> data[8], linesize[4] ->
> linsesize[8] patch separately as requested. Patch also has the fix to
> avfilter_get_video_buffer that is required to adjust for this. Patch now
> works with make lavfitest and make test when applied on top of latest
> svn revision (r24294).
> 
> ---
>  libavfilter/avfilter.h |    4 ++--
>  libavfilter/defaults.c |   16 +++++++++++-----
>  2 files changed, 13 insertions(+), 7 deletions(-)
> 
> 
> 

>  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


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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100722/a72f6600/attachment.pgp>



More information about the ffmpeg-devel mailing list