X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=1135cc9a3add1f07e2416bba28a279748120de8c;hb=d39bfb9a1360a83f3451b79d01fdc4f465ef21d3;hp=42e04e8381e270b88bb91af7bf9fb7661103ce6c;hpb=b468ccabdb13fca86ae8a324239d83490ef5832e;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 42e04e838..1135cc9a3 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -1,16 +1,39 @@ +/* + Copyright (C) 2013 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + #include #include "ffmpeg_content.h" -#include "ffmpeg_decoder.h" +#include "ffmpeg_examiner.h" #include "compose.hpp" #include "job.h" #include "util.h" +#include "filter.h" +#include "film.h" #include "log.h" #include "i18n.h" using std::string; +using std::stringstream; using std::vector; using std::list; +using std::cout; using boost::shared_ptr; using boost::lexical_cast; @@ -18,23 +41,24 @@ int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; int const FFmpegContentProperty::AUDIO_STREAMS = 102; int const FFmpegContentProperty::AUDIO_STREAM = 103; +int const FFmpegContentProperty::FILTERS = 104; -FFmpegContent::FFmpegContent (boost::filesystem::path f) - : Content (f) - , VideoContent (f) - , AudioContent (f) +FFmpegContent::FFmpegContent (shared_ptr f, boost::filesystem::path p) + : Content (f, p) + , VideoContent (f, p) + , AudioContent (f, p) { } -FFmpegContent::FFmpegContent (shared_ptr node) - : Content (node) - , VideoContent (node) - , AudioContent (node) +FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node) + : Content (f, node) + , VideoContent (f, node) + , AudioContent (f, node) { list > c = node->node_children ("SubtitleStream"); for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { - _subtitle_streams.push_back (FFmpegSubtitleStream (*i)); + _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (*i))); if ((*i)->optional_number_child ("Selected")) { _subtitle_stream = _subtitle_streams.back (); } @@ -42,11 +66,30 @@ FFmpegContent::FFmpegContent (shared_ptr node) c = node->node_children ("AudioStream"); for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { - _audio_streams.push_back (FFmpegAudioStream (*i)); + _audio_streams.push_back (shared_ptr (new FFmpegAudioStream (*i))); 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 ())); + } + + _first_video = node->optional_number_child