diff --git a/apps/bmxtranswrap/bmxtranswrap.cpp b/apps/bmxtranswrap/bmxtranswrap.cpp index 83b243b7..fa9b8b4b 100644 --- a/apps/bmxtranswrap/bmxtranswrap.cpp +++ b/apps/bmxtranswrap/bmxtranswrap.cpp @@ -613,7 +613,6 @@ static void usage(const char *cmd) printf(" separate partitions for header metadata, index tables, essence container data and footer\n"); printf(" --body-part Create separate body partitions for essence data\n"); printf(" and don't create separate body partitions for index table segments\n"); - printf(" --repeat-index Repeat the index table segments in the footer partition\n"); printf(" --clip-wrap Use clip wrapping for a single sound track\n"); printf(" --mp-track-num Use the material package track number property to define a track order. By default the track number is set to 0\n"); printf(" --aes-3 Use AES-3 audio mapping\n"); @@ -626,6 +625,7 @@ static void usage(const char *cmd) printf("\n"); printf(" op1a/rdd9:\n"); printf(" --ard-zdf-hdf Use the ARD ZDF HDF profile\n"); + printf(" --repeat-index Repeat the index table segments in the footer partition\n"); printf("\n"); printf(" op1a/d10:\n"); printf(" --cbe-index-duration-0 Use duration=0 if index table is CBE\n"); @@ -3828,6 +3828,9 @@ int main(int argc, const char** argv) if (clip_sub_type == AS10_CLIP_SUB_TYPE) rdd9_clip->SetValidator(new AS10RDD9Validator(as10_shim, as10_loose_checks)); + if (repeat_index) + rdd9_clip->SetRepeatIndexTable(true); + if (partition_interval_set) rdd9_clip->SetPartitionInterval(partition_interval); rdd9_clip->SetOutputStartOffset(- precharge); diff --git a/apps/raw2bmx/raw2bmx.cpp b/apps/raw2bmx/raw2bmx.cpp index 918b6a05..d9a05dfc 100644 --- a/apps/raw2bmx/raw2bmx.cpp +++ b/apps/raw2bmx/raw2bmx.cpp @@ -537,7 +537,6 @@ static void usage(const char *cmd) printf(" separate partitions for header metadata, index tables, essence container data and footer\n"); printf(" --body-part Create separate body partitions for essence data\n"); printf(" and don't create separate body partitions for index table segments\n"); - printf(" --repeat-index Repeat the index table segments in the footer partition\n"); printf(" --clip-wrap Use clip wrapping for a single sound track\n"); printf(" --mp-track-num Use the material package track number property to define a track order. By default the track number is set to 0\n"); printf(" --aes-3 Use AES-3 audio mapping\n"); @@ -563,6 +562,7 @@ static void usage(const char *cmd) printf("\n"); printf(" op1a/rdd9:\n"); printf(" --ard-zdf-hdf Use the ARD ZDF HDF profile\n"); + printf(" --repeat-index Repeat the index table segments in the footer partition\n"); printf("\n"); printf(" as11d10/d10:\n"); printf(" --d10-mute Indicate using a string of 8 '0' or '1' which sound channels should be muted. The lsb is the rightmost digit\n"); @@ -5225,6 +5225,9 @@ int main(int argc, const char** argv) } else if (clip_type == CW_RDD9_CLIP_TYPE) { RDD9File *rdd9_clip = clip->GetRDD9Clip(); + if (repeat_index) + rdd9_clip->SetRepeatIndexTable(true); + if (partition_interval_set) rdd9_clip->SetPartitionInterval(partition_interval); rdd9_clip->SetOutputStartOffset(output_start_offset); diff --git a/include/bmx/rdd9_mxf/RDD9File.h b/include/bmx/rdd9_mxf/RDD9File.h index c988c52b..e5f7af32 100644 --- a/include/bmx/rdd9_mxf/RDD9File.h +++ b/include/bmx/rdd9_mxf/RDD9File.h @@ -76,6 +76,7 @@ class RDD9File void ReserveHeaderMetadataSpace(uint32_t min_bytes); // default 8192 void SetPartitionInterval(int64_t frame_count); // default 10sec void SetValidator(RDD9Validator *validator); + void SetRepeatIndexTable(bool enable); // default false. Repeat index table in Footer if true public: void SetOutputStartOffset(int64_t offset); diff --git a/include/bmx/rdd9_mxf/RDD9IndexTable.h b/include/bmx/rdd9_mxf/RDD9IndexTable.h index 10d49f9c..7e2a47c9 100644 --- a/include/bmx/rdd9_mxf/RDD9IndexTable.h +++ b/include/bmx/rdd9_mxf/RDD9IndexTable.h @@ -145,6 +145,7 @@ class RDD9IndexTable void SetExtensions(mxfOptBool single_index_location, mxfOptBool single_essence_location, mxfOptBool forward_index_direction); + void SetRepeatIndexTable(bool enable); void RegisterSystemItem(); void RegisterPictureTrackElement(uint32_t track_index); diff --git a/src/rdd9_mxf/RDD9File.cpp b/src/rdd9_mxf/RDD9File.cpp index 71f2a056..430401cb 100644 --- a/src/rdd9_mxf/RDD9File.cpp +++ b/src/rdd9_mxf/RDD9File.cpp @@ -236,6 +236,11 @@ void RDD9File::SetValidator(RDD9Validator *validator) mValidator->SetRDD9File(this); } +void RDD9File::SetRepeatIndexTable(bool enable) +{ + mIndexTable->SetRepeatIndexTable(enable); +} + void RDD9File::SetOutputStartOffset(int64_t offset) { BMX_CHECK(offset >= 0); diff --git a/src/rdd9_mxf/RDD9IndexTable.cpp b/src/rdd9_mxf/RDD9IndexTable.cpp index 98e4460c..9c61c8aa 100644 --- a/src/rdd9_mxf/RDD9IndexTable.cpp +++ b/src/rdd9_mxf/RDD9IndexTable.cpp @@ -259,6 +259,11 @@ void RDD9IndexTable::SetExtensions(mxfOptBool single_index_location, mxfOptBool mForwardIndexDirection = forward_index_direction; } +void RDD9IndexTable::SetRepeatIndexTable(bool enable) +{ + mRepeatInFooter = enable; +} + void RDD9IndexTable::RegisterSystemItem() { mIndexElements.push_back(new RDD9IndexTableElement(0, RDD9IndexTableElement::SYSTEM_ITEM, true, false)); diff --git a/test/rdd9_mxf/CMakeLists.txt b/test/rdd9_mxf/CMakeLists.txt index 3f1747b0..6f58004b 100644 --- a/test/rdd9_mxf/CMakeLists.txt +++ b/test/rdd9_mxf/CMakeLists.txt @@ -5,6 +5,7 @@ setup_test_dir("rdd9_mxf") set(tests ancvbi mpeg2lg + repeatindex ) foreach(test ${tests}) diff --git a/test/rdd9_mxf/repeatindex.md5 b/test/rdd9_mxf/repeatindex.md5 new file mode 100644 index 00000000..4de625ff --- /dev/null +++ b/test/rdd9_mxf/repeatindex.md5 @@ -0,0 +1 @@ +624c21119ad01eca312058d5641c0a7c \ No newline at end of file diff --git a/test/rdd9_mxf/test_repeatindex.cmake b/test/rdd9_mxf/test_repeatindex.cmake new file mode 100644 index 00000000..756ed9d3 --- /dev/null +++ b/test/rdd9_mxf/test_repeatindex.cmake @@ -0,0 +1,57 @@ +# Test creating an RDD9 MXF file with the index repeated in the footer. + +include("${TEST_SOURCE_DIR}/../testing.cmake") + + +if(TEST_MODE STREQUAL "check") + set(output_file test_repeatindex.mxf) +elseif(TEST_MODE STREQUAL "samples") + file(MAKE_DIRECTORY ${BMX_TEST_SAMPLES_DIR}) + + set(output_file ${BMX_TEST_SAMPLES_DIR}/test_repeatindex.mxf) +else() + set(output_file test_repeatindex.mxf) +endif() + +set(checksum_file repeatindex.md5) + +set(create_test_audio ${CREATE_TEST_ESSENCE} + -t 1 + -d 24 + audio +) + +set(create_test_video ${CREATE_TEST_ESSENCE} + -t 14 + -d 24 + video +) + +set(create_command ${RAW2BMX} + --regtest + -t rdd9 + -y 10:11:12:13 + --clip test + --part 12 + --repeat-index + -o ${output_file} + -a 16:9 --mpeg2lg_422p_hl_1080i video + -q 16 --locked true --pcm audio + -q 16 --locked true --pcm audio +) + +run_test_a( + "${TEST_MODE}" + "${BMX_TEST_WITH_VALGRIND}" + "${create_test_video}" + "${create_test_audio}" + "" + "${create_command}" + "" + "" + "" + "${output_file}" + "${checksum_file}" + "" + "" +)