Basic release notes support (#2282).
[dcpomatic.git] / src / lib / ffmpeg.h
index b0769971e3e9c9f00f4812c51b3333badd6654f8..25d26e8136ad5a5d5b7cb28ee4012e1a87a8e228 100644 (file)
 
 #include "file_group.h"
 #include "ffmpeg_subtitle_period.h"
-#include "warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 extern "C" {
 #include <libavcodec/avcodec.h>
 }
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #include <boost/thread/mutex.hpp>
 
 
@@ -75,11 +75,14 @@ protected:
 
        AVFormatContext* _format_context = nullptr;
        std::vector<AVCodecContext*> _codec_context;
-       AVFrame* _frame = nullptr;
 
+       /** AVFrame used for decoding video */
+       AVFrame* _video_frame = nullptr;
        /** Index of video stream within AVFormatContext */
        boost::optional<int> _video_stream;
 
+       AVFrame* audio_frame (std::shared_ptr<const FFmpegAudioStream> stream);
+
        /* It would appear (though not completely verified) that one must have
           a mutex around calls to avcodec_open* and avcodec_close... and here
           it is.
@@ -92,6 +95,9 @@ private:
 
        static void ffmpeg_log_callback (void* ptr, int level, const char* fmt, va_list vl);
        static std::weak_ptr<Log> _ffmpeg_log;
+
+       /** AVFrames used for decoding audio streams; accessed with audio_frame() */
+       std::map<std::shared_ptr<const FFmpegAudioStream>, AVFrame*> _audio_frame;
 };