+
+ auto video_range = node->optional_string_child("Range");
+ if (!video_range) {
+ _range = video_range_hint;
+ } else if (*video_range == "full") {
+ _range = VideoRange::FULL;
+ } else {
+ _range = VideoRange::VIDEO;
+ }
+
+ if (auto pixel_quanta = node->optional_node_child("PixelQuanta")) {
+ _pixel_quanta = PixelQuanta(pixel_quanta);
+ }
+
+ auto burnt = node->optional_string_child("BurntSubtitleLanguage");
+ if (burnt) {
+ _burnt_subtitle_language = dcp::LanguageTag (*burnt);
+ }
+
+}
+
+
+VideoContent::VideoContent (Content* parent, vector<shared_ptr<Content> > c)
+ : ContentPart (parent)
+ , _length (0)
+ , _yuv (false)
+{
+ auto ref = c[0]->video;
+ DCPOMATIC_ASSERT (ref);
+
+ for (size_t i = 1; i < c.size(); ++i) {
+
+ if (c[i]->video->use() != ref->use()) {
+ throw JoinError (_("Content to be joined must have all its video used or not used."));
+ }
+
+ if (c[i]->video->size() != ref->size()) {
+ throw JoinError (_("Content to be joined must have the same picture size."));
+ }
+
+ if (c[i]->video->frame_type() != ref->frame_type()) {
+ throw JoinError (_("Content to be joined must have the same video frame type."));
+ }
+
+ if (c[i]->video->requested_crop() != ref->requested_crop()) {
+ throw JoinError (_("Content to be joined must have the same crop."));
+ }
+
+ if (c[i]->video->custom_ratio() != ref->custom_ratio()) {
+ throw JoinError (_("Content to be joined must have the same custom ratio setting."));
+ }
+
+ if (c[i]->video->custom_size() != ref->custom_size()) {
+ throw JoinError (_("Content to be joined must have the same custom size setting."));
+ }
+
+ if (c[i]->video->colour_conversion() != ref->colour_conversion()) {
+ throw JoinError (_("Content to be joined must have the same colour conversion."));
+ }
+
+ if (c[i]->video->fade_in() != ref->fade_in() || c[i]->video->fade_out() != ref->fade_out()) {
+ throw JoinError (_("Content to be joined must have the same fades."));
+ }
+
+ if (c[i]->video->burnt_subtitle_language() != ref->burnt_subtitle_language()) {
+ throw JoinError (_("Content to be joined must have the same burnt subtitle language."));
+ }
+
+ _length += c[i]->video->length ();
+
+ if (c[i]->video->yuv ()) {
+ _yuv = true;
+ }
+
+ _pixel_quanta = max(_pixel_quanta, c[i]->video->_pixel_quanta);
+ }
+
+ _use = ref->use ();
+ _size = ref->size ();
+ _frame_type = ref->frame_type ();
+ _crop = ref->requested_crop ();
+ _custom_ratio = ref->custom_ratio ();
+ _colour_conversion = ref->colour_conversion ();
+ _fade_in = ref->fade_in ();
+ _fade_out = ref->fade_out ();
+ _range = ref->range ();
+ _burnt_subtitle_language = ref->burnt_subtitle_language ();