PARP Research Group University of Murcia, Spain


QVMPlayerCamera Class Reference
[Video and image input/output group]

Class to create versatile video input blocks for the QVision application architecture. More...

#include <qvio/qvmplayerproxy.h>

Inherits QVCamera.

List of all members.

Public Slots

bool grab ()
 Grabs a frame from camera input.
void pauseCam ()
void unpauseCam ()
void nextFrameCam ()
void setSpeedCam (double d)
 Set the camera speed.
void seekCam (QVCamera::TSeekType type, double pos)
 Moves the camera file to a given position.
void closeCam ()
bool linkProperty (QString sourcePropertyName, QVPropertyContainer *destinyContainer, QString destinyPropertyName, LinkType linkType=AsynchronousLink)
 Links properties among QVPropertyContainer's.
bool linkProperty (QString sourcePropertyName, QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType=AsynchronousLink)
bool linkProperty (QVPropertyContainer *destinyContainer, QString destinyPropertyName, LinkType linkType=AsynchronousLink)
bool linkProperty (QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType=AsynchronousLink)
bool linkProperty (QString sourcePropertyName, QVPropertyContainer *destinyContainer, LinkType linkType=AsynchronousLink)
bool linkProperty (QString sourcePropertyName, QVPropertyContainer &destinyContainer, LinkType linkType=AsynchronousLink)
void linkProperty (QVPropertyContainer *container, LinkType linkType=AsynchronousLink)
 Links properties among QVPropertyContainer's.
void linkProperty (QVPropertyContainer &container, LinkType linkType=AsynchronousLink)
bool unlinkProperty (QString origName, QVPropertyContainer *destCont, QString destName)
 Unlinks properties among QVPropertyContainer's.
bool unlinkProperty (QString origName, QVPropertyContainer &destCont, QString destName)
void unlink ()
 Completely unlinks a property holder.
bool link (QVWorker *worker, const QString imageY, const QString imageU, const QString imageV)
bool link (QVWorker &worker, const QString imageY, const QString imageU, const QString imageV)
bool unlink (QVWorker *worker, const QString imageName)
bool unlink (QVWorker &worker, const QString imageName)

Public Member Functions

 QVMPlayerCamera (QString name=QString())
 ~QVMPlayerCamera ()
const QString getUrlBase () const
 Returns the current camera name (without path).
QVMPlayerProxy::OpenOptions getOptions () const
 Returns current camera options.
unsigned int getFramesUpdated () const
 Returns the total number of updated frames.
unsigned int getRows () const
 Returns the number of rows of the buffer.
unsigned int getCols () const
 Returns the number of cols of the buffer.
double getFPS () const
 Returns the camera speed in frames per second.
double getTimeLength () const
 Returns the video file length in seconds.
double getTimePos () const
 Returns the current video position in seconds.
double getSpeed () const
 Returns the current video speed.
unsigned int getFramesGrabbed () const
 Returns number of frames grabbed.
unsigned int getFramesRead () const
 Returns number of frames read.
bool isLiveCamera () const
 Tells if the camera is a live camera.


Detailed Description

Class to create versatile video input blocks for the QVision application architecture.

This is an implementation of the class QVCamera, based on the QVMPlayerProxy interface class for the MPlayer application.

This class can create input blocks to read frames from a video source, in a QVision application. The video sources can be any video file or device connected physically to the computer, or remotely through a network video stream. The class can read from a wide variety of media formats, becoming is a good, robust and versatile video input reader class.

For a detailed usage of this class in a QVision application, see section ProgrammingModel. To learn how to specify a given video source for the class, read QVMPlayerProxy class documentation. Specifically, the Video source identifier URL formats section.

See also:
QVMPlayerProxy

Definition at line 43 of file qvmplayercamera.h.


Constructor & Destructor Documentation

QVMPlayerCamera::QVMPlayerCamera ( QString  name = QString()  ) 

Constructs a QVMPlayerCamera, which is initially in "Closed" status.

Definition at line 46 of file qvmplayercamera.cpp.

QVMPlayerCamera::~QVMPlayerCamera (  ) 

Destroys a QVMPlayerCamera.

Definition at line 81 of file qvmplayercamera.cpp.


Member Function Documentation

const QString QVMPlayerCamera::getUrlBase (  )  const [inline]

Returns the current camera name (without path).

Returns:
Current camera name.
Deprecated:
Use getName() instead

Definition at line 77 of file qvmplayercamera.h.

QVMPlayerProxy::OpenOptions QVMPlayerCamera::getOptions (  )  const [inline]

Returns current camera options.

Returns:
Current camera options.

Definition at line 81 of file qvmplayercamera.h.

unsigned int QVMPlayerCamera::getFramesUpdated (  )  const [inline]

Returns the total number of updated frames.

Returns:
Current total number of updated frames.

Definition at line 85 of file qvmplayercamera.h.

unsigned int QVMPlayerCamera::getRows (  )  const [inline]

Returns the number of rows of the buffer.

Returns:
Number of rows.

Definition at line 89 of file qvmplayercamera.h.

unsigned int QVMPlayerCamera::getCols (  )  const [inline]

Returns the number of cols of the buffer.

Returns:
Number of cols.

Definition at line 93 of file qvmplayercamera.h.

double QVMPlayerCamera::getFPS (  )  const [inline]

Returns the camera speed in frames per second.

Returns:
Camera speed in frames per second.

Definition at line 97 of file qvmplayercamera.h.

double QVMPlayerCamera::getTimeLength (  )  const [inline]

Returns the video file length in seconds.

Returns:
Video length in seconds.

Definition at line 101 of file qvmplayercamera.h.

double QVMPlayerCamera::getTimePos (  )  const [inline]

Returns the current video position in seconds.

Returns:
Current video position in seconds.

Definition at line 105 of file qvmplayercamera.h.

double QVMPlayerCamera::getSpeed (  )  const [inline]

Returns the current video speed.

Returns:
Current video speed (as a multiplier of the FPS).

Definition at line 109 of file qvmplayercamera.h.

unsigned int QVMPlayerCamera::getFramesGrabbed (  )  const [inline]

Returns number of frames grabbed.

Returns:
Number of successful frames returned by grab's

Definition at line 113 of file qvmplayercamera.h.

unsigned int QVMPlayerCamera::getFramesRead (  )  const [inline]

Returns number of frames read.

Returns:
Number of frames actually read by a camera.

Definition at line 117 of file qvmplayercamera.h.

bool QVMPlayerCamera::isLiveCamera (  )  const [inline]

Tells if the camera is a live camera.

Returns:
True if camera is a live camera.

Definition at line 121 of file qvmplayercamera.h.

bool QVMPlayerCamera::grab (  )  [slot]

Grabs a frame from camera input.

Grabs an image, and stores it in the corresponding properties of the camera: "RGB image", "Y channel image", "U channel image", and "V channel image".

Parameters:
image QVImage that will store grabbed frame.
Returns:
TRUE if success, FALSE if fail.

Definition at line 112 of file qvmplayercamera.cpp.

Referenced by link(), linkProperty(), and unlinkProperty().

void QVMPlayerCamera::pauseCam (  )  [inline, slot]

Pauses the camera.

Definition at line 133 of file qvmplayercamera.h.

void QVMPlayerCamera::unpauseCam (  )  [inline, slot]

Unpauses the camera.

Definition at line 136 of file qvmplayercamera.h.

void QVMPlayerCamera::nextFrameCam (  )  [inline, slot]

Go to the next frame.

Definition at line 139 of file qvmplayercamera.h.

void QVMPlayerCamera::setSpeedCam ( double  d  )  [inline, slot]

Set the camera speed.

Parameters:
d Camera speed (as a multiplier of the FPS)

Definition at line 143 of file qvmplayercamera.h.

void QVMPlayerCamera::seekCam ( QVCamera::TSeekType  type,
double  pos 
) [inline, slot]

Moves the camera file to a given position.

Parameters:
type Type of seek: Current=0,Percentage=1,Absolute=2.
pos 
  • If in Current mode: Relative displacement with respect to the current position in seconds.
  • If in Percentage mode: Percentage of total video length.
  • If in Absolute mode: Absolute position in seconds.

Definition at line 151 of file qvmplayercamera.h.

void QVMPlayerCamera::closeCam (  )  [slot]

Closes the camera.

Definition at line 107 of file qvmplayercamera.cpp.

Referenced by ~QVMPlayerCamera().

bool QVMPlayerCamera::linkProperty ( QString  sourcePropName,
QVPropertyContainer destinyContainer,
QString  destinyPropName,
LinkType  linkType = AsynchronousLink 
) [virtual, slot]

Links properties among QVPropertyContainer's.

This method safely links properties among property holders in a thread safe manner. It is mainly used when programming multithreaded applications -with multiple QVWorkers-, but also, for example, when linking workers (running in an independent thread) with GUI widgets (running in the main thread).

The pointer this corresponds to the source QVPropertyContainer.

See also QVPropertyContainer::LinkType.

Parameters:
sourcePropName Identifying QString for the source property.
destinyContainer Pointer to the destination QVPropertyContainer.
destinyPropName Identifying QString for the destination property.
linkType Synchronous or asynchronous.
Returns:
TRUE if the connection went OK, FALSE otherwise (for example, due to type mismatch, some of the properties does not exists, or whatever).

Reimplemented from QVPropertyContainer.

Definition at line 140 of file qvmplayercamera.cpp.

Referenced by link(), linkProperty(), and main().

void QVMPlayerCamera::linkProperty ( QVPropertyContainer container,
LinkType  linkType = AsynchronousLink 
) [virtual, slot]

Links properties among QVPropertyContainer's.

This method safely links all input properties from a container with the same name and type output current container's properties, holders in a thread safe manner. It is mainly used when programming multithreaded applications -with multiple QVWorkers-, but also, for example, when linking workers (running in an independent thread) with GUI widgets (running in the main thread).

Parameters:
container Pointer to the destination QVPropertyContainer.
linkType Synchronous or asynchronous.

Reimplemented from QVPropertyContainer.

Definition at line 202 of file qvmplayercamera.cpp.

bool QVMPlayerCamera::unlinkProperty ( QString  origName,
QVPropertyContainer destCont,
QString  destName 
) [virtual, slot]

Unlinks properties among QVPropertyContainer's.

This method safely ulinks properties among property holders in a thread safe manner.

The pointer this corresponds to the source QVPropertyContainer.

See also QVPropertyContainer::LinkType.

Parameters:
origName Identifying QString for the source property.
destCont Pointer to the destination QVPropertyContainer.
destName Identifying QString for the destination property.
Returns:
TRUE if the disconnection went OK, FALSE otherwise (for example, due to type mismatch, some of the properties does not exists, or whatever).

Reimplemented from QVPropertyContainer.

Definition at line 212 of file qvmplayercamera.cpp.

Referenced by unlink(), and unlinkProperty().

void QVMPlayerCamera::unlink (  )  [virtual, slot]

Completely unlinks a property holder.

Deletes all the input and output links associated to the holder. Of course, all the corresponding necessary unlinks in other property holders are also performed.

Reimplemented from QVPropertyContainer.

Definition at line 245 of file qvmplayercamera.cpp.

Referenced by unlink().


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



QVision framework. PARP research group, copyright 2007, 2008.