[FFmpeg-cvslog] avformat/mxfenc: Add Product Version, Toolkit version and Platform

Michael Niedermayer git at videolan.org
Wed May 9 00:59:29 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Mar 17 16:01:15 2018 +0100| [86c92509231f67a2397f0d98530e5dca1720d1f3] | committer: Michael Niedermayer

avformat/mxfenc: Add Product Version, Toolkit version and Platform

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86c92509231f67a2397f0d98530e5dca1720d1f3
---

 libavformat/mxfenc.c            | 28 +++++++++++++++++++++++++++-
 tests/ref/fate/copy-trac4914    |  2 +-
 tests/ref/fate/mxf-reel_name    |  2 +-
 tests/ref/fate/time_base        |  2 +-
 tests/ref/lavf/mxf              |  6 +++---
 tests/ref/lavf/mxf_d10          |  2 +-
 tests/ref/lavf/mxf_dv25         |  2 +-
 tests/ref/lavf/mxf_dvcpro50     |  2 +-
 tests/ref/lavf/mxf_opatom       |  2 +-
 tests/ref/lavf/mxf_opatom_audio |  2 +-
 10 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index fcaa330902..a9338f7bc3 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -431,9 +431,12 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
     { 0x3C09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x01,0x00,0x00,0x00}}, /* This Generation UID */
     { 0x3C01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x02,0x01,0x00,0x00}}, /* Company Name */
     { 0x3C02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x03,0x01,0x00,0x00}}, /* Product Name */
+    { 0x3C03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x04,0x00,0x00,0x00}}, /* Product Version */
     { 0x3C04, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x05,0x01,0x00,0x00}}, /* Version String */
     { 0x3C05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x07,0x00,0x00,0x00}}, /* Product ID */
     { 0x3C06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x03,0x00,0x00}}, /* Modification Date */
+    { 0x3C07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x0A,0x00,0x00,0x00}}, /* Toolkit Version */
+    { 0x3C08, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x06,0x01,0x00,0x00}}, /* Platform */
     // Content Storage
     { 0x1901, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x05,0x01,0x00,0x00}}, /* Package strong reference batch */
     { 0x1902, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x05,0x02,0x00,0x00}}, /* Package strong reference batch */
@@ -776,6 +779,22 @@ static void mxf_write_local_tag_utf16(AVIOContext *pb, int tag, const char *valu
     avio_put_str16be(pb, value);
 }
 
+static void store_version(AVFormatContext *s){
+    AVIOContext *pb = s->pb;
+
+    if (s->flags & AVFMT_FLAG_BITEXACT) {
+        avio_wb16(pb, 0); // major
+        avio_wb16(pb, 0); // minor
+        avio_wb16(pb, 0); // tertiary
+    } else {
+        avio_wb16(pb, LIBAVFORMAT_VERSION_MAJOR); // major
+        avio_wb16(pb, LIBAVFORMAT_VERSION_MINOR); // minor
+        avio_wb16(pb, LIBAVFORMAT_VERSION_MICRO); // tertiary
+    }
+    avio_wb16(pb, 0); // patch
+    avio_wb16(pb, 0); // release
+}
+
 static void mxf_write_identification(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
@@ -790,7 +809,7 @@ static void mxf_write_identification(AVFormatContext *s)
 
     version = s->flags & AVFMT_FLAG_BITEXACT ?
         "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
-    length = 72 + mxf_utf16_local_tag_length(company) +
+    length = 100 +mxf_utf16_local_tag_length(company) +
                   mxf_utf16_local_tag_length(product) +
                   mxf_utf16_local_tag_length(version);
     klv_encode_ber_length(pb, length);
@@ -805,6 +824,10 @@ static void mxf_write_identification(AVFormatContext *s)
     mxf_write_uuid(pb, Identification, 1);
     mxf_write_local_tag_utf16(pb, 0x3C01, company); // Company Name
     mxf_write_local_tag_utf16(pb, 0x3C02, product); // Product Name
+
+    mxf_write_local_tag(pb, 10, 0x3C03); // Product Version
+    store_version(s);
+
     mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String
 
     // write product uid
@@ -814,6 +837,9 @@ static void mxf_write_identification(AVFormatContext *s)
     // modification date
     mxf_write_local_tag(pb, 8, 0x3C06);
     avio_wb64(pb, mxf->timestamp);
+
+    mxf_write_local_tag(pb, 10, 0x3C07); // Toolkit Version
+    store_version(s);
 }
 
 static void mxf_write_content_storage(AVFormatContext *s, MXFPackage *packages, int package_count)
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index 0964f96fdd..e5b9ee293e 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@
-6da61d6b9b654c9b1e8f70be01fae7f7 *tests/data/fate/copy-trac4914.mxf
+da66943da7ede9d7409c78befa3c1b95 *tests/data/fate/copy-trac4914.mxf
 561209 tests/data/fate/copy-trac4914.mxf
 #tb 0: 1001/30000
 #media_type 0: video
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index ecd818f539..a22d058868 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@
-3d81a5c7479617d2f082a828db5e1d80
+d35f74e97bb8a3d5cadc1df69d82dcf9
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index a1c578acfa..13c7eca627 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-39441bec6d05cd65adc0f5b8557fe8ad
+6222dfa98933f06afb9992ab6c21486c
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index a5f3db200d..c9a1ce8544 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-0c59c7eb43abd8fbd9eab41dc0bec1d0 *./tests/data/lavf/lavf.mxf
+707059147bb7569509cf3b697b54d701 *./tests/data/lavf/lavf.mxf
 525881 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-6b0e6f16dfd1ba0524bf14f16d50b86d *./tests/data/lavf/lavf.mxf
+5af94bc17e47190a1e2943a461c836ff *./tests/data/lavf/lavf.mxf
 561209 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
-b9e4dbb9a9b65fadf47509ef2b094fe5 *./tests/data/lavf/lavf.mxf
+523ed9d06ab7a4090f9a29fa7abf7a03 *./tests/data/lavf/lavf.mxf
 525881 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index 6db0d0ea10..2e6e13f1ce 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-bac717411fd88894e71db6b5268a75bc *./tests/data/lavf/lavf.mxf_d10
+07a242f1881f0349e4ed10a4f1584ddb *./tests/data/lavf/lavf.mxf_d10
 5331501 ./tests/data/lavf/lavf.mxf_d10
 ./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488
diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25
index b17542bbce..e192f91fe2 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@
-06549669b096e58a3a57279004532ed2 *./tests/data/lavf/lavf.mxf_dv25
+8117b64eaee48b9b6f8be964afbed8e0 *./tests/data/lavf/lavf.mxf_dv25
 3833901 ./tests/data/lavf/lavf.mxf_dv25
 ./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52
diff --git a/tests/ref/lavf/mxf_dvcpro50 b/tests/ref/lavf/mxf_dvcpro50
index 64115766b6..4d6b45de90 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50
@@ -1,3 +1,3 @@
-6b3297c1f3af13398719ffd4e194e87b *./tests/data/lavf/lavf.mxf_dvcpro50
+d6e87fb17a89a8a8fff96e0fd9d6fd4a *./tests/data/lavf/lavf.mxf_dvcpro50
 7430701 ./tests/data/lavf/lavf.mxf_dvcpro50
 ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom
index 153537e14a..969e2bc4c5 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@
-e1568a9638de2883ca8cfa63c044432c *./tests/data/lavf/lavf.mxf_opatom
+fea3ed4c2e5088701154530cb2a57f98 *./tests/data/lavf/lavf.mxf_opatom
 4717113 ./tests/data/lavf/lavf.mxf_opatom
 ./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a
diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio
index ffddde0f3a..84ac7b23ad 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@
-63a33b96d0a8e10d5e9dd6c1dfd2b63b *./tests/data/lavf/lavf.mxf_opatom_audio
+71735ea72b3bdcfa3455d51bc439aa57 *./tests/data/lavf/lavf.mxf_opatom_audio
 102457 ./tests/data/lavf/lavf.mxf_opatom_audio
 ./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff



More information about the ffmpeg-cvslog mailing list