]> git.sesse.net Git - nageru/blobdiff - shared/ffmpeg_raii.h
Fix a Clang 19 warning.
[nageru] / shared / ffmpeg_raii.h
index 33d233480528dd8414e92b3fd32b04c1281d4ffa..ad4edeae25292fbc41ef2f4f95d4e58f9ee6fdf9 100644 (file)
@@ -17,6 +17,7 @@ struct AVCodecParameters;
 struct AVDictionary;
 struct AVFormatContext;
 struct AVFrame;
+struct AVPacket;
 struct AVInputFormat;
 struct SwsContext;
 typedef struct AVIOInterruptCB AVIOInterruptCB;
@@ -30,14 +31,19 @@ typedef std::unique_ptr<AVFormatContext, avformat_close_input_unique>
        AVFormatContextWithCloser;
 
 AVFormatContextWithCloser avformat_open_input_unique(
-       const char *pathname, AVInputFormat *fmt,
+       const char *pathname, const AVInputFormat *fmt,
        AVDictionary **options);
 
 AVFormatContextWithCloser avformat_open_input_unique(
-       const char *pathname, AVInputFormat *fmt,
+       const char *pathname, const AVInputFormat *fmt,
        AVDictionary **options,
        const AVIOInterruptCB &interrupt_cb);
 
+AVFormatContextWithCloser avformat_open_input_unique(
+       int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+       void *opaque, const AVInputFormat *fmt, AVDictionary **options,
+       const AVIOInterruptCB &interrupt_cb);
+
 
 // AVCodecContext
 struct avcodec_free_context_unique {
@@ -69,6 +75,17 @@ typedef std::unique_ptr<AVFrame, av_frame_free_unique>
 
 AVFrameWithDeleter av_frame_alloc_unique();
 
+// AVPacket (ick!)
+// Not really unique from FFmpeg's point of view, but it is from ours
+struct av_packet_free_unique {
+       void operator() (AVPacket *packet) const;
+};
+
+typedef std::unique_ptr<AVPacket, av_packet_free_unique>
+       AVPacketWithDeleter;
+
+AVPacketWithDeleter av_packet_alloc_unique();
+
 // SwsContext
 struct sws_free_context_unique {
        void operator() (SwsContext *context) const;