summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Nicholson <tim.nicholson@bbc.co.uk>2015-03-30 11:11:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-30 15:03:41 +0200
commitac9919b9662f28816cf79c1d5c36719160009588 (patch)
tree3687d65d49f431244575a8d9b0436aee3f43cc8b
parentdadc43eee4d9036aa532665a04720238cc15e922 (diff)
libavformat/mxfenc.c: Add 'Presentation Y offset' metadata
Previously unset, and some software mishandles files if it is absent Signed-off-by: Tim Nicholson <tim.nicholson@bbc.co.uk> Reviewed-by: tomas.hardin@codemill.se Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mxfenc.c7
-rw-r--r--tests/ref/lavf/mxf6
-rw-r--r--tests/ref/lavf/mxf_d102
-rw-r--r--tests/ref/lavf/mxf_opatom2
4 files changed, 11 insertions, 6 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index ac60357b7b..7b400b3727 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -406,6 +406,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x3202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}}, /* Stored Height */
{ 0x3209, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0C,0x00,0x00,0x00}}, /* Display Width */
{ 0x3208, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0B,0x00,0x00,0x00}}, /* Display Height */
+ { 0x320B, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0E,0x00,0x00,0x00}}, /* Presentation Y offset */
{ 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* Aspect Ratio */
{ 0x3201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* Picture Essence Coding */
{ 0x3212, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x03,0x01,0x06,0x00,0x00,0x00}}, /* Field Dominance (Opt) */
@@ -978,7 +979,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
int stored_height = (st->codec->height+15)/16*16;
int display_height;
int f1, f2;
- unsigned desc_size = size+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20;
+ unsigned desc_size = size+8+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20;
if (sc->interlaced && sc->field_dominance)
desc_size += 5;
@@ -1003,6 +1004,10 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
mxf_write_local_tag(pb, 4, 0x3208);
avio_wb32(pb, display_height>>sc->interlaced);
+ // presentation Y offset
+ mxf_write_local_tag(pb, 4, 0x320B);
+ avio_wb32(pb, (st->codec->height - display_height)>>sc->interlaced);
+
// component depth
mxf_write_local_tag(pb, 4, 0x3301);
avio_wb32(pb, sc->component_depth);
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index 8ead4349dc..5fb984b884 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-306708cc2ad2414def89fa2f3c0bfc5c *./tests/data/lavf/lavf.mxf
+613b160bf09927661d9455dd975ad780 *./tests/data/lavf/lavf.mxf
525369 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1
-f465084f0c365926a81aab56fb6b945c *./tests/data/lavf/lavf.mxf
+64471cfc480751f2ca7998c4edbc7a02 *./tests/data/lavf/lavf.mxf
560697 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x11a6178e
-52fc707e1177c97232e2537168c232e6 *./tests/data/lavf/lavf.mxf
+a546bd6d8fe1608690bf2fc326cab0c3 *./tests/data/lavf/lavf.mxf
525369 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index 71707cae13..8201557527 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-8f601d5b55a0665cc105a115dc8b3af0 *./tests/data/lavf/lavf.mxf_d10
+22dca5c8d62fe7ad1c56416ae736d6c1 *./tests/data/lavf/lavf.mxf_d10
5330989 ./tests/data/lavf/lavf.mxf_d10
./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488
diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom
index 5529e5b01a..0dd59c1889 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@
-0f753a141424e2a1b44e6390f70172eb *./tests/data/lavf/lavf.mxf_opatom
+5df0bb1083cbe0ef3a70e4a93e44d812 *./tests/data/lavf/lavf.mxf_opatom
4717113 ./tests/data/lavf/lavf.mxf_opatom
./tests/data/lavf/lavf.mxf_opatom CRC=0xbdd696b9