Public Member Functions | Private Attributes | List of all members
rs2::frame_queue Class Reference

#include <rs_processing.hpp>

Public Member Functions

size_t capacity () const
 
void enqueue (frame f) const
 
 frame_queue (unsigned int capacity, bool keep_frames=false)
 
 frame_queue ()
 
bool keep_frames () const
 
void operator() (frame f) const
 
template<typename T >
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame (T *output) const
 
template<typename T >
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type try_wait_for_frame (T *output, unsigned int timeout_ms=5000) const
 
frame wait_for_frame (unsigned int timeout_ms=5000) const
 

Private Attributes

size_t _capacity
 
bool _keep
 
std::shared_ptr< rs2_frame_queue_queue
 

Detailed Description

Definition at line 134 of file rs_processing.hpp.

Constructor & Destructor Documentation

rs2::frame_queue::frame_queue ( unsigned int  capacity,
bool  keep_frames = false 
)
inlineexplicit

create frame queue. frame queues are the simplest x-platform synchronization primitive provided by librealsense to help developers who are not using async APIs param[in] capacity size of the frame queue param[in] keep_frames if set to true, the queue automatically calls keep() on every frame enqueued into it.

Definition at line 143 of file rs_processing.hpp.

rs2::frame_queue::frame_queue ( )
inline

Definition at line 152 of file rs_processing.hpp.

Member Function Documentation

size_t rs2::frame_queue::capacity ( ) const
inline

Return the capacity of the queue

Returns
capacity size

Definition at line 216 of file rs_processing.hpp.

void rs2::frame_queue::enqueue ( frame  f) const
inline

enqueue new frame into the queue

Parameters
[in]f- frame handle to enqueue (this operation passed ownership to the queue)

Definition at line 158 of file rs_processing.hpp.

bool rs2::frame_queue::keep_frames ( ) const
inline

Return whether or not the queue calls keep on enqueued frames

Returns
keeping frames

Definition at line 222 of file rs_processing.hpp.

void rs2::frame_queue::operator() ( frame  f) const
inline

Does the same thing as enqueue function.

Definition at line 208 of file rs_processing.hpp.

template<typename T >
std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type rs2::frame_queue::poll_for_frame ( T *  output) const
inline

poll if a new frame is available and dequeue if it is

Parameters
[out]f- frame handle
Returns
true if new frame was stored to f

Definition at line 183 of file rs_processing.hpp.

template<typename T >
std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type rs2::frame_queue::try_wait_for_frame ( T *  output,
unsigned int  timeout_ms = 5000 
) const
inline

Definition at line 195 of file rs_processing.hpp.

frame rs2::frame_queue::wait_for_frame ( unsigned int  timeout_ms = 5000) const
inline

wait until new frame becomes available in the queue and dequeue it

Returns
frame handle to be released using rs2_release_frame

Definition at line 169 of file rs_processing.hpp.

Member Data Documentation

size_t rs2::frame_queue::_capacity
private

Definition at line 226 of file rs_processing.hpp.

bool rs2::frame_queue::_keep
private

Definition at line 227 of file rs_processing.hpp.

std::shared_ptr<rs2_frame_queue> rs2::frame_queue::_queue
private

Definition at line 225 of file rs_processing.hpp.


The documentation for this class was generated from the following file:


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:40