[FFmpeg-cvslog] mpegvideo parser: move specific fields into private context

Rafaël Carré git at videolan.org
Sat Feb 11 01:35:44 CET 2012


ffmpeg | branch: master | Rafaël Carré <funman at videolan.org> | Wed Feb  8 17:46:50 2012 -0500| [07554ace702f66034954856bb45f654161fd011f] | committer: Diego Biurrun

mpegvideo parser: move specific fields into private context

This obviates using ParseContext1, which is slated for removal.

Signed-off-by: Diego Biurrun <diego at biurrun.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07554ace702f66034954856bb45f654161fd011f
---

 libavcodec/mpegvideo_parser.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 1798f83..f0b3b20 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -23,11 +23,19 @@
 #include "parser.h"
 #include "mpegvideo.h"
 
+struct MpvParseContext {
+    ParseContext pc;
+    AVRational frame_rate;
+    int progressive_sequence;
+    int width, height;
+};
+
+
 static void mpegvideo_extract_headers(AVCodecParserContext *s,
                                       AVCodecContext *avctx,
                                       const uint8_t *buf, int buf_size)
 {
-    ParseContext1 *pc = s->priv_data;
+    struct MpvParseContext *pc = s->priv_data;
     const uint8_t *buf_end = buf + buf_size;
     uint32_t start_code;
     int frame_rate_index, ext_type, bytes_left;
@@ -131,7 +139,7 @@ static int mpegvideo_parse(AVCodecParserContext *s,
                            const uint8_t **poutbuf, int *poutbuf_size,
                            const uint8_t *buf, int buf_size)
 {
-    ParseContext1 *pc1 = s->priv_data;
+    struct MpvParseContext *pc1 = s->priv_data;
     ParseContext *pc= &pc1->pc;
     int next;
 
@@ -175,8 +183,8 @@ static int mpegvideo_split(AVCodecContext *avctx,
 
 AVCodecParser ff_mpegvideo_parser = {
     .codec_ids      = { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
-    .priv_data_size = sizeof(ParseContext1),
+    .priv_data_size = sizeof(struct MpvParseContext),
     .parser_parse   = mpegvideo_parse,
-    .parser_close   = ff_parse1_close,
+    .parser_close   = ff_parse_close,
     .split          = mpegvideo_split,
 };



More information about the ffmpeg-cvslog mailing list