summaryrefslogtreecommitdiff
path: root/src/h__02_Reader.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2013-12-15 23:34:13 +0000
committerjhurst <>2013-12-15 23:34:13 +0000
commit7f373b689817ee70fbe5d6a14cb0512b5260f77c (patch)
tree0b182f46691f1420e18be08ea1952a818c546f94 /src/h__02_Reader.cpp
parent1f41555bcf96369227cda526e36196fe512f464e (diff)
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.
Diffstat (limited to 'src/h__02_Reader.cpp')
-rw-r--r--src/h__02_Reader.cpp33
1 files changed, 19 insertions, 14 deletions
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<IndexTableSegment*>(*ii);
+
+ if ( segment != 0 )
{
- m_Duration += static_cast<IndexTableSegment*>(*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<IndexTableSegment*>(object);
+
+ if ( segment != 0 )
{
- static_cast<IndexTableSegment*>(object)->RtFileOffset = essence_container_offset;
- static_cast<IndexTableSegment*>(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<InterchangeObject*>::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<IndexTableSegment*>(*li);
+
+ if ( segment != 0 )
{
- IndexTableSegment* Segment = static_cast<IndexTableSegment*>(*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;
}
}