Commit 8b1e9206 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '259fe728'

* commit '259fe728':
  mxf: Extract origin information from material and source track
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4a4d0258 259fe728
...@@ -114,6 +114,7 @@ typedef struct { ...@@ -114,6 +114,7 @@ typedef struct {
UID *structural_components_refs; UID *structural_components_refs;
int structural_components_count; int structural_components_count;
int64_t duration; int64_t duration;
uint8_t origin;
} MXFSequence; } MXFSequence;
typedef struct { typedef struct {
...@@ -715,6 +716,9 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID ...@@ -715,6 +716,9 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID
case 0x0201: case 0x0201:
avio_read(pb, sequence->data_definition_ul, 16); avio_read(pb, sequence->data_definition_ul, 16);
break; break;
case 0x4b02:
sequence->origin = avio_r8(pb);
break;
case 0x1001: case 0x1001:
sequence->structural_components_count = avio_rb32(pb); sequence->structural_components_count = avio_rb32(pb);
sequence->structural_components_refs = av_calloc(sequence->structural_components_count, sizeof(UID)); sequence->structural_components_refs = av_calloc(sequence->structural_components_count, sizeof(UID));
...@@ -1627,6 +1631,16 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) ...@@ -1627,6 +1631,16 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
} }
} }
st->need_parsing = AVSTREAM_PARSE_HEADERS; st->need_parsing = AVSTREAM_PARSE_HEADERS;
if (material_track->sequence->origin) {
char material_origin[3];
snprintf(material_origin, sizeof(material_origin), "%d", material_track->sequence->origin);
av_dict_set(&st->metadata, "material_track_origin", material_origin, 0);
}
if (source_track->sequence->origin) {
char source_origin[3];
snprintf(source_origin, sizeof(source_origin), "%d", source_track->sequence->origin);
av_dict_set(&st->metadata, "source_track_origin", source_origin, 0);
}
} else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul); container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
/* Only overwrite existing codec ID if it is unset or A-law, which is the default according to SMPTE RP 224. */ /* Only overwrite existing codec ID if it is unset or A-law, which is the default according to SMPTE RP 224. */
......
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