summaryrefslogtreecommitdiff
path: root/src/AS_DCP_JP2K.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2008-01-21 03:57:52 +0000
committerjhurst <>2008-01-21 03:57:52 +0000
commit4808d5031d03ffe14e7e1fa9dfd4ef2c6c0c48d2 (patch)
tree5af97d04095357c45831f966a6716c4f179379dd /src/AS_DCP_JP2K.cpp
parent007b85f5de4f24b221234cb44a4ad57bbbb96ea4 (diff)
changes to make Wailua integration easier
Diffstat (limited to 'src/AS_DCP_JP2K.cpp')
-rwxr-xr-xsrc/AS_DCP_JP2K.cpp31
1 files changed, 30 insertions, 1 deletions
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
@@ -486,6 +486,23 @@ ASDCP::JP2K::MXFSReader::OpenRead(const char* filename) const
//
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,
AESDecContext* Ctx, HMACContext* HMAC) const
{
@@ -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.