X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=4ae5546c2c2daa38a76a07c770eba837f572047a;hb=3753cb8685e1755b067676345a5871db24149d0f;hp=1135cc9a3add1f07e2416bba28a279748120de8c;hpb=d39bfb9a1360a83f3451b79d01fdc4f465ef21d3;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 1135cc9a3..4ae5546c2 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,6 +17,9 @@ */ +extern "C" { +#include +} #include #include "ffmpeg_content.h" #include "ffmpeg_examiner.h" @@ -26,6 +29,7 @@ #include "filter.h" #include "film.h" #include "log.h" +#include "exceptions.h" #include "i18n.h" @@ -34,8 +38,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; int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; @@ -47,17 +53,19 @@ FFmpegContent::FFmpegContent (shared_ptr f, boost::filesystem::path : Content (f, p) , VideoContent (f, p) , AudioContent (f, p) + , SubtitleContent (f, p) { } -FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node) +FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node, int version) : Content (f, node) - , VideoContent (f, node) + , VideoContent (f, node, version) , AudioContent (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 (); @@ -65,31 +73,46 @@ 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) { + for (list::iterator i = c.begin(); i != c.end(); ++i) { _filters.push_back (Filter::from_id ((*i)->content ())); } - _first_video = node->optional_number_child