X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fffmpeg_raii.h;h=ad4edeae25292fbc41ef2f4f95d4e58f9ee6fdf9;hb=fb65325fa7865b45d2799f3a916fcbae517e38cf;hp=00f7fc177af7fb45f124eb22b28c1bd57723ef85;hpb=bdc9f1ea04141e71906d486f9d254c3346835e72;p=nageru diff --git a/shared/ffmpeg_raii.h b/shared/ffmpeg_raii.h index 00f7fc1..ad4edea 100644 --- a/shared/ffmpeg_raii.h +++ b/shared/ffmpeg_raii.h @@ -17,6 +17,7 @@ struct AVCodecParameters; struct AVDictionary; struct AVFormatContext; struct AVFrame; +struct AVPacket; struct AVInputFormat; struct SwsContext; typedef struct AVIOInterruptCB AVIOInterruptCB; @@ -74,6 +75,17 @@ typedef std::unique_ptr 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 + AVPacketWithDeleter; + +AVPacketWithDeleter av_packet_alloc_unique(); + // SwsContext struct sws_free_context_unique { void operator() (SwsContext *context) const;