From 4808d5031d03ffe14e7e1fa9dfd4ef2c6c0c48d2 Mon Sep 17 00:00:00 2001 From: jhurst Date: Mon, 21 Jan 2008 03:57:52 +0000 Subject: changes to make Wailua integration easier --- src/AS_DCP_JP2K.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/AS_DCP_JP2K.cpp') diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp index 8f77173..e0852b1 100755 --- a/src/AS_DCP_JP2K.cpp +++ b/src/AS_DCP_JP2K.cpp @@ -484,6 +484,23 @@ ASDCP::JP2K::MXFSReader::OpenRead(const char* filename) const return m_Reader->OpenRead(filename, ASDCP::ESS_JPEG_2000_S); } +// +ASDCP::Result_t +ASDCP::JP2K::MXFSReader::ReadFrame(ui32_t FrameNum, SFrameBuffer& FrameBuf, AESDecContext* Ctx, HMACContext* HMAC) const +{ + Result_t result = RESULT_INIT; + + if ( m_Reader && m_Reader->m_File.IsOpen() ) + { + result = m_Reader->ReadFrame(FrameNum, SP_LEFT, FrameBuf.Left, Ctx, HMAC); + + if ( ASDCP_SUCCESS(result) ) + result = m_Reader->ReadFrame(FrameNum, SP_RIGHT, FrameBuf.Right, Ctx, HMAC); + } + + return result; +} + // ASDCP::Result_t ASDCP::JP2K::MXFSReader::ReadFrame(ui32_t FrameNum, StereoscopicPhase_t phase, FrameBuffer& FrameBuf, @@ -495,7 +512,6 @@ ASDCP::JP2K::MXFSReader::ReadFrame(ui32_t FrameNum, StereoscopicPhase_t phase, F return RESULT_INIT; } - // Fill the struct with the values from the file's header. // Returns RESULT_INIT if the file is not open. ASDCP::Result_t @@ -906,6 +922,19 @@ ASDCP::JP2K::MXFSWriter::OpenWrite(const char* filename, const WriterInfo& Info, return result; } +ASDCP::Result_t +ASDCP::JP2K::MXFSWriter::WriteFrame(const SFrameBuffer& FrameBuf, AESEncContext* Ctx, HMACContext* HMAC) +{ + if ( m_Writer.empty() ) + return RESULT_INIT; + + Result_t result = m_Writer->WriteFrame(FrameBuf.Left, SP_LEFT, Ctx, HMAC); + + if ( ASDCP_SUCCESS(result) ) + result = m_Writer->WriteFrame(FrameBuf.Right, SP_RIGHT, Ctx, HMAC); + + return result; +} // Writes a frame of essence to the MXF file. If the optional AESEncContext // argument is present, the essence is encrypted prior to writing. -- cgit v1.2.3