+ node->add_child("VideoFrameType")->add_child_text (lexical_cast<string> (static_cast<int> (_video_frame_type)));
+ node->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left));
+ node->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right));
+ node->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top));
+ node->add_child("BottomCrop")->add_child_text (boost::lexical_cast<string> (_crop.bottom));
+ if (_ratio) {
+ node->add_child("Ratio")->add_child_text (_ratio->id ());
+ }
+ _colour_conversion.as_xml (node->add_child("ColourConversion"));
+}
+
+void
+VideoContent::setup_default_colour_conversion ()
+{
+ _colour_conversion = PresetColourConversion (_("sRGB"), 2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6).conversion;
+}
+
+void
+VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
+{
+ /* These examiner calls could call other content methods which take a lock on the mutex */
+ libdcp::Size const vs = d->video_size ();
+ float const vfr = d->video_frame_rate ();
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_size = vs;
+ _video_frame_rate = vfr;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_SIZE);
+ signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
+}
+
+
+string
+VideoContent::information () const
+{
+ if (video_size().width == 0 || video_size().height == 0) {
+ return "";
+ }
+
+ stringstream s;
+
+ s << String::compose (
+ _("%1x%2 pixels (%3:1)"),
+ video_size().width,
+ video_size().height,
+ setprecision (3), video_size().ratio ()
+ );
+
+ return s.str ();
+}
+
+void
+VideoContent::set_left_crop (int c)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+
+ if (_crop.left == c) {
+ return;
+ }
+
+ _crop.left = c;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_CROP);
+}
+
+void
+VideoContent::set_right_crop (int c)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_crop.right == c) {
+ return;
+ }
+
+ _crop.right = c;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_CROP);
+}
+
+void
+VideoContent::set_top_crop (int c)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_crop.top == c) {
+ return;
+ }
+
+ _crop.top = c;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_CROP);
+}
+
+void
+VideoContent::set_bottom_crop (int c)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_crop.bottom == c) {
+ return;
+ }
+
+ _crop.bottom = c;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_CROP);