# 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])
{
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 )
{
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);
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<ui32_t>(DDescObj->ContainerDuration);
if ( KM_SUCCESS(result) )
{
- m_EssenceDescriptor = static_cast<MXF::DCDataDescriptor*>(iObj);
+ m_EssenceDescriptor = static_cast<MXF::PrivateDCDataDescriptor*>(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;
}
ASDCP::ATMOS::MXFWriter::h__Writer::DCData_DDesc_to_MD(ASDCP::DCData::DCDataDescriptor& DDesc)
{
ASDCP_TEST_NULL(m_EssenceDescriptor);
- MXF::DCDataDescriptor* DDescObj = static_cast<MXF::DCDataDescriptor *>(m_EssenceDescriptor);
+ MXF::PrivateDCDataDescriptor* DDescObj = static_cast<MXF::PrivateDCDataDescriptor *>(m_EssenceDescriptor);
DDescObj->SampleRate = DDesc.EditRate;
DDescObj->ContainerDuration = DDesc.ContainerDuration;
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);
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;
}
}
(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
*/
(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
*/
/*
-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
UL TmpUL(Entry.ul);
+#define MDD_AUTHORING_MODE
#ifdef MDD_AUTHORING_MODE
char buf[64];
std::map<ASDCP::UL, ui32_t>::iterator ii = m_md_lookup.find(TmpUL);
//
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<UL, ui32_t>::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<UL, ui32_t>::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<UL, ui32_t>::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];
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 )
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
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;
Batch<LocalTagEntry>::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"));
}
}
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();
}
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
//
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] &&
{
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);
// set up MXF writer
if ( ASDCP_SUCCESS(result) )
{
+ if ( Mixer.ChannelCount() % 2 != 0 )
+ {
+ result = Mixer.AppendSilenceChannels(1);
+ }
+
Mixer.FillAudioDescriptor(ADesc);
ADesc.EditRate = PictureRate;
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 )
{
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 )
{
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 )
{
else
{
char strbuf[IntBufferLen];
- const MDDEntry* Entry = Dict.FindUL(Key.Value());
+ const MDDEntry* Entry = Dict.FindULAnyVersion(Key.Value());
if ( Entry == 0 )
{