diff options
| author | jelkins <jelkins@cinecert.com> | 2020-10-09 11:45:53 -0700 |
|---|---|---|
| committer | jelkins <jelkins@cinecert.com> | 2020-10-09 11:45:53 -0700 |
| commit | fa71fce41f9fe79ab27a35461d625931d21f588a (patch) | |
| tree | 209356efbe9698f548b7eea3a57671d74f834cd6 /src | |
| parent | 082323548f0390c9dd9d331f48aa3ed9362a30c6 (diff) | |
add new function to calculate ContainerDuration from IndexTableSegment
Diffstat (limited to 'src')
| -rwxr-xr-x | src/MXF.cpp | 19 | ||||
| -rwxr-xr-x | src/MXF.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp index c5cc07e..813ee15 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -1231,6 +1231,25 @@ ASDCP::MXF::OPAtomIndexFooter::GetMDObjectsByType(const byte_t* ObjectID, std::l } // +ui64_t +ASDCP::MXF::OPAtomIndexFooter::ContainerDuration() const +{ + ui64_t container_duration = 0; + std::list<InterchangeObject*>::iterator li; + for ( li = m_PacketList->m_List.begin(); li != m_PacketList->m_List.end(); li++ ) + { + IndexTableSegment *segment = dynamic_cast<IndexTableSegment*>(*li); + + if ( segment != 0 ) + { + container_duration += segment->IndexDuration; + } + } + + return container_duration; +} + +// ASDCP::Result_t ASDCP::MXF::OPAtomIndexFooter::Lookup(ui32_t frame_num, IndexTableSegment::IndexEntry& Entry) const { @@ -486,6 +486,7 @@ namespace ASDCP virtual Result_t GetMDObjectByType(const byte_t*, InterchangeObject** = 0); virtual Result_t GetMDObjectsByType(const byte_t* ObjectID, std::list<InterchangeObject*>& ObjectList); + virtual ui64_t ContainerDuration() const; virtual Result_t Lookup(ui32_t frame_num, IndexTableSegment::IndexEntry&) const; virtual void PushIndexEntry(const IndexTableSegment::IndexEntry&); virtual void SetDeltaParams(const IndexTableSegment::DeltaEntry&); |
