From c45055937fb80cf78384e942dea0a57b5bf4b14c Mon Sep 17 00:00:00 2001 From: milla Date: Wed, 26 May 2021 14:13:38 +0200 Subject: Added API functions in AS_02_IAB.h: AddDmsGenericPartUtf8Text for write and ReadGenericStreamPartitionPayload for read. These functions are a wrapper so that the writer and reader call their implementation of AddDmsGenericPartUtf8Text and ReadGenericStreamPartitionPayload respectively. In the case of the AddDmsGenericPartUtf8Text 2 new parameters have been added: trackDescription and dataDescription. --- src/AS_02_IAB.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/AS_02_IAB.cpp') diff --git a/src/AS_02_IAB.cpp b/src/AS_02_IAB.cpp index aa551d9..8aea196 100644 --- a/src/AS_02_IAB.cpp +++ b/src/AS_02_IAB.cpp @@ -263,6 +263,17 @@ AS_02::IAB::MXFWriter::WriteFrame(const ui8_t* frame, ui32_t sz) { return result; } +Result_t +AS_02::IAB::MXFWriter::AddDmsGenericPartUtf8Text(const ASDCP::FrameBuffer& FrameBuf, ASDCP::AESEncContext* Ctx, + ASDCP::HMACContext* HMAC, const std::string& trackDescription, const std::string& dataDescription) +{ + if ( m_Writer.empty() ) + return RESULT_INIT; + + m_Writer->FlushIndexPartition(); + return m_Writer->AddDmsGenericPartUtf8Text(FrameBuf, Ctx, HMAC, trackDescription, dataDescription); +} + Result_t AS_02::IAB::MXFWriter::Finalize() { @@ -590,6 +601,17 @@ AS_02::IAB::MXFReader::ReadFrame(ui32_t frame_number, AS_02::IAB::MXFReader::Fra return result; } +Result_t +AS_02::IAB::MXFReader::ReadGenericStreamPartitionPayload(const ui32_t SID, ASDCP::FrameBuffer& frame_buf) +{ + if ( m_Reader && m_Reader->m_File->IsOpen() ) + { + return m_Reader->ReadGenericStreamPartitionPayload(SID, frame_buf, 0, 0 /*no encryption*/); + } + + return RESULT_INIT; +} + Result_t AS_02::IAB::MXFReader::FillWriterInfo(WriterInfo& Info) const { /* are we already running */ -- cgit v1.2.3