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

A video buffer from a Firewire (IEEE 1394) camera. More...

#include <dvbuffer.h>

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

Public Member Functions

 DVBuffer2 (int cam_no, int num_dma_buffers, int bright=-1, int exposure=-1, double fps=DC::cam_type< T >::fps)
 Construct a video buffer. More...
 
double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
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 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::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...
 
- Public Member Functions inherited from CVD::DC::RawDCVideo
 RawDCVideo (int camera_no, int num_dma_buffers, int bright, int exposure, int mode, double frame_rate)
 Construct a video buffer. More...
 
ImageRef size ()
 The size of the VideoFrames returned by this buffer.
 
VideoFrame< byte > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
void put_frame (VideoFrame< byte > *f)
 Tell the buffer that you are finished with this frame. More...
 
bool frame_pending ()
 Is there a frame waiting in the buffer? This function does not block.
 
void set_shutter (unsigned int s)
 Set the camera shutter speed. More...
 
unsigned int get_shutter ()
 Get the camera shutter speed.
 
void set_iris (unsigned int i)
 Set the camera iris. More...
 
unsigned int get_iris ()
 Get the camera iris.
 
void set_sharpness (unsigned int s)
 Set the camera sharpness. More...
 
unsigned int get_sharpness ()
 Get the camera sharpness.
 
void set_gain (unsigned int g)
 Set the camera gain. More...
 
unsigned int get_gain ()
 Get the camera gain.
 
void set_exposure (unsigned int e)
 Set the camera exposure. More...
 
unsigned int get_exposure ()
 Get the camera exposure.
 
void set_brightness (unsigned int b)
 Set the camera brightness. More...
 
unsigned int get_brightness ()
 Get the camera brightness.
 
void set_feature_value (unsigned int feature, unsigned int value)
 Set any DC1394 camera feature value. More...
 
unsigned int get_feature_value (unsigned int feature)
 Get any DC1394 camera feature value. More...
 
std::pair< unsigned int, unsigned int > get_feature_min_max (unsigned int feature)
 Get the min and max value of any camera feature. More...
 
void auto_on_off (unsigned int feature, unsigned int auto_value)
 Toggle auto on or off. More...
 
double frame_rate ()
 Get the camera frame rate.
 
raw1394handle_t & handle ()
 What is the handle for this device?
 
nodeid_t & node ()
 Which node is this device on?
 

Detailed Description

template<class T>
class CVD::DVBuffer2< T >

A video buffer from a Firewire (IEEE 1394) camera.

The requested image format depends on the templated pixel type. Frames of size 640 by 480 pixels are requested, at 30fps (except for CVD::Rgb<CVD::byte>, which is 15fps).

Parameters
TThe pixel type of the frames. Currently only <CVD::Rgb<CVD::byte> > CVD::yuv411> and CVD::byte> are supported.

Constructor & Destructor Documentation

◆ DVBuffer2()

template<class T >
CVD::DVBuffer2< T >::DVBuffer2 ( int  cam_no,
int  num_dma_buffers,
int  bright = -1,
int  exposure = -1,
double  fps = DC::cam_type<T>::fps 
)
inline

Construct a video buffer.

Parameters
cam_noThe camera number (the first camera is 0)
num_dma_buffersThe number of DMA buffers to use (at least 3 is recommended)
brightThe brightness correction (default = -1 = automatic)
exposureThe exposure correction (default = -1 = automatic)
fpsThe number of frames per second (default = 30fps)

Member Function Documentation

◆ frame_pending()

template<class T >
virtual bool CVD::DVBuffer2< 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::DVBuffer2< 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 >.

◆ seek_to()

template<class T >
virtual void CVD::DVBuffer2< T >::seek_to ( double  )
inlinevirtual

Go to a particular point in the video buffer (only implemented in buffers of recorded video)

Parameters
tThe frame time in seconds

Reimplemented from CVD::RawVideoBuffer.


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