X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMXF.h;h=fbae83419bd21be9201357cbf3cb6d50191e2691;hb=99f3c9bd7e314ed2342598ad0e2357c68c79e732;hp=b43fc84dccc01081767d93e9ffeb7e726f11fd70;hpb=f457a7ea8fa446b71e7802a20f575ae5bcc9926b;p=asdcplib.git diff --git a/src/MXF.h b/src/MXF.h index b43fc84..fbae834 100755 --- a/src/MXF.h +++ b/src/MXF.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2005-2006, John Hurst +Copyright (c) 2005-2012, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,13 +41,13 @@ namespace ASDCP class InterchangeObject; // - typedef ASDCP::MXF::InterchangeObject* (*MXFObjectFactory_t)(); + typedef ASDCP::MXF::InterchangeObject* (*MXFObjectFactory_t)(const Dictionary*&); // void SetObjectFactory(UL label, MXFObjectFactory_t factory); // - InterchangeObject* CreateObject(const byte_t* label); + InterchangeObject* CreateObject(const Dictionary*& Dict, const UL& label); // seek an open file handle to the start of the RIP KLV packet @@ -57,6 +57,7 @@ namespace ASDCP class RIP : public ASDCP::KLVFilePacket { ASDCP_NO_COPY_CONSTRUCT(RIP); + RIP(); public: // @@ -78,24 +79,26 @@ namespace ASDCP return str_buf; } - inline virtual bool Unarchive(Kumu::MemIOReader* Reader) { + inline bool HasValue() const { return true; } + inline ui32_t ArchiveLength() const { return sizeof(ui32_t) + sizeof(ui64_t); } + + inline bool Unarchive(Kumu::MemIOReader* Reader) { if ( ! Reader->ReadUi32BE(&BodySID) ) return false; if ( ! Reader->ReadUi64BE(&ByteOffset) ) return false; return true; } - inline virtual bool HasValue() const { return true; } - - inline virtual bool Archive(Kumu::MemIOWriter* Writer) const { + inline bool Archive(Kumu::MemIOWriter* Writer) const { if ( ! Writer->WriteUi32BE(BodySID) ) return false; if ( ! Writer->WriteUi64BE(ByteOffset) ) return false; return true; } }; + const Dictionary*& m_Dict; Array PairArray; - RIP() {} + RIP(const Dictionary*& d) : m_Dict(d) {} virtual ~RIP() {} virtual Result_t InitFromFile(const Kumu::FileReader& Reader); virtual Result_t WriteToFile(Kumu::FileWriter& Writer); @@ -108,12 +111,15 @@ namespace ASDCP class Partition : public ASDCP::KLVFilePacket { ASDCP_NO_COPY_CONSTRUCT(Partition); + Partition(); protected: class h__PacketList; mem_ptr m_PacketList; public: + const Dictionary*& m_Dict; + ui16_t MajorVersion; ui16_t MinorVersion; ui32_t KAGSize; @@ -128,10 +134,11 @@ namespace ASDCP UL OperationalPattern; Batch