+VideoContent::VideoContent (shared_ptr<const Film> f, vector<shared_ptr<Content> > c)
+ : Content (f, c)
+ , _video_length (0)
+{
+ shared_ptr<VideoContent> ref = dynamic_pointer_cast<VideoContent> (c[0]);
+ assert (ref);
+
+ for (size_t i = 0; i < c.size(); ++i) {
+ shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c[i]);
+
+ if (vc->video_size() != ref->video_size()) {
+ throw JoinError (_("Content to be joined must have the same picture size."));
+ }
+
+ if (vc->video_frame_rate() != ref->video_frame_rate()) {
+ throw JoinError (_("Content to be joined must have the same video frame rate."));
+ }
+
+ if (vc->video_frame_type() != ref->video_frame_type()) {
+ throw JoinError (_("Content to be joined must have the same video frame type."));
+ }
+
+ if (vc->crop() != ref->crop()) {
+ throw JoinError (_("Content to be joined must have the same crop."));
+ }
+
+ if (vc->scale() != ref->scale()) {
+ throw JoinError (_("Content to be joined must have the same scale setting."));
+ }
+
+ if (vc->colour_conversion() != ref->colour_conversion()) {
+ throw JoinError (_("Content to be joined must have the same colour conversion."));
+ }
+
+ _video_length += vc->video_length ();
+ }
+
+ _video_size = ref->video_size ();
+ _video_frame_rate = ref->video_frame_rate ();
+ _video_frame_type = ref->video_frame_type ();
+ _crop = ref->crop ();
+ _scale = ref->scale ();
+ _colour_conversion = ref->colour_conversion ();
+}
+