C++11 tidying.
[libdcp.git] / src / stereo_picture_frame.cc
index ac9cb6d9890396b12ec3424c32c81fa601357231..8d3a2757359b6325c09309436e667eab51845b98 100644 (file)
  */
 
 
-#include "stereo_picture_frame.h"
-#include "exceptions.h"
-#include "util.h"
-#include "rgb_xyz.h"
 #include "colour_conversion.h"
 #include "compose.hpp"
-#include "j2k.h"
 #include "crypto_context.h"
+#include "exceptions.h"
+#include "j2k_transcode.h"
+#include "rgb_xyz.h"
+#include "stereo_picture_frame.h"
+#include "util.h"
 #include <asdcp/AS_DCP.h>
 #include <asdcp/KM_fileio.h>
 
@@ -94,13 +94,14 @@ StereoPictureFrame::Part::size () const
 /** Make a picture frame from a 3D (stereoscopic) asset.
  *  @param reader Reader for the MXF file.
  *  @param n Frame within the asset, not taking EntryPoint into account.
+ *  @param check_hmac true to check the HMAC and give an error if it is not as expected.
  */
-StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n, shared_ptr<DecryptionContext> c)
+StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n, shared_ptr<DecryptionContext> c, bool check_hmac)
 {
        /* XXX: unfortunate guesswork on this buffer size */
        _buffer = make_shared<ASDCP::JP2K::SFrameBuffer>(4 * Kumu::Megabyte);
 
-       if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), c->hmac()))) {
+       if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), check_hmac ? c->hmac() : nullptr))) {
                boost::throw_exception (ReadError (String::compose ("could not read video frame %1 of %2", n)));
        }
 }