X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fvideo_content.cc;h=216ad6784b22f1df56da7f2ebea36468f4fc7953;hp=f5e5139122191337183735e764573480894688cf;hb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;hpb=4985d87750c87019dfe5dc7ef44e12c45326dd0e diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index f5e513912..216ad6784 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -62,6 +62,7 @@ using std::setprecision; using std::list; using std::pair; using std::shared_ptr; +using std::make_shared; using boost::optional; using std::dynamic_pointer_cast; using dcp::raw_convert; @@ -71,7 +72,7 @@ VideoContent::VideoContent (Content* parent) : ContentPart (parent) , _use (true) , _length (0) - , _frame_type (VIDEO_FRAME_TYPE_2D) + , _frame_type (VideoFrameType::TWO_D) , _yuv (true) , _fade_in (0) , _fade_out (0) @@ -84,10 +85,10 @@ shared_ptr VideoContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) { if (!node->optional_number_child ("VideoWidth")) { - return shared_ptr (); + return {}; } - return shared_ptr (new VideoContent (parent, node, version)); + return make_shared(parent, node, version); } VideoContent::VideoContent (Content* parent, cxml::ConstNodePtr node, int version) @@ -109,22 +110,22 @@ VideoContent::VideoContent (Content* parent, cxml::ConstNodePtr node, int versio /* Snapshot of the VideoFrameType enum at version 34 */ switch (node->number_child ("VideoFrameType")) { case 0: - _frame_type = VIDEO_FRAME_TYPE_2D; + _frame_type = VideoFrameType::TWO_D; break; case 1: - _frame_type = VIDEO_FRAME_TYPE_3D_LEFT_RIGHT; + _frame_type = VideoFrameType::THREE_D_LEFT_RIGHT; break; case 2: - _frame_type = VIDEO_FRAME_TYPE_3D_TOP_BOTTOM; + _frame_type = VideoFrameType::THREE_D_TOP_BOTTOM; break; case 3: - _frame_type = VIDEO_FRAME_TYPE_3D_ALTERNATE; + _frame_type = VideoFrameType::THREE_D_ALTERNATE; break; case 4: - _frame_type = VIDEO_FRAME_TYPE_3D_LEFT; + _frame_type = VideoFrameType::THREE_D_LEFT; break; case 5: - _frame_type = VIDEO_FRAME_TYPE_3D_RIGHT; + _frame_type = VideoFrameType::THREE_D_RIGHT; break; } } else { @@ -138,7 +139,7 @@ VideoContent::VideoContent (Content* parent, cxml::ConstNodePtr node, int versio _crop.bottom = node->number_child ("BottomCrop"); if (version <= 7) { - optional r = node->optional_string_child ("Ratio"); + auto r = node->optional_string_child ("Ratio"); if (r) { _legacy_ratio = Ratio::from_id(r.get())->ratio(); } @@ -355,15 +356,15 @@ VideoContent::size_after_3d_split () const { auto const s = size (); switch (frame_type ()) { - case VIDEO_FRAME_TYPE_2D: - case VIDEO_FRAME_TYPE_3D: - case VIDEO_FRAME_TYPE_3D_ALTERNATE: - case VIDEO_FRAME_TYPE_3D_LEFT: - case VIDEO_FRAME_TYPE_3D_RIGHT: + case VideoFrameType::TWO_D: + case VideoFrameType::THREE_D: + case VideoFrameType::THREE_D_ALTERNATE: + case VideoFrameType::THREE_D_LEFT: + case VideoFrameType::THREE_D_RIGHT: return s; - case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: + case VideoFrameType::THREE_D_LEFT_RIGHT: return dcp::Size (s.width / 2, s.height); - case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: + case VideoFrameType::THREE_D_TOP_BOTTOM: return dcp::Size (s.width, s.height / 2); }