aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-03-07 10:52:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-08 00:39:56 +0100
commitf6daa9f4f67a40b2f5d8725ae6268d08dba505a0 (patch)
tree8245548b20843f978e21d81b8cb024a94d475acc /libavformat
parent8c7721e7094c6d2a9079e26be135d673becaddaa (diff)
downloadffmpeg-f6daa9f4f67a40b2f5d8725ae6268d08dba505a0.tar.gz
mxfdec: Add intra_only flag to MXFTrack
This allows future assumptions to be made without affecting non-intra files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index b9c9034dc4..5808a04fd2 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -121,6 +121,7 @@ typedef struct {
int track_id;
uint8_t track_number[4];
AVRational edit_rate;
+ int intra_only;
} MXFTrack;
typedef struct {
@@ -893,6 +894,19 @@ static const MXFCodecUL mxf_picture_essence_container_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14, CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE },
};
+
+/* EC ULs for intra-only formats */
+static const MXFCodecUL mxf_intra_only_essence_container_uls[] = {
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14, CODEC_ID_MPEG2VIDEO }, /* MXF-GC SMPTE D-10 Mappings */
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE },
+};
+
+/* intra-only PictureEssenceCoding ULs, where no corresponding EC UL exists */
+static const MXFCodecUL mxf_intra_only_picture_essence_coding_uls[] = {
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14, CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra Profiles */
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE },
+};
+
static const MXFCodecUL mxf_sound_essence_container_uls[] = {
// sound essence container uls
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
@@ -1252,6 +1266,14 @@ finish_decoding_index:
return ret;
}
+static int mxf_is_intra_only(MXFDescriptor *descriptor)
+{
+ return mxf_get_codec_ul(mxf_intra_only_essence_container_uls,
+ &descriptor->essence_container_ul)->id != CODEC_ID_NONE ||
+ mxf_get_codec_ul(mxf_intra_only_picture_essence_coding_uls,
+ &descriptor->essence_codec_ul)->id != CODEC_ID_NONE;
+}
+
static int mxf_parse_structural_metadata(MXFContext *mxf)
{
MXFPackage *material_package = NULL;
@@ -1408,6 +1430,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
st->codec->extradata_size = descriptor->extradata_size;
}
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ source_track->intra_only = mxf_is_intra_only(descriptor);
container_ul = mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul);
if (st->codec->codec_id == CODEC_ID_NONE)
st->codec->codec_id = container_ul->id;