dmuVideoOut
Inherits from: dmuVideo
#include "dmuVideoOut.h"
Overview
The dmuVideoOut object sends dmBuffers it receives from its parent object to video output. As buffers come in, the videoOut
object keeps a handle to the latest buffer. The actual transfer to
the video output device happens in the handleEvents routine which
is called from the user program after a select call on the object's
file descriptor falls through. This ensures that the video output
queue is not filled faster than the output device can handle.
See the source code for more info and implementation details.
Public Methods
- dmuVideoOut()
Constructs and initializes a dmuVideoOut object. No VL path
construction or memory allocation happens here - That happens
in setup()
- ~dmuVideoOut()
The destructor destroys our video path, and shuts down the video
server (this behavior is inherited from dmuVideo).
- int setup(int destDevice = VL_ANY)
Setup creates the VL memory->video path for the object.
- int setDefaultControls()
This is a convenience method which will set all the video
controls to the default values. See the header file or the
dmuVideo documentation for more information.
- int init(dmuParams *params = NULL)
Init sets up the pointers and locks that will be used to keep
track of buffers used for the video transfer. This should be
called after the entire dmu chain has been set up, because this
method obtains the constraints of all of it's child objects
before creating the buffer pool. See the Overview section for
more information on init().
- int receive(DMbuffer inBuffer)
Handles dmbuffers that come down from the parent object. This
method is for internal library use, and shouldn't be called by
the user program.
- int handleEvents(fd_set fdSet)
Handles the VL events for the video path. This gets called from
the user program's main handle events loop whenever the select()
call on the videoOut objects file descriptor falls through.
HandleEvents will trigger the transfer of the most recent
DMBuffer that it has received from memory to the video output
device.
- int addSrcConstraints(DMparams *params)
For internal use only. Called by the parent objects init() method.
Control Value Methods
These methods set and get
control values on the video path. For now, you'll have to set
these controls after doing a setup () and
before doing an init() and start() See
man vlGetControl (3) for more information on the controls
listed here.
- int setZoom(int num, int denom)
The default Zoom factor is 1/1
- int setZoomSize(int x, int y)
ZoomSize is a control that works only on composite and s-video
sources. This control zooms the associated video down to the
size specified by x and y. Note that this may
not maintain the original aspect ratio of the video. This
control is particularly useful when texture mapping video, since
texture map dimensions have to be power of 2.
- int setPacking(int packing)
The default packing mode is VL_PACKING_ABGR_8.
- int setTiming(int timing)
Default timing is VL_TIMING_525_SQ_PIX
- int setFormat(int format)
Default format is: VL_FORMAT_RGB.
- int setCaptureType(int capType)
Default capture mode is VL_CAPTURE_INTERLEAVED.
- int setRate(int num, int denom)
Not currently used
- int setLayout(int layout)
Default layout is VL_LAYOUT_LINEAR. Use this layout if you
will be mapping the data, or performing any computation on
the buffer. Set ths value to VL_LAYOUT_GRAPHICS when dealing
with GL objects in the chain (eg texture maps), as this mode
is much faster (and sometimes required) when using Open GL
- int setSize(int width, int height)
Default size is the full, un-zoomed size of the video source
- int setOffset(int x, int y)
Default offset it (0,0)
- void getImageDimensions(int *returnWidth, int *returnHeight)
We override the default behaviors on these, so we can query the
video path directly
Return the size of a 'frame' which could be full frames, or could
be fields, depending on the capture mode.
- int getImageSizeX()
Return the size of a 'frame' which could be full frames, or could
be fields, depending on the capture mode.
- int getImageSizeY()
- void getBufferDimensions(int *returnWidth, int *returnHeight)
Return the size of a 'frame' which could be full frames, or could
be fields, depending on the capture mode.
- int getBufferSizeX()
Return the size of a 'frame' which could be full frames, or could
be fields, depending on the capture mode.
- int getBufferSizeY()
- int getBufferBytes(int *returnSize)
Return the size of a buffer which would be used for a single
video transfer (either a full frame, or a field, depending on the
capture mode). This is measured in bytes, not pixels as in
buffer dimensions.
Overview Object List Object Hierarchy
Sample Apps