[FFmpeg-devel] [PATCH] Separate video specific BufferRef properties into VideoProps

S.N. Hemanth Meenakshisundaram smeenaks
Tue Aug 10 17:44:31 CEST 2010


> On date Monday 2010-08-09 15:34:02 +0200, Michael Niedermayer encoded:
>> On Sat, Aug 07, 2010 at 06:23:22PM -0700, S.N. Hemanth Meenakshisundaram
>> wrote:
> [...]
>> >  /**
>> > + * Video specific properties in a reference to an AVFilterBuffer.
>> Since
>> > + * AVFilterBufferRef is common to different media formats, video
>> specific
>> > + * per reference properties must be separated out.
>> > + */
>> > +
>> > +typedef struct AVFilterBufferRefVideoProps
>> > +{
>> > +    AVRational pixel_aspect;    ///< pixel aspect ratio
>> > +    int w;                      ///< image width
>> > +    int h;                      ///< image height
>> > +    int interlaced;             ///< is frame interlaced
>> > +    int top_field_first;        ///< field order
>> > +} AVFilterBufferRefVideoProps;
>> > +
>> > +/**
>> >   * A reference to an AVFilterBuffer. Since filters can manipulate the
>> origin of
>> >   * a buffer to, for example, crop image without any memcpy, the
>> buffer origin
>> >   * and dimensions are per-reference properties. Linesize is also
>> useful for
>> > @@ -101,34 +117,41 @@ typedef struct AVFilterBufferRef
>> >      AVFilterBuffer *buf;        ///< the buffer 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
>> > -    int h;                      ///< image height
>> >      int format;                 ///< media format
>> >
>> >      int64_t pts;                ///< presentation timestamp in units
>> of 1/AV_TIME_BASE
>> >      int64_t pos;                ///< byte position in stream, -1 if
>> unknown
>> >
>> > -    AVRational pixel_aspect;    ///< pixel aspect ratio
>> > -
>> >      int perms;                  ///< permissions, see the AV_PERM_*
>> flags
>> >
>> > -    int interlaced;             ///< is frame interlaced
>> > -    int top_field_first;
>> > +    enum AVMediaType type;      ///< media type of buffer data
>> > +    void *props;                ///< media specific properties, cast
>> to right type
>>
>> AVFilterBufferRefVideoProps *vid;
>> AVFilterBufferRefAudioProps *aud;
>
> I have a slightly preference for a *props generic pointer, but two
> distinct fields are fine as well, can you say Michael why do you
> prefer like that?
>
> Also in this case I'd prefer *video_props, *audio_props, really don't
> like arbitrary contractions.


If I make separate fields for video and audio props, we may have to add
more  for other types of filters later on. Is that ok?

Regards,




More information about the ffmpeg-devel mailing list