Fix a reference leak of hw_frames_ctx and prepare for QSV (#736)

This commit is contained in:
Cameron Gutman
2023-01-10 13:52:15 -06:00
committed by GitHub
parent 5477f58f18
commit 44ad28ebf4
7 changed files with 92 additions and 69 deletions

View File

@@ -17,6 +17,8 @@
struct sockaddr;
struct AVFrame;
struct AVBufferRef;
struct AVHWFramesContext;
// Forward declarations of boost classes to avoid having to include boost headers
// here, which results in issues with Windows.h and WinSock2.h include order.
@@ -196,13 +198,18 @@ struct hwdevice_t {
/**
* implementations must take ownership of 'frame'
*/
virtual int set_frame(AVFrame *frame) {
virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx) {
BOOST_LOG(error) << "Illegal call to hwdevice_t::set_frame(). Did you forget to override it?";
return -1;
};
virtual void set_colorspace(std::uint32_t colorspace, std::uint32_t color_range) {};
/**
* Implementations may set parameters during initialization of the hwframes context
*/
virtual void init_hwframes(AVHWFramesContext *frames) {};
virtual ~hwdevice_t() = default;
};