diff options
| author | jhurst <jhurst@cinecert.com> | 2012-03-16 00:28:23 +0000 |
|---|---|---|
| committer | jhurst <> | 2012-03-16 00:28:23 +0000 |
| commit | aac3cfda50b82f7b763b69b9acfcc4d63c81d98b (patch) | |
| tree | 60d819d1c568564e926a34488e69dd574bf11580 /src/MXF.cpp | |
| parent | e511dc66f4a9c9278964d89a85662fcd9bfb18ac (diff) | |
as-02ooooooooooo!
Diffstat (limited to 'src/MXF.cpp')
| -rwxr-xr-x | src/MXF.cpp | 129 |
1 files changed, 62 insertions, 67 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp index bc7bec2..6bc3fcb 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -43,8 +43,6 @@ const ui32_t CBRIndexEntriesPerSegment = 5000; //------------------------------------------------------------------------------------------ // -const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH; - // ASDCP::Result_t ASDCP::MXF::SeekToRIP(const Kumu::FileReader& Reader) @@ -174,80 +172,77 @@ ASDCP::MXF::RIP::Dump(FILE* stream) // // -class ASDCP::MXF::Partition::h__PacketList -{ -public: - std::list<InterchangeObject*> m_List; - std::map<UUID, InterchangeObject*> m_Map; - - ~h__PacketList() { - while ( ! m_List.empty() ) - { - delete m_List.back(); - m_List.pop_back(); - } - } +ASDCP::MXF::Partition::PacketList::~PacketList() { + while ( ! m_List.empty() ) + { + delete m_List.back(); + m_List.pop_back(); + } +} - // - void AddPacket(InterchangeObject* ThePacket) // takes ownership - { - assert(ThePacket); - m_Map.insert(std::map<UUID, InterchangeObject*>::value_type(ThePacket->InstanceUID, ThePacket)); - m_List.push_back(ThePacket); - } +// +void +ASDCP::MXF::Partition::PacketList::AddPacket(InterchangeObject* ThePacket) // takes ownership +{ + assert(ThePacket); + m_Map.insert(std::map<UUID, InterchangeObject*>::value_type(ThePacket->InstanceUID, ThePacket)); + m_List.push_back(ThePacket); +} - // - Result_t GetMDObjectByID(const UUID& ObjectID, InterchangeObject** Object) - { - ASDCP_TEST_NULL(Object); +// +ASDCP::Result_t +ASDCP::MXF::Partition::PacketList::GetMDObjectByID(const UUID& ObjectID, InterchangeObject** Object) +{ + ASDCP_TEST_NULL(Object); - std::map<UUID, InterchangeObject*>::iterator mi = m_Map.find(ObjectID); + std::map<UUID, InterchangeObject*>::iterator mi = m_Map.find(ObjectID); + + if ( mi == m_Map.end() ) + { + *Object = 0; + return RESULT_FAIL; + } - if ( mi == m_Map.end() ) - { - *Object = 0; - return RESULT_FAIL; - } + *Object = (*mi).second; + return RESULT_OK; +} - *Object = (*mi).second; - return RESULT_OK; - } +// +ASDCP::Result_t +ASDCP::MXF::Partition::PacketList::GetMDObjectByType(const byte_t* ObjectID, InterchangeObject** Object) +{ + ASDCP_TEST_NULL(ObjectID); + ASDCP_TEST_NULL(Object); + std::list<InterchangeObject*>::iterator li; + *Object = 0; - // - Result_t GetMDObjectByType(const byte_t* ObjectID, InterchangeObject** Object) - { - ASDCP_TEST_NULL(ObjectID); - ASDCP_TEST_NULL(Object); - std::list<InterchangeObject*>::iterator li; - *Object = 0; - - for ( li = m_List.begin(); li != m_List.end(); li++ ) - { - if ( (*li)->HasUL(ObjectID) ) - { - *Object = *li; - return RESULT_OK; - } - } + for ( li = m_List.begin(); li != m_List.end(); li++ ) + { + if ( (*li)->HasUL(ObjectID) ) + { + *Object = *li; + return RESULT_OK; + } + } - return RESULT_FAIL; - } + return RESULT_FAIL; +} - // - Result_t GetMDObjectsByType(const byte_t* ObjectID, std::list<InterchangeObject*>& ObjectList) - { - ASDCP_TEST_NULL(ObjectID); - std::list<InterchangeObject*>::iterator li; +// +ASDCP::Result_t +ASDCP::MXF::Partition::PacketList::GetMDObjectsByType(const byte_t* ObjectID, std::list<InterchangeObject*>& ObjectList) +{ + ASDCP_TEST_NULL(ObjectID); + std::list<InterchangeObject*>::iterator li; - for ( li = m_List.begin(); li != m_List.end(); li++ ) - { - if ( (*li)->HasUL(ObjectID) ) - ObjectList.push_back(*li); - } + for ( li = m_List.begin(); li != m_List.end(); li++ ) + { + if ( (*li)->HasUL(ObjectID) ) + ObjectList.push_back(*li); + } - return ObjectList.empty() ? RESULT_FAIL : RESULT_OK; - } -}; + return ObjectList.empty() ? RESULT_FAIL : RESULT_OK; +} //------------------------------------------------------------------------------------------ // @@ -260,7 +255,7 @@ ASDCP::MXF::Partition::Partition(const Dictionary*& d) : FooterPartition(0), HeaderByteCount(0), IndexByteCount(0), IndexSID(0), BodyOffset(0), BodySID(0) { - m_PacketList = new h__PacketList; + m_PacketList = new PacketList; } ASDCP::MXF::Partition::~Partition() |
