X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=c7a15619dd0e12d6c4eed919af2567d03932467d;hb=75538d19688ad8c29c5949de9bff9f044c713936;hp=05b6ae8ea8a9105952c858d3ae3bc5a116be2030;hpb=e65d31fbccad80c80f743516ecdd8269826d2114;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 05b6ae8ea..c7a15619d 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -65,6 +65,7 @@ int const FFmpegContentProperty::FILTERS = 102; FFmpegContent::FFmpegContent (shared_ptr film, boost::filesystem::path p) : Content (film, p) + , _encrypted (false) { } @@ -125,7 +126,8 @@ FFmpegContent::FFmpegContent (shared_ptr film, cxml::ConstNodePtr no _color_trc = get_optional_enum(node, "ColorTransferCharacteristic"); _colorspace = get_optional_enum(node, "Colorspace"); _bits_per_pixel = node->optional_number_child ("BitsPerPixel"); - + _decryption_key = node->optional_string_child ("DecryptionKey"); + _encrypted = node->optional_bool_child("Encrypted").get_value_or(false); } FFmpegContent::FFmpegContent (shared_ptr film, vector > c) @@ -187,6 +189,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, vector_color_trc; _colorspace = ref->_colorspace; _bits_per_pixel = ref->_bits_per_pixel; + _encrypted = ref->_encrypted; } void @@ -246,13 +249,19 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const if (_bits_per_pixel) { node->add_child("BitsPerPixel")->add_child_text (raw_convert (*_bits_per_pixel)); } + if (_decryption_key) { + node->add_child("DecryptionKey")->add_child_text (_decryption_key.get()); + } + if (_encrypted) { + node->add_child("Encypted")->add_child_text ("1"); + } } void FFmpegContent::examine (shared_ptr job) { - ContentChange cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS); - ContentChange cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM); + ChangeSignaller cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS); + ChangeSignaller cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM); job->set_progress_unknown (); @@ -311,6 +320,7 @@ FFmpegContent::examine (shared_ptr job) _subtitle_stream = _subtitle_streams.front (); } + _encrypted = first_path.extension() == ".ecinema"; } if (examiner->has_video ()) { @@ -369,7 +379,7 @@ FFmpegContent::technical_summary () const void FFmpegContent::set_subtitle_stream (shared_ptr s) { - ContentChange cc (this, FFmpegContentProperty::SUBTITLE_STREAM); + ChangeSignaller cc (this, FFmpegContentProperty::SUBTITLE_STREAM); { boost::mutex::scoped_lock lm (_mutex); @@ -410,7 +420,7 @@ FFmpegContent::full_length () const void FFmpegContent::set_filters (vector const & filters) { - ContentChange cc (this, FFmpegContentProperty::FILTERS); + ChangeSignaller cc (this, FFmpegContentProperty::FILTERS); { boost::mutex::scoped_lock lm (_mutex); @@ -630,7 +640,7 @@ void FFmpegContent::signal_subtitle_stream_changed () { /* XXX: this is too late; really it should be before the change */ - ContentChange cc (this, FFmpegContentProperty::SUBTITLE_STREAM); + ChangeSignaller cc (this, FFmpegContentProperty::SUBTITLE_STREAM); } vector >