libcvd
Classes | Public Member Functions | List of all members
CVD::UVCBuffer< T > Class Template Reference

A live video buffer which uses the Video for Linux 2 (V4L2) API. More...

#include <uvcbuffer.h>

Inheritance diagram for CVD::UVCBuffer< T >:
Inheritance graph
[legend]
Collaboration diagram for CVD::UVCBuffer< T >:
Collaboration graph
[legend]

Public Member Functions

 UVCBuffer (const std::string &dev, ImageRef size, int frames_per_second=0, bool mjpeg=0, bool verbose=0)
 
virtual ImageRef size ()
 The size of the VideoFrames returned by this buffer.
 
virtual VideoFrame< T > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
virtual void put_frame (VideoFrame< T > *f)
 Tell the buffer that you are finished with this frame. More...
 
virtual bool frame_pending ()
 Is there a frame waiting in the buffer? This function does not block. More...
 
virtual double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
int num_buffers ()
 
- Public Member Functions inherited from CVD::VideoBuffer< T >
 VideoBuffer (VideoBufferType::Type _type)
 Construct the buffer with the known semantics.
 
virtual void flush ()
 Flush all old frames out of the video buffer, on a flushable buffer, causing the next get_frame() to sleep until a frame arrives. More...
 
VideoBufferType::Type type ()
 Returns the type of the video stream. More...
 
- Public Member Functions inherited from CVD::RawVideoBuffer
virtual RawVideoBuffersource_buffer ()
 Which video grabber provides the source images for this video grabber. More...
 
RawVideoBufferroot_buffer ()
 Follow the chain of video grabbers back as far as at will go. More...
 
virtual void seek_to (double)
 Go to a particular point in the video buffer (only implemented in buffers of recorded video) More...
 
- Public Member Functions inherited from CVD::UVC::RawUVCBuffer
 RawUVCBuffer (const std::string &dev, unsigned int fmt, ImageRef size, double frame_per_second, bool mjpeg, bool verbose)
 
ImageRef getSize ()
 
void fill_frame (void *)
 
double getRate ()
 
const std::string & device_name () const
 
 RawUVCBuffer (const RawUVCBuffer &)=delete
 
void operator= (const RawUVCBuffer &)=delete
 

Detailed Description

template<class T>
class CVD::UVCBuffer< T >

A live video buffer which uses the Video for Linux 2 (V4L2) API.

A replacement for the (deprecated?) V4L2Buffer

Member Function Documentation

◆ frame_pending()

template<class T >
virtual bool CVD::UVCBuffer< T >::frame_pending ( )
inlinevirtual

Is there a frame waiting in the buffer? This function does not block.

See is_live and is_flushable.

Implements CVD::RawVideoBuffer.

◆ put_frame()

template<class T >
virtual void CVD::UVCBuffer< T >::put_frame ( VideoFrame< T > *  f)
inlinevirtual

Tell the buffer that you are finished with this frame.

Typically the VideoBuffer then destroys the frame.

Parameters
fThe frame that you are finished with.

Implements CVD::VideoBuffer< T >.


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