Skip to content

Commit

Permalink
op1a: signal 379-2/rd44 compliance if rdd36/prores present
Browse files Browse the repository at this point in the history
SMPTE RDD 44 (RDD 36 / ProRes in MXF) requires SMPTE ST 379-2
(MXF contrained generic container) which requires the
ContainerConstraintsSubDescriptor to be included in the file.
  • Loading branch information
philipnbbc committed Aug 16, 2023
1 parent 86b3c86 commit 76b8da9
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/libMXF
2 changes: 1 addition & 1 deletion deps/libMXFpp
2 changes: 2 additions & 0 deletions meta/extensions_mxflib_dict.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
<EssenceStreamID type="UInt32" use="required" globalKey="06 0e 2b 34 01 01 01 04 01 03 04 04 00 00 00 00"/>
</DCTimedTextResourceSubDescriptor>

<ContainerConstraintsSubDescriptor base="SubDescriptor" type="localSet" key="06 0e 2b 34 02 53 01 01 0d 01 01 01 01 01 67 00"/>

<Filler base="StructuralComponent" type="localSet" key="06 0e 2b 34 02 53 01 01 0d 01 01 01 01 01 09 00"/>

</MXFDictionary>
15 changes: 15 additions & 0 deletions src/mxf_op1a/OP1AFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <bmx/mxf_op1a/OP1AFile.h>
#include <bmx/mxf_op1a/OP1APCMTrack.h>
#include <bmx/mxf_op1a/OP1ATimedTextTrack.h>
#include <bmx/mxf_op1a/OP1ARDD36Track.h>
#include <bmx/mxf_helper/MXFDescriptorHelper.h>
#include <bmx/mxf_helper/MXFMCALabelHelper.h>
#include <bmx/MXFUtils.h>
Expand Down Expand Up @@ -920,6 +921,20 @@ void OP1AFile::CreateHeaderMetadata()
}
for (i = 0; i < mXMLTracks.size(); i++)
mXMLTracks[i]->AddHeaderMetadata(mHeaderMetadata, mMaterialPackage);

// Signal ST 379-2 generic container compliance if there is RDD 36 / ProRes video.
// This is required by RDD 44 (RDD 36 / ProRes in MXF)
bool have_rdd36 = false;
for (i = 0; i < mTracks.size(); i++) {
if (dynamic_cast<OP1ARDD36Track*>(mTracks[i])) {
have_rdd36 = true;
break;
}
}
if (have_rdd36) {
GenericDescriptor *descriptor = dynamic_cast<GenericDescriptor*>(mFileSourcePackage->getDescriptor());
descriptor->appendSubDescriptors(new ContainerConstraintsSubDescriptor(mHeaderMetadata));
}
}

void OP1AFile::CreateFile()
Expand Down
2 changes: 1 addition & 1 deletion test/imf/test_rdd36_1.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d764f976db1f2da07afc3f24663fbf2e
f77cce44755ef17ba44ce08513b4c9fb
2 changes: 1 addition & 1 deletion test/imf/test_rdd36_2.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2dfb2ef93efef921a727e062102d7658
0e91ab514b472b82ea34ef0b32b848ac
2 changes: 1 addition & 1 deletion test/mxf_op1a/rdd36_422.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5854c321a6a06bfa2fcb0fcaff04fbb7
4816099ab01c757c7b852fd6360d2a27
2 changes: 1 addition & 1 deletion test/mxf_op1a/rdd36_4444.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
54b59c8ecb7aa44a4eac117d2242d443
10163ef2d374eb08a1e63a19d2cc077e

0 comments on commit 76b8da9

Please sign in to comment.