/*
-Copyright (c) 2011-2013, Robert Scheler, Heiko Sparenberg Fraunhofer IIS,
+Copyright (c) 2011-2018, Robert Scheler, Heiko Sparenberg Fraunhofer IIS,
John Hurst
All rights reserved.
{
BodySID = 0;
IndexSID = 129;
+ MinorVersion = 3;
}
AS_02::MXF::AS02IndexWriterVBR::~AS02IndexWriterVBR() {}
{
assert(m_Dict);
ASDCP::FrameBuffer index_body_buffer;
- ui32_t index_body_size = m_PacketList->m_List.size() * MaxIndexSegmentSize; // segment-count * max-segment-size
+ ui32_t index_body_size = (ui32_t)m_PacketList->m_List.size() * MaxIndexSegmentSize; // segment-count * max-segment-size
Result_t result = index_body_buffer.Capacity(index_body_size);
ui64_t start_position = 0;
IndexTableSegment* segment = dynamic_cast<IndexTableSegment*>(*i);
if ( segment != 0 )
{
- duration += segment->IndexEntryArray.size();
+ duration += (ui32_t)segment->IndexEntryArray.size();
}
}
m_CurrentSegment->IndexEntryArray.push_back(Entry);
}
+void
+AS_02::MXF::AS02IndexWriterVBR::SetEditRate(const ASDCP::Rational& edit_rate)
+{
+ m_EditRate = edit_rate;
+}
//------------------------------------------------------------------------------------------
//
//
Result_t
-AS_02::h__AS02WriterFrame::WriteEKLVPacket(const ASDCP::FrameBuffer& FrameBuf,const byte_t* EssenceUL, AESEncContext* Ctx, HMACContext* HMAC)
+AS_02::h__AS02WriterFrame::WriteEKLVPacket(const ASDCP::FrameBuffer& FrameBuf,const byte_t* EssenceUL,
+ const ui32_t& MinEssenceElementBerLength,
+ AESEncContext* Ctx, HMACContext* HMAC)
{
ui64_t this_stream_offset = m_StreamOffset; // m_StreamOffset will be changed by the call to Write_EKLV_Packet
Result_t result = Write_EKLV_Packet(m_File, *m_Dict, m_HeaderPart, m_Info, m_CtFrameBuf, m_FramesWritten,
- m_StreamOffset, FrameBuf, EssenceUL, Ctx, HMAC);
+ m_StreamOffset, FrameBuf, EssenceUL, MinEssenceElementBerLength, Ctx, HMAC);
if ( KM_SUCCESS(result) )
{
m_IndexWriter.PushIndexEntry(Entry);
}
- if ( m_FramesWritten > 0 && ( m_FramesWritten % m_PartitionSpace ) == 0 )
+ if ( m_FramesWritten > 1 && ( ( m_FramesWritten + 1 ) % m_PartitionSpace ) == 0 )
{
- m_IndexWriter.ThisPartition = m_File.Tell();
- m_IndexWriter.WriteToFile(m_File);
- m_RIP.PairArray.push_back(RIP::Pair(0, m_IndexWriter.ThisPartition));
+ assert(m_IndexWriter.GetDuration() > 0);
+ FlushIndexPartition();
UL body_ul(m_Dict->ul(MDD_ClosedCompleteBodyPartition));
Partition body_part(m_Dict);
+ body_part.MajorVersion = m_HeaderPart.MajorVersion;
+ body_part.MinorVersion = m_HeaderPart.MinorVersion;
body_part.BodySID = 1;
body_part.OperationalPattern = m_HeaderPart.OperationalPattern;
body_part.EssenceContainers = m_HeaderPart.EssenceContainers;
body_part.BodyOffset = m_StreamOffset;
result = body_part.WriteToFile(m_File, body_ul);
- m_RIP.PairArray.push_back(RIP::Pair(1, body_part.ThisPartition));
+ m_RIP.PairArray.push_back(RIP::PartitionPair(1, body_part.ThisPartition));
}
return result;
{
BodySID = 0;
IndexSID = 129;
+ MinorVersion = 3;
}
AS_02::MXF::AS02IndexWriterCBR::~AS02IndexWriterCBR() {}
return result;
}
-
-
//
// end h__02_Writer.cpp
//