diff options
| author | mikey <mikey@cinecert.com> | 2013-04-12 23:39:31 +0000 |
|---|---|---|
| committer | mikey <> | 2013-04-12 23:39:31 +0000 |
| commit | 252740d6f7d8924c6af30e55d2da487356a0acdc (patch) | |
| tree | ba01aa630cf6cd11e7c286a60380aa35be916616 /src/AS_DCP_JP2K.cpp | |
| parent | c9e20228d6c328a0b446c1417e0082389ff045ff (diff) | |
Added atmos support and new ULs per SMPTE 429-2:2013 - see README for deets.
Diffstat (limited to 'src/AS_DCP_JP2K.cpp')
| -rwxr-xr-x | src/AS_DCP_JP2K.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp index 33d5b93..300a6a2 100755 --- a/src/AS_DCP_JP2K.cpp +++ b/src/AS_DCP_JP2K.cpp @@ -280,6 +280,22 @@ lh__Reader::MD_to_JP2K_PDesc(JP2K::PictureDescriptor& PDesc) return RESULT_OK; } +// Compares the actual floating point value of the rates. +// This allows, for example, {300000,1001} and {2997,100) to be considered equivalent. +// to 29.97. +bool +epsilon_compare(const ASDCP::Rational& left, const ASDCP::Rational& right, double epsilon = 0.001) +{ + bool result = false; + double difference = left.Quotient() - right.Quotient(); + + if (fabs(difference) < epsilon) + result = true; + + return result; +} +// end DOLBY + // // ASDCP::Result_t @@ -459,6 +475,8 @@ ASDCP::JP2K::MXFReader::MXFReader() ASDCP::JP2K::MXFReader::~MXFReader() { + if ( m_Reader && m_Reader->m_File.IsOpen() ) + m_Reader->Close(); } // Warning: direct manipulation of MXF structures can interfere @@ -510,6 +528,12 @@ ASDCP::JP2K::MXFReader::ReadFrame(ui32_t FrameNum, FrameBuffer& FrameBuf, return RESULT_INIT; } +ASDCP::Result_t +ASDCP::JP2K::MXFReader::LocateFrame(ui32_t FrameNum, Kumu::fpos_t& streamOffset, i8_t& temporalOffset, i8_t& keyFrameOffset) const +{ + return m_Reader->LocateFrame(FrameNum, streamOffset, temporalOffset, keyFrameOffset); +} + // Fill the struct with the values from the file's header. // Returns RESULT_INIT if the file is not open. @@ -663,6 +687,8 @@ ASDCP::JP2K::MXFSReader::MXFSReader() ASDCP::JP2K::MXFSReader::~MXFSReader() { + if ( m_Reader && m_Reader->m_File.IsOpen() ) + m_Reader->Close(); } // Warning: direct manipulation of MXF structures can interfere @@ -731,6 +757,12 @@ ASDCP::JP2K::MXFSReader::ReadFrame(ui32_t FrameNum, StereoscopicPhase_t phase, F return RESULT_INIT; } +ASDCP::Result_t +ASDCP::JP2K::MXFSReader::LocateFrame(ui32_t FrameNum, Kumu::fpos_t& streamOffset, i8_t& temporalOffset, i8_t& keyFrameOffset) const +{ + return m_Reader->LocateFrame(FrameNum, streamOffset, temporalOffset, keyFrameOffset); +} + // Fill the struct with the values from the file's header. // Returns RESULT_INIT if the file is not open. ASDCP::Result_t |
