X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=f810d53be21374e27cd3e929214d04130fcb98b6;hb=362ed9ee4f73bee21b3ef8d3b449bb8e8877f501;hp=35f9f71f2fc98806c4d13089db93c34cb090b2dc;hpb=f0d79f2ee79becbcb7bc9065155eaa0963a6aa99;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 35f9f71f2..f810d53be 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, shared_ptr 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