[FFmpeg-devel] [PATCH] flv: clarify use of video info/cmd frame.

Clément Bœsch ubitux at gmail.com
Tue Mar 20 08:00:18 CET 2012


On Mon, Mar 19, 2012 at 06:49:48PM +0100, Michael Niedermayer wrote:
> On Mon, Mar 19, 2012 at 02:52:49PM +0100, Clément Bœsch wrote:
> > From: Clément Bœsch <clement.boesch at smartjog.com>
> > 
> > Also add generated key frame in the enum, and doxycomment the existing
> > ones. Descriptions directly taken from the public specifications.
> > ---
> >  libavformat/flv.h    |    8 +++++---
> >  libavformat/flvdec.c |    2 +-
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/libavformat/flv.h b/libavformat/flv.h
> > index ef8eaab..c9f7b83 100644
> > --- a/libavformat/flv.h
> > +++ b/libavformat/flv.h
> > @@ -110,9 +110,11 @@ enum {
> >  };
> >  
> >  enum {
> > -    FLV_FRAME_KEY        = 1 << FLV_VIDEO_FRAMETYPE_OFFSET,
> > -    FLV_FRAME_INTER      = 2 << FLV_VIDEO_FRAMETYPE_OFFSET,
> > -    FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET,
> > +    FLV_FRAME_KEY            = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame)
> > +    FLV_FRAME_INTER          = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame)
> > +    FLV_FRAME_DISP_INTER     = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< disposable inter frame (H.263 only)
> > +    FLV_FRAME_GENERATED_KEY  = 4 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< generated key frame (reserved for server use only)
> > +    FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< video info/command frame
> >  };
> >  
> >  typedef enum {
> > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> > index 8ae7950..94fd76d 100644
> > --- a/libavformat/flvdec.c
> > +++ b/libavformat/flvdec.c
> > @@ -518,7 +518,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
> >          stream_type=FLV_STREAM_TYPE_VIDEO;
> >          flags = avio_r8(s->pb);
> >          size--;
> > -        if ((flags & 0xf0) == 0x50) /* video info / command frame */
> > +        if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD)
> 
> thats not the same as before, was the old wrong ?
> 

Pushed after clearing the misunderstanding on IRC with Michael.

We have:
  #define FLV_FRAME_VIDEO_INFO_C 0xf0

and the enum defines:
  FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET
                           = 5 << 4
                           = 0x50

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120320/76b00f7e/attachment.asc>


More information about the ffmpeg-devel mailing list