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

Michael Niedermayer michaelni
Tue Aug 10 19:39:38 CEST 2010


On Tue, Aug 10, 2010 at 05:15:19PM +0200, Stefano Sabatini wrote:
> 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?

because that way you dont need casts, you can just use p->vid->blah

> 
> Also in this case I'd prefer *video_props, *audio_props, really don't
> like arbitrary contractions.

i think these would become too long in code as these could be used alot

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- 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/20100810/7ab95a52/attachment.pgp>



More information about the ffmpeg-devel mailing list