From: mschroffel Date: Thu, 19 May 2016 21:38:17 +0000 (+0000) Subject: version roll X-Git-Tag: rel_2_10_32~98 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=7ea686690e5ec6cfd8a73f49e264a2648d2ec8f2;p=asdcplib.git version roll --- diff --git a/configure.ac b/configure.ac index 201348e..8ba2bdc 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_PREREQ([2.59]) # For example, if asdcplib version 1.0.0 were modified to accomodate changes # in file format, and if no changes were made to AS_DCP.h, the new version would be # 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1. -AC_INIT([asdcplib], [2.5.14b], [asdcplib@cinecert.com]) +AC_INIT([asdcplib], [2.5.14], [asdcplib@cinecert.com]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/KM_error.h]) diff --git a/src/AS_02_PCM.cpp b/src/AS_02_PCM.cpp index e58690a..8532887 100644 --- a/src/AS_02_PCM.cpp +++ b/src/AS_02_PCM.cpp @@ -106,7 +106,7 @@ AS_02::PCM::MXFReader::h__Reader::OpenRead(const std::string& filename, const AS { if ( ! UL(reader.Key()).MatchIgnoreStream(m_Dict->ul(MDD_WAVEssenceClip)) ) { - const MDDEntry *entry = m_Dict->FindUL(reader.Key()); + const MDDEntry *entry = m_Dict->FindULAnyVersion(reader.Key()); if ( entry == 0 ) { diff --git a/src/AS_DCP_ATMOS.cpp b/src/AS_DCP_ATMOS.cpp index 518df74..f53ae71 100644 --- a/src/AS_DCP_ATMOS.cpp +++ b/src/AS_DCP_ATMOS.cpp @@ -107,7 +107,7 @@ typedef std::list SubDescriptorList_t; class ASDCP::ATMOS::MXFReader::h__Reader : public ASDCP::h__ASDCPReader { - MXF::DCDataDescriptor* m_EssenceDescriptor; + MXF::PrivateDCDataDescriptor* m_EssenceDescriptor; MXF::DolbyAtmosSubDescriptor* m_EssenceSubDescriptor; KM_NO_COPY_CONSTRUCT(h__Reader); @@ -130,7 +130,7 @@ ASDCP::Result_t ASDCP::ATMOS::MXFReader::h__Reader::MD_to_DCData_DDesc(ASDCP::DCData::DCDataDescriptor& DDesc) { ASDCP_TEST_NULL(m_EssenceDescriptor); - MXF::DCDataDescriptor* DDescObj = m_EssenceDescriptor; + MXF::PrivateDCDataDescriptor* DDescObj = m_EssenceDescriptor; DDesc.EditRate = DDescObj->SampleRate; assert(DDescObj->ContainerDuration <= 0xFFFFFFFFL); DDesc.ContainerDuration = static_cast(DDescObj->ContainerDuration); @@ -170,13 +170,13 @@ ASDCP::ATMOS::MXFReader::h__Reader::OpenRead(const std::string& filename) if ( KM_SUCCESS(result) ) { - m_EssenceDescriptor = static_cast(iObj); + m_EssenceDescriptor = static_cast(iObj); } } if ( m_EssenceDescriptor == 0 ) { - DefaultLogSink().Error("DCDataDescriptor object not found.\n"); + DefaultLogSink().Error("DCDataDescriptor object not found in Atmos file.\n"); result = RESULT_FORMAT; } @@ -420,7 +420,7 @@ ASDCP::Result_t ASDCP::ATMOS::MXFWriter::h__Writer::DCData_DDesc_to_MD(ASDCP::DCData::DCDataDescriptor& DDesc) { ASDCP_TEST_NULL(m_EssenceDescriptor); - MXF::DCDataDescriptor* DDescObj = static_cast(m_EssenceDescriptor); + MXF::PrivateDCDataDescriptor* DDescObj = static_cast(m_EssenceDescriptor); DDescObj->SampleRate = DDesc.EditRate; DDescObj->ContainerDuration = DDesc.ContainerDuration; @@ -456,7 +456,7 @@ ASDCP::ATMOS::MXFWriter::h__Writer::OpenWrite(const std::string& filename, ui32_ if ( ASDCP_SUCCESS(result) ) { m_HeaderSize = HeaderSize; - m_EssenceDescriptor = new MXF::DCDataDescriptor(m_Dict); + m_EssenceDescriptor = new MXF::PrivateDCDataDescriptor(m_Dict); m_EssenceSubDescriptor = new DolbyAtmosSubDescriptor(m_Dict); SubDescriptorList_t subDescriptors; subDescriptors.push_back(m_EssenceSubDescriptor); diff --git a/src/AS_DCP_DCData.cpp b/src/AS_DCP_DCData.cpp index ef4d6d4..208e852 100644 --- a/src/AS_DCP_DCData.cpp +++ b/src/AS_DCP_DCData.cpp @@ -150,7 +150,7 @@ ASDCP::DCData::MXFReader::h__Reader::OpenRead(const std::string& filename) if ( KM_FAILURE(result) ) { - DefaultLogSink().Error("DCDataDescriptor object not found.\n"); + DefaultLogSink().Error("DCDataDescriptor object not found in ST 429-14 file.\n"); result = RESULT_FORMAT; } } diff --git a/src/DCData_ByteStream_Parser.cpp b/src/DCData_ByteStream_Parser.cpp index 28e1869..6025e3b 100644 --- a/src/DCData_ByteStream_Parser.cpp +++ b/src/DCData_ByteStream_Parser.cpp @@ -24,7 +24,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*! \file AtmosSyncChannel_Mixer.h +/*! \file DCData_ByteStream_Parser.cpp \version $Id$ \brief AS-DCP library, Digital Cinema Data bytestream essence reader */ diff --git a/src/DCData_Sequence_Parser.cpp b/src/DCData_Sequence_Parser.cpp index de9f39a..28006da 100644 --- a/src/DCData_Sequence_Parser.cpp +++ b/src/DCData_Sequence_Parser.cpp @@ -24,7 +24,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*! \file AtmosSyncChannel_Mixer.h +/*! \file DCData_Sequence_Parser.cpp \version $Id$ \brief AS-DCP library, DCinema data seqence reader implementation */ diff --git a/src/Dict.cpp b/src/Dict.cpp index 639e40f..a50a05e 100755 --- a/src/Dict.cpp +++ b/src/Dict.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2006-2009, John Hurst +Copyright (c) 2006-2016, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -195,6 +195,7 @@ ASDCP::Dictionary::AddEntry(const MDDEntry& Entry, ui32_t index) UL TmpUL(Entry.ul); +#define MDD_AUTHORING_MODE #ifdef MDD_AUTHORING_MODE char buf[64]; std::map::iterator ii = m_md_lookup.find(TmpUL); @@ -253,26 +254,57 @@ ASDCP::Dictionary::Type(MDD_t type_id) const // const ASDCP::MDDEntry* -ASDCP::Dictionary::FindUL(const byte_t* ul_buf) const +ASDCP::Dictionary::FindULAnyVersion(const byte_t* ul_buf) const { assert(m_MDD_Table[0].name[0]); - std::map::const_iterator i = m_md_lookup.find(UL(ul_buf)); - - if ( i == m_md_lookup.end() ) - { - byte_t tmp_ul[SMPTE_UL_LENGTH]; - memcpy(tmp_ul, ul_buf, SMPTE_UL_LENGTH); - tmp_ul[SMPTE_UL_LENGTH-1] = 0; + byte_t search_ul[SMPTE_UL_LENGTH]; + memcpy(search_ul, ul_buf, SMPTE_UL_LENGTH); + memset(search_ul+7, 0, SMPTE_UL_LENGTH-7); - i = m_md_lookup.find(UL(tmp_ul)); + UL target(ul_buf); + const ASDCP::MDDEntry *found_entry = 0; - if ( i == m_md_lookup.end() ) + std::map::const_iterator lower = m_md_lookup.lower_bound(UL(search_ul)); + + for ( ; lower != m_md_lookup.end(); ++lower ) + { + if ( lower->first.MatchExact(target) ) { - char buf[64]; - UL TmpUL(ul_buf); - Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL: %s\n", TmpUL.EncodeString(buf, 64)); - return 0; + found_entry = &m_MDD_Table[lower->second]; + break; } + else if ( found_entry == 0 && lower->first.MatchIgnoreStream(target) ) + { + found_entry = &m_MDD_Table[lower->second]; + } + else if ( found_entry != 0 && ! lower->first.MatchIgnoreStream(target) ) + { + break; + } + } + + if ( found_entry == 0 ) + { + char buf[64]; + Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL: %s\n", target.EncodeString(buf, 64)); + } + + return found_entry; +} + +// +const ASDCP::MDDEntry* +ASDCP::Dictionary::FindULExact(const byte_t* ul_buf) const +{ + assert(m_MDD_Table[0].name[0]); + std::map::const_iterator i = m_md_lookup.find(UL(ul_buf)); + + if ( i == m_md_lookup.end() ) + { + char buf[64]; + UL tmp_ul(ul_buf); + Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL: %s\n", tmp_ul.EncodeString(buf, 64)); + return 0; } return &m_MDD_Table[i->second]; diff --git a/src/KLV.cpp b/src/KLV.cpp index 24a90a5..b9a5d63 100755 --- a/src/KLV.cpp +++ b/src/KLV.cpp @@ -171,7 +171,7 @@ ASDCP::KLVPacket::Dump(FILE* stream, const Dictionary& Dict, bool show_value) UL TmpUL(m_KeyStart); fprintf(stream, "%s", TmpUL.EncodeString(buf, 64)); - const MDDEntry* Entry = Dict.FindUL(m_KeyStart); + const MDDEntry* Entry = Dict.FindULAnyVersion(m_KeyStart); fprintf(stream, " len: %7qu (%s)\n", m_ValueLength, (Entry ? Entry->name : "Unknown")); if ( show_value && m_ValueLength < 1000 ) diff --git a/src/KLV.h b/src/KLV.h index 9bb1cb3..ae2dee8 100755 --- a/src/KLV.h +++ b/src/KLV.h @@ -107,9 +107,8 @@ 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 operator<(const UL& rhs) const; bool MatchIgnoreStream(const UL& rhs) const; - bool ExactMatch(const UL& rhs) const; + bool MatchExact(const UL& rhs) const; }; // UMID @@ -160,7 +159,8 @@ inline const char* ui64sz(ui64_t i, char* buf) bool AddEntry(const MDDEntry& Entry, ui32_t index); bool DeleteEntry(ui32_t index); - const MDDEntry* FindUL(const byte_t*) const; + const MDDEntry* FindULAnyVersion(const byte_t*) const; + const MDDEntry* FindULExact(const byte_t*) const; const MDDEntry* FindSymbol(const std::string&) const; const MDDEntry& Type(MDD_t type_id) const; diff --git a/src/MXF.cpp b/src/MXF.cpp index 258bdbf..92ae5bb 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -575,7 +575,7 @@ ASDCP::MXF::Primer::Dump(FILE* stream) Batch::iterator i = LocalTagEntryBatch.begin(); for ( ; i != LocalTagEntryBatch.end(); i++ ) { - const MDDEntry* Entry = m_Dict->FindUL((*i).UL.Value()); + const MDDEntry* Entry = m_Dict->FindULAnyVersion((*i).UL.Value()); fprintf(stream, " %s %s\n", (*i).EncodeString(identbuf, IdentBufferLen), (Entry ? Entry->name : "Unknown")); } } @@ -702,11 +702,11 @@ ASDCP::MXF::OP1aHeader::InitFromFile(const Kumu::FileReader& Reader) if ( m_Dict == &DefaultCompositeDict() ) { // select more explicit dictionary if one is available - if ( OperationalPattern.ExactMatch(MXFInterop_OPAtom_Entry().ul) ) + if ( OperationalPattern.MatchExact(MXFInterop_OPAtom_Entry().ul) ) { m_Dict = &DefaultInteropDict(); } - else if ( OperationalPattern.ExactMatch(SMPTE_390_OPAtom_Entry().ul) ) + else if ( OperationalPattern.MatchExact(SMPTE_390_OPAtom_Entry().ul) ) { m_Dict = &DefaultSMPTEDict(); } diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp index 9e481e2..b2557f7 100755 --- a/src/MXFTypes.cpp +++ b/src/MXFTypes.cpp @@ -65,72 +65,6 @@ ASDCP::UL::operator==(const UL& rhs) const return false; } - -// -bool -ASDCP::UL::operator<(const UL& rhs) const -{ - if ( m_Value[0] < rhs.m_Value[0] ) return true; - if ( m_Value[0] == rhs.m_Value[0] ) - { - if ( m_Value[1] < rhs.m_Value[1] ) return true; - if ( m_Value[1] == rhs.m_Value[1] ) - { - if ( m_Value[2] < rhs.m_Value[2] ) return true; - if ( m_Value[2] == rhs.m_Value[2] ) - { - if ( m_Value[3] < rhs.m_Value[3] ) return true; - if ( m_Value[3] == rhs.m_Value[3] ) - { - if ( m_Value[4] < rhs.m_Value[4] ) return true; - if ( m_Value[4] == rhs.m_Value[4] ) - { - if ( m_Value[5] < rhs.m_Value[5] ) return true; - if ( m_Value[5] == rhs.m_Value[5] ) - { - if ( m_Value[6] < rhs.m_Value[6] ) return true; - if ( m_Value[6] == rhs.m_Value[6] ) - { - if ( m_Value[8] < rhs.m_Value[8] ) return true; - if ( m_Value[8] == rhs.m_Value[8] ) - { - if ( m_Value[9] < rhs.m_Value[9] ) return true; - if ( m_Value[9] == rhs.m_Value[9] ) - { - if ( m_Value[10] < rhs.m_Value[10] ) return true; - if ( m_Value[10] == rhs.m_Value[10] ) - { - if ( m_Value[11] < rhs.m_Value[11] ) return true; - if ( m_Value[11] == rhs.m_Value[11] ) - { - if ( m_Value[12] < rhs.m_Value[12] ) return true; - if ( m_Value[12] == rhs.m_Value[12] ) - { - if ( m_Value[13] < rhs.m_Value[13] ) return true; - if ( m_Value[13] == rhs.m_Value[13] ) - { - if ( m_Value[14] < rhs.m_Value[14] ) return true; - if ( m_Value[14] == rhs.m_Value[14] ) - { - if ( m_Value[15] < rhs.m_Value[15] ) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - - return false; -} - // bool ASDCP::UL::MatchIgnoreStream(const UL& rhs) const @@ -159,7 +93,7 @@ ASDCP::UL::MatchIgnoreStream(const UL& rhs) const // bool -ASDCP::UL::ExactMatch(const UL& rhs) const +ASDCP::UL::MatchExact(const UL& rhs) const { if ( m_Value[0] == rhs.m_Value[0] && m_Value[1] == rhs.m_Value[1] && diff --git a/src/WavFileWriter.h b/src/WavFileWriter.h index 6f507c8..f5a5495 100755 --- a/src/WavFileWriter.h +++ b/src/WavFileWriter.h @@ -154,7 +154,7 @@ class WavFileWriter { for ( ui32_t i = 0; i < file_count && ASDCP_SUCCESS(result); i++ ) { - snprintf(filename, Kumu::MaxFilePath, "%s_%u.wav", file_root, (i + 1)); + snprintf(filename, Kumu::MaxFilePath, "%s_%02u.wav", file_root, (i + 1)); m_OutFile.push_back(new WavFileElement(element_size)); result = m_OutFile.back()->OpenWrite(filename); diff --git a/src/asdcp-wrap.cpp b/src/asdcp-wrap.cpp index 7d730d4..e8bf2f1 100755 --- a/src/asdcp-wrap.cpp +++ b/src/asdcp-wrap.cpp @@ -1151,6 +1151,11 @@ write_PCM_with_ATMOS_sync_file(CommandOptions& Options) // set up MXF writer if ( ASDCP_SUCCESS(result) ) { + if ( Mixer.ChannelCount() % 2 != 0 ) + { + result = Mixer.AppendSilenceChannels(1); + } + Mixer.FillAudioDescriptor(ADesc); ADesc.EditRate = PictureRate; diff --git a/src/h__02_Reader.cpp b/src/h__02_Reader.cpp index 45825f0..d852592 100644 --- a/src/h__02_Reader.cpp +++ b/src/h__02_Reader.cpp @@ -409,7 +409,7 @@ AS_02::h__AS02Reader::OpenMXFRead(const char* filename) if ( m_HeaderPart.OperationalPattern != OP1a_ul ) { char strbuf[IdentBufferLen]; - const MDDEntry* Entry = m_Dict->FindUL(m_HeaderPart.OperationalPattern.Value()); + const MDDEntry* Entry = m_Dict->FindULAnyVersion(m_HeaderPart.OperationalPattern.Value()); if ( Entry == 0 ) { diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp index d0c5168..a764767 100755 --- a/src/h__Reader.cpp +++ b/src/h__Reader.cpp @@ -84,18 +84,18 @@ ASDCP::h__ASDCPReader::OpenMXFRead(const std::string& filename) m_Info.LabelSetType = LS_MXF_UNKNOWN; - if ( m_HeaderPart.OperationalPattern.ExactMatch(MXFInterop_OPAtom_Entry().ul) ) + if ( m_HeaderPart.OperationalPattern.MatchExact(MXFInterop_OPAtom_Entry().ul) ) { m_Info.LabelSetType = LS_MXF_INTEROP; } - else if ( m_HeaderPart.OperationalPattern.ExactMatch(SMPTE_390_OPAtom_Entry().ul) ) + else if ( m_HeaderPart.OperationalPattern.MatchExact(SMPTE_390_OPAtom_Entry().ul) ) { m_Info.LabelSetType = LS_MXF_SMPTE; } else { char strbuf[IdentBufferLen]; - const MDDEntry* Entry = m_Dict->FindUL(m_HeaderPart.OperationalPattern.Value()); + const MDDEntry* Entry = m_Dict->FindULExact(m_HeaderPart.OperationalPattern.Value()); if ( Entry == 0 ) { @@ -312,7 +312,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, if ( ! UL(ess_p).MatchIgnoreStream(EssenceUL) ) // ignore the stream number { char strbuf[IntBufferLen]; - const MDDEntry* Entry = Dict.FindUL(Key.Value()); + const MDDEntry* Entry = Dict.FindULAnyVersion(Key.Value()); if ( Entry == 0 ) { @@ -431,7 +431,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, else { char strbuf[IntBufferLen]; - const MDDEntry* Entry = Dict.FindUL(Key.Value()); + const MDDEntry* Entry = Dict.FindULAnyVersion(Key.Value()); if ( Entry == 0 ) {