return (write_time_changed || calculate_digest() != digest());
}
+
int const VideoContentProperty::CUSTOM_RATIO = 8;
int const VideoContentProperty::CUSTOM_SIZE = 9;
int const VideoContentProperty::BURNT_SUBTITLE_LANGUAGE = 10;
+int const VideoContentProperty::TYPE = 11;
using std::cout;
: ContentPart (parent)
, _use (true)
, _length (0)
+ , _type(VideoType::MAIN)
, _frame_type (VideoFrameType::TWO_D)
, _yuv (true)
, _fade_in (0)
_use = node->optional_bool_child("Use").get_value_or(true);
_length = node->number_child<Frame> ("VideoLength");
+ _type = string_to_video_type(node->optional_string_child("VideoType").get_value_or("main"));
+
if (version <= 34) {
/* Snapshot of the VideoFrameType enum at version 34 */
switch (node->number_child<int> ("VideoFrameType")) {
throw JoinError (_("Content to be joined must have the same picture size."));
}
+ if (c[i]->video->type() != ref->type()) {
+ throw JoinError(_("Content to be joined must have the same video type."));
+ }
+
if (c[i]->video->frame_type() != ref->frame_type()) {
throw JoinError (_("Content to be joined must have the same video frame type."));
}
_use = ref->use ();
_size = ref->size ();
+ _type = ref->type();
_frame_type = ref->frame_type ();
_crop = ref->requested_crop ();
_custom_ratio = ref->custom_ratio ();
node->add_child("VideoLength")->add_child_text (raw_convert<string> (_length));
node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_size.width));
node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_size.height));
+ node->add_child("VideoType")->add_child_text(video_type_to_string(_type));
node->add_child("VideoFrameType")->add_child_text (video_frame_type_to_string (_frame_type));
if (_sample_aspect_ratio) {
node->add_child("SampleAspectRatio")->add_child_text (raw_convert<string> (_sample_aspect_ratio.get ()));
}
+void
+VideoContent::set_type(VideoType type)
+{
+ maybe_set(_type, type, VideoContentProperty::TYPE);
+}
+
+
void
VideoContent::set_frame_type (VideoFrameType t)
{
#include "user_property.h"
#include "video_frame_type.h"
#include "video_range.h"
+#include "video_type.h"
#include "types.h"
#include <dcp/language_tag.h>
#include <boost/thread/mutex.hpp>
static int const CUSTOM_RATIO;
static int const CUSTOM_SIZE;
static int const BURNT_SUBTITLE_LANGUAGE;
+ static int const TYPE;
};
return _size;
}
+ void set_type(VideoType type);
void set_frame_type (VideoFrameType);
void set_crop (Crop crop);
void set_burnt_subtitle_language (boost::optional<dcp::LanguageTag> language);
+ VideoType type() const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _type;
+ }
+
VideoFrameType frame_type () const {
boost::mutex::scoped_lock lm (_mutex);
return _frame_type;
Frame _length;
boost::optional<ColourConversion> _colour_conversion;
dcp::Size _size;
+ VideoType _type;
VideoFrameType _frame_type;
Crop _crop;
/** ratio to scale cropped image to (or none to guess); i.e. if set, scale to _custom_ratio:1 */
--- /dev/null
+/*
+ Copyright (C) 2022 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "dcpomatic_assert.h"
+#include "video_type.h"
+#include <string>
+
+
+using std::string;
+
+
+string
+video_type_to_string(VideoType type)
+{
+ switch (type) {
+ case VideoType::MAIN:
+ return "main";
+ case VideoType::SIGN_LANGUAGE:
+ return "sign-language";
+ default:
+ DCPOMATIC_ASSERT(false);
+ }
+}
+
+
+VideoType
+string_to_video_type(string type)
+{
+ if (type == "main") {
+ return VideoType::MAIN;
+ } else if (type == "sign-language") {
+ return VideoType::SIGN_LANGUAGE;
+ }
+
+ DCPOMATIC_ASSERT(false);
+}
+
--- /dev/null
+/*
+ Copyright (C) 2022 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#ifndef DCPOMATIC_VIDEO_TYPE_H
+#define DCPOMATIC_VIDEO_TYPE_H
+
+
+#include <string>
+
+
+enum class VideoType
+{
+ MAIN,
+ SIGN_LANGUAGE,
+ COUNT
+};
+
+
+VideoType string_to_video_type(std::string type);
+std::string video_type_to_string(VideoType type);
+
+
+#endif
video_mxf_examiner.cc
video_range.cc
video_ring_buffers.cc
+ video_type.cc
writer.cc
zipper.cc
"""
sizer->Add(_ignore_video, wxGBPosition(r, 0), wxGBSpan(1, 3));
++r;
+ _sign_language = new CheckBox(this, _("Video contains sign language"));
+ sizer->Add(_sign_language, wxGBPosition(r, 0), wxGBSpan(1, 3));
+ ++r;
+
auto overall = new wxBoxSizer (wxVERTICAL);
overall->Add (sizer, 1, wxALL, DCPOMATIC_DIALOG_BORDER);
auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
_burnt_subtitle->SetValue (_content->video && static_cast<bool>(_content->video->burnt_subtitle_language()));
_burnt_subtitle_language->set (_content->video ? _content->video->burnt_subtitle_language() : boost::none);
+ _sign_language->Enable(static_cast<bool>(_content->video));
+ _sign_language->SetValue(_content->video ? (_content->video->type() == VideoType::SIGN_LANGUAGE) : false);
+
_filters_button->Bind (wxEVT_BUTTON, bind(&ContentAdvancedDialog::edit_filters, this));
_set_video_frame_rate->Bind (wxEVT_BUTTON, bind(&ContentAdvancedDialog::set_video_frame_rate, this));
_video_frame_rate->Bind (wxEVT_TEXT, boost::bind(&ContentAdvancedDialog::video_frame_rate_changed, this));
}
+VideoType
+ContentAdvancedDialog::video_type() const
+{
+ DCPOMATIC_ASSERT(_content->video);
+ return _sign_language->GetValue() ? VideoType::SIGN_LANGUAGE : VideoType::MAIN;
+}
+
+
bool
ContentAdvancedDialog::ignore_video() const
{
*/
+#include "lib/video_type.h"
#include <dcp/language_tag.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
boost::optional<double> video_frame_rate() const;
boost::optional<dcp::LanguageTag> burnt_subtitle_language() const;
+ VideoType video_type() const;
private:
void edit_filters ();
CheckBox* _burnt_subtitle;
LanguageTagWidget* _burnt_subtitle_language;
CheckBox* _ignore_video;
+ CheckBox* _sign_language;
};
if (content->video) {
content->video->set_use(!dialog->ignore_video());
content->video->set_burnt_subtitle_language(dialog->burnt_subtitle_language());
+ content->video->set_type(dialog->video_type());
}
auto ffmpeg = dynamic_pointer_cast<FFmpegContent>(content);