diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-21 21:47:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-21 21:47:25 +0100 |
| commit | 6199e090dc1e32d3753ba7e7d7ea8c5f0d79f046 (patch) | |
| tree | b09d9b6b19dadb694590981775a61f829b6f3622 /src/lib/video_content.cc | |
| parent | cbd4450197a083bf58bda510e626f73ba583cb66 (diff) | |
Revert "Remove join function; the code is long and I don't think anybody"
It turns out Carsten uses it :)
This reverts commit bd5e8b83a3a18787241982efdae809d4db21f65d.
Diffstat (limited to 'src/lib/video_content.cc')
| -rw-r--r-- | src/lib/video_content.cc | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 0dba55525..d3ba6c1ab 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -154,6 +154,56 @@ VideoContent::VideoContent (Content* parent, cxml::ConstNodePtr node, int versio } } +VideoContent::VideoContent (Content* parent, vector<shared_ptr<Content> > c) + : ContentPart (parent) + , _length (0) + , _yuv (false) +{ + shared_ptr<VideoContent> ref = c[0]->video; + DCPOMATIC_ASSERT (ref); + + for (size_t i = 1; i < c.size(); ++i) { + + 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->crop() != ref->crop()) { + throw JoinError (_("Content to be joined must have the same crop.")); + } + + if (c[i]->video->scale() != ref->scale()) { + throw JoinError (_("Content to be joined must have the same scale 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.")); + } + + _length += c[i]->video->length (); + + if (c[i]->video->yuv ()) { + _yuv = true; + } + } + + _size = ref->size (); + _frame_type = ref->frame_type (); + _crop = ref->crop (); + _scale = ref->scale (); + _colour_conversion = ref->colour_conversion (); + _fade_in = ref->fade_in (); + _fade_out = ref->fade_out (); +} + void VideoContent::as_xml (xmlpp::Node* node) const { |
