summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-31 20:36:04 +0000
committerCarl Hetherington <cth@carlh.net>2018-10-31 20:36:04 +0000
commita60428e8a618c648fccab0d9c115f1d2a3dea2d2 (patch)
tree886c224f91dccd2014c73ee117d4cfcf4696a8e6 /src/lib/ffmpeg_content.cc
parente477bee9f3548641f78395cb4b2751751b14c085 (diff)
swaroop: beginning of encrypted MP4 / .ecinema.v2.13.65
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 70b867172..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<const Film> film, boost::filesystem::path p)
: Content (film, p)
+ , _encrypted (false)
{
}
@@ -126,6 +127,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no
_colorspace = get_optional_enum<AVColorSpace>(node, "Colorspace");
_bits_per_pixel = node->optional_number_child<int> ("BitsPerPixel");
_decryption_key = node->optional_string_child ("DecryptionKey");
+ _encrypted = node->optional_bool_child("Encrypted").get_value_or(false);
}
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
@@ -187,6 +189,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
_color_trc = ref->_color_trc;
_colorspace = ref->_colorspace;
_bits_per_pixel = ref->_bits_per_pixel;
+ _encrypted = ref->_encrypted;
}
void
@@ -249,6 +252,9 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
if (_decryption_key) {
node->add_child("DecryptionKey")->add_child_text (_decryption_key.get());
}
+ if (_encrypted) {
+ node->add_child("Encypted")->add_child_text ("1");
+ }
}
void
@@ -314,6 +320,7 @@ FFmpegContent::examine (shared_ptr<Job> job)
_subtitle_stream = _subtitle_streams.front ();
}
+ _encrypted = first_path.extension() == ".ecinema";
}
if (examiner->has_video ()) {