+VideoContent::set_range (VideoRange r)
+{
+ maybe_set (_range, r, VideoContentProperty::RANGE);
+}
+
+void
+VideoContent::set_use (bool u)
+{
+ maybe_set (_use, u, VideoContentProperty::USE);
+}
+
+void
+VideoContent::take_settings_from (shared_ptr<const VideoContent> c)
+{
+ if (c->_colour_conversion) {
+ set_colour_conversion (c->_colour_conversion.get());
+ } else {
+ unset_colour_conversion ();
+ }
+ set_use (c->_use);
+ set_frame_type (c->_frame_type);
+ set_left_crop (c->_crop.left);
+ set_right_crop (c->_crop.right);
+ set_top_crop (c->_crop.top);
+ set_bottom_crop (c->_crop.bottom);
+ set_custom_ratio (c->_custom_ratio);
+ set_custom_size (c->_custom_size);
+ set_fade_in (c->_fade_in);
+ set_fade_out (c->_fade_out);
+}
+
+void
+VideoContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const
+{
+ pos = pos.round (film->video_frame_rate());
+}
+
+void
+VideoContent::modify_trim_start (ContentTime& trim) const
+{
+ if (_parent->video_frame_rate()) {
+ trim = trim.round (_parent->video_frame_rate().get());
+ }
+}
+
+
+/** @param film_container The size of the container for the DCP that we are working on */
+dcp::Size
+VideoContent::scaled_size (dcp::Size film_container)
+{
+ if (_custom_ratio) {
+ return fit_ratio_within(*_custom_ratio, film_container);
+ }
+
+ if (_custom_size) {
+ return *_custom_size;
+ }
+
+ dcp::Size size = size_after_crop ();
+ size.width *= _sample_aspect_ratio.get_value_or(1);
+
+ /* This is what we will return unless there is any legacy stuff to take into account */
+ dcp::Size auto_size = fit_ratio_within (size.ratio(), film_container);
+
+ if (_legacy_ratio) {
+ if (fit_ratio_within(*_legacy_ratio, film_container) != auto_size) {
+ _custom_ratio = *_legacy_ratio;
+ _legacy_ratio = optional<float>();
+ return fit_ratio_within(*_custom_ratio, film_container);
+ }
+ _legacy_ratio = boost::optional<float>();
+ }
+
+ return auto_size;
+}
+
+
+void
+VideoContent::set_custom_ratio (optional<float> ratio)