]> git.sesse.net Git - ffmpeg/commitdiff
Export profiles from the mpeg2 video decoder
authorBenjamin Larsson <benjamin@southpole.se>
Thu, 10 Mar 2011 10:29:56 +0000 (11:29 +0100)
committerRonald S. Bultje <rsbultje@gmail.com>
Thu, 10 Mar 2011 23:05:35 +0000 (18:05 -0500)
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/avcodec.h
libavcodec/mpeg12.c

index 3eedcf94638e52578386602475f44296dbb9cb41..d323e6635e1aa7ae26aef080fba3638af7c9c44c 100644 (file)
@@ -2277,6 +2277,7 @@ typedef struct AVCodecContext {
      */
      int profile;
 #define FF_PROFILE_UNKNOWN -99
+#define FF_PROFILE_RESERVED -100
 
 #define FF_PROFILE_AAC_MAIN 0
 #define FF_PROFILE_AAC_LOW  1
@@ -2289,6 +2290,13 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_DTS_HD_HRA  50
 #define FF_PROFILE_DTS_HD_MA   60
 
+#define FF_PROFILE_MPEG2_422    0
+#define FF_PROFILE_MPEG2_HIGH   1
+#define FF_PROFILE_MPEG2_SS     2
+#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
+#define FF_PROFILE_MPEG2_MAIN   4
+#define FF_PROFILE_MPEG2_SIMPLE 5
+
 #define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
 #define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
 
index 3c73627eeb0cc7adf28514bf15949517942abd24..e33f597ce7431a1fc3c209d8e0c93a7d54886005 100644 (file)
@@ -2471,6 +2471,18 @@ static int mpeg_decode_end(AVCodecContext *avctx)
     return 0;
 }
 
+static const AVProfile mpeg2_video_profiles[] = {
+    { FF_PROFILE_MPEG2_422,          "4:2:2"              },
+    { FF_PROFILE_MPEG2_HIGH,         "High"               },
+    { FF_PROFILE_MPEG2_SS,           "Spatially Scalable" },
+    { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable"       },
+    { FF_PROFILE_MPEG2_MAIN,         "Main"               },
+    { FF_PROFILE_MPEG2_SIMPLE,       "Simple"             },
+    { FF_PROFILE_RESERVED,           "Reserved"           },
+    { FF_PROFILE_RESERVED,           "Reserved"           },
+};
+
+
 AVCodec ff_mpeg1video_decoder = {
     "mpeg1video",
     AVMEDIA_TYPE_VIDEO,
@@ -2499,6 +2511,7 @@ AVCodec ff_mpeg2video_decoder = {
     .flush= flush,
     .max_lowres= 3,
     .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
+    .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
 };
 
 //legacy decoder