]> git.sesse.net Git - nageru/blobdiff - ffmpeg_raii.h
Support audio-only FFmpeg inputs. Somewhat wonky, though.
[nageru] / ffmpeg_raii.h
index 0b112345d59727ca83728e638135bb3a0ab41159..33d233480528dd8414e92b3fd32b04c1281d4ffa 100644 (file)
@@ -18,7 +18,8 @@ struct AVDictionary;
 struct AVFormatContext;
 struct AVFrame;
 struct AVInputFormat;
-
+struct SwsContext;
+typedef struct AVIOInterruptCB AVIOInterruptCB;
 
 // AVFormatContext
 struct avformat_close_input_unique {
@@ -29,7 +30,13 @@ typedef std::unique_ptr<AVFormatContext, avformat_close_input_unique>
        AVFormatContextWithCloser;
 
 AVFormatContextWithCloser avformat_open_input_unique(
-       const char *pathname, AVInputFormat *fmt, AVDictionary **options);
+       const char *pathname, AVInputFormat *fmt,
+       AVDictionary **options);
+
+AVFormatContextWithCloser avformat_open_input_unique(
+       const char *pathname, AVInputFormat *fmt,
+       AVDictionary **options,
+       const AVIOInterruptCB &interrupt_cb);
 
 
 // AVCodecContext
@@ -62,4 +69,12 @@ typedef std::unique_ptr<AVFrame, av_frame_free_unique>
 
 AVFrameWithDeleter av_frame_alloc_unique();
 
+// SwsContext
+struct sws_free_context_unique {
+       void operator() (SwsContext *context) const;
+};
+
+typedef std::unique_ptr<SwsContext, sws_free_context_unique>
+       SwsContextWithDeleter;
+
 #endif  // !defined(_FFMPEG_RAII_H)