Extract audio more correctly and neatly; support 7.1 in DCP naming; fix up lack of...
[dcpomatic.git] / src / lib / ffmpeg_decoder.h
index 739502d50205a87ecb5f11500767e88b3cf4bf4f..339afbaef368a1b85def1b1039301ea94dd039e1 100644 (file)
@@ -39,6 +39,7 @@ struct AVFormatContext;
 struct AVFrame;
 struct AVBufferContext;
 struct AVCodec;
+struct AVStream;
 class Job;
 class FilmState;
 class Options;
@@ -63,6 +64,11 @@ public:
        int audio_sample_rate () const;
        AVSampleFormat audio_sample_format () const;
        int64_t audio_channel_layout () const;
+       bool has_subtitles () const;
+       int bytes_per_audio_sample () const;
+
+       std::vector<AudioStream> audio_streams () const;
+       std::vector<SubtitleStream> subtitle_streams () const;
 
 private:
 
@@ -80,11 +86,16 @@ private:
 
        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;
@@ -94,6 +105,4 @@ private:
        AVCodec* _subtitle_codec;                ///< may be 0 if there is no subtitle
 
        AVPacket _packet;
-       AVSubtitle _subtitle;
-       bool _have_subtitle;
 };