X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=d15f3fd26a8fcbe47175fdb23e966964a1bd5d51;hb=bb0a36c3a6bea9cd1ebdde7b8a3a04765e317569;hp=88fc6dbd237c3aa09a020c474e91250f24865201;hpb=0eee0c3adda726542a5f2b8fad68f54ebf701392;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 88fc6dbd2..d15f3fd26 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,11 @@ */ +extern "C" { +#include +} #include +#include #include "ffmpeg_content.h" #include "ffmpeg_examiner.h" #include "compose.hpp" @@ -26,6 +30,7 @@ #include "filter.h" #include "film.h" #include "log.h" +#include "exceptions.h" #include "i18n.h" @@ -34,8 +39,10 @@ using std::stringstream; using std::vector; using std::list; using std::cout; +using std::pair; using boost::shared_ptr; -using boost::lexical_cast; +using boost::dynamic_pointer_cast; +using libdcp::raw_convert; int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; @@ -52,14 +59,14 @@ FFmpegContent::FFmpegContent (shared_ptr f, boost::filesystem::path } -FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node) +FFmpegContent::FFmpegContent (shared_ptr f, cxml::ConstNodePtr node, int version, list& notes) : Content (f, node) - , VideoContent (f, node) + , VideoContent (f, node, version) , AudioContent (f, node) - , SubtitleContent (f, node) + , SubtitleContent (f, node, version) { - list > c = node->node_children ("SubtitleStream"); - for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { + list c = node->node_children ("SubtitleStream"); + for (list::const_iterator i = c.begin(); i != c.end(); ++i) { _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (*i))); if ((*i)->optional_number_child ("Selected")) { _subtitle_stream = _subtitle_streams.back (); @@ -67,32 +74,51 @@ FFmpegContent::FFmpegContent (shared_ptr f, shared_ptrnode_children ("AudioStream"); - for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { - _audio_streams.push_back (shared_ptr (new FFmpegAudioStream (*i))); + for (list::const_iterator i = c.begin(); i != c.end(); ++i) { + _audio_streams.push_back (shared_ptr (new FFmpegAudioStream (*i, version))); if ((*i)->optional_number_child ("Selected")) { _audio_stream = _audio_streams.back (); } } c = node->node_children ("Filter"); - for (list >::iterator i = c.begin(); i != c.end(); ++i) { - _filters.push_back (Filter::from_id ((*i)->content ())); + for (list::iterator i = c.begin(); i != c.end(); ++i) { + Filter const * f = Filter::from_id ((*i)->content ()); + if (f) { + _filters.push_back (f); + } else { + notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), (*i)->content())); + } } - _first_video = node->optional_number_child