3 #include "gpu_frame.h"
\r
4 #include "frame_format.h"
\r
9 namespace caspar { namespace core {
\r
11 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
12 /// \struct frame_factory
\r
14 /// \brief Factory interface used to create frames.
\r
15 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
16 struct frame_factory
\r
18 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
19 /// \fn virtual ~frame_factory()
\r
21 /// \brief Destructor.
\r
22 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
23 virtual ~frame_factory(){}
\r
25 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
26 /// \fn virtual void release_frames(void* tag) = 0;
\r
28 /// \brief Releases the frame pool associated with the provided tag.
\r
30 /// \param tag Tag associated with the source frame pool.
\r
31 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
32 virtual void release_frames(void* tag) = 0;
\r
34 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
35 /// \fn virtual gpu_frame_ptr create_frame(size_t width, size_t height, void* tag) = 0;
\r
37 /// \brief Creates a frame from a pool associated with the provided tag.
\r
38 /// Frames are pooled on destruction and need to be released with *release_frames*.
\r
40 /// \param width The width.
\r
41 /// \param height The height.
\r
42 /// \param tag Tag associated with the source frame pool.
\r
45 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
46 virtual gpu_frame_ptr create_frame(size_t width, size_t height, void* tag) = 0;
\r
48 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
49 /// \fn virtual gpu_frame_ptr create_frame(const gpu_frame_desc& desc, void* tag) = 0;
\r
51 /// \brief Creates a frame from a pool associated with the provided tag.
\r
52 /// Frames are pooled on destruction and need to be released with *release_frames*.
\r
54 /// \param desc Information describing the frame.
\r
55 /// \param tag Tag associated with the source frame pool.
\r
58 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
59 virtual gpu_frame_ptr create_frame(const gpu_frame_desc& desc, void* tag) = 0;
\r
61 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
62 /// \fn gpu_frame_ptr create_frame(const frame_format_desc format_desc, void* tag)
\r
64 /// \brief Creates a frame from a pool associated with the provided tag.
\r
65 /// Frames are pooled on destruction and need to be released with *release_frames*.
\r
67 /// \param format_desc Information describing the frame format.
\r
68 /// \param tag Tag associated with the source frame pool.
\r
71 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
72 gpu_frame_ptr create_frame(const frame_format_desc format_desc, void* tag)
\r
74 return create_frame(format_desc.width, format_desc.height, tag);
\r
78 typedef std::shared_ptr<frame_factory> frame_factory_ptr;
\r