hwapi/base: Improve frame allocation method

This allows us to cache existing frames, reducing the CPU and GPU memory load that appears due to constantly recreating frames.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-10-03 19:18:44 +02:00
parent d3f7b15633
commit 650b397ced
+6 -1
View File
@@ -55,8 +55,13 @@ namespace obsffmpeg {
public: public:
virtual AVBufferRef* create_device_context() = 0; virtual AVBufferRef* create_device_context() = 0;
virtual std::shared_ptr<AVFrame> allocate_frame(AVBufferRef* frames) = 0;
virtual void copy_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key,
uint64_t* next_lock_key, std::shared_ptr<AVFrame> frame) = 0;
virtual std::shared_ptr<AVFrame> avframe_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key, virtual std::shared_ptr<AVFrame> avframe_from_obs(AVBufferRef* frames, uint32_t handle, uint64_t lock_key,
uint64_t* next_lock_key) = 0; uint64_t* next_lock_key) = 0;
}; };
} // namespace hwapi } // namespace hwapi
} // namespace obsffmpeg } // namespace obsffmpeg