![]() |
University of Murcia, Spain ![]() |
QVMPlayerCamera Class ReferenceClass to create versatile video input blocks for the QVision application architecture.
More...
|
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. |
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.
Definition at line 43 of file qvmplayercamera.h.
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.
const QString QVMPlayerCamera::getUrlBase | ( | ) | const [inline] |
Returns the current camera name (without path).
Definition at line 77 of file qvmplayercamera.h.
QVMPlayerProxy::OpenOptions QVMPlayerCamera::getOptions | ( | ) | const [inline] |
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.
Definition at line 85 of file qvmplayercamera.h.
unsigned int QVMPlayerCamera::getRows | ( | ) | const [inline] |
Returns the number of rows of the buffer.
Definition at line 89 of file qvmplayercamera.h.
unsigned int QVMPlayerCamera::getCols | ( | ) | const [inline] |
Returns the number of cols of the buffer.
Definition at line 93 of file qvmplayercamera.h.
double QVMPlayerCamera::getFPS | ( | ) | const [inline] |
Returns the 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.
Definition at line 101 of file qvmplayercamera.h.
double QVMPlayerCamera::getTimePos | ( | ) | const [inline] |
Returns the current video position in seconds.
Definition at line 105 of file qvmplayercamera.h.
double QVMPlayerCamera::getSpeed | ( | ) | const [inline] |
Returns the current video speed.
Definition at line 109 of file qvmplayercamera.h.
unsigned int QVMPlayerCamera::getFramesGrabbed | ( | ) | const [inline] |
Returns number of frames grabbed.
Definition at line 113 of file qvmplayercamera.h.
unsigned int QVMPlayerCamera::getFramesRead | ( | ) | const [inline] |
Returns number of frames read.
Definition at line 117 of file qvmplayercamera.h.
bool QVMPlayerCamera::isLiveCamera | ( | ) | const [inline] |
Tells if the 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".
image | QVImage that will store grabbed frame. |
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.
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.
type | Type of seek: Current=0,Percentage=1,Absolute=2. | |
pos |
|
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.
sourcePropName | Identifying QString for the source property. | |
destinyContainer | Pointer to the destination QVPropertyContainer. | |
destinyPropName | Identifying QString for the destination property. | |
linkType | Synchronous or asynchronous. |
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).
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.
origName | Identifying QString for the source property. | |
destCont | Pointer to the destination QVPropertyContainer. | |
destName | Identifying QString for the destination property. |
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().