summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-23 00:25:36 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-23 00:25:36 +0000
commit0703842433013ac1d5f79c09d7a8361dc2e565c8 (patch)
tree1f8985669bea1ee72024e86f927255a667f78e8a
parent1c724e363a644abaee7efb39d6091e7b30de0fb6 (diff)
parent054cc86d5ba734c72780b07a772a55e3a7000a4f (diff)
Merge branch 'master' into 1.0
-rwxr-xr-xasdcplib/src/AS_DCP.h2
-rwxr-xr-xasdcplib/src/AS_DCP_JP2K.cpp21
-rw-r--r--src/picture_mxf_writer.h1
-rw-r--r--src/stereo_picture_mxf_writer.cc2
4 files changed, 22 insertions, 4 deletions
diff --git a/asdcplib/src/AS_DCP.h b/asdcplib/src/AS_DCP.h
index 3edd1f74..eb2ce6e6 100755
--- a/asdcplib/src/AS_DCP.h
+++ b/asdcplib/src/AS_DCP.h
@@ -1289,7 +1289,7 @@ namespace ASDCP {
Result_t WriteFrame(const FrameBuffer&, StereoscopicPhase_t phase,
AESEncContext* = 0, HMACContext* = 0, std::string* hash = 0);
- Result_t FakeWriteFrame(int size);
+ Result_t FakeWriteFrame(int size, StereoscopicPhase_t phase);
// Closes the MXF file, writing the index and revised header. Returns
// RESULT_SPHASE if WriteFrame was called an odd number of times.
diff --git a/asdcplib/src/AS_DCP_JP2K.cpp b/asdcplib/src/AS_DCP_JP2K.cpp
index 903b2e85..05166d68 100755
--- a/asdcplib/src/AS_DCP_JP2K.cpp
+++ b/asdcplib/src/AS_DCP_JP2K.cpp
@@ -1197,6 +1197,23 @@ public:
return lh__Writer::WriteFrame(FrameBuf, false, Ctx, HMAC, hash);
}
+ Result_t FakeWriteFrame(int size, StereoscopicPhase_t phase)
+ {
+ if (m_NextPhase != phase)
+ {
+ return RESULT_SPHASE;
+ }
+
+ if (phase == SP_LEFT)
+ {
+ m_NextPhase = SP_RIGHT;
+ return lh__Writer::FakeWriteFrame(size, true);
+ }
+
+ m_NextPhase = SP_LEFT;
+ return lh__Writer::FakeWriteFrame(size, false);
+ }
+
//
Result_t Finalize()
{
@@ -1338,12 +1355,12 @@ ASDCP::JP2K::MXFSWriter::WriteFrame(const FrameBuffer& FrameBuf, StereoscopicPha
}
ASDCP::Result_t
-ASDCP::JP2K::MXFSWriter::FakeWriteFrame(int size)
+ASDCP::JP2K::MXFSWriter::FakeWriteFrame(int size, StereoscopicPhase_t phase)
{
if ( m_Writer.empty() )
return RESULT_INIT;
- return m_Writer->FakeWriteFrame(size, true);
+ return m_Writer->FakeWriteFrame(size, phase);
}
// Closes the MXF file, writing the index and other closing information.
diff --git a/src/picture_mxf_writer.h b/src/picture_mxf_writer.h
index 9f50f973..bcd8873d 100644
--- a/src/picture_mxf_writer.h
+++ b/src/picture_mxf_writer.h
@@ -29,6 +29,7 @@ namespace dcp {
class PictureMXF;
+/** Information about a single frame (either a monoscopic frame or a left *or* right eye stereoscopic frame) */
struct FrameInfo
{
FrameInfo (uint64_t o, uint64_t s, std::string h)
diff --git a/src/stereo_picture_mxf_writer.cc b/src/stereo_picture_mxf_writer.cc
index 10c5ea06..ad029b57 100644
--- a/src/stereo_picture_mxf_writer.cc
+++ b/src/stereo_picture_mxf_writer.cc
@@ -94,7 +94,7 @@ StereoPictureMXFWriter::fake_write (int size)
assert (_started);
assert (!_finalized);
- Kumu::Result_t r = _state->mxf_writer.FakeWriteFrame (size);
+ Kumu::Result_t r = _state->mxf_writer.FakeWriteFrame (size, _next_eye == EYE_LEFT ? ASDCP::JP2K::SP_LEFT : ASDCP::JP2K::SP_RIGHT);
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError ("error in writing video MXF", _mxf->file().string(), r));
}