dmuLatch
Inherits from: dmuObj
#include "dmuLatch.h"
Overview
This object allows you to grab a buffer and then manipulate is
however you want. Then you can send the buffer down the rest
of the chain. There are other classes that subclass from this one
which associates gl contexts and pbuffer with the buffer past in.
While you have a buffer in the grab()ed state, other buffer could
come down the chain. It will ignore all the buffers until you grab
again. When you grab, you always get the most current buffer that
has come down the chain.
See the source code for more info and implementation details.
Public Methods
- dmuLatch()
Constructs and initialization of member variables.This class is
intended as a base class, and should not be instantiated
directly.
- ~dmuLatch()
Destroys the object, and the PBuffer that is associated with
the object.
- int setup()
This method create the semaphores needed to create the latch
- virtual int init(dmuParams *params = NULL)
This method meerly calls init on it's parents
- virtual int grab()
This method grabs the most recent DMBuffer that we've receive()'d
and locks it. The locked buffer can then be used for other things.
The buffer remains valid and usable until we release() it. While we
have a buffer grab()ed, other buffer can be coming down the chain,
but this object will ignore then until we grab() again.
- virtual int release()
This unlocks the currently latched buffer so we can grab another one.
If the object current has a latched buffer, it will be propagated down
to the children. This facilitates compositing operations.
- virtual int addSrcConstraints(DMparams *params)
If this class is acting as a destination for another object in a
chain, this method is used to notify the parent object (i.e. the
source object) of any constraints which the video path may have
on its source. These constraints are added to the params
parameter structure. addSrcConstraints() is ususally called
internally in the library during the init() method of the parent
object. It is rarely, if ever, used by user programs.
- virtual int addDstConstraints(DMparams *params)
Similar to addSrcConstraints. Our desination constraints are the same
as our parents destination constraints, so that's what we add.
- virtual int receive(DMbuffer inBuffer)
This method is used internal to the library. It is called by the
parent object to notify the object that there is new data for it
to grab.
- virtual unsigned char* mapBuffer()
This method returns a pointer to the data within the currently
latched buffer
- virtual int handleEvents(fd_set fdSet)
You can use this method to pass buffer right through the latch object
Overview Object List Object Hierarchy
Sample Apps