Remove old unused stuff.
[dcpomatic.git] / src / lib / ffmpeg_decoder.h
index 9b57b55894fcd62eec3a0b89ab3e1063f59c6e55..26b5d69792f42084d8b72cbad9c6cac5415e6282 100644 (file)
@@ -25,6 +25,7 @@
 #include <string>
 #include <stdint.h>
 #include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
 extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libpostproc/postprocess.h>
@@ -39,6 +40,7 @@ struct AVFormatContext;
 struct AVFrame;
 struct AVBufferContext;
 struct AVCodec;
+struct AVStream;
 class Job;
 class FilmState;
 class Options;
@@ -55,14 +57,16 @@ public:
        ~FFmpegDecoder ();
 
        /* Methods to query our input video */
-       int length_in_frames () const;
-       int decoding_frames () const;
        float frames_per_second () const;
        Size native_size () const;
        int audio_channels () const;
        int audio_sample_rate () const;
        AVSampleFormat audio_sample_format () const;
        int64_t audio_channel_layout () const;
+       bool has_subtitles () const;
+
+       std::vector<AudioStream> audio_streams () const;
+       std::vector<SubtitleStream> subtitle_streams () const;
 
 private:
 
@@ -78,11 +82,18 @@ private:
        void setup_audio ();
        void setup_subtitle ();
 
+       void maybe_add_subtitle ();
+
+       std::string stream_name (AVStream* s) const;
+
        AVFormatContext* _format_context;
        int _video_stream;
        int _audio_stream; ///< may be < 0 if there is no audio
        int _subtitle_stream; ///< may be < 0 if there is no subtitle
        AVFrame* _frame;
+
+       std::vector<AudioStream> _audio_streams;
+       std::vector<SubtitleStream> _subtitle_streams;
        
        AVCodecContext* _video_codec_context;
        AVCodec* _video_codec;
@@ -92,6 +103,7 @@ private:
        AVCodec* _subtitle_codec;                ///< may be 0 if there is no subtitle
 
        AVPacket _packet;
-       AVSubtitle _subtitle;
-       bool _have_subtitle;
+
+       boost::optional<double> _first_video;
+       boost::optional<double> _first_audio;
 };