Loading...
Searching...
No Matches
HostFramePool.hpp
Go to the documentation of this file.
1#pragma once
29#include <score_plugin_gfx_export.h>
30
33
34#include <cstddef>
35#include <mutex>
36#include <vector>
37
38namespace score::gfx::interop
39{
40
41class SCORE_PLUGIN_GFX_EXPORT HostFramePool
42{
43public:
46
47 HostFramePool(const HostFramePool&) = delete;
48 HostFramePool& operator=(const HostFramePool&) = delete;
49
53 bool allocate(std::size_t frameBytes, int frames, VendorDmaRegistrar reg);
54
57 void release();
58
59 bool valid() const noexcept { return !m_frames.empty(); }
60
62 FrameMemoryProvider provider();
63
65 bool owns(const void* p) const noexcept;
66
69 void recycle(void* p) noexcept;
70
71private:
72 VendorFrameMemory acquire() noexcept;
73
74 struct Frame
75 {
76 void* base{};
77 std::size_t bytes{};
78 bool inUse{};
79 };
80
81 std::mutex m_mutex;
82 std::vector<Frame> m_frames;
84};
85
86} // namespace score::gfx::interop
Vendor-neutral host-staged video OUTPUT helper.
Vendor-supplied pin / unpin callbacks shared by the GPU-direct and host-staged output helpers.
Definition HostFramePool.hpp:42
Vendor destination-frame memory for the direct-readback mode.
Definition CpuStagedVideoOutput.hpp:118
Definition VendorDmaRegistrar.hpp:41
One vendor destination frame for the direct-readback mode.
Definition CpuStagedVideoOutput.hpp:81