* Let older tags on the same place as originally * Add new fate tests for rawvideo and v210 and update checksum for mxf tests --- libavformat/mxfenc.c | 37 +++++++++++++++---------- tests/fate/lavf-container.mak | 7 +++++ 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 +- tests/ref/lavf/mxf_rawvideo_uyvy422 | 3 ++ tests/ref/lavf/mxf_rawvideo_yuv420p | 3 ++ tests/ref/lavf/mxf_rawvideo_yuv422p | 3 ++ tests/ref/lavf/mxf_rawvideo_yuyv422 | 3 ++ tests/ref/lavf/mxf_v210 | 3 ++ 19 files changed, 59 insertions(+), 28 deletions(-) create mode 100644 tests/ref/lavf/mxf_rawvideo_uyvy422 create mode 100644 tests/ref/lavf/mxf_rawvideo_yuv420p create mode 100644 tests/ref/lavf/mxf_rawvideo_yuv422p create mode 100644 tests/ref/lavf/mxf_rawvideo_yuyv422 create mode 100644 tests/ref/lavf/mxf_v210
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index a2ec7b89d7..2f042a7dc4 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1122,7 +1122,9 @@ static inline uint32_t rescale_mastering_luma(AVRational q) return av_rescale(q.num, FF_MXF_MASTERING_LUMA_DEN, q.den); } -static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID key) +typedef void (*generic_desc_extra_tags_func)(AVFormatContext *, AVStream *, const UID, MXFStreamContext *, AVIOContext *, void*); + +static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID key, generic_desc_extra_tags_func write_extra_tags_func, void* extra_tags_func_context) { MXFStreamContext *sc = st->priv_data; AVIOContext *pb = s->pb; @@ -1214,6 +1216,10 @@ static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UI avio_wb32(pb, -((st->codecpar->height - display_height)&1)); } + if(write_extra_tags_func != NULL) { + (*write_extra_tags_func)(s, st, key, sc, pb, extra_tags_func_context); + } + if (sc->signal_standard) { mxf_write_local_tag(s, 1, 0x3215); avio_w8(pb, sc->signal_standard); @@ -1239,6 +1245,7 @@ static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UI f1 *= 2; } + mxf_write_local_tag(s, 16, 0x320D); avio_wb32(pb, 2); avio_wb32(pb, 4); @@ -1310,12 +1317,8 @@ static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UI return pos; } -static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key) +static void mxf_write_extra_cdci_tags(AVFormatContext *s, AVStream *st, const UID key, MXFStreamContext *sc, AVIOContext *pb, void* extra_tags_func_context) { - MXFStreamContext *sc = st->priv_data; - AVIOContext *pb = s->pb; - int64_t pos = mxf_write_generic_desc(s, st, key); - // component depth mxf_write_local_tag(s, 4, 0x3301); avio_wb32(pb, sc->component_depth); @@ -1352,8 +1355,11 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID mxf_write_local_tag(s, 4, 0x3306); avio_wb32(pb, color); } +} - return pos; +static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key) +{ + return mxf_write_generic_desc(s, st, key, &mxf_write_extra_cdci_tags, NULL); } static void mxf_update_klv_size(AVIOContext *pb, int64_t pos) @@ -1389,20 +1395,23 @@ static void mxf_write_avc_subdesc(AVFormatContext *s, AVStream *st) mxf_update_klv_size(s->pb, pos); } +static void mxf_write_extra_rgba_tags(AVFormatContext *s, AVStream *st, const UID key, MXFStreamContext *sc, AVIOContext *pb, void* extra_tags_func_context) +{ + const char* pixelLayoutData = extra_tags_func_context; + + // pixel layout + mxf_write_local_tag(s, 16, 0x3401); + avio_write(pb, pixelLayoutData, 16); +} + static void mxf_write_cdci_or_rgba_desc(AVFormatContext *s, AVStream *st) { - AVIOContext *pb = s->pb; const char* pixelLayoutData = NULL; int64_t pos; if(ff_mxf_find_pixel_layout(&pixelLayoutData, st->codecpar->format) >= 0) { - pos = mxf_write_generic_desc(s, st, mxf_rgba_descriptor_key); - - // pixel layout - mxf_write_local_tag(s, 16, 0x3401); - avio_write(pb, pixelLayoutData, 16); - + pos = mxf_write_generic_desc(s, st, mxf_rgba_descriptor_key, &mxf_write_extra_rgba_tags, (void*)pixelLayoutData); mxf_update_klv_size(s->pb, pos); return; } diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak index 9e0eed4851..af61417576 100644 --- a/tests/fate/lavf-container.mak +++ b/tests/fate/lavf-container.mak @@ -9,6 +9,8 @@ FATE_LAVF_CONTAINER-$(call ENCDEC2, MPEG4, PCM_ALAW, MOV) + FATE_LAVF_CONTAINER-$(call ENCDEC, MPEG4, MOV) += mp4 FATE_LAVF_CONTAINER-$(call ENCDEC2, MPEG1VIDEO, MP2, MPEG1SYSTEM MPEGPS) += mpg FATE_LAVF_CONTAINER-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf mxf_dv25 mxf_dvcpro50 +FATE_LAVF_CONTAINER-$(call ENCDEC2, RAWVIDEO, PCM_S16LE, MXF) += mxf_rawvideo_uyvy422 mxf_rawvideo_yuyv422 mxf_rawvideo_yuv422p mxf_rawvideo_yuv420p +FATE_LAVF_CONTAINER-$(call ENCDEC2, V210, PCM_S16LE, MXF) += mxf_v210 FATE_LAVF_CONTAINER-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF_D10 MXF) += mxf_d10 FATE_LAVF_CONTAINER-$(call ENCDEC2, DNXHD, PCM_S16LE, MXF_OPATOM MXF) += mxf_opatom mxf_opatom_audio FATE_LAVF_CONTAINER-$(call ENCDEC2, MPEG4, MP2, NUT) += nut @@ -45,6 +47,11 @@ fate-lavf-mxf: CMD = lavf_container_timecode "-ar 48000 -bf 2 -threads 1" fate-lavf-mxf_d10: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32 -c:v mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" fate-lavf-mxf_dv25: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=4/3 -c:v dvvideo -pix_fmt yuv420p -b 25000k -top 0 -f mxf" fate-lavf-mxf_dvcpro50: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v dvvideo -pix_fmt yuv422p -b 50000k -top 0 -f mxf" +fate-lavf-mxf_rawvideo_uyvy422: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v rawvideo -pix_fmt uyvy422 -b 50000k -top 0 -f mxf" +fate-lavf-mxf_rawvideo_yuyv422: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v rawvideo -pix_fmt yuyv422 -b 50000k -top 0 -f mxf" +fate-lavf-mxf_rawvideo_yuv422p: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v rawvideo -pix_fmt yuv422p -b 50000k -top 0 -f mxf" +fate-lavf-mxf_rawvideo_yuv420p: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v rawvideo -pix_fmt yuv420p -b 50000k -top 0 -f mxf" +fate-lavf-mxf_v210: CMD = lavf_container "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,setdar=16/9 -c:v v210 -pix_fmt yuv422p10le -b 50000k -top 0 -f mxf" fate-lavf-mxf_opatom: CMD = lavf_container "" "-s 1920x1080 -c:v dnxhd -pix_fmt yuv422p -vb 36M -f mxf_opatom -map 0" fate-lavf-mxf_opatom_audio: CMD = lavf_container "-ar 48000 -ac 1" "-f mxf_opatom -mxf_audio_edit_rate 25 -map 1" fate-lavf-smjpeg: CMD = lavf_container "" "-f smjpeg" diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914 index 743dc8c055..72a81c4e21 100644 --- a/tests/ref/fate/copy-trac4914 +++ b/tests/ref/fate/copy-trac4914 @@ -1,4 +1,4 @@ -f5150fb82c1bb5a90906fce93dcc3f76 *tests/data/fate/copy-trac4914.mxf +438f4fea5b4956e324e0ce61329d42fe *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 64a2dec463..01469c28a0 100644 --- a/tests/ref/fate/mxf-d10-user-comments +++ b/tests/ref/fate/mxf-d10-user-comments @@ -1,4 +1,4 @@ -6dc13ae283257e898e069e5041ac8435 *tests/data/fate/mxf-d10-user-comments.mxf_d10 +904042310dbc0ec7a0763bc543a19d14 *tests/data/fate/mxf-d10-user-comments.mxf_d10 3782189 tests/data/fate/mxf-d10-user-comments.mxf_d10 #extradata 0: 34, 0x716b05c4 #tb 0: 1/25 diff --git a/tests/ref/fate/mxf-opatom-user-comments b/tests/ref/fate/mxf-opatom-user-comments index ec4fdff425..2272eb7692 100644 --- a/tests/ref/fate/mxf-opatom-user-comments +++ b/tests/ref/fate/mxf-opatom-user-comments @@ -1 +1 @@ -8475bebf3448a972ae89ba59309fd7d6 +0e498d6c36a8b3e37aa9ecb64496d3b6 diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name index d50f0f6990..b0728b7fe3 100644 --- a/tests/ref/fate/mxf-reel_name +++ b/tests/ref/fate/mxf-reel_name @@ -1 +1 @@ -ce49a0361d3f79106e1952d387eace51 +560f4451dd6b38f78cf86f231e48eff6 diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments index 5fcdc5806a..f6fa46cc97 100644 --- a/tests/ref/fate/mxf-user-comments +++ b/tests/ref/fate/mxf-user-comments @@ -1 +1 @@ -956f653cd75e1a319569caec9df81b4f +9d3ba341971578da259ddb59009a0852 diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base index 28815d0828..658684b037 100644 --- a/tests/ref/fate/time_base +++ b/tests/ref/fate/time_base @@ -1 +1 @@ -78ac0348027b75d73acb8bea14e67a59 +8e36415635c2524ca26d543ee36e7234 diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 21bf2be513..d364d38155 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -8938d5c4a396ff1b24d10d4f917ae1c9 *tests/data/lavf/lavf.mxf +7d02fc2e7745c07a52eeaebb24c6e79f *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab -93ea2cfdf5dda7fffdc0d2fdcfb6a9a4 *tests/data/lavf/lavf.mxf +48f6b83fba88c6eac8ffd80a7fd24bdb *tests/data/lavf/lavf.mxf 561721 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x96ff1b48 -87bdf844ae34bcc758e44419e80177a0 *tests/data/lavf/lavf.mxf +6810c86109c5e6a139ff1b3c47f4a274 *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 47ef244cb1..d6bf06b510 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -7f16902e28718c2a92bc082400a1c6ee *tests/data/lavf/lavf.mxf_d10 +ecec1e36b3ddc9dd686df429674680b6 *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 92509cf1f4..fa3b4da61c 100644 --- a/tests/ref/lavf/mxf_dv25 +++ b/tests/ref/lavf/mxf_dv25 @@ -1,3 +1,3 @@ -106e33eb1634595623f0334e92204b65 *tests/data/lavf/lavf.mxf_dv25 +e05459f1a7fae9765a6b3035fdbae7ef *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 2d569b0553..a94e74dab0 100644 --- a/tests/ref/lavf/mxf_dvcpro50 +++ b/tests/ref/lavf/mxf_dvcpro50 @@ -1,3 +1,3 @@ -3d5a303c22666996700f0e8f6e4cb938 *tests/data/lavf/lavf.mxf_dvcpro50 +02bdd6731f7e520aa8c9c67c8db53bc3 *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 61e755550b..2a0c6bd38a 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -5d235c127ace64b1f4fe6c79a7ca8be6 *tests/data/lavf/lavf.mxf_opatom +5659524f7c407daaed778345b0adefe5 *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 97362e7aa4..b6b03b8f0e 100644 --- a/tests/ref/lavf/mxf_opatom_audio +++ b/tests/ref/lavf/mxf_opatom_audio @@ -1,3 +1,3 @@ -c356a3fdd49a1e015961678e837c12bb *tests/data/lavf/lavf.mxf_opatom_audio +7da9e57a0310ad4e073f9a1f4de4c378 *tests/data/lavf/lavf.mxf_opatom_audio 102969 tests/data/lavf/lavf.mxf_opatom_audio tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff diff --git a/tests/ref/lavf/mxf_rawvideo_uyvy422 b/tests/ref/lavf/mxf_rawvideo_uyvy422 new file mode 100644 index 0000000000..ca74e191f3 --- /dev/null +++ b/tests/ref/lavf/mxf_rawvideo_uyvy422 @@ -0,0 +1,3 @@ +21fadfdb0188edca474bbde73c630e30 *tests/data/lavf/lavf.mxf_rawvideo_uyvy422 +20974649 tests/data/lavf/lavf.mxf_rawvideo_uyvy422 +tests/data/lavf/lavf.mxf_rawvideo_uyvy422 CRC=0x35946b93 diff --git a/tests/ref/lavf/mxf_rawvideo_yuv420p b/tests/ref/lavf/mxf_rawvideo_yuv420p new file mode 100644 index 0000000000..512056391c --- /dev/null +++ b/tests/ref/lavf/mxf_rawvideo_yuv420p @@ -0,0 +1,3 @@ +6e6c6a6bea63aac1622ab0008aaf89b5 *tests/data/lavf/lavf.mxf_rawvideo_yuv420p +15790649 tests/data/lavf/lavf.mxf_rawvideo_yuv420p +tests/data/lavf/lavf.mxf_rawvideo_yuv420p CRC=0x15c6bb97 diff --git a/tests/ref/lavf/mxf_rawvideo_yuv422p b/tests/ref/lavf/mxf_rawvideo_yuv422p new file mode 100644 index 0000000000..1a5d239e14 --- /dev/null +++ b/tests/ref/lavf/mxf_rawvideo_yuv422p @@ -0,0 +1,3 @@ +f534813596e2800f5cdd76560eec4186 *tests/data/lavf/lavf.mxf_rawvideo_yuv422p +20974649 tests/data/lavf/lavf.mxf_rawvideo_yuv422p +tests/data/lavf/lavf.mxf_rawvideo_yuv422p CRC=0xd7cc6b93 diff --git a/tests/ref/lavf/mxf_rawvideo_yuyv422 b/tests/ref/lavf/mxf_rawvideo_yuyv422 new file mode 100644 index 0000000000..7fd25d3e9f --- /dev/null +++ b/tests/ref/lavf/mxf_rawvideo_yuyv422 @@ -0,0 +1,3 @@ +57fe7476e6ec8f5a349579b9233de25a *tests/data/lavf/lavf.mxf_rawvideo_yuyv422 +20974649 tests/data/lavf/lavf.mxf_rawvideo_yuyv422 +tests/data/lavf/lavf.mxf_rawvideo_yuyv422 CRC=0x60866b93 diff --git a/tests/ref/lavf/mxf_v210 b/tests/ref/lavf/mxf_v210 new file mode 100644 index 0000000000..c23418e406 --- /dev/null +++ b/tests/ref/lavf/mxf_v210 @@ -0,0 +1,3 @@ +a96bd5ed2f15acbbbbebdd3d332dae73 *tests/data/lavf/lavf.mxf_v210 +27886649 tests/data/lavf/lavf.mxf_v210 +tests/data/lavf/lavf.mxf_v210 CRC=0x27a8f8cb -- 2.20.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".