/* 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_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; 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 (shared_ptr f, boost::filesystem::path p) : Content (f, p) , VideoContent (f, p) , AudioContent (f, p) , SubtitleContent (f, p) { } FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node) : Content (f, node) , VideoContent (f, node) , AudioContent (f, node) , SubtitleContent (f, node) { 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 (); } } c = node->node_children ("AudioStream"); for (list >::const_iterator i = c.begin(); i != c.end(); ++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