Commit d0061e77 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mxfdec: Detect jpeg2000 through codec_ul too

Fixes Ticket2345
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ce3bcb94
...@@ -166,6 +166,7 @@ typedef struct MXFDescriptor { ...@@ -166,6 +166,7 @@ typedef struct MXFDescriptor {
enum MXFMetadataSetType type; enum MXFMetadataSetType type;
UID essence_container_ul; UID essence_container_ul;
UID essence_codec_ul; UID essence_codec_ul;
UID codec_ul;
AVRational sample_rate; AVRational sample_rate;
AVRational aspect_ratio; AVRational aspect_ratio;
int width; int width;
...@@ -974,6 +975,9 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int ...@@ -974,6 +975,9 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
case 0x3004: case 0x3004:
avio_read(pb, descriptor->essence_container_ul, 16); avio_read(pb, descriptor->essence_container_ul, 16);
break; break;
case 0x3005:
avio_read(pb, descriptor->codec_ul, 16);
break;
case 0x3006: case 0x3006:
descriptor->linked_track_id = avio_rb32(pb); descriptor->linked_track_id = avio_rb32(pb);
break; break;
...@@ -1151,6 +1155,11 @@ static const MXFCodecUL mxf_data_essence_container_uls[] = { ...@@ -1151,6 +1155,11 @@ static const MXFCodecUL mxf_data_essence_container_uls[] = {
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE }, { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
}; };
static const MXFCodecUL mxf_codec_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x09,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 },
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
static const char* const mxf_data_essence_descriptor[] = { static const char* const mxf_data_essence_descriptor[] = {
"vbi_vanc_smpte_436M", "vbi_vanc_smpte_436M",
}; };
...@@ -1950,6 +1959,11 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) ...@@ -1950,6 +1959,11 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
/* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */ /* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */
codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul); codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul);
st->codec->codec_id = (enum AVCodecID)codec_ul->id; st->codec->codec_id = (enum AVCodecID)codec_ul->id;
if (st->codec->codec_id == AV_CODEC_ID_NONE) {
codec_ul = mxf_get_codec_ul(mxf_codec_uls, &descriptor->codec_ul);
st->codec->codec_id = (enum AVCodecID)codec_ul->id;
}
av_log(mxf->fc, AV_LOG_VERBOSE, "%s: Universal Label: ", av_log(mxf->fc, AV_LOG_VERBOSE, "%s: Universal Label: ",
avcodec_get_name(st->codec->codec_id)); avcodec_get_name(st->codec->codec_id));
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment