openvideo::State Class Reference
[Core Classes]
A State is used to pass data along OpenVideo's graph.
More...
#include <State.h>
Inherited by openvideo::DSVLSrcState, openvideo::ImageSrcState, openvideo::TestSrcState, openvideo::V4L2SrcState, and openvideo::VideoWrapperSrcState.
Public Member Functions | |
| State () | |
| virtual | ~State () |
| void | clear () |
| void | addElement (std::string key, void *value) |
| void * | getElementData (std::string key) |
| void | removeElement (std::string key) |
| virtual Buffer * | getCurrentBuffer () |
| void | unlockAllBuffers () |
| Buffer * | findFreeBuffer () |
| int | getNumFrames () const |
| int | getNumLockedBuffers () const |
Public Attributes | |
| int | width |
| int | height |
| PIXEL_FORMAT | format |
Protected Attributes | |
| BufferVector | buffers |
| Buffer * | currentBuffer |
Private Attributes | |
| std::map< std::string, void * > | elements |
Detailed Description
A State is used to pass data along OpenVideo's graph.
An OpenTracker node passes exactly one state object to all of its children. Since each node is allowed to create a new State a node can in turn access multiple states.
The Statet implementation holds variables specific for video data like (image)width, (image)height, image(format) or the current(frame). On top of this, a State implements the ability to share any arbitraty data in its elements map. Therefore It provides functions to set, access and remove those data from the map.
The following drawing demonstrates the use of multiple State objects in an OpenVideo graph.
Definition at line 104 of file State.h.
Constructor & Destructor Documentation
|
|
constructor
Definition at line 234 of file State.h. References clear(). |
|
|
destructor
Definition at line 238 of file State.h. References clear(). |
Member Function Documentation
|
||||||||||||
|
Adds an Element to the element map.
Definition at line 253 of file State.h. References elements. |
|
|
Clear the entire State.
Definition at line 244 of file State.h. References currentBuffer, elements, format, openvideo::FORMAT_UNKNOWN, height, and width. Referenced by openvideo::VideoWrapperSrc::init(), openvideo::V4L2Src::init(), openvideo::TestSrc::init(), openvideo::OpenCVSrc::init(), openvideo::ImageSrc::init(), openvideo::DSVLSrc::init(), State(), and ~State(). |
|
|
Returns a frame with state STATE_UNUSED. If no frame can be found, NULL is returned.
Definition at line 86 of file State.cxx. References buffers. Referenced by openvideo::VideoWrapperSrc::process(), openvideo::TestSrc::process(), openvideo::DSVLSrc::process(), and openvideo::V4L2Src::processImage(). |
|
|
Returns the latest updated buffer.
Definition at line 153 of file State.h. Referenced by openvideo::GLUTSink::process(), and openvideo::GL_TEXTURE_2D_Sink::process(). |
|
|
Returns an element from the map.
Definition at line 259 of file State.h. References elements. |
|
|
|
|
|
Definition at line 97 of file State.cxx. References buffers. |
|
|
Remove an element from the map.
Definition at line 269 of file State.h. References elements. |
|
|
Unlocks all frame buffers.
Definition at line 78 of file State.cxx. References buffers. Referenced by openvideo::DSVLSrc::~DSVLSrc(), openvideo::ImageSrc::~ImageSrc(), and openvideo::V4L2Src::~V4L2Src(). |
Member Data Documentation
|
|
|
Definition at line 175 of file State.h. Referenced by clear(), openvideo::VideoWrapperSrcState::setCurrentBuffer(), openvideo::V4L2SrcState::setCurrentBuffer(), openvideo::ImageSrcState::setCurrentBuffer(), and openvideo::DSVLSrcState::setCurrentBuffer(). |
|
|
A map to store additional data in the State.
Definition at line 170 of file State.h. Referenced by addElement(), clear(), getElementData(), and removeElement(). |
|
|
Store the image format.
Definition at line 130 of file State.h. Referenced by clear(), openvideo::DSVLSrcBuffer::DSVLSrcBuffer(), openvideo::ImageSrcBuffer::ImageSrcBuffer(), openvideo::VideoWrapperSrc::init(), openvideo::V4L2Src::init(), openvideo::ImageSrc::init(), openvideo::DSVLSrc::init(), openvideo::OpenCVSrc::process(), openvideo::TestSrcBuffer::TestSrcBuffer(), and openvideo::VideoWrapperSrcBuffer::VideoWrapperSrcBuffer(). |
|
|
The documentation for this class was generated from the following files:
