aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mxf.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-08-03 09:14:56 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-08-03 09:14:56 +0000
commit8c5002db1770abedb79c1929a4c441fe2ad5ae83 (patch)
treeb8ebc022ac7f1d2c3a12ad534764b44abd0ad7ec /libavformat/mxf.c
parentcd035a6051bbaffa3f7f180e8b72d4b0741a8cec (diff)
downloadffmpeg-8c5002db1770abedb79c1929a4c441fe2ad5ae83.tar.gz
add codec detection based on essence container ul
Originally committed as revision 5904 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxf.c')
-rw-r--r--libavformat/mxf.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index 026c808552..3779917274 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -632,6 +632,20 @@ static const MXFCodecUL mxf_codec_uls[] = {
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, CODEC_ID_NONE },
};
+static const MXFCodecUL mxf_picture_essence_container_uls[] = {
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, CODEC_ID_NONE },
+};
+
+static const MXFCodecUL mxf_sound_essence_container_uls[] = {
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 }, CODEC_ID_PCM_S16LE }, /* AES Frame wrapped */
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 }, CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0xc0 MPA stream id */
+ //{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x05,0x01 }, CODEC_ID_PCM_AES3 }, /* D-10 Mapping 30Mbps PAL Extended Template */
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, CODEC_ID_NONE },
+};
+
static enum CodecID mxf_get_codec_id(const MXFCodecUL *uls, UID *uid)
{
while (uls->id != CODEC_ID_NONE) {
@@ -784,13 +798,18 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
}
#ifdef DEBUG
PRINT_KEY(descriptor->essence_codec_ul);
+ PRINT_KEY(descriptor->essence_container_ul);
#endif
st->codec->codec_id = mxf_get_codec_id(mxf_codec_uls, &descriptor->essence_codec_ul);
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
+ if (st->codec->codec_id == CODEC_ID_NONE)
+ st->codec->codec_id = mxf_get_codec_id(mxf_picture_essence_container_uls, &descriptor->essence_container_ul);
st->codec->width = descriptor->width;
st->codec->height = descriptor->height;
st->codec->bits_per_sample = descriptor->bits_per_sample; /* Uncompressed */
} else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
+ if (st->codec->codec_id == CODEC_ID_NONE)
+ st->codec->codec_id = mxf_get_codec_id(mxf_sound_essence_container_uls, &descriptor->essence_container_ul);
st->codec->channels = descriptor->channels;
st->codec->bits_per_sample = descriptor->bits_per_sample;
st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;