summaryrefslogtreecommitdiff
path: root/src/AS_02_TimedText.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2018-08-06 22:07:03 +0000
committerjhurst <>2018-08-06 22:07:03 +0000
commitf4061a21fffad4fdf8dbb2f193f0f0960b25421c (patch)
treec66e09ce3c57e263690bc0c0f37d37e9a3aa75f8 /src/AS_02_TimedText.cpp
parent38954bfe8dd72a817fb070c58327cd111b9bd282 (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_02_TimedText.cpp')
-rw-r--r--src/AS_02_TimedText.cpp69
1 files changed, 11 insertions, 58 deletions
diff --git a/src/AS_02_TimedText.cpp b/src/AS_02_TimedText.cpp
index 9e14600..974c811 100644
--- a/src/AS_02_TimedText.cpp
+++ b/src/AS_02_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
@@ -186,7 +186,7 @@ AS_02::TimedText::MXFReader::h__Reader::ReadTimedTextResource(ASDCP::TimedText::
//
ASDCP::Result_t
AS_02::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const Kumu::UUID& uuid,
- ASDCP::TimedText::FrameBuffer& FrameBuf,
+ ASDCP::TimedText::FrameBuffer& frame_buf,
AESDecContext* Ctx, HMACContext* HMAC)
{
ResourceMap_t::const_iterator ri = m_ResourceMap.find(uuid);
@@ -197,70 +197,23 @@ AS_02::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const Kumu::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;
- }
-
- if ( KM_SUCCESS(result) )
- {
- FrameBuf.AssetID(uuid.Value());
- 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
- ASDCP::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", uuid.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);
- }
- }
+ assert(desc_object);
+ result = ReadGenericStreamPartitionPayload(desc_object->EssenceStreamID, frame_buf);
}
+ if ( KM_SUCCESS(result) )
+ {
+ frame_buf.AssetID(uuid.Value());
+ frame_buf.MIMEType(desc_object->MIMEMediaType);
+ }
+
return result;
}