summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/AS_DCP.cpp2
-rwxr-xr-xsrc/AS_DCP_JP2K.cpp88
-rwxr-xr-xsrc/AS_DCP_MXF.cpp6
-rwxr-xr-xsrc/Index.cpp4
-rwxr-xr-xsrc/MXF.cpp140
-rwxr-xr-xsrc/MXF.h9
-rwxr-xr-xsrc/MXFTypes.h7
-rwxr-xr-xsrc/Metadata.cpp842
-rwxr-xr-xsrc/Metadata.h60
-rwxr-xr-xsrc/WavFileWriter.h2
-rwxr-xr-xsrc/asdcp-test.cpp6
-rwxr-xr-xsrc/h__Reader.cpp2
-rwxr-xr-xsrc/klvwalk.cpp6
13 files changed, 631 insertions, 543 deletions
diff --git a/src/AS_DCP.cpp b/src/AS_DCP.cpp
index 4b5acd6..a5187d6 100755
--- a/src/AS_DCP.cpp
+++ b/src/AS_DCP.cpp
@@ -173,7 +173,7 @@ const char*
ASDCP::Version()
{
static char ver[16];
- sprintf(ver, "%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
+ snprintf(ver, 16, "%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
return ver;
}
diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp
index 4262edf..033e4ef 100755
--- a/src/AS_DCP_JP2K.cpp
+++ b/src/AS_DCP_JP2K.cpp
@@ -50,10 +50,10 @@ ASDCP::JP2K_PDesc_to_MD(JP2K::PictureDescriptor& PDesc, MDObject& PDescObj)
PDescObj.SetValue("Codec", DataChunk(klv_key_size, JP2KEssenceCompressionLabel));
- sprintf(text_buf, "%ld/%ld", PDesc.EditRate.Numerator, PDesc.EditRate.Denominator);
+ snprintf(text_buf, 32, "%ld/%ld", PDesc.EditRate.Numerator, PDesc.EditRate.Denominator);
PDescObj.SetString("SampleRate", text_buf);
- sprintf(text_buf, "%ld/%ld", PDesc.AspectRatio.Numerator, PDesc.AspectRatio.Denominator);
+ snprintf(text_buf, 32, "%ld/%ld", PDesc.AspectRatio.Numerator, PDesc.AspectRatio.Denominator);
PDescObj.SetString("AspectRatio", text_buf);
PDescObj.SetUint("FrameLayout", 0);
@@ -100,31 +100,15 @@ ASDCP::Result_t
ASDCP::MD_to_JP2K_PDesc(MXF::RGBAEssenceDescriptor* PDescObj, JP2K::PictureDescriptor& PDesc)
{
ASDCP_TEST_NULL(PDescObj);
- PDesc.CodingStyleLength = PDesc.QuantDefaultLength = 0;
+ memset(&PDesc, 0, sizeof(PDesc));
-#if 0
- PDesc.StoredWidth = PDescObj.GetUint("StoredWidth");
- PDesc.StoredHeight = PDescObj.GetUint("StoredHeight");
- PDesc.ContainerDuration = PDescObj.GetUint("ContainerDuration");
-
- //
- MDObject* Ptr = PDescObj["SampleRate"]; // should be EditRate
-
- if ( Ptr )
- {
- PDesc.EditRate.Numerator = Ptr->GetInt("Numerator");
- PDesc.EditRate.Denominator = Ptr->GetInt("Denominator");
- }
-
- //
- Ptr = PDescObj["AspectRatio"];
-
- if ( Ptr )
- {
- PDesc.AspectRatio.Numerator = Ptr->GetInt("Numerator");
- PDesc.AspectRatio.Denominator = Ptr->GetInt("Denominator");
- }
+ PDesc.EditRate = PDescObj->SampleRate;
+ PDesc.ContainerDuration = PDescObj->ContainerDuration;
+ PDesc.StoredWidth = PDescObj->StoredWidth;
+ PDesc.StoredHeight = PDescObj->StoredHeight;
+ PDesc.AspectRatio = PDescObj->AspectRatio;
+#if 0
MDObject* PSubDescObj = GetMDObjectByType(PDescObj, "JPEG2000PictureSubDescriptor");
if ( PSubDescObj == 0 )
@@ -133,23 +117,17 @@ ASDCP::MD_to_JP2K_PDesc(MXF::RGBAEssenceDescriptor* PDescObj, JP2K::PictureDescr
return RESULT_FALSE;
}
- PDesc.Rsize = PSubDescObj->GetUint("Rsize");
- PDesc.Xsize = PSubDescObj->GetUint("Xsize");
- PDesc.Ysize = PSubDescObj->GetUint("Ysize");
- PDesc.XOsize = PSubDescObj->GetUint("XOsize");
- PDesc.YOsize = PSubDescObj->GetUint("YOsize");
- PDesc.XTsize = PSubDescObj->GetUint("XTsize");
- PDesc.YTsize = PSubDescObj->GetUint("YTsize");
- PDesc.XTOsize = PSubDescObj->GetUint("XTOsize");
- PDesc.YTOsize = PSubDescObj->GetUint("YTOsize");
- PDesc.Csize = PSubDescObj->GetUint("Csize");
-
- //
- Ptr = (*PSubDescObj)["PictureComponentSizing"];
-
- if ( Ptr )
- {
- DataChunk DC3 = Ptr->GetData();
+ PDesc.Rsize = PSubDescObj->Rsize;
+ PDesc.Xsize = PSubDescObj->Xsize;
+ PDesc.Ysize = PSubDescObj->Ysize;
+ PDesc.XOsize = PSubDescObj->XOsize;
+ PDesc.YOsize = PSubDescObj->YOsize;
+ PDesc.XTsize = PSubDescObj->XTsize;
+ PDesc.YTsize = PSubDescObj->YTsize;
+ PDesc.XTOsize = PSubDescObj->XTOsize;
+ PDesc.YTOsize = PSubDescObj->YTOsize;
+ PDesc.Csize = PSubDescObj->Csize;
+ // PictureComponentSizing
if ( DC3.Size == 17 ) // ( 2* sizeof(ui32_t) ) + 3 components * 3 byte each
{
@@ -159,28 +137,16 @@ ASDCP::MD_to_JP2K_PDesc(MXF::RGBAEssenceDescriptor* PDescObj, JP2K::PictureDescr
{
DefaultLogSink().Error("Unexpected PictureComponentSizing size: %lu, should be 17\n", DC3.Size);
}
- }
+#endif
- //
- Ptr = (*PSubDescObj)["CodingStyleDefault"];
+ // CodingStyleDefault
+ // PDesc.CodingStyleLength = DC1.Size;
+ // memcpy(PDesc.CodingStyle, DC1.Data, DC1.Size);
- if ( Ptr )
- {
- DataChunk DC1 = Ptr->GetData();
- PDesc.CodingStyleLength = DC1.Size;
- memcpy(PDesc.CodingStyle, DC1.Data, DC1.Size);
- }
+ // QuantizationDefault
+ // PDesc.QuantDefaultLength = DC2.Size;
+ // memcpy(PDesc.QuantDefault, DC2.Data, DC2.Size);
- //
- Ptr = (*PSubDescObj)["QuantizationDefault"];
-
- if ( Ptr )
- {
- DataChunk DC2 = Ptr->GetData();
- PDesc.QuantDefaultLength = DC2.Size;
- memcpy(PDesc.QuantDefault, DC2.Data, DC2.Size);
- }
-#endif
return RESULT_OK;
}
diff --git a/src/AS_DCP_MXF.cpp b/src/AS_DCP_MXF.cpp
index 03b9b54..fbf37c3 100755
--- a/src/AS_DCP_MXF.cpp
+++ b/src/AS_DCP_MXF.cpp
@@ -93,7 +93,7 @@ ASDCP::MD_to_WriterInfo(Identification* InfoObj, WriterInfo& Info)
InfoObj->CompanyName.ToString(tmp_str);
if ( *tmp_str ) Info.CompanyName = tmp_str;
- memcpy(Info.ProductUUID, InfoObj->ProductUID.Data(), UUIDlen);
+ memcpy(Info.ProductUUID, InfoObj->ProductUID.Value(), UUIDlen);
return RESULT_OK;
}
@@ -106,8 +106,8 @@ ASDCP::MD_to_CryptoInfo(CryptographicContext* InfoObj, WriterInfo& Info)
ASDCP_TEST_NULL(InfoObj);
Info.EncryptedEssence = true;
- memcpy(Info.ContextID, InfoObj->ContextID.Data(), UUIDlen);
- memcpy(Info.CryptographicKeyID, InfoObj->CryptographicKeyID.Data(), UUIDlen);
+ memcpy(Info.ContextID, InfoObj->ContextID.Value(), UUIDlen);
+ memcpy(Info.CryptographicKeyID, InfoObj->CryptographicKeyID.Value(), UUIDlen);
UL MIC_SHA1(MICAlgorithm_HMAC_SHA1);
UL MIC_NONE(MICAlgorithm_NONE);
diff --git a/src/Index.cpp b/src/Index.cpp
index 96c81ed..b7bdc33 100755
--- a/src/Index.cpp
+++ b/src/Index.cpp
@@ -153,7 +153,7 @@ ASDCP::MXF::IndexTableSegment::Dump(FILE* stream)
const char*
ASDCP::MXF::IndexTableSegment::DeltaEntry::ToString(char* str_buf) const
{
- sprintf(str_buf, "%3i %-3hu %-3lu", PosTableIndex, Slice, ElementData);
+ snprintf(str_buf, IdentBufferLen, "%3i %-3hu %-3lu", PosTableIndex, Slice, ElementData);
return str_buf;
}
@@ -203,7 +203,7 @@ ASDCP::MXF::IndexTableSegment::IndexEntry::ToString(char* str_buf) const
txt_flags[3] = ( (Flags & 0x10) != 0 ) ? 'b' : ' ';
txt_flags[4] = ( (Flags & 0x0f) == 3 ) ? 'B' : ( (Flags & 0x0f) == 2 ) ? 'P' : 'I';
- sprintf(str_buf, "%3i %-3hu %s %s",
+ snprintf(str_buf, IdentBufferLen, "%3i %-3hu %s %s",
TemporalOffset, KeyFrameOffset, txt_flags,
i64sz(StreamOffset, intbuf));
diff --git a/src/MXF.cpp b/src/MXF.cpp
index faed567..ae45e07 100755
--- a/src/MXF.cpp
+++ b/src/MXF.cpp
@@ -31,9 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ASDCP_DECLARE_MDD
#include "MDD.h"
-#include "Mutex.h"
#include "MXF.h"
-#include "Metadata.h"
#include <hex_utils.h>
//------------------------------------------------------------------------------------------
@@ -362,7 +360,7 @@ ASDCP::MXF::Primer::InsertTag(const ASDCP::UL& Key, ASDCP::TagValue& Tag)
if ( i == m_Lookup->end() )
{
- const MDDEntry* mdde = GetMDDEntry(Key.Data());
+ const MDDEntry* mdde = GetMDDEntry(Key.Value());
assert(mdde);
LocalTagEntry TmpEntry;
@@ -413,7 +411,7 @@ ASDCP::MXF::Primer::Dump(FILE* stream)
Batch<LocalTagEntry>::iterator i = LocalTagEntryBatch.begin();
for ( ; i != LocalTagEntryBatch.end(); i++ )
{
- const MDDEntry* Entry = GetMDDEntry((*i).UL.Data());
+ const MDDEntry* Entry = GetMDDEntry((*i).UL.Value());
fprintf(stream, " %s %s\n", (*i).ToString(identbuf), (Entry ? Entry->name : "Unknown"));
}
@@ -914,7 +912,7 @@ ASDCP::MXF::OPAtomIndexFooter::Lookup(ui32_t frame_num, IndexTableSegment::Index
else if ( (ui64_t)frame_num >= start_pos
&& (ui64_t)frame_num < (start_pos + Segment->IndexDuration) )
{
- Entry = Segment->IndexEntryArray[frame_num];
+ Entry = Segment->IndexEntryArray[frame_num-start_pos];
return RESULT_OK;
}
}
@@ -959,6 +957,18 @@ ASDCP::MXF::InterchangeObject::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
}
//
+void
+ASDCP::MXF::InterchangeObject::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+
+ fputc('\n', stream);
+ KLVPacket::Dump(stream, false);
+ fprintf(stream, " InstanceUID = %s\n", InstanceUID.ToString(identbuf));
+ fprintf(stream, " GenerationUID = %s\n", GenerationUID.ToString(identbuf));
+}
+
+//
bool
ASDCP::MXF::InterchangeObject::IsA(const byte_t* label)
{
@@ -969,126 +979,6 @@ ASDCP::MXF::InterchangeObject::IsA(const byte_t* label)
}
-//------------------------------------------------------------------------------------------
-//
-
-//
-enum FLT_t
- {
- FLT_Preface,
- FLT_Identification,
- FLT_ContentStorage,
- FLT_MaterialPackage,
- FLT_SourcePackage,
- FLT_Track,
- FLT_Sequence,
- FLT_SourceClip,
- FLT_TimecodeComponent,
- FLT_FileDescriptor,
- FLT_WaveAudioDescriptor,
- FLT_GenericPictureEssenceDescriptor,
- FLT_MPEG2VideoDescriptor,
- FLT_RGBAEssenceDescriptor,
- FLT_JPEG2000PictureSubDescriptor,
- FLT_IndexTableSegment,
- FLT_CryptographicFramework,
- FLT_CryptographicContext
- };
-
-//
-typedef std::map<ASDCP::UL, FLT_t>::iterator FLi_t;
-
-class FactoryList : public std::map<ASDCP::UL, FLT_t>
-{
- ASDCP::Mutex m_Lock;
-
-public:
- FactoryList() {}
- ~FactoryList() {}
-
- bool Empty() {
- ASDCP::AutoMutex BlockLock(m_Lock);
- return empty();
- }
-
- FLi_t Find(const byte_t* label) {
- ASDCP::AutoMutex BlockLock(m_Lock);
- return find(label);
- }
-
- FLi_t End() {
- ASDCP::AutoMutex BlockLock(m_Lock);
- return end();
- }
-
-};
-
-//
-static FactoryList s_FactoryList;
-
-#define SETUP_IDX(t) const ui32_t FLT_##t = v;
-#define SETUP_FACTORY(t) s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_##t].ul, FLT_##t));
-#define CASE_FACTORY(t) case FLT_##t: return new t
-
-//
-ASDCP::MXF::InterchangeObject*
-ASDCP::MXF::CreateObject(const byte_t* label)
-{
- if ( label == 0 )
- return 0;
-
- if ( s_FactoryList.empty() )
- {
- SETUP_FACTORY(Preface);
- SETUP_FACTORY(Identification);
- SETUP_FACTORY(ContentStorage);
- SETUP_FACTORY(MaterialPackage);
- SETUP_FACTORY(SourcePackage);
- SETUP_FACTORY(Track);
- SETUP_FACTORY(Sequence);
- SETUP_FACTORY(SourceClip);
- SETUP_FACTORY(TimecodeComponent);
- SETUP_FACTORY(FileDescriptor);
- SETUP_FACTORY(WaveAudioDescriptor);
- SETUP_FACTORY(GenericPictureEssenceDescriptor);
- SETUP_FACTORY(MPEG2VideoDescriptor);
- SETUP_FACTORY(RGBAEssenceDescriptor);
- SETUP_FACTORY(JPEG2000PictureSubDescriptor);
- SETUP_FACTORY(IndexTableSegment);
- SETUP_FACTORY(CryptographicFramework);
- SETUP_FACTORY(CryptographicContext);
- }
-
- FLi_t i = s_FactoryList.find(label);
-
- if ( i == s_FactoryList.end() )
- return new InterchangeObject;
-
- switch ( i->second )
- {
- CASE_FACTORY(Preface);
- CASE_FACTORY(Identification);
- CASE_FACTORY(ContentStorage);
- CASE_FACTORY(MaterialPackage);
- CASE_FACTORY(SourcePackage);
- CASE_FACTORY(Track);
- CASE_FACTORY(Sequence);
- CASE_FACTORY(SourceClip);
- CASE_FACTORY(TimecodeComponent);
- CASE_FACTORY(FileDescriptor);
- CASE_FACTORY(WaveAudioDescriptor);
- CASE_FACTORY(GenericPictureEssenceDescriptor);
- CASE_FACTORY(MPEG2VideoDescriptor);
- CASE_FACTORY(RGBAEssenceDescriptor);
- CASE_FACTORY(JPEG2000PictureSubDescriptor);
- CASE_FACTORY(IndexTableSegment);
- CASE_FACTORY(CryptographicFramework);
- CASE_FACTORY(CryptographicContext);
- }
-
- return new InterchangeObject;
-}
-
//
// end MXF.cpp
//
diff --git a/src/MXF.h b/src/MXF.h
index 076e999..74c64db 100755
--- a/src/MXF.h
+++ b/src/MXF.h
@@ -57,7 +57,7 @@ namespace ASDCP
inline const char* ToString(char* str_buf) const {
char intbuf[IntBufferLen];
- sprintf(str_buf, "%-6lu: %s", BodySID, ui64sz(ByteOffset, intbuf));
+ snprintf(str_buf, IdentBufferLen, "%-6lu: %s", BodySID, ui64sz(ByteOffset, intbuf));
return str_buf;
}
@@ -134,7 +134,7 @@ namespace ASDCP
ASDCP::UL UL;
inline const char* ToString(char* str_buf) const {
- sprintf(str_buf, "%02x %02x: ", Tag.a, Tag.b);
+ snprintf(str_buf, IdentBufferLen, "%02x %02x: ", Tag.a, Tag.b);
UL.ToString(str_buf + strlen(str_buf));
return str_buf;
}
@@ -192,10 +192,7 @@ namespace ASDCP
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
virtual bool IsA(const byte_t* label);
-
- virtual void Dump(FILE* stream = 0) {
- KLVPacket::Dump(stream, true);
- }
+ virtual void Dump(FILE* stream = 0);
};
//
diff --git a/src/MXFTypes.h b/src/MXFTypes.h
index 4667588..eb26096 100755
--- a/src/MXFTypes.h
+++ b/src/MXFTypes.h
@@ -221,8 +221,9 @@ namespace ASDCP
//
inline const char* ToString(char* str_buf) const {
- sprintf(str_buf, "%04hu-%02hu-%02hu %02hu:%02hu:%02hu.%03hu",
- Year, Month, Day, Hour, Minute, Second, mSec_4);
+ snprintf(str_buf, IdentBufferLen,
+ "%04hu-%02hu-%02hu %02hu:%02hu:%02hu.%03hu",
+ Year, Month, Day, Hour, Minute, Second, mSec_4);
return str_buf;
}
@@ -276,7 +277,7 @@ namespace ASDCP
//
const char* ToString(char* str_buf) const {
- sprintf(str_buf, "%lu/%lu", Numerator, Denominator);
+ snprintf(str_buf, IdentBufferLen, "%lu/%lu", Numerator, Denominator);
return str_buf;
}
diff --git a/src/Metadata.cpp b/src/Metadata.cpp
index b1a11c2..b597303 100755
--- a/src/Metadata.cpp
+++ b/src/Metadata.cpp
@@ -32,12 +32,139 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Metadata.h"
#include "MDD.h"
-#include <hex_utils.h>
-
+#include "Mutex.h"
+#include "hex_utils.h"
//------------------------------------------------------------------------------------------
+
//
+enum FLT_t
+ {
+ FLT_Preface,
+ FLT_IndexTableSegment,
+ FLT_Identification,
+ FLT_ContentStorage,
+ FLT_MaterialPackage,
+ FLT_SourcePackage,
+ FLT_Track,
+ FLT_Sequence,
+ FLT_SourceClip,
+ FLT_TimecodeComponent,
+ FLT_FileDescriptor,
+ FLT_GenericSoundEssenceDescriptor,
+ FLT_WaveAudioDescriptor,
+ FLT_GenericPictureEssenceDescriptor,
+ FLT_RGBAEssenceDescriptor,
+ FLT_JPEG2000PictureSubDescriptor,
+ FLT_CDCIEssenceDescriptor,
+ FLT_MPEG2VideoDescriptor,
+ FLT_CryptographicFramework,
+ FLT_CryptographicContext,
+ };
+
+//
+typedef std::map<ASDCP::UL, FLT_t>::iterator FLi_t;
+
+class FactoryList : public std::map<ASDCP::UL, FLT_t>
+{
+ ASDCP::Mutex m_Lock;
+
+public:
+ FactoryList() {}
+ ~FactoryList() {}
+
+ bool Empty() {
+ ASDCP::AutoMutex BlockLock(m_Lock);
+ return empty();
+ }
+
+ FLi_t Find(const byte_t* label) {
+ ASDCP::AutoMutex BlockLock(m_Lock);
+ return find(label);
+ }
+
+ FLi_t End() {
+ ASDCP::AutoMutex BlockLock(m_Lock);
+ return end();
+ }
+
+};
+
+//
+static FactoryList s_FactoryList;
+
+//
+ASDCP::MXF::InterchangeObject*
+ASDCP::MXF::CreateObject(const byte_t* label)
+{
+ if ( label == 0 )
+ return 0;
+
+ if ( s_FactoryList.empty() )
+ {
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_Preface].ul, FLT_Preface));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_IndexTableSegment].ul, FLT_IndexTableSegment));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_Identification].ul, FLT_Identification));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_ContentStorage].ul, FLT_ContentStorage));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_MaterialPackage].ul, FLT_MaterialPackage));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_SourcePackage].ul, FLT_SourcePackage));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_Track].ul, FLT_Track));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_Sequence].ul, FLT_Sequence));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_SourceClip].ul, FLT_SourceClip));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_TimecodeComponent].ul, FLT_TimecodeComponent));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_FileDescriptor].ul, FLT_FileDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_GenericSoundEssenceDescriptor].ul, FLT_GenericSoundEssenceDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_WaveAudioDescriptor].ul, FLT_WaveAudioDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_GenericPictureEssenceDescriptor].ul, FLT_GenericPictureEssenceDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_RGBAEssenceDescriptor].ul, FLT_RGBAEssenceDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_JPEG2000PictureSubDescriptor].ul, FLT_JPEG2000PictureSubDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_CDCIEssenceDescriptor].ul, FLT_CDCIEssenceDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_MPEG2VideoDescriptor].ul, FLT_MPEG2VideoDescriptor));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_CryptographicFramework].ul, FLT_CryptographicFramework));
+ s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_CryptographicContext].ul, FLT_CryptographicContext));
+ }
+
+ FLi_t i = s_FactoryList.find(label);
+
+ if ( i == s_FactoryList.end() )
+ return new InterchangeObject;
+
+ switch ( i->second )
+ {
+ case FLT_Preface: return new Preface;
+ case FLT_IndexTableSegment: return new IndexTableSegment;
+ case FLT_Identification: return new Identification;
+ case FLT_ContentStorage: return new ContentStorage;
+ case FLT_MaterialPackage: return new MaterialPackage;
+ case FLT_SourcePackage: return new SourcePackage;
+ case FLT_Track: return new Track;
+ case FLT_Sequence: return new Sequence;
+ case FLT_SourceClip: return new SourceClip;
+ case FLT_TimecodeComponent: return new TimecodeComponent;
+ case FLT_FileDescriptor: return new FileDescriptor;
+ case FLT_GenericSoundEssenceDescriptor: return new GenericSoundEssenceDescriptor;
+ case FLT_WaveAudioDescriptor: return new WaveAudioDescriptor;
+ case FLT_GenericPictureEssenceDescriptor: return new GenericPictureEssenceDescriptor;
+ case FLT_RGBAEssenceDescriptor: return new RGBAEssenceDescriptor;
+ case FLT_JPEG2000PictureSubDescriptor: return new JPEG2000PictureSubDescriptor;
+ case FLT_CDCIEssenceDescriptor: return new CDCIEssenceDescriptor;
+ case FLT_MPEG2VideoDescriptor: return new MPEG2VideoDescriptor;
+ case FLT_CryptographicFramework: return new CryptographicFramework;
+ case FLT_CryptographicContext: return new CryptographicContext;
+ }
+
+ return new InterchangeObject;
+}
+
+
+//------------------------------------------------------------------------------------------
+// KLV Sets
+
+
+
+//------------------------------------------------------------------------------------------
+// Identification
//
ASDCP::Result_t
@@ -57,6 +184,28 @@ ASDCP::MXF::Identification::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::Identification::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "ThisGenerationUID", ThisGenerationUID.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "CompanyName", CompanyName.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "ProductName", ProductName.ToString(identbuf));
+ fprintf(stream, " %22s = %d\n", "ProductVersion", ProductVersion);
+ fprintf(stream, " %22s = %s\n", "VersionString", VersionString.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "ProductUID", ProductUID.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "ModificationDate", ModificationDate.ToString(identbuf));
+ fprintf(stream, " %22s = %d\n", "ToolkitVersion", ToolkitVersion);
+ fprintf(stream, " %22s = %s\n", "Platform", Platform.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::Identification::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -73,7 +222,6 @@ ASDCP::MXF::Identification::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::Identification::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -81,23 +229,8 @@ ASDCP::MXF::Identification::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_Identification].ul, 0);
}
-
-//
-void
-ASDCP::MXF::Identification::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- InterchangeObject::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// ContentStorage
//
ASDCP::Result_t
@@ -110,6 +243,23 @@ ASDCP::MXF::ContentStorage::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::ContentStorage::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %s:\n", "Packages");
+ Packages.Dump(stream);
+ fprintf(stream, " %s:\n", "EssenceContainerData");
+ EssenceContainerData.Dump(stream);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::ContentStorage::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -126,7 +276,6 @@ ASDCP::MXF::ContentStorage::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::ContentStorage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -134,23 +283,8 @@ ASDCP::MXF::ContentStorage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_ContentStorage].ul, 0);
}
-
-//
-void
-ASDCP::MXF::ContentStorage::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- InterchangeObject::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// GenericPackage
//
ASDCP::Result_t
@@ -165,9 +299,28 @@ ASDCP::MXF::GenericPackage::InitFromTLVSet(TLVReader& TLVSet)
return result;
}
+//
+void
+ASDCP::MXF::GenericPackage::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "PackageUID", PackageUID.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Name", Name.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "PackageCreationDate", PackageCreationDate.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "PackageModifiedDate", PackageModifiedDate.ToString(identbuf));
+ fprintf(stream, " %s:\n", "Tracks");
+ Tracks.Dump(stream);
+}
+
//------------------------------------------------------------------------------------------
-//
+// MaterialPackage
//
ASDCP::Result_t
@@ -178,6 +331,19 @@ ASDCP::MXF::MaterialPackage::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::MaterialPackage::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericPackage::Dump(stream);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::MaterialPackage::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -194,7 +360,6 @@ ASDCP::MXF::MaterialPackage::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::MaterialPackage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -202,30 +367,28 @@ ASDCP::MXF::MaterialPackage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_MaterialPackage].ul, 0);
}
+//------------------------------------------------------------------------------------------
+// SourcePackage
+
+//
+ASDCP::Result_t
+ASDCP::MXF::SourcePackage::InitFromTLVSet(TLVReader& TLVSet)
+{
+ Result_t result = GenericPackage::InitFromTLVSet(TLVSet);
+ return result;
+}
//
void
-ASDCP::MXF::MaterialPackage::Dump(FILE* stream)
+ASDCP::MXF::SourcePackage::Dump(FILE* stream)
{
-// char identbuf[IdentBufferLen];
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
if ( stream == 0 )
stream = stderr;
GenericPackage::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
-//------------------------------------------------------------------------------------------
-//
-
-//
-ASDCP::Result_t
-ASDCP::MXF::SourcePackage::InitFromTLVSet(TLVReader& TLVSet)
-{
- Result_t result = GenericPackage::InitFromTLVSet(TLVSet);
- return result;
}
//
@@ -245,7 +408,6 @@ ASDCP::MXF::SourcePackage::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::SourcePackage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -253,23 +415,8 @@ ASDCP::MXF::SourcePackage::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_SourcePackage].ul, 0);
}
-
-//
-void
-ASDCP::MXF::SourcePackage::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericPackage::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// GenericTrack
//
ASDCP::Result_t
@@ -283,9 +430,26 @@ ASDCP::MXF::GenericTrack::InitFromTLVSet(TLVReader& TLVSet)
return result;
}
+//
+void
+ASDCP::MXF::GenericTrack::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "TrackID", TrackID);
+ fprintf(stream, " %22s = %d\n", "TrackNumber", TrackNumber);
+ fprintf(stream, " %22s = %s\n", "TrackName", TrackName.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Sequence", Sequence.ToString(identbuf));
+}
+
//------------------------------------------------------------------------------------------
-//
+// Track
//
ASDCP::Result_t
@@ -298,6 +462,21 @@ ASDCP::MXF::Track::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::Track::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericTrack::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "EditRate", EditRate.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Origin", i64sz(Origin, identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::Track::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -314,7 +493,6 @@ ASDCP::MXF::Track::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::Track::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -322,23 +500,8 @@ ASDCP::MXF::Track::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_Track].ul, 0);
}
-
-//
-void
-ASDCP::MXF::Track::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericTrack::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// StructuralComponent
//
ASDCP::Result_t
@@ -350,9 +513,24 @@ ASDCP::MXF::StructuralComponent::InitFromTLVSet(TLVReader& TLVSet)
return result;
}
+//
+void
+ASDCP::MXF::StructuralComponent::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "DataDefinition", DataDefinition.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Duration", i64sz(Duration, identbuf));
+}
+
//------------------------------------------------------------------------------------------
-//
+// Sequence
//
ASDCP::Result_t
@@ -364,6 +542,21 @@ ASDCP::MXF::Sequence::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::Sequence::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ StructuralComponent::Dump(stream);
+ fprintf(stream, " %s:\n", "StructuralComponents");
+ StructuralComponents.Dump(stream);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::Sequence::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -380,7 +573,6 @@ ASDCP::MXF::Sequence::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::Sequence::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -388,23 +580,8 @@ ASDCP::MXF::Sequence::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_Sequence].ul, 0);
}
-
-//
-void
-ASDCP::MXF::Sequence::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- StructuralComponent::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// SourceClip
//
ASDCP::Result_t
@@ -418,6 +595,22 @@ ASDCP::MXF::SourceClip::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::SourceClip::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ StructuralComponent::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "StartPosition", i64sz(StartPosition, identbuf));
+ fprintf(stream, " %22s = %s\n", "SourcePackageID", SourcePackageID.ToString(identbuf));
+ fprintf(stream, " %22s = %d\n", "SourceTrackID", SourceTrackID);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::SourceClip::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -434,7 +627,6 @@ ASDCP::MXF::SourceClip::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::SourceClip::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -442,23 +634,8 @@ ASDCP::MXF::SourceClip::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_SourceClip].ul, 0);
}
-
-//
-void
-ASDCP::MXF::SourceClip::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- StructuralComponent::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// TimecodeComponent
//
ASDCP::Result_t
@@ -472,6 +649,22 @@ ASDCP::MXF::TimecodeComponent::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::TimecodeComponent::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ StructuralComponent::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "RoundedTimecodeBase", RoundedTimecodeBase);
+ fprintf(stream, " %22s = %s\n", "StartTimecode", i64sz(StartTimecode, identbuf));
+ fprintf(stream, " %22s = %d\n", "DropFrame", DropFrame);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::TimecodeComponent::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -488,7 +681,6 @@ ASDCP::MXF::TimecodeComponent::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::TimecodeComponent::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -496,23 +688,8 @@ ASDCP::MXF::TimecodeComponent::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_TimecodeComponent].ul, 0);
}
-
-//
-void
-ASDCP::MXF::TimecodeComponent::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- StructuralComponent::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// GenericDescriptor
//
ASDCP::Result_t
@@ -524,9 +701,26 @@ ASDCP::MXF::GenericDescriptor::InitFromTLVSet(TLVReader& TLVSet)
return result;
}
+//
+void
+ASDCP::MXF::GenericDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %s:\n", "Locators");
+ Locators.Dump(stream);
+ fprintf(stream, " %s:\n", "SubDescriptors");
+ SubDescriptors.Dump(stream);
+}
+
//------------------------------------------------------------------------------------------
-//
+// FileDescriptor
//
ASDCP::Result_t
@@ -542,6 +736,24 @@ ASDCP::MXF::FileDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::FileDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "LinkedTrackID", LinkedTrackID);
+ fprintf(stream, " %22s = %s\n", "SampleRate", SampleRate.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "ContainerDuration", i64sz(ContainerDuration, identbuf));
+ fprintf(stream, " %22s = %s\n", "EssenceContainer", EssenceContainer.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Codec", Codec.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::FileDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -558,7 +770,6 @@ ASDCP::MXF::FileDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::FileDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -566,23 +777,8 @@ ASDCP::MXF::FileDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_FileDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::FileDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// GenericSoundEssenceDescriptor
//
ASDCP::Result_t
@@ -601,6 +797,27 @@ ASDCP::MXF::GenericSoundEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::GenericSoundEssenceDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ FileDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "AudioSamplingRate", AudioSamplingRate.ToString(identbuf));
+ fprintf(stream, " %22s = %d\n", "Locked", Locked);
+ fprintf(stream, " %22s = %d\n", "AudioRefLevel", AudioRefLevel);
+ fprintf(stream, " %22s = %d\n", "ElectroSpatialFormulation", ElectroSpatialFormulation);
+ fprintf(stream, " %22s = %d\n", "ChannelCount", ChannelCount);
+ fprintf(stream, " %22s = %d\n", "QuantizationBits", QuantizationBits);
+ fprintf(stream, " %22s = %d\n", "DialNorm", DialNorm);
+ fprintf(stream, " %22s = %s\n", "SoundEssenceCompression", SoundEssenceCompression.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::GenericSoundEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -617,7 +834,6 @@ ASDCP::MXF::GenericSoundEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::GenericSoundEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -625,23 +841,8 @@ ASDCP::MXF::GenericSoundEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buf
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_GenericSoundEssenceDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::GenericSoundEssenceDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- FileDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// WaveAudioDescriptor
//
ASDCP::Result_t
@@ -655,6 +856,22 @@ ASDCP::MXF::WaveAudioDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::WaveAudioDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericSoundEssenceDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "BlockAlign", BlockAlign);
+ fprintf(stream, " %22s = %d\n", "SequenceOffset", SequenceOffset);
+ fprintf(stream, " %22s = %d\n", "AvgBps", AvgBps);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::WaveAudioDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -671,7 +888,6 @@ ASDCP::MXF::WaveAudioDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::WaveAudioDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -679,23 +895,8 @@ ASDCP::MXF::WaveAudioDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_WaveAudioDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::WaveAudioDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericSoundEssenceDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// GenericPictureEssenceDescriptor
//
ASDCP::Result_t
@@ -714,6 +915,27 @@ ASDCP::MXF::GenericPictureEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::GenericPictureEssenceDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ FileDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "FrameLayout", FrameLayout);
+ fprintf(stream, " %22s = %d\n", "StoredWidth", StoredWidth);
+ fprintf(stream, " %22s = %d\n", "StoredHeight", StoredHeight);
+ fprintf(stream, " %22s = %d\n", "DisplayWidth", DisplayWidth);
+ fprintf(stream, " %22s = %d\n", "DisplayHeight", DisplayHeight);
+ fprintf(stream, " %22s = %s\n", "AspectRatio", AspectRatio.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "Gamma", Gamma.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "PictureEssenceCoding", PictureEssenceCoding.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::GenericPictureEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -730,7 +952,6 @@ ASDCP::MXF::GenericPictureEssenceDescriptor::InitFromBuffer(const byte_t* p, ui3
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::GenericPictureEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -738,23 +959,8 @@ ASDCP::MXF::GenericPictureEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& B
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_GenericPictureEssenceDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::GenericPictureEssenceDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- FileDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// RGBAEssenceDescriptor
//
ASDCP::Result_t
@@ -768,6 +974,22 @@ ASDCP::MXF::RGBAEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::RGBAEssenceDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericPictureEssenceDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "ComponentMaxRef", ComponentMaxRef);
+ fprintf(stream, " %22s = %d\n", "ComponentMinRef", ComponentMinRef);
+ fprintf(stream, " %22s = %s\n", "PixelLayout", PixelLayout.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::RGBAEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -784,7 +1006,6 @@ ASDCP::MXF::RGBAEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::RGBAEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -792,23 +1013,8 @@ ASDCP::MXF::RGBAEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_RGBAEssenceDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::RGBAEssenceDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericPictureEssenceDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// JPEG2000PictureSubDescriptor
//
ASDCP::Result_t
@@ -832,6 +1038,32 @@ ASDCP::MXF::JPEG2000PictureSubDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::JPEG2000PictureSubDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "Rsize", Rsize);
+ fprintf(stream, " %22s = %d\n", "Xsize", Xsize);
+ fprintf(stream, " %22s = %d\n", "Ysize", Ysize);
+ fprintf(stream, " %22s = %d\n", "XOsize", XOsize);
+ fprintf(stream, " %22s = %d\n", "YOsize", YOsize);
+ fprintf(stream, " %22s = %d\n", "XTsize", XTsize);
+ fprintf(stream, " %22s = %d\n", "YTsize", YTsize);
+ fprintf(stream, " %22s = %d\n", "XTOsize", XTOsize);
+ fprintf(stream, " %22s = %d\n", "YTOsize", YTOsize);
+ fprintf(stream, " %22s = %d\n", "Csize", Csize);
+ fprintf(stream, " %22s = %s\n", "PictureComponentSizing", PictureComponentSizing.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "CodingStyleDefault", CodingStyleDefault.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "QuantizationDefault", QuantizationDefault.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::JPEG2000PictureSubDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -848,7 +1080,6 @@ ASDCP::MXF::JPEG2000PictureSubDescriptor::InitFromBuffer(const byte_t* p, ui32_t
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::JPEG2000PictureSubDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -856,23 +1087,8 @@ ASDCP::MXF::JPEG2000PictureSubDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buff
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_JPEG2000PictureSubDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::JPEG2000PictureSubDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- InterchangeObject::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// CDCIEssenceDescriptor
//
ASDCP::Result_t
@@ -891,6 +1107,27 @@ ASDCP::MXF::CDCIEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::CDCIEssenceDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ GenericPictureEssenceDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "ComponentDepth", ComponentDepth);
+ fprintf(stream, " %22s = %d\n", "HorizontalSubsampling", HorizontalSubsampling);
+ fprintf(stream, " %22s = %d\n", "VerticalSubsampling", VerticalSubsampling);
+ fprintf(stream, " %22s = %d\n", "ColorSiting", ColorSiting);
+ fprintf(stream, " %22s = %d\n", "ReversedByteOrder", ReversedByteOrder);
+ fprintf(stream, " %22s = %d\n", "BlackRefLevel", BlackRefLevel);
+ fprintf(stream, " %22s = %d\n", "WhiteReflevel", WhiteReflevel);
+ fprintf(stream, " %22s = %d\n", "ColorRange", ColorRange);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::CDCIEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -907,7 +1144,6 @@ ASDCP::MXF::CDCIEssenceDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::CDCIEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -915,23 +1151,8 @@ ASDCP::MXF::CDCIEssenceDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_CDCIEssenceDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::CDCIEssenceDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- GenericPictureEssenceDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// MPEG2VideoDescriptor
//
ASDCP::Result_t
@@ -946,6 +1167,23 @@ ASDCP::MXF::MPEG2VideoDescriptor::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::MPEG2VideoDescriptor::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ CDCIEssenceDescriptor::Dump(stream);
+ fprintf(stream, " %22s = %d\n", "CodedContentType", CodedContentType);
+ fprintf(stream, " %22s = %d\n", "LowDelay", LowDelay);
+ fprintf(stream, " %22s = %d\n", "BitRate", BitRate);
+ fprintf(stream, " %22s = %d\n", "ProfileAndLevel", ProfileAndLevel);
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::MPEG2VideoDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -962,7 +1200,6 @@ ASDCP::MXF::MPEG2VideoDescriptor::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::MPEG2VideoDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -970,23 +1207,8 @@ ASDCP::MXF::MPEG2VideoDescriptor::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_MPEG2VideoDescriptor].ul, 0);
}
-
-//
-void
-ASDCP::MXF::MPEG2VideoDescriptor::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- CDCIEssenceDescriptor::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// CryptographicFramework
//
ASDCP::Result_t
@@ -998,6 +1220,20 @@ ASDCP::MXF::CryptographicFramework::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::CryptographicFramework::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "ContextSR", ContextSR.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::CryptographicFramework::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -1014,7 +1250,6 @@ ASDCP::MXF::CryptographicFramework::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::CryptographicFramework::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -1022,23 +1257,8 @@ ASDCP::MXF::CryptographicFramework::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_CryptographicFramework].ul, 0);
}
-
-//
-void
-ASDCP::MXF::CryptographicFramework::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- InterchangeObject::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//------------------------------------------------------------------------------------------
-//
+// CryptographicContext
//
ASDCP::Result_t
@@ -1054,6 +1274,24 @@ ASDCP::MXF::CryptographicContext::InitFromTLVSet(TLVReader& TLVSet)
}
//
+void
+ASDCP::MXF::CryptographicContext::Dump(FILE* stream)
+{
+ char identbuf[IdentBufferLen];
+ *identbuf = 0;
+
+ if ( stream == 0 )
+ stream = stderr;
+
+ InterchangeObject::Dump(stream);
+ fprintf(stream, " %22s = %s\n", "ContextID", ContextID.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "SourceEssenceContainer", SourceEssenceContainer.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "CipherAlgorithm", CipherAlgorithm.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "MICAlgorithm", MICAlgorithm.ToString(identbuf));
+ fprintf(stream, " %22s = %s\n", "CryptographicKeyID", CryptographicKeyID.ToString(identbuf));
+}
+
+//
ASDCP::Result_t
ASDCP::MXF::CryptographicContext::InitFromBuffer(const byte_t* p, ui32_t l)
{
@@ -1070,7 +1308,6 @@ ASDCP::MXF::CryptographicContext::InitFromBuffer(const byte_t* p, ui32_t l)
return result;
}
-
//
ASDCP::Result_t
ASDCP::MXF::CryptographicContext::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
@@ -1078,21 +1315,6 @@ ASDCP::MXF::CryptographicContext::WriteToBuffer(ASDCP::FrameBuffer& Buffer)
return WriteKLToBuffer(Buffer, s_MDD_Table[MDDindex_CryptographicContext].ul, 0);
}
-
-//
-void
-ASDCP::MXF::CryptographicContext::Dump(FILE* stream)
-{
-// char identbuf[IdentBufferLen];
-
- if ( stream == 0 )
- stream = stderr;
-
- InterchangeObject::Dump(stream);
- fputs("==========================================================================\n", stream);
-}
-
-
//
// end MXF.cpp
//
diff --git a/src/Metadata.h b/src/Metadata.h
index a9d05ab..8630d18 100755
--- a/src/Metadata.h
+++ b/src/Metadata.h
@@ -48,9 +48,13 @@ namespace ASDCP
} PictureElement[8];
RGBLayout() { memset(PictureElement, 0, sizeof(PictureElement)); }
- //
- Result_t ReadFrom(ASDCP::MemIOReader& Reader) { return RESULT_OK; }
- Result_t WriteTo(ASDCP::MemIOWriter& Writer) { return RESULT_OK; }
+ //
+ Result_t ReadFrom(ASDCP::MemIOReader& Reader) { return RESULT_OK; }
+ Result_t WriteTo(ASDCP::MemIOWriter& Writer) { return RESULT_OK; }
+ inline const char* ToString(char* str_buf) const {
+ snprintf(str_buf, IdentBufferLen, "RGBLayout: <PictureElement[8]>\n");
+ return str_buf;
+ }
};
class Raw : public IArchive
@@ -62,9 +66,13 @@ namespace ASDCP
Raw() {}
~Raw() {}
- //
- Result_t ReadFrom(ASDCP::MemIOReader& Reader) { return RESULT_OK; }
- Result_t WriteTo(ASDCP::MemIOWriter& Writer) { return RESULT_OK; }
+ //
+ Result_t ReadFrom(ASDCP::MemIOReader& Reader) { return RESULT_OK; }
+ Result_t WriteTo(ASDCP::MemIOWriter& Writer) { return RESULT_OK; }
+ inline const char* ToString(char* str_buf) const {
+ snprintf(str_buf, IdentBufferLen, "RAW\n");
+ return str_buf;
+ }
};
//
@@ -88,9 +96,9 @@ namespace ASDCP
Identification() : ProductVersion(0), ToolkitVersion(0) {}
virtual ~Identification() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -105,9 +113,9 @@ namespace ASDCP
ContentStorage() {}
virtual ~ContentStorage() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -125,6 +133,7 @@ namespace ASDCP
GenericPackage() {}
virtual ~GenericPackage() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
};
//
@@ -137,9 +146,9 @@ namespace ASDCP
MaterialPackage() {}
virtual ~MaterialPackage() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -152,9 +161,9 @@ namespace ASDCP
SourcePackage() {}
virtual ~SourcePackage() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -171,6 +180,7 @@ namespace ASDCP
GenericTrack() : TrackID(0), TrackNumber(0) {}
virtual ~GenericTrack() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
};
//
@@ -185,9 +195,9 @@ namespace ASDCP
Track() : Origin(0) {}
virtual ~Track() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -202,6 +212,7 @@ namespace ASDCP
StructuralComponent() : Duration(0) {}
virtual ~StructuralComponent() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
};
//
@@ -215,9 +226,9 @@ namespace ASDCP
Sequence() {}
virtual ~Sequence() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -233,9 +244,9 @@ namespace ASDCP
SourceClip() : StartPosition(0), SourceTrackID(0) {}
virtual ~SourceClip() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -251,9 +262,9 @@ namespace ASDCP
TimecodeComponent() : RoundedTimecodeBase(0), StartTimecode(0), DropFrame(0) {}
virtual ~TimecodeComponent() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -268,6 +279,7 @@ namespace ASDCP
GenericDescriptor() {}
virtual ~GenericDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
};
//
@@ -285,9 +297,9 @@ namespace ASDCP
FileDescriptor() : LinkedTrackID(0), ContainerDuration(0) {}
virtual ~FileDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -308,9 +320,9 @@ namespace ASDCP
GenericSoundEssenceDescriptor() : Locked(0), AudioRefLevel(0), ElectroSpatialFormulation(0), ChannelCount(0), QuantizationBits(0), DialNorm(0) {}
virtual ~GenericSoundEssenceDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -326,9 +338,9 @@ namespace ASDCP
WaveAudioDescriptor() : BlockAlign(0), SequenceOffset(0), AvgBps(0) {}
virtual ~WaveAudioDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -349,9 +361,9 @@ namespace ASDCP
GenericPictureEssenceDescriptor() : FrameLayout(0), StoredWidth(0), StoredHeight(0), DisplayWidth(0), DisplayHeight(0) {}
virtual ~GenericPictureEssenceDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -367,9 +379,9 @@ namespace ASDCP
RGBAEssenceDescriptor() : ComponentMaxRef(0), ComponentMinRef(0) {}
virtual ~RGBAEssenceDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -395,9 +407,9 @@ namespace ASDCP
JPEG2000PictureSubDescriptor() : Rsize(0), Xsize(0), Ysize(0), XOsize(0), YOsize(0), XTsize(0), YTsize(0), XTOsize(0), YTOsize(0), Csize(0) {}
virtual ~JPEG2000PictureSubDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -418,9 +430,9 @@ namespace ASDCP
CDCIEssenceDescriptor() : ComponentDepth(0), HorizontalSubsampling(0), VerticalSubsampling(0), ColorSiting(0), ReversedByteOrder(0), BlackRefLevel(0), WhiteReflevel(0), ColorRange(0) {}
virtual ~CDCIEssenceDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -437,9 +449,9 @@ namespace ASDCP
MPEG2VideoDescriptor() : CodedContentType(0), LowDelay(0), BitRate(0), ProfileAndLevel(0) {}
virtual ~MPEG2VideoDescriptor() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -453,9 +465,9 @@ namespace ASDCP
CryptographicFramework() {}
virtual ~CryptographicFramework() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
//
@@ -473,9 +485,9 @@ namespace ASDCP
CryptographicContext() {}
virtual ~CryptographicContext() {}
virtual Result_t InitFromTLVSet(TLVReader& TLVSet);
+ virtual void Dump(FILE* = 0);
virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
virtual Result_t WriteToBuffer(ASDCP::FrameBuffer&);
- virtual void Dump(FILE* = 0);
};
} // namespace MXF
diff --git a/src/WavFileWriter.h b/src/WavFileWriter.h
index 250cc20..40d23ba 100755
--- a/src/WavFileWriter.h
+++ b/src/WavFileWriter.h
@@ -72,7 +72,7 @@ class WavFileWriter
for ( ui32_t i = 0; i < file_count && ASDCP_SUCCESS(result); i++ )
{
- sprintf(filename, "%s_%lu.wav", file_root, (i + 1));
+ snprintf(filename, 256, "%s_%lu.wav", file_root, (i + 1));
m_OutFile.push_back(new ASDCP::FileWriter);
result = m_OutFile.back()->OpenWrite(filename);
diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp
index 12d8feb..1dfc33f 100755
--- a/src/asdcp-test.cpp
+++ b/src/asdcp-test.cpp
@@ -85,7 +85,7 @@ public:
ProductName = "asdcp-test";
char s_buf[128];
- sprintf(s_buf, "%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
+ snprintf(s_buf, 128, "%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
ProductVersion = s_buf;
}
} s_MyInfo;
@@ -562,7 +562,7 @@ read_MPEG2_file(CommandOptions& Options)
if ( ASDCP_SUCCESS(result) )
{
char filename[256];
- sprintf(filename, "%s.ves", Options.file_root);
+ snprintf(filename, 256, "%s.ves", Options.file_root);
result = OutFile.OpenWrite(filename);
}
@@ -844,7 +844,7 @@ read_JP2K_file(CommandOptions& Options)
FileWriter OutFile;
char filename[256];
ui32_t write_count;
- sprintf(filename, "%s%06lu.j2c", Options.file_root, i);
+ snprintf(filename, 256, "%s%06lu.j2c", Options.file_root, i);
result = OutFile.OpenWrite(filename);
if ( ASDCP_SUCCESS(result) )
diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp
index 38c497f..4c1cf12 100755
--- a/src/h__Reader.cpp
+++ b/src/h__Reader.cpp
@@ -75,7 +75,7 @@ ASDCP::h__Reader::InitInfo(WriterInfo& Info)
if( ASDCP_SUCCESS(result) )
{
SourcePackage* SP = (SourcePackage*)Object;
- memcpy(Info.AssetUUID, SP->PackageUID.Data() + 16, UUIDlen);
+ memcpy(Info.AssetUUID, SP->PackageUID.Value() + 16, UUIDlen);
}
// optional CryptographicContext
diff --git a/src/klvwalk.cpp b/src/klvwalk.cpp
index 96d31e4..0f3bac5 100755
--- a/src/klvwalk.cpp
+++ b/src/klvwalk.cpp
@@ -29,9 +29,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\brief KLV+MXF test
*/
-#include <AS_DCP.h>
-#include <MXF.h>
-#include <hex_utils.h>
+#include "AS_DCP.h"
+#include "MXF.h"
+#include "hex_utils.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>