mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
add codec detection based on essence container ul
Originally committed as revision 5904 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cd035a6051
commit
8c5002db17
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user