FFmpegContent::FFmpegContent (shared_ptr<const Film> film, boost::filesystem::path p)
: Content (film, p)
+ , _encrypted (false)
{
}
_color_trc = get_optional_enum<AVColorTransferCharacteristic>(node, "ColorTransferCharacteristic");
_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)
_color_trc = ref->_color_trc;
_colorspace = ref->_colorspace;
_bits_per_pixel = ref->_bits_per_pixel;
+ _encrypted = ref->_encrypted;
}
void
if (_bits_per_pixel) {
node->add_child("BitsPerPixel")->add_child_text (raw_convert<string> (*_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> job)
{
+ ChangeSignaller<Content> cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
+ ChangeSignaller<Content> cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
job->set_progress_unknown ();
Content::examine (job);
_subtitle_streams = examiner->subtitle_streams ();
if (!_subtitle_streams.empty ()) {
text.clear ();
- text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE)));
+ text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_UNKNOWN)));
_subtitle_stream = _subtitle_streams.front ();
}
+ _encrypted = first_path.extension() == ".ecinema";
}
if (examiner->has_video ()) {
set_default_colour_conversion ();
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
string
void
FFmpegContent::set_subtitle_stream (shared_ptr<FFmpegSubtitleStream> s)
{
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
{
boost::mutex::scoped_lock lm (_mutex);
_subtitle_stream = s;
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
bool
void
FFmpegContent::set_filters (vector<Filter const *> const & filters)
{
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::FILTERS);
+
{
boost::mutex::scoped_lock lm (_mutex);
_filters = filters;
}
-
- signal_changed (FFmpegContentProperty::FILTERS);
}
string
void
FFmpegContent::signal_subtitle_stream_changed ()
{
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ /* XXX: this is too late; really it should be before the change */
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
}
vector<shared_ptr<FFmpegAudioStream> >