X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fffmpeg_raii.h;h=ad4edeae25292fbc41ef2f4f95d4e58f9ee6fdf9;hb=2f92c975a3cf9f4803a58267fd2a12765e34a69e;hp=00f7fc177af7fb45f124eb22b28c1bd57723ef85;hpb=79da5a221c1109e6ae536b68c5bfc2dfb4ee725b;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;