+}
+
+dcp::Size
+VideoContent::video_size_after_3d_split () const
+{
+ dcp::Size const s = video_size ();
+ switch (video_frame_type ()) {
+ case VIDEO_FRAME_TYPE_2D:
+ return s;
+ case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT:
+ return dcp::Size (s.width / 2, s.height);
+ case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM:
+ return dcp::Size (s.width, s.height / 2);
+ }
+
+ assert (false);
+}
+
+void
+VideoContent::set_colour_conversion (ColourConversion c)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _colour_conversion = c;
+ }
+
+ signal_changed (VideoContentProperty::COLOUR_CONVERSION);
+}
+
+/** @return Video size after 3D split and crop */
+dcp::Size
+VideoContent::video_size_after_crop () const
+{
+ return crop().apply (video_size_after_3d_split ());
+}
+
+/** @param t A time offset from the start of this piece of content.
+ * @return Corresponding time with respect to the content.
+ */
+ContentTime
+VideoContent::dcp_time_to_content_time (DCPTime t) const
+{
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+ return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
+}
+
+VideoContentScale::VideoContentScale (Ratio const * r)
+ : _ratio (r)
+ , _scale (true)
+{
+
+}
+
+VideoContentScale::VideoContentScale ()
+ : _ratio (0)
+ , _scale (false)
+{
+
+}
+
+VideoContentScale::VideoContentScale (bool scale)
+ : _ratio (0)
+ , _scale (scale)
+{
+
+}
+
+VideoContentScale::VideoContentScale (shared_ptr<cxml::Node> node)
+ : _ratio (0)
+ , _scale (true)
+{
+ optional<string> r = node->optional_string_child ("Ratio");
+ if (r) {
+ _ratio = Ratio::from_id (r.get ());
+ } else {
+ _scale = node->bool_child ("Scale");
+ }
+}
+
+void
+VideoContentScale::as_xml (xmlpp::Node* node) const
+{
+ if (_ratio) {
+ node->add_child("Ratio")->add_child_text (_ratio->id ());
+ } else {
+ node->add_child("Scale")->add_child_text (_scale ? "1" : "0");
+ }
+}
+
+string
+VideoContentScale::id () const
+{
+ stringstream s;
+
+ if (_ratio) {
+ s << _ratio->id () << "_";
+ } else {
+ s << (_scale ? "S1" : "S0");
+ }