From f4061a21fffad4fdf8dbb2f193f0f0960b25421c Mon Sep 17 00:00:00 2001 From: jhurst Date: Mon, 6 Aug 2018 22:07:03 +0000 Subject: 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 --- src/AS_DCP_TimedText.cpp | 67 ++++++++---------------------------------------- 1 file changed, 10 insertions(+), 57 deletions(-) (limited to 'src/AS_DCP_TimedText.cpp') 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(tmp_iobj); + TimedTextResourceSubDescriptor* desc_object = dynamic_cast(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; -- cgit v1.2.3