NVIDIA DeepStream SDK API Reference

9.2 Release
rs2::frame_queue Class Reference

Detailed Description

Public Member Functions

 frame_queue (unsigned int capacity, bool keep_frames=false)
 create frame queue. More...
 
 frame_queue ()
 
void enqueue (frame f) const
 enqueue new frame into the queue More...
 
frame wait_for_frame (unsigned int timeout_ms=5000) const
 wait until new frame becomes available in the queue and dequeue it More...
 
template<typename T >
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame (T *output) const
 poll if a new frame is available and dequeue if it is More...
 
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
 
void operator() (frame f) const
 Does the same thing as enqueue function. More...
 
size_t capacity () const
 Return the capacity of the queue. More...
 
bool keep_frames () const
 Return whether or not the queue calls keep on enqueued frames. More...
 
 frame_queue (unsigned int capacity, bool keep_frames=false)
 create frame queue. More...
 
 frame_queue ()
 
void enqueue (frame f) const
 enqueue new frame into the queue More...
 
frame wait_for_frame (unsigned int timeout_ms=5000) const
 wait until new frame becomes available in the queue and dequeue it More...
 
template<typename T >
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame (T *output) const
 poll if a new frame is available and dequeue if it is More...
 
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
 
void operator() (frame f) const
 Does the same thing as enqueue function. More...
 
size_t capacity () const
 Return the capacity of the queue. More...
 
bool keep_frames () const
 Return whether or not the queue calls keep on enqueued frames. More...
 

Constructor & Destructor Documentation

◆ frame_queue() [1/4]

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 sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References capacity(), rs2::error::handle(), rs2_create_frame_queue(), and rs2_delete_frame_queue().

◆ frame_queue() [2/4]

rs2::frame_queue::frame_queue ( )
inline

◆ frame_queue() [3/4]

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 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References capacity(), rs2::error::handle(), rs2_create_frame_queue(), and rs2_delete_frame_queue().

◆ frame_queue() [4/4]

rs2::frame_queue::frame_queue ( )
inline

Member Function Documentation

◆ capacity() [1/2]

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

Return the capacity of the queue.

Returns
capacity size

Definition at line 216 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

Referenced by frame_queue().

◆ capacity() [2/2]

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

Return the capacity of the queue.

Returns
capacity size

Definition at line 216 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

◆ enqueue() [1/2]

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 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::frame::keep(), and rs2_enqueue_frame().

◆ enqueue() [2/2]

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 sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::frame::keep(), and rs2_enqueue_frame().

Referenced by operator()().

◆ keep_frames() [1/2]

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 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

◆ keep_frames() [2/2]

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 sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

◆ operator()() [1/2]

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

Does the same thing as enqueue function.

Definition at line 208 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References enqueue(), and absl::move().

◆ operator()() [2/2]

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

Does the same thing as enqueue function.

Definition at line 208 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References enqueue(), and absl::move().

◆ poll_for_frame() [1/2]

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 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::error::handle(), and rs2_poll_for_frame().

◆ poll_for_frame() [2/2]

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 sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::error::handle(), and rs2_poll_for_frame().

Referenced by rs2::syncer::poll_for_frames(), and rs2::filter::process().

◆ try_wait_for_frame() [1/2]

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

◆ try_wait_for_frame() [2/2]

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

◆ wait_for_frame() [1/2]

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 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::error::handle(), and rs2_wait_for_frame().

◆ wait_for_frame() [2/2]

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 sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_processing.hpp.

References rs2::error::handle(), and rs2_wait_for_frame().

Referenced by rs2::syncer::wait_for_frames().


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