lobot::VideoStream Class Reference

Video stream wrapper for Lobot/Robolocust project. More...

#include <Robots/LoBot/io/LoVideoStream.H>

Collaboration diagram for lobot::VideoStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VideoStream (int camera_number, const Dims &resolution=LOBOT_DEFAULT_GRAB_SIZE, float frame_rate=LOBOT_DEFAULT_GRAB_RATE)
 VideoStream (const std::string &mpeg_file_name)
void update ()
Dims frameSize () const
float frameRate () const
ImageType readFrame () const

Detailed Description

Video stream wrapper for Lobot/Robolocust project.

This class wraps around lobot::Grabber and INVT's InputMPEGStream so that its clients can simply retrieve images either directly from multiple FireWire cameras or multiple MPEG files without having to be concerned about where or how those images were obtained.

Ideally, we would not need this class. Unfortunately, we need this hack since lobot::Grabber is not implemented within the INVT ModelComponent hierarchy to act as an InputFrameSeries.

Definition at line 112 of file LoVideoStream.H.


Constructor & Destructor Documentation

lobot::VideoStream::VideoStream ( int  camera_number,
const Dims resolution = LOBOT_DEFAULT_GRAB_SIZE,
float  frame_rate = LOBOT_DEFAULT_GRAB_RATE 
)

This constructor sets up a grabber to read input images directly from a FireWire camera. It expects to be passed the FireWire sub-channel ID (i.e., camera number) of the camera it is to be bound to.

Definition at line 59 of file LoVideoStream.C.

lobot::VideoStream::VideoStream ( const std::string mpeg_file_name  ) 

This constructor sets up an input MPEG stream to read input images from an MPEG file. It should be passed the name of the MPEG file name it is to read images from.

Definition at line 65 of file LoVideoStream.C.


Member Function Documentation

float lobot::VideoStream::frameRate (  )  const

This method returns the rate at which frames are read from the input video source. The returned number's units are frames per second.

Definition at line 97 of file LoVideoStream.C.

References FfmpegDecoder::peekFrameSpec().

Dims lobot::VideoStream::frameSize (  )  const

This method returns the size of the frames being read from the input video source.

Definition at line 88 of file LoVideoStream.C.

References FfmpegDecoder::peekFrameSpec().

Referenced by lobot::Compositor< pixel_type >::push_back().

ImageType lobot::VideoStream::readFrame (  )  const [inline]

As far as VideoStream clients are concerned, this method reads the next frame from the input video source (i.e., either a firewire camera or MPEG file) and returns it as an Image<PixRGB<byte>>. In actuality, this method returns the frame read and cached by an earlier call to the update() method. Clients of VideoStream should not use update() directly; that is designed to be called from an application's main loop (or similar structure/place). Instead, clients should call this method to retrieve frames from the input video sources.

Definition at line 166 of file LoVideoStream.H.

Referenced by lobot::VideoRecorder::update().

void lobot::VideoStream::update (  ) 

This method reads the next frame from the input video source (either camera or MPEG file) and caches it internally. This method is meant to be called from the main loop of the application/program rather than directly by clients. Clients should, instead, use the readFrame() method.

Definition at line 76 of file LoVideoStream.C.

References FfmpegDecoder::readRGB().

Referenced by lobot::App::run().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:30:39 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3