Conversion of frame index to FFmpeg time must always use the original or detected...
[dcpomatic.git] / src / lib / video_content.h
index ea4676cecbe1607fe4a86e47a71c278e763e86b2..62459222d84cb823d95682b65d2f44481bcc41bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     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
@@ -96,6 +96,15 @@ public:
                return _video_length;
        }
 
+       VideoContent::Frame video_length_after_3d_combine () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               if (_video_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) {
+                       return _video_length / 2;
+               }
+               
+               return _video_length;
+       }
+
        libdcp::Size video_size () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _video_size;
@@ -106,7 +115,13 @@ public:
                return _video_frame_rate;
        }
 
+       float original_video_frame_rate () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _original_video_frame_rate;
+       }
+       
        void set_video_frame_type (VideoFrameType);
+       void set_video_frame_rate (float);
 
        void set_left_crop (int);
        void set_right_crop (int);
@@ -162,10 +177,14 @@ public:
 
        VideoContent::Frame time_to_content_video_frames (Time) const;
 
+       void scale_and_crop_to_fit_width ();
+       void scale_and_crop_to_fit_height ();
+
 protected:
        void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);
 
        VideoContent::Frame _video_length;
+       float _original_video_frame_rate;
        float _video_frame_rate;
 
 private: