/* Copyright (C) 2013-2016 Carl Hetherington This file is part of DCP-o-matic. DCP-o-matic 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. DCP-o-matic 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 DCP-o-matic. If not, see . */ #ifndef DCPOMATIC_FFMPEG_CONTENT_H #define DCPOMATIC_FFMPEG_CONTENT_H #include "audio_stream.h" #include "content.h" #include "filter.h" struct AVFormatContext; struct AVStream; class FFmpegAudioStream; class FFmpegSubtitleStream; class Filter; class VideoContent; struct ffmpeg_pts_offset_test; struct audio_sampling_rate_test; class FFmpegContentProperty { public: static int constexpr SUBTITLE_STREAMS = 100; /** The chosen subtitle stream, or something about it */ static int constexpr SUBTITLE_STREAM = 101; static int constexpr FILTERS = 102; static int constexpr KDM = 103; }; class FFmpegContent : public Content { public: FFmpegContent(boost::filesystem::path); FFmpegContent(cxml::ConstNodePtr, boost::optional film_directory, int version, std::list &); FFmpegContent(std::vector>); std::shared_ptr shared_from_this() { return std::dynamic_pointer_cast(Content::shared_from_this()); } std::shared_ptr shared_from_this() const { return std::dynamic_pointer_cast(Content::shared_from_this()); } void examine(std::shared_ptr film, std::shared_ptr, bool tolerant) override; void take_settings_from(std::shared_ptr c) override; std::string summary() const override; std::string technical_summary() const override; void as_xml( xmlpp::Element* element, bool with_paths, PathBehaviour path_behaviour, boost::optional film_directory ) const override; dcpomatic::DCPTime full_length(std::shared_ptr film) const override; dcpomatic::DCPTime approximate_length() const override; std::string identifier() const override; void set_default_colour_conversion(); void set_filters(std::vector const&); std::vector> subtitle_streams() const { boost::mutex::scoped_lock lm(_mutex); return _subtitle_streams; } std::shared_ptr subtitle_stream() const { boost::mutex::scoped_lock lm(_mutex); return _subtitle_stream; } std::vector> ffmpeg_audio_streams() const; std::vector filters() const { boost::mutex::scoped_lock lm(_mutex); return _filters; } void set_subtitle_stream(std::shared_ptr); boost::optional first_video() const { boost::mutex::scoped_lock lm(_mutex); return _first_video; } void signal_subtitle_stream_changed(); /** Remove all IDs from any streams we have. This is only for working around changes * to stream identification in 2.18.26. */ void remove_stream_ids(); private: void add_properties(std::shared_ptr film, std::list &) const override; friend struct ffmpeg_pts_offset_test; friend struct audio_sampling_rate_test; std::vector> _subtitle_streams; std::shared_ptr _subtitle_stream; boost::optional _first_video; /** Video filters that should be used when generating DCPs */ std::vector _filters; boost::optional _color_range; boost::optional _color_primaries; boost::optional _color_trc; boost::optional _colorspace; boost::optional _bits_per_pixel; }; #endif