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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user