X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=ffmpeg_raii.h;h=33d233480528dd8414e92b3fd32b04c1281d4ffa;hp=0b112345d59727ca83728e638135bb3a0ab41159;hb=4a0187ffb4075b4d217b8d9e9c96cac548b199d8;hpb=778a9bccf11b06d077eea4b32ccc0baf1e8cf01b diff --git a/ffmpeg_raii.h b/ffmpeg_raii.h index 0b11234..33d2334 100644 --- a/ffmpeg_raii.h +++ b/ffmpeg_raii.h @@ -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 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 AVFrameWithDeleter av_frame_alloc_unique(); +// SwsContext +struct sws_free_context_unique { + void operator() (SwsContext *context) const; +}; + +typedef std::unique_ptr + SwsContextWithDeleter; + #endif // !defined(_FFMPEG_RAII_H)