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/>.
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/>.
int const FFmpegContentProperty::SUBTITLE_STREAMS = 100;
int const FFmpegContentProperty::SUBTITLE_STREAM = 101;
int const FFmpegContentProperty::FILTERS = 102;
int const FFmpegContentProperty::KDM = 103;
int const FFmpegContentProperty::SUBTITLE_STREAMS = 100;
int const FFmpegContentProperty::SUBTITLE_STREAM = 101;
int const FFmpegContentProperty::FILTERS = 102;
int const FFmpegContentProperty::KDM = 103;
- video = VideoContent::from_xml (this, node, version);
+ _color_range = get_optional_enum<AVColorRange>(node, "ColorRange");
+
+ VideoRange const video_range_hint = (_color_range && *_color_range == AVCOL_RANGE_JPEG) ? VideoRange::FULL : VideoRange::VIDEO;
+
+ video = VideoContent::from_xml (this, node, version, video_range_hint);
- text = TextContent::from_xml (this, node, version);
+ text = TextContent::from_xml (this, node, version, notes);
- list<cxml::NodePtr> c = node->node_children ("SubtitleStream");
- for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
- _subtitle_streams.push_back (shared_ptr<FFmpegSubtitleStream> (new FFmpegSubtitleStream (*i, version)));
- if ((*i)->optional_number_child<int> ("Selected")) {
+ for (auto i: node->node_children("SubtitleStream")) {
+ _subtitle_streams.push_back (make_shared<FFmpegSubtitleStream>(i, version));
+ if (i->optional_number_child<int>("Selected")) {
- c = node->node_children ("AudioStream");
- for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<FFmpegAudioStream> as (new FFmpegAudioStream (*i, version));
+ for (auto i: node->node_children("AudioStream")) {
+ auto as = make_shared<FFmpegAudioStream>(i, version);
/* This is an old file and this stream is not selected, so un-map it */
as->set_mapping (AudioMapping (as->channels (), MAX_DCP_AUDIO_CHANNELS));
}
}
/* This is an old file and this stream is not selected, so un-map it */
as->set_mapping (AudioMapping (as->channels (), MAX_DCP_AUDIO_CHANNELS));
}
}
- c = node->node_children ("Filter");
- for (list<cxml::NodePtr>::iterator i = c.begin(); i != c.end(); ++i) {
- Filter const * f = Filter::from_id ((*i)->content ());
+ for (auto i: node->node_children("Filter")) {
+ Filter const * f = Filter::from_id(i->content());
- notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), (*i)->content()));
+ notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
_color_primaries = get_optional_enum<AVColorPrimaries>(node, "ColorPrimaries");
_color_trc = get_optional_enum<AVColorTransferCharacteristic>(node, "ColorTransferCharacteristic");
_colorspace = get_optional_enum<AVColorSpace>(node, "Colorspace");
_bits_per_pixel = node->optional_number_child<int> ("BitsPerPixel");
}
_color_primaries = get_optional_enum<AVColorPrimaries>(node, "ColorPrimaries");
_color_trc = get_optional_enum<AVColorTransferCharacteristic>(node, "ColorTransferCharacteristic");
_colorspace = get_optional_enum<AVColorSpace>(node, "Colorspace");
_bits_per_pixel = node->optional_number_child<int> ("BitsPerPixel");
}
if (fc->only_text() && fc->only_text()->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
throw JoinError (_("Content to be joined must use the same subtitle stream."));
}
if (fc->only_text() && fc->only_text()->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
throw JoinError (_("Content to be joined must use the same subtitle stream."));
}
- BOOST_FOREACH (AudioStreamPtr i, audio->streams ()) {
- shared_ptr<FFmpegAudioStream> f = dynamic_pointer_cast<FFmpegAudioStream> (i);
+ for (auto i: audio->streams()) {
+ auto f = dynamic_pointer_cast<FFmpegAudioStream> (i);
- for (vector<shared_ptr<FFmpegSubtitleStream> >::const_iterator i = _subtitle_streams.begin(); i != _subtitle_streams.end(); ++i) {
- xmlpp::Node* t = node->add_child("SubtitleStream");
- if (_subtitle_stream && *i == _subtitle_stream) {
+ for (auto i: _subtitle_streams) {
+ auto t = node->add_child("SubtitleStream");
+ if (_subtitle_stream && i == _subtitle_stream) {
- for (vector<Filter const *>::const_iterator i = _filters.begin(); i != _filters.end(); ++i) {
- node->add_child("Filter")->add_child_text ((*i)->id ());
+ for (auto i: _filters) {
+ node->add_child("Filter")->add_child_text(i->id());
- ChangeSignaller<Content> cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
- ChangeSignaller<Content> cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
+ ContentChangeSignaller cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
+ ContentChangeSignaller cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
if (examiner->has_video ()) {
video.reset (new VideoContent (this));
video->take_from_examiner (examiner);
}
if (examiner->has_video ()) {
video.reset (new VideoContent (this));
video->take_from_examiner (examiner);
}
if (fabs (rot - 180) < 1.0) {
_filters.push_back (Filter::from_id ("vflip"));
_filters.push_back (Filter::from_id ("hflip"));
if (fabs (rot - 180) < 1.0) {
_filters.push_back (Filter::from_id ("vflip"));
_filters.push_back (Filter::from_id ("hflip"));
longest = max (longest, Frame(llrint(i->length())));
}
return DCPTime::from_frames (longest, 24);
}
longest = max (longest, Frame(llrint(i->length())));
}
return DCPTime::from_frames (longest, 24);
}
/** Our subtitle streams have colour maps, which can be changed, but
* they have no way of signalling that change. As a hack, we have this
* method which callers can use when they've modified one of our subtitle
/** Our subtitle streams have colour maps, which can be changed, but
* they have no way of signalling that change. As a hack, we have this
* method which callers can use when they've modified one of our subtitle
FFmpegContent::signal_subtitle_stream_changed ()
{
/* XXX: this is too late; really it should be before the change */
FFmpegContent::signal_subtitle_stream_changed ()
{
/* XXX: this is too late; really it should be before the change */
- BOOST_FOREACH (AudioStreamPtr i, audio->streams()) {
- fa.push_back (dynamic_pointer_cast<FFmpegAudioStream> (i));
+ for (auto i: audio->streams()) {
+ fa.push_back (dynamic_pointer_cast<FFmpegAudioStream>(i));