summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMarc-Antoine Arnaud <arnaud.marcantoine@gmail.com>2014-07-22 18:08:04 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-07-28 22:17:42 +0200
commit259fe7280d0b63dc7a8ff017d44f26d3a84cfde8 (patch)
treefd3766dc96ada3773a6dcd0b01e44945e0858b02 /libavformat
parentc9d982aa11a6267611c3770792f0e04b48438348 (diff)
downloadffmpeg-259fe7280d0b63dc7a8ff017d44f26d3a84cfde8.tar.gz
mxf: Extract origin information from material and source track
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index bb876c0b46..ba76577e13 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -111,6 +111,7 @@ typedef struct {
UID *structural_components_refs;
int structural_components_count;
int64_t duration;
+ uint8_t origin;
} MXFSequence;
typedef struct {
@@ -686,6 +687,9 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID
case 0x0201:
avio_read(pb, sequence->data_definition_ul, 16);
break;
+ case 0x4b02:
+ sequence->origin = avio_r8(pb);
+ break;
case 0x1001:
sequence->structural_components_count = avio_rb32(pb);
if (sequence->structural_components_count >= UINT_MAX / sizeof(UID))
@@ -1589,6 +1593,16 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
}
}
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) {
container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
if (st->codec->codec_id == AV_CODEC_ID_NONE)