X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_decoder.h;h=e92b326b8ac588e8a73e8898a0a01bfd61cf779f;hb=cc4a67b7eb8ecaed076e261960848f70e3e741af;hp=8e7d685805264213925102da1fd27968d9c0a5b8;hpb=4928ece9b10df775ab3003c024f52bdd30d8f591;p=dcpomatic.git diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 8e7d68580..e92b326b8 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -44,6 +44,7 @@ class FilmState; class Options; class Image; class Log; +class Subtitle; /** @class FFmpegDecoder * @brief A decoder using FFmpeg to decode content. @@ -63,6 +64,7 @@ public: int audio_sample_rate () const; AVSampleFormat audio_sample_format () const; int64_t audio_channel_layout () const; + bool has_subtitles () const; private: @@ -76,16 +78,23 @@ private: void setup_general (); void setup_video (); void setup_audio (); + void setup_subtitle (); + + void maybe_add_subtitle (); AVFormatContext* _format_context; int _video_stream; - int _audio_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; AVCodecContext* _video_codec_context; AVCodec* _video_codec; - AVCodecContext* _audio_codec_context; - AVCodec* _audio_codec; + AVCodecContext* _audio_codec_context; ///< may be 0 if there is no audio + AVCodec* _audio_codec; ///< may be 0 if there is no audio + AVCodecContext* _subtitle_codec_context; ///< may be 0 if there is no subtitle + AVCodec* _subtitle_codec; ///< may be 0 if there is no subtitle AVPacket _packet; + boost::shared_ptr _subtitle; };