UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
video_frame_pool Struct Reference

#include <video_frame_pool.h>

Collaboration diagram for video_frame_pool:
Collaboration graph

Classes

struct  impl
 

Public Member Functions

 video_frame_pool (unsigned int max_used_frames=0, video_frame_pool_allocator const &alloc=default_data_allocator())
 
 ~video_frame_pool ()
 
video_frame_pool_allocator const & get_allocator ()
 
struct video_frame * get_disposable_frame ()
 
std::shared_ptr< video_frame > get_frame ()
 
struct video_frame * get_pod_frame ()
 
video_frame_pool & operator= (video_frame_pool &&)
 
void reconfigure (struct video_desc new_desc, size_t new_size=SIZE_MAX)
 

Private Attributes

std::unique_ptr< impl > m_impl
 

Detailed Description

Definition at line 62 of file video_frame_pool.h.

Constructor & Destructor Documentation

◆ video_frame_pool()

video_frame_pool::video_frame_pool ( unsigned int max_used_frames = 0,
video_frame_pool_allocator const & alloc = default_data_allocator() )
Parameters
max_used_framesmaximal frames that are allocated. 0 means unlimited. If get_frames() is called and that number of frames is unreturned, get_frames() will block.

Definition at line 90 of file video_frame_pool.cpp.

92 : m_impl(std::make_unique<video_frame_pool::impl>(max_used_frames, alloc))
93{
94}
std::unique_ptr< impl > m_impl

Referenced by video_frame_pool_init().

◆ ~video_frame_pool()

video_frame_pool::~video_frame_pool ( )
default

Member Function Documentation

◆ get_allocator()

video_frame_pool_allocator const & video_frame_pool::get_allocator ( )

Definition at line 117 of file video_frame_pool.cpp.

118{
119 return m_impl->get_allocator();
120}

References m_impl.

◆ get_disposable_frame()

struct video_frame * video_frame_pool::get_disposable_frame ( )
Returns
legacy struct pointer with dispose callback properly set

Definition at line 107 of file video_frame_pool.cpp.

108{
109 return m_impl->get_disposable_frame();
110}

References m_impl.

Referenced by video_frame_pool_get_disposable_frame().

◆ get_frame()

std::shared_ptr< video_frame > video_frame_pool::get_frame ( )

Returns free frame

If the pool size is exhausted (see constructor param), the call will block until there is some available.

Definition at line 102 of file video_frame_pool.cpp.

103{
104 return m_impl->get_frame();
105}

References m_impl.

Referenced by vidcap_state_aja::CaptureFrames(), get_copy(), video_frame_pool::impl::get_disposable_frame(), and video_frame_pool::impl::get_pod_frame().

◆ get_pod_frame()

struct video_frame * video_frame_pool::get_pod_frame ( )
Returns
frame eligible to be freed by vf_free()

Definition at line 112 of file video_frame_pool.cpp.

113{
114 return m_impl->get_pod_frame();
115}

References m_impl.

◆ operator=()

video_frame_pool & video_frame_pool::operator= ( video_frame_pool && )
default

◆ reconfigure()

void video_frame_pool::reconfigure ( struct video_desc new_desc,
size_t new_size = SIZE_MAX )
Parameters
new_sizeif omitted, deduce from video desc (only for pixel formats)

Definition at line 97 of file video_frame_pool.cpp.

98{
99 m_impl->reconfigure(new_desc, new_size);
100}

References m_impl.

Referenced by j2k_compress_push(), and vidcap_state_aja::SetupHostBuffers().

Member Data Documentation

◆ m_impl

std::unique_ptr<impl> video_frame_pool::m_impl
private

The documentation for this struct was generated from the following files: