From 7f373b689817ee70fbe5d6a14cb0512b5260f77c Mon Sep 17 00:00:00 2001 From: jhurst Date: Sun, 15 Dec 2013 23:34:13 +0000 Subject: o Added preliminary support for timed-text wrapping for AS-02. This work will require changes in SMPTE ST 429-5 and perhaps other standards work, so files created with this implementation are "speculative". Publication of the revised ST 429-5 may not occur until early 2015. o Moved LocalFilenameResolver into the AS_DCP public API so that it can be used by other modules including AS-02. o Fixed wave wrapping UL in clip-wrapped AS-02 files. Renamed some UL constants to reflect "clip" or "frame" wrapping. o Re-factored JP2K_PDesc_to_MD() and MD_to_JP2K_PDesc() to work with GenericPictureEssenceDescriptor objects. o Fixed a bug that was suppressing PictureComponentSizing, CodingStyleDefault and QuantizationDefault when writing the essence descriptor in a JP2K file (AS-DCP and AS-02). o Fixed the version byte on the following UL values: StereoscopicPictureSubDescriptor GenericPictureEssenceDescriptor_ColorPrimaries GenericPictureEssenceDescriptor_ActiveHeight GenericPictureEssenceDescriptor_ActiveWidth GenericPictureEssenceDescriptor_ActiveXOffset GenericPictureEssenceDescriptor_ActiveYOffset o Added some essence descriptor options to as-02-wrap. o Added TTML timed-text wrapping option to as-02-wrap. o Changed bit rate display in asdcp-info from mebi-bits/s to mega-bits/s. o Added "SMPTE" / "Interop" format type display to asdcp-info. o Modified asdcp-wrap to assume -L when wrapping timed-text (since there is no MXF text wrapping for Interop.) o Fixed missing-index-partion bugs for AS-02 files. --- src/h__02_Reader.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/h__02_Reader.cpp') diff --git a/src/h__02_Reader.cpp b/src/h__02_Reader.cpp index a433026..1a0de11 100644 --- a/src/h__02_Reader.cpp +++ b/src/h__02_Reader.cpp @@ -200,9 +200,11 @@ AS_02::MXF::AS02IndexReader::InitFromFile(const Kumu::FileReader& reader, const for ( ii = m_PacketList->m_List.begin(); ii != m_PacketList->m_List.end(); ++ii ) { - if ( (*ii)->IsA(OBJ_TYPE_ARGS(IndexTableSegment)) ) + IndexTableSegment *segment = dynamic_cast(*ii); + + if ( segment != 0 ) { - m_Duration += static_cast(*ii)->IndexDuration; + m_Duration += segment->IndexDuration; } } } @@ -263,10 +265,12 @@ AS_02::MXF::AS02IndexReader::InitFromBuffer(const byte_t* p, ui32_t l, const ui6 if ( KM_SUCCESS(result) ) { - if ( object->IsA(OBJ_TYPE_ARGS(IndexTableSegment)) ) + IndexTableSegment *segment = dynamic_cast(object); + + if ( segment != 0 ) { - static_cast(object)->RtFileOffset = essence_container_offset; - static_cast(object)->RtEntryOffset = body_offset; + segment->RtFileOffset = essence_container_offset; + segment->RtEntryOffset = body_offset; m_PacketList->AddPacket(object); // takes ownership } else @@ -340,29 +344,30 @@ AS_02::MXF::AS02IndexReader::Lookup(ui32_t frame_num, ASDCP::MXF::IndexTableSegm std::list::iterator li; for ( li = m_PacketList->m_List.begin(); li != m_PacketList->m_List.end(); li++ ) { - if ( (*li)->IsA(OBJ_TYPE_ARGS(IndexTableSegment)) ) + IndexTableSegment *segment = dynamic_cast(*li); + + if ( segment != 0 ) { - IndexTableSegment* Segment = static_cast(*li); - ui64_t start_pos = Segment->IndexStartPosition; + ui64_t start_pos = segment->IndexStartPosition; - if ( Segment->EditUnitByteCount > 0 ) + if ( segment->EditUnitByteCount > 0 ) { if ( m_PacketList->m_List.size() > 1 ) DefaultLogSink().Error("Unexpected multiple IndexTableSegment in CBR file\n"); - if ( ! Segment->IndexEntryArray.empty() ) + if ( ! segment->IndexEntryArray.empty() ) DefaultLogSink().Error("Unexpected IndexEntryArray contents in CBR file\n"); - Entry.StreamOffset = ((ui64_t)frame_num * Segment->EditUnitByteCount) + Segment->RtFileOffset; + Entry.StreamOffset = ((ui64_t)frame_num * segment->EditUnitByteCount) + segment->RtFileOffset; return RESULT_OK; } else if ( (ui64_t)frame_num >= start_pos - && (ui64_t)frame_num < (start_pos + Segment->IndexDuration) ) + && (ui64_t)frame_num < (start_pos + segment->IndexDuration) ) { ui64_t tmp = frame_num - start_pos; assert(tmp <= 0xFFFFFFFFL); - Entry = Segment->IndexEntryArray[(ui32_t) tmp]; - Entry.StreamOffset = Entry.StreamOffset - Segment->RtEntryOffset + Segment->RtFileOffset; + Entry = segment->IndexEntryArray[(ui32_t) tmp]; + Entry.StreamOffset = Entry.StreamOffset - segment->RtEntryOffset + segment->RtFileOffset; return RESULT_OK; } } -- cgit v1.2.3