X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fvideo_content.h;h=7d9cb4f8f0298eccb5a307b37612b5ab8e6e95be;hb=4616b19fb5241a54c9d57f7a91bb975f41aed14b;hp=a82c6c22131a339229c55d078942677d57718465;hpb=09806bc8d6a48fc79d923ec1cdf6f90176bf8b6a;p=dcpomatic.git diff --git a/src/lib/video_content.h b/src/lib/video_content.h index a82c6c221..7d9cb4f8f 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,9 +43,9 @@ public: VideoContentScale (); VideoContentScale (Ratio const *); VideoContentScale (bool); - VideoContentScale (boost::shared_ptr); + VideoContentScale (cxml::NodePtr); - dcp::Size size (boost::shared_ptr, dcp::Size) const; + dcp::Size size (boost::shared_ptr, dcp::Size, dcp::Size) const; std::string id () const; std::string name () const; void as_xml (xmlpp::Node *) const; @@ -64,7 +64,9 @@ public: } private: + /** a ratio to stretch the content to, or 0 for no stretch */ Ratio const * _ratio; + /** true if we want to scale the content */ bool _scale; static std::vector _scales; @@ -81,7 +83,7 @@ public: VideoContent (boost::shared_ptr); VideoContent (boost::shared_ptr, DCPTime, ContentTime); VideoContent (boost::shared_ptr, boost::filesystem::path); - VideoContent (boost::shared_ptr, boost::shared_ptr, int); + VideoContent (boost::shared_ptr, cxml::ConstNodePtr, int); VideoContent (boost::shared_ptr, std::vector >); void as_xml (xmlpp::Node *) const; @@ -94,6 +96,15 @@ public: return _video_length; } + ContentTime video_length_after_3d_combine () const { + boost::mutex::scoped_lock lm (_mutex); + if (_video_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) { + return ContentTime (_video_length.get() / 2); + } + + return _video_length; + } + dcp::Size video_size () const { boost::mutex::scoped_lock lm (_mutex); return _video_size; @@ -105,6 +116,7 @@ public: } void set_video_frame_type (VideoFrameType); + void set_video_frame_rate (float); void set_left_crop (int); void set_right_crop (int); @@ -160,6 +172,9 @@ public: ContentTime dcp_time_to_content_time (DCPTime) const; + void scale_and_crop_to_fit_width (); + void scale_and_crop_to_fit_height (); + protected: void take_from_video_examiner (boost::shared_ptr);