diff options
| author | jhurst <jhurst@cinecert.com> | 2018-08-06 22:07:03 +0000 |
|---|---|---|
| committer | jhurst <> | 2018-08-06 22:07:03 +0000 |
| commit | f4061a21fffad4fdf8dbb2f193f0f0960b25421c (patch) | |
| tree | c66e09ce3c57e263690bc0c0f37d37e9a3aa75f8 /src/AS_DCP_TimedText.cpp | |
| parent | 38954bfe8dd72a817fb070c58327cd111b9bd282 (diff) | |
o Added support for SMPTE RDD 47 "ISXD Track File"
o Added generic support for SMPTE RP 2057 "Text-Based Metadata Carriage in MXF"
o Re-factored AS-02 frame-wrap index write to use a common implementation
o Re-factored support for SMPTE ST 410 to use a common implementation (affects
o AS-DCP and AS-02 timed-text MXF (SMPTE 429-5)
o Patched several ambiguous integer casts.
o Added new essence type identifiers ESS_AS02_ISXD and ESS_AS02_ACES
o Fixed a bug wherein the Generic Container data tarck clip was instead being
o written as a DM track
o Fixed UL values DCDataDescriptor and ContainerConstraintSubDescriptor to have
o a byte 6 value of 0x53 (Tag Set) instead of 0x07 (coding sentinel)
o Added UL values 492 - 511 to the dictionary
o Added ApplicationSchemes and ConformsToSpecifications to the Preface set
o Added default initializer to MXF::LineMapPair
o Added sets DescriptiveFramework, DescriptiveObject, TextBasedDMFramework,
o TextBasedObject, GenericStreamTextBasedSet and ISXDDataEssenceDescriptor
o Added ISXD support and options '-G', '-u' to as-02-wrap
o Added ISXD support and option '-g' to as-02-unwrap
Diffstat (limited to 'src/AS_DCP_TimedText.cpp')
| -rw-r--r-- | src/AS_DCP_TimedText.cpp | 67 |
1 files changed, 10 insertions, 57 deletions
diff --git a/src/AS_DCP_TimedText.cpp b/src/AS_DCP_TimedText.cpp index 6e34a5d..1f0930a 100644 --- a/src/AS_DCP_TimedText.cpp +++ b/src/AS_DCP_TimedText.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2008-2016, John Hurst +Copyright (c) 2008-2018, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -244,7 +244,7 @@ ASDCP::TimedText::MXFReader::h__Reader::ReadTimedTextResource(FrameBuffer& Frame // ASDCP::Result_t -ASDCP::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const byte_t* uuid, FrameBuffer& FrameBuf, +ASDCP::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const byte_t* uuid, FrameBuffer& frame_buf, AESDecContext* Ctx, HMACContext* HMAC) { KM_TEST_NULL_L(uuid); @@ -258,68 +258,21 @@ ASDCP::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const byte_t* uuid return RESULT_RANGE; } - TimedTextResourceSubDescriptor* DescObject = 0; // get the subdescriptor InterchangeObject* tmp_iobj = 0; Result_t result = m_HeaderPart.GetMDObjectByID((*ri).second, &tmp_iobj); - DescObject = static_cast<TimedTextResourceSubDescriptor*>(tmp_iobj); + TimedTextResourceSubDescriptor* desc_object = dynamic_cast<TimedTextResourceSubDescriptor*>(tmp_iobj); if ( KM_SUCCESS(result) ) { - RIP::const_pair_iterator pi; - RIP::PartitionPair TmpPair; - ui32_t sequence = 0; - - // Look up the partition start in the RIP using the SID. - // Count the sequence length in because this is the sequence - // value needed to complete the HMAC. - for ( pi = m_RIP.PairArray.begin(); pi != m_RIP.PairArray.end(); ++pi, ++sequence ) - { - if ( (*pi).BodySID == DescObject->EssenceStreamID ) - { - TmpPair = *pi; - break; - } - } - - if ( TmpPair.ByteOffset == 0 ) - { - DefaultLogSink().Error("Body SID not found in RIP set: %d\n", DescObject->EssenceStreamID); - return RESULT_FORMAT; - } + assert(desc_object); + result = ReadGenericStreamPartitionPayload(desc_object->EssenceStreamID, frame_buf); + } - if ( KM_SUCCESS(result) ) - { - FrameBuf.AssetID(uuid); - FrameBuf.MIMEType(DescObject->MIMEMediaType); - - // seek tp the start of the partition - if ( (Kumu::fpos_t)TmpPair.ByteOffset != m_LastPosition ) - { - m_LastPosition = TmpPair.ByteOffset; - result = m_File.Seek(TmpPair.ByteOffset); - } - - // read the partition header - MXF::Partition GSPart(m_Dict); - result = GSPart.InitFromFile(m_File); - - if( ASDCP_SUCCESS(result) ) - { - // check the SID - if ( DescObject->EssenceStreamID != GSPart.BodySID ) - { - char buf[64]; - DefaultLogSink().Error("Generic stream partition body differs: %s\n", RID.EncodeHex(buf, 64)); - return RESULT_FORMAT; - } - - // read the essence packet - assert(m_Dict); - if( ASDCP_SUCCESS(result) ) - result = ReadEKLVPacket(0, sequence, FrameBuf, m_Dict->ul(MDD_GenericStream_DataElement), Ctx, HMAC); - } - } + if ( KM_SUCCESS(result) ) + { + frame_buf.AssetID(uuid); + frame_buf.MIMEType(desc_object->MIMEMediaType); } return result; |
