Guess video range better when importing 2.14.x projects (#2227).
[dcpomatic.git] / src / lib / video_content.h
index c1e1dbeec5b05345f96730b56bd6871da6c4dead..3ec88457823f980bd9ea62b3abf1a4337251ac71 100644 (file)
@@ -26,6 +26,7 @@
 #include "colour_conversion.h"
 #include "content_part.h"
 #include "dcpomatic_time.h"
+#include "pixel_quanta.h"
 #include "types.h"
 #include "user_property.h"
 #include <dcp/language_tag.h>
@@ -45,7 +46,6 @@ public:
        static int const SIZE;
        static int const FRAME_TYPE;
        static int const CROP;
-       static int const SCALE;
        static int const COLOUR_CONVERSION;
        static int const FADE_IN;
        static int const FADE_OUT;
@@ -60,7 +60,7 @@ class VideoContent : public ContentPart, public std::enable_shared_from_this<Vid
 {
 public:
        explicit VideoContent (Content* parent);
-       VideoContent (Content* parent, cxml::ConstNodePtrint);
+       VideoContent (Content* parent, cxml::ConstNodePtr node, int version, VideoRange video_range_hint);
        VideoContent (Content* parent, std::vector<std::shared_ptr<Content>>);
 
        void as_xml (xmlpp::Node *) const;
@@ -113,27 +113,29 @@ public:
                return _frame_type;
        }
 
-       Crop crop () const {
+       Crop actual_crop () const;
+
+       Crop requested_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop;
        }
 
-       int left_crop () const {
+       int requested_left_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.left;
        }
 
-       int right_crop () const {
+       int requested_right_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.right;
        }
 
-       int top_crop () const {
+       int requested_top_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.top;
        }
 
-       int bottom_crop () const {
+       int requested_bottom_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.bottom;
        }
@@ -181,6 +183,11 @@ public:
                return _range;
        }
 
+       PixelQuanta pixel_quanta () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _pixel_quanta;
+       }
+
        bool use () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _use;
@@ -209,7 +216,7 @@ public:
        void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
        void modify_trim_start (dcpomatic::ContentTime& pos) const;
 
-       static std::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtrint);
+       static std::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr node, int version, VideoRange video_range_hint);
 
 private:
 
@@ -246,6 +253,7 @@ private:
        /** fade out time in content frames */
        Frame _fade_out;
        VideoRange _range;
+       PixelQuanta _pixel_quanta;
        boost::optional<dcp::LanguageTag> _burnt_subtitle_language;
 };