X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.h;h=fca3bf8beb3e52afff2494b0b5addbdfd198c2fd;hb=c008066160d85b9ec9e5485375d7baaa5d27bda2;hp=c546d69eb70e9a74107b2c8b3f860a17a3d14b30;hpb=39bc73fe192f932ed6695eb87b19de446e8b4f55;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index c546d69eb..fca3bf8be 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -31,88 +31,9 @@ struct AVFormatContext; struct AVStream; class Filter; -class ffmpeg_pts_offset_test; - -class FFmpegStream -{ -public: - FFmpegStream (std::string n, int i) - : name (n) - , _id (i) - {} - - FFmpegStream (cxml::ConstNodePtr); - - void as_xml (xmlpp::Node *) const; - - /** @param c An AVFormatContext. - * @param index A stream index within the AVFormatContext. - * @return true if this FFmpegStream uses the given stream index. - */ - bool uses_index (AVFormatContext const * c, int index) const; - AVStream* stream (AVFormatContext const * c) const; - - std::string technical_summary () const { - return "id " + boost::lexical_cast (_id); - } - - std::string identifier () const { - return boost::lexical_cast (_id); - } - - std::string name; - - friend bool operator== (FFmpegStream const & a, FFmpegStream const & b); - friend bool operator!= (FFmpegStream const & a, FFmpegStream const & b); - -private: - int _id; -}; - -class FFmpegAudioStream : public FFmpegStream -{ -public: - FFmpegAudioStream (std::string n, int i, int f, int c) - : FFmpegStream (n, i) - , frame_rate (f) - , channels (c) - , mapping (c) - { - mapping.make_default (); - } - - FFmpegAudioStream (cxml::ConstNodePtr, int); - - void as_xml (xmlpp::Node *) const; - - int frame_rate; - int channels; - AudioMapping mapping; - boost::optional first_audio; - -private: - friend class ffmpeg_pts_offset_test; - - /* Constructor for tests */ - FFmpegAudioStream () - : FFmpegStream ("", 0) - , frame_rate (0) - , channels (0) - , mapping (1) - {} -}; - -class FFmpegSubtitleStream : public FFmpegStream -{ -public: - FFmpegSubtitleStream (std::string n, int i) - : FFmpegStream (n, i) - {} - - FFmpegSubtitleStream (cxml::ConstNodePtr); - - void as_xml (xmlpp::Node *) const; -}; +class FFmpegSubtitleStream; +class FFmpegAudioStream; +struct ffmpeg_pts_offset_test; class FFmpegContentProperty : public VideoContentProperty { @@ -135,7 +56,7 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); } - void examine (boost::shared_ptr); + void examine (boost::shared_ptr, bool calculate_digest); std::string summary () const; std::string technical_summary () const; std::string information () const; @@ -152,6 +73,9 @@ public: void set_audio_mapping (AudioMapping); boost::filesystem::path audio_analysis_path () const; + /* SubtitleContent */ + bool has_subtitles () const; + void set_filters (std::vector const &); std::vector > subtitle_streams () const { @@ -187,8 +111,10 @@ public: return _first_video; } + std::list subtitles_during (ContentTimePeriod, bool starting) const; + private: - friend class ffmpeg_pts_offset_test; + friend struct ffmpeg_pts_offset_test; std::vector > _subtitle_streams; boost::shared_ptr _subtitle_stream;