[FFmpeg-devel] [PATCH v6 2/3] avformat/mxf: add platform local tag

lance.lmwang at gmail.com lance.lmwang at gmail.com
Mon Feb 1 01:50:54 EET 2021


From: Limin Wang <lance.lmwang at gmail.com>

Please check the string of platform with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf
....
application_platform: Lavf (linux)

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 configure                               | 1 +
 libavformat/mxfenc.c                    | 4 ++++
 tests/ref/fate/copy-trac4914            | 2 +-
 tests/ref/fate/mxf-d10-user-comments    | 2 +-
 tests/ref/fate/mxf-opatom-user-comments | 2 +-
 tests/ref/fate/mxf-reel_name            | 2 +-
 tests/ref/fate/mxf-user-comments        | 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 +-
 14 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index df298b4..a092a6b 100755
--- a/configure
+++ b/configure
@@ -7579,6 +7579,7 @@ cat > $TMPH <<EOF
 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
 #define AVCONV_DATADIR "$(eval c_escape $datadir)"
 #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
+#define OS_NAME $target_os
 #define av_restrict $restrict_keyword
 #define EXTERN_PREFIX "${extern_prefix}"
 #define EXTERN_ASM ${extern_prefix}
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 0c464d4..64d6314 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -719,6 +719,7 @@ static void store_version(AVFormatContext *s){
     avio_wb16(pb, 0); // release
 }
 
+#define PLATFROM_IDENT    "Lavf " AV_STRINGIFY((OS_NAME))
 static void mxf_write_identification(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
@@ -726,6 +727,7 @@ static void mxf_write_identification(AVFormatContext *s)
     const char *company = "FFmpeg";
     const char *product = s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer";
     const char *version;
+    const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFROM_IDENT;
     int length;
 
     mxf_write_metadata_key(pb, 0x013000);
@@ -735,6 +737,7 @@ static void mxf_write_identification(AVFormatContext *s)
         "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
     length = 100 +mxf_utf16_local_tag_length(company) +
                   mxf_utf16_local_tag_length(product) +
+                  mxf_utf16_local_tag_length(platform) +
                   mxf_utf16_local_tag_length(version);
     klv_encode_ber_length(pb, length);
 
@@ -753,6 +756,7 @@ static void mxf_write_identification(AVFormatContext *s)
     store_version(s);
 
     mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String
+    mxf_write_local_tag_utf16(pb, 0x3C08, platform); // Platform
 
     // write product uid
     mxf_write_local_tag(pb, 16, 0x3C05);
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index e8f8afb..743dc8c 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@
-5d58a32f21b78169d925845f783054e6 *tests/data/fate/copy-trac4914.mxf
+f5150fb82c1bb5a90906fce93dcc3f76 *tests/data/fate/copy-trac4914.mxf
 561721 tests/data/fate/copy-trac4914.mxf
 #tb 0: 1001/30000
 #media_type 0: video
diff --git a/tests/ref/fate/mxf-d10-user-comments b/tests/ref/fate/mxf-d10-user-comments
index 3b9d9d2..c35add0 100644
--- a/tests/ref/fate/mxf-d10-user-comments
+++ b/tests/ref/fate/mxf-d10-user-comments
@@ -1 +1 @@
-fe9b43f5b6e7737fe2670b660fd3d860
+7bb9f39e8e05724525154de17f0235d8
diff --git a/tests/ref/fate/mxf-opatom-user-comments b/tests/ref/fate/mxf-opatom-user-comments
index be57eb4..ec4fdff 100644
--- a/tests/ref/fate/mxf-opatom-user-comments
+++ b/tests/ref/fate/mxf-opatom-user-comments
@@ -1 +1 @@
-9b3d7201c37c5783702774e46e0da141
+8475bebf3448a972ae89ba59309fd7d6
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index acda8fe..d50f0f6 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@
-422d6ed4821e7bbecbcdecc553abc6e4
+ce49a0361d3f79106e1952d387eace51
diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments
index 3b77db9..5fcdc58 100644
--- a/tests/ref/fate/mxf-user-comments
+++ b/tests/ref/fate/mxf-user-comments
@@ -1 +1 @@
-c77b632dbcdacd6466e1ec794917556e
+956f653cd75e1a319569caec9df81b4f
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index d3c9795..28815d0 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-e5c9da6972b6f6e7b15bcbbf20a9dbd1
+78ac0348027b75d73acb8bea14e67a59
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index 1b1fe1a..21bf2be 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-1703da2e9f0ca49a5f0bcbcc6944c9c0 *tests/data/lavf/lavf.mxf
+8938d5c4a396ff1b24d10d4f917ae1c9 *tests/data/lavf/lavf.mxf
 526393 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-b44c4f138f1a87256211c3112dd52c87 *tests/data/lavf/lavf.mxf
+93ea2cfdf5dda7fffdc0d2fdcfb6a9a4 *tests/data/lavf/lavf.mxf
 561721 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x96ff1b48
-9ede3c95054c30eb815fbe598a1f097b *tests/data/lavf/lavf.mxf
+87bdf844ae34bcc758e44419e80177a0 *tests/data/lavf/lavf.mxf
 526393 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 19e6f20..47ef244 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-c72f1f3d6ce555f96946c421f705f880 *tests/data/lavf/lavf.mxf_d10
+7f16902e28718c2a92bc082400a1c6ee *tests/data/lavf/lavf.mxf_d10
 5332013 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 2951538..92509cf 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@
-5048796729fba47e9614a177c370e850 *tests/data/lavf/lavf.mxf_dv25
+106e33eb1634595623f0334e92204b65 *tests/data/lavf/lavf.mxf_dv25
 3834413 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 9df2fc9..2d569b0 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50
@@ -1,3 +1,3 @@
-7023122fc4bcd5c12de6a33cc78ce9b8 *tests/data/lavf/lavf.mxf_dvcpro50
+3d5a303c22666996700f0e8f6e4cb938 *tests/data/lavf/lavf.mxf_dvcpro50
 7431213 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 bff36e0..61e7555 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@
-8a4c5680b0955d4e2abecfb1c37a56d4 *tests/data/lavf/lavf.mxf_opatom
+5d235c127ace64b1f4fe6c79a7ca8be6 *tests/data/lavf/lavf.mxf_opatom
 4717625 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 5c65a37..97362e7 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@
-697f4eb4a472909945222d7750145f80 *tests/data/lavf/lavf.mxf_opatom_audio
+c356a3fdd49a1e015961678e837c12bb *tests/data/lavf/lavf.mxf_opatom_audio
 102969 tests/data/lavf/lavf.mxf_opatom_audio
 tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list