diff options
| author | tmccolm <tmccolm@cinecert.com> | 2011-06-24 22:12:24 +0000 |
|---|---|---|
| committer | tmccolm <> | 2011-06-24 22:12:24 +0000 |
| commit | 0a815c035a2cc3742507aebd059d5c042a111527 (patch) | |
| tree | d25ea9e6217b7146ab79af5be9ce10b44e5a9f4e /src | |
| parent | cec23b082065ae551621a577dcb0ccd1f687ccd0 (diff) | |
added
Diffstat (limited to 'src')
| -rwxr-xr-x | src/AS_DCP.h | 4 | ||||
| -rwxr-xr-x | src/AS_DCP_PCM.cpp | 35 | ||||
| -rwxr-xr-x | src/KLV.h | 1 | ||||
| -rwxr-xr-x | src/KM_prng.cpp | 3 | ||||
| -rw-r--r-- | src/MDD.cpp | 16 | ||||
| -rwxr-xr-x | src/MDD.h | 6 | ||||
| -rwxr-xr-x | src/MXFTypes.cpp | 25 | ||||
| -rwxr-xr-x | src/asdcp-test.cpp | 12 | ||||
| -rwxr-xr-x | src/h__Reader.cpp | 6 |
9 files changed, 83 insertions, 25 deletions
diff --git a/src/AS_DCP.h b/src/AS_DCP.h index dfeae4a..136671c 100755 --- a/src/AS_DCP.h +++ b/src/AS_DCP.h @@ -792,7 +792,9 @@ namespace ASDCP { CF_NONE, CF_CFG_1, // 5.1 with optional HI/VI CF_CFG_2, // 6.1 (5.1 + center surround) with optional HI/VI - CF_CFG_3, // 7.1 with optional HI/VI + CF_CFG_3, // 7.1 (SDDS) with optional HI/VI + CF_CFG_4, // Wild Track Format + CF_CFG_5, // 7.1 DS with optional HI/VI }; struct AudioDescriptor diff --git a/src/AS_DCP_PCM.cpp b/src/AS_DCP_PCM.cpp index 1f4e004..b54e1fa 100755 --- a/src/AS_DCP_PCM.cpp +++ b/src/AS_DCP_PCM.cpp @@ -39,15 +39,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static std::string PCM_PACKAGE_LABEL = "File Package: SMPTE 382M frame wrapping of wave audio"; static std::string SOUND_DEF_LABEL = "Sound Track"; -static byte_t SNDFMT_CFG_1_UL[16] = { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, - 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x01, 0x00 }; - -static byte_t SNDFMT_CFG_2_UL[16] = { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, - 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x02, 0x00 }; - -static byte_t SNDFMT_CFG_3_UL[16] = { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, - 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x03, 0x00 }; - // Result_t PCM_ADesc_to_MD(PCM::AudioDescriptor& ADesc, MXF::WaveAudioDescriptor* ADescObj) @@ -68,15 +59,23 @@ PCM_ADesc_to_MD(PCM::AudioDescriptor& ADesc, MXF::WaveAudioDescriptor* ADescObj) switch ( ADesc.ChannelFormat ) { case PCM::CF_CFG_1: - ADescObj->ChannelAssignment = UL(SNDFMT_CFG_1_UL); + ADescObj->ChannelAssignment = DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_1_5p1).ul; break; case PCM::CF_CFG_2: - ADescObj->ChannelAssignment = UL(SNDFMT_CFG_2_UL); + ADescObj->ChannelAssignment = DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_2_6p1).ul; break; case PCM::CF_CFG_3: - ADescObj->ChannelAssignment = UL(SNDFMT_CFG_3_UL); + ADescObj->ChannelAssignment = DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_3_7p1).ul; + break; + + case PCM::CF_CFG_4: + ADescObj->ChannelAssignment = DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_4_WTF).ul; + break; + + case PCM::CF_CFG_5: + ADescObj->ChannelAssignment = DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_5_7p1_DS).ul; break; } @@ -103,14 +102,20 @@ MD_to_PCM_ADesc(MXF::WaveAudioDescriptor* ADescObj, PCM::AudioDescriptor& ADesc) if ( ADescObj->ChannelAssignment.HasValue() ) { - if ( ADescObj->ChannelAssignment == UL(SNDFMT_CFG_1_UL) ) + if ( ADescObj->ChannelAssignment == DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_1_5p1).ul ) ADesc.ChannelFormat = PCM::CF_CFG_1; - else if ( ADescObj->ChannelAssignment == UL(SNDFMT_CFG_2_UL) ) + else if ( ADescObj->ChannelAssignment == DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_2_6p1).ul ) ADesc.ChannelFormat = PCM::CF_CFG_2; - else if ( ADescObj->ChannelAssignment == UL(SNDFMT_CFG_3_UL) ) + else if ( ADescObj->ChannelAssignment == DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_3_7p1).ul ) ADesc.ChannelFormat = PCM::CF_CFG_3; + + else if ( ADescObj->ChannelAssignment == DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_4_WTF).ul ) + ADesc.ChannelFormat = PCM::CF_CFG_4; + + else if ( ADescObj->ChannelAssignment == DefaultSMPTEDict().Type(MDD_DCAudioChannelCfg_5_7p1_DS).ul ) + ADesc.ChannelFormat = PCM::CF_CFG_5; } return RESULT_OK; @@ -107,6 +107,7 @@ inline const char* ui64sz(ui64_t i, char* buf) const char* EncodeString(char* str_buf, ui32_t buf_len) const; bool operator==(const UL& rhs) const; + bool ExactMatch(const UL& rhs) const; }; // UMID diff --git a/src/KM_prng.cpp b/src/KM_prng.cpp index 031cb35..fb4286c 100755 --- a/src/KM_prng.cpp +++ b/src/KM_prng.cpp @@ -163,6 +163,7 @@ Kumu::FortunaRNG::FillRandom(byte_t* buf, ui32_t len) { assert(buf); assert(s_RNG); + const byte_t* front_of_buffer = buf; while ( len ) { @@ -179,7 +180,7 @@ Kumu::FortunaRNG::FillRandom(byte_t* buf, ui32_t len) s_RNG->set_key(rng_key); } - return buf; + return front_of_buffer; } // diff --git a/src/MDD.cpp b/src/MDD.cpp index d0f96ed..0855959 100644 --- a/src/MDD.cpp +++ b/src/MDD.cpp @@ -866,7 +866,21 @@ static const ASDCP::MDDEntry s_MDD_Table[] = { { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x05, // 276 0x01, 0x02, 0x02, 0x10, 0x02, 0x01, 0x00, 0x00 }, {0x3b, 0x0a}, false, "EssenceContainers" }, - + { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, // 277 + 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x01, 0x00 }, + {0}, false, "DCAudioChannelCfg_1_5p1" }, + { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, // 278 + 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x02, 0x00 }, + {0}, false, "DCAudioChannelCfg_2_6p1" }, + { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0b, // 279 + 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x03, 0x00 }, + {0}, false, "DCAudioChannelCfg_3_7p1" }, + { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0c, // 280 + 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x04, 0x00 }, + {0}, false, "DCAudioChannelCfg_4_WTF" }, + { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0c, // 281 + 0x04, 0x02, 0x02, 0x10, 0x03, 0x01, 0x05, 0x00 }, + {0}, false, "DCAudioChannelCfg_5_7p1_DS" }, { {0}, {0}, false, 0 } }; @@ -312,7 +312,13 @@ namespace ASDCP { MDD_Core_IndexSID, // 274 MDD_Core_OperationalPattern, // 275 MDD_Core_EssenceContainers, // 276 + MDD_DCAudioChannelCfg_1_5p1, // 277 + MDD_DCAudioChannelCfg_2_6p1, // 278 + MDD_DCAudioChannelCfg_3_7p1, // 279 + MDD_DCAudioChannelCfg_4_WTF, // 280 + MDD_DCAudioChannelCfg_5_7p1_DS, // 281 MDD_Max + }; // enum MDD_t // diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp index a1b0f8b..e2741d3 100755 --- a/src/MXFTypes.cpp +++ b/src/MXFTypes.cpp @@ -64,6 +64,31 @@ ASDCP::UL::operator==(const UL& rhs) const } +bool +ASDCP::UL::ExactMatch(const UL& rhs) const +{ + if ( m_Value[0] == rhs.m_Value[0] && + m_Value[1] == rhs.m_Value[1] && + m_Value[2] == rhs.m_Value[2] && + m_Value[3] == rhs.m_Value[3] && + m_Value[4] == rhs.m_Value[4] && + m_Value[5] == rhs.m_Value[5] && + m_Value[6] == rhs.m_Value[6] && + m_Value[7] == rhs.m_Value[7] && + m_Value[8] == rhs.m_Value[8] && + m_Value[9] == rhs.m_Value[9] && + m_Value[10] == rhs.m_Value[10] && + m_Value[11] == rhs.m_Value[11] && + m_Value[12] == rhs.m_Value[12] && + m_Value[13] == rhs.m_Value[13] && + m_Value[14] == rhs.m_Value[14] && + m_Value[15] == rhs.m_Value[15] + ) + return true; + + return false; +} + const char* ASDCP::UL::EncodeString(char* str_buf, ui32_t buf_len) const { diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp index e60f4d3..babbf4f 100755 --- a/src/asdcp-test.cpp +++ b/src/asdcp-test.cpp @@ -172,8 +172,8 @@ Read/Write Options:\n\ -d <duration> - Number of frames to process, default all\n\ -f <start-frame> - Starting frame number, default 0\n\ -l <label> - Use given channel format label when writing MXF sound\n\ - files. SMPTE 429-2 labels: '5.1', '6.1', '7.1'. Default\n\ - is no label (valid for Interop only).\n\ + files. SMPTE 429-2 labels: '5.1', '6.1', '7.1', '7.1DS', 'WTF'.\n\ + Default is no label (valid for Interop only).\n\ -L - Write SMPTE UL values instead of MXF Interop\n\ -p <rate> - fps of picture when wrapping PCM or JP2K:\n\ Use one of [23|24|25|30|48|50|60], 24 is default\n\ @@ -234,8 +234,14 @@ decode_channel_fmt(const std::string& label_name) else if ( label_name == "7.1" ) return PCM::CF_CFG_3; + else if ( label_name == "WTF" ) + return PCM::CF_CFG_4; + + else if ( label_name == "7.1DS" ) + return PCM::CF_CFG_5; + fprintf(stderr, "Error decoding channel format string: %s\n", label_name.c_str()); - fprintf(stderr, "Expecting '5.1', '6.1', or '7.1'\n"); + fprintf(stderr, "Expecting '5.1', '6.1', '7.1', '7.1DS' or 'WTF'\n"); return PCM::CF_NONE; } diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp index b0f8870..6ba52e2 100755 --- a/src/h__Reader.cpp +++ b/src/h__Reader.cpp @@ -63,12 +63,10 @@ ASDCP::h__Reader::InitInfo() InterchangeObject* Object; m_Info.LabelSetType = LS_MXF_UNKNOWN; - UL OPAtomUL(SMPTE_390_OPAtom_Entry().ul); - UL Interop_OPAtomUL(MXFInterop_OPAtom_Entry().ul); - if ( m_HeaderPart.OperationalPattern == Interop_OPAtomUL ) + if ( m_HeaderPart.OperationalPattern.ExactMatch(MXFInterop_OPAtom_Entry().ul) ) m_Info.LabelSetType = LS_MXF_INTEROP; - else if ( m_HeaderPart.OperationalPattern == OPAtomUL ) + else if ( m_HeaderPart.OperationalPattern.ExactMatch(SMPTE_390_OPAtom_Entry().ul) ) m_Info.LabelSetType = LS_MXF_SMPTE; // Identification |
