History

avformat/mxfdec: set toolkit version metadata

Please check the string of toolkit version with below command: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf ./ffmpeg -i out.mxf .... toolkit_version : 58.65.101.0.0

Limin Wang committed 5 years ago

Commit 3f8db7e1 parent cba716f3 files · +26 −0Browse files

Unified · Split

3 files
  1. libavformat/mxfdec.c +24 −0
  2. tests/ref/fate/mxf-probe-applehdr10 +1 −0
  3. tests/ref/fate/mxf-probe-dnxhd +1 −0
libavformat/mxfdec.c+24−0
@@ -1978,6 +1978,15 @@ static int mxf_umid_to_str(UID ul, UID uid, char **str) · 1977 unmodified lines
19781978 return 0;
19791979 }
19801980
1981+static int mxf_version_to_str(uint16_t major, uint16_t minor, uint16_t tertiary,
1982+ uint16_t patch, uint16_t release, char **str)
1983+{
1984+ *str = av_asprintf("%d.%d.%d.%d.%d", major, minor, tertiary, patch, release);
1985+ if (!*str)
1986+ return AVERROR(ENOMEM);
1987+ return 0;
1988+}
1989+
19811990 static int mxf_add_umid_metadata(AVDictionary **pm, const char *key, MXFPackage* package)
19821991 {
19831992 char *str;
@@ -2739,6 +2748,17 @@ static int64_t mxf_timestamp_to_int64(uint64_t timestamp) · 755 unmodified lines
27392748 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
27402749 } while (0)
27412750
2751+#define SET_VERSION_METADATA(pb, name, major, minor, tertiary, patch, release, str) do { \
2752+ major = avio_rb16(pb); \
2753+ minor = avio_rb16(pb); \
2754+ tertiary = avio_rb16(pb); \
2755+ patch = avio_rb16(pb); \
2756+ release = avio_rb16(pb); \
2757+ if ((ret = mxf_version_to_str(major, minor, tertiary, patch, release, &str)) < 0) \
2758+ return ret; \
2759+ av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
2760+} while (0)
2761+
27422762 #define SET_UID_METADATA(pb, name, var, str) do { \
27432763 avio_read(pb, var, 16); \
27442764 if ((ret = mxf_uid_to_str(var, &str)) < 0) \
@@ -2760,6 +2780,7 @@ static int mxf_read_identification_metadata(void *arg, AVIOContext *pb, int tag, · 15 unmodified lines
27602780 UID uid = { 0 };
27612781 char *str = NULL;
27622782 uint64_t ts;
2783+ uint16_t major, minor, tertiary, patch, release;
27632784 switch (tag) {
27642785 case 0x3C01:
27652786 SET_STR_METADATA(pb, "company_name", str);
@@ -2776,6 +2797,9 @@ static int mxf_read_identification_metadata(void *arg, AVIOContext *pb, int tag, · 10 unmodified lines
27762797 case 0x3C06:
27772798 SET_TS_METADATA(pb, "modification_date", ts, str);
27782799 break;
2800+ case 0x3C07:
2801+ SET_VERSION_METADATA(pb, "toolkit_version", major, minor, tertiary, patch, release, str);
2802+ break;
27792803 case 0x3C08:
27802804 SET_STR_METADATA(pb, "application_platform", str);
27812805 break;
tests/ref/fate/mxf-probe-applehdr10+1−0
@@ -164,6 +164,7 @@ TAG:product_name=Compressor · 163 unmodified lines
164164 TAG:product_version=4.4.7 (4.4.7)
165165 TAG:product_uid=00000000-0000-0000-0000-000000000000
166166 TAG:modification_date=2020-09-08T16:18:57.036000Z
167+TAG:toolkit_version=3.8.0.171.1
167168 TAG:material_package_umid=0x060A2B340101010501010D201300000045843C9FE69D4B8FA90DDAAA1602A2E8
168169 TAG:timecode=00:01:15;26
169170 [/FORMAT]
tests/ref/fate/mxf-probe-dnxhd+1−0
@@ -173,6 +173,7 @@ TAG:project_name=UHD · 172 unmodified lines
173173 TAG:uid=784c8132-ae36-ed4d-b0ff-2edf1f3f2d92
174174 TAG:generation_uid=b6bcfcab-70ff-7331-c47c-478869de11d2
175175 TAG:application_platform=AAFSDK (MacOS X)
176+TAG:toolkit_version=1.1.0.0.0
176177 TAG:modification_date=2016-09-18T19:25:25.000000Z
177178 TAG:product_uid=acfbf03a-4f42-a231-d0b7-c06ecd3d4ad7
178179 TAG:product_version=Unknown version

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t