Inherits from: dmuVideo
#include "dmuVideoIn.h"
The dmuVideoIn class creates a video path from a single video input source (on an O2 with the pro-video option, this is either camera, composite video, or s-video input) into memory. After the transfer has been started, video events from the VL come into the object and trigger the file descriptor associated with the path to notify the user program. The user program should then call the handleEvents method on the dmuVideo object. If the video event is signaling the succesful capture of a full video frame (or field, depending on the CaptureType control value), then the video frame associated with the event is pulled into a DMbuffer, and propagated down the dmu chain. See dmuVideo for more information on control values and setup procedures for a dmuVideo class Note - There are known problems with capturing video into graphics-mode dmbuffers that are non-square in size. The best parameters for texture mapping are: 512x512, with the video origin set to 32.
See the source code for more info and implementation details.
If fd_set has the file descriptor for the video path set, then handleEvents will receive the next event on the VL video queue and process it. If this event is a VLTransferComplete event, signaling that a frame is ready, then the new frame is pulled into the DMbuffer pool, and all of the child objects are notified.
Return Values: dmuVideoIn uses a different convention
for return values than most objects in libDMU. The current
implementation returns either VIDEOIN_RANDOM_EVENT or
VIDEOIN_TRANSFER_COMPLETE if a video event was received
sucessfully, depending on what video event was received. These
two values are used to make debugging problems with the video
driver easier, as it sometimes happens that VLTransferComplete
events aren't caught. If a program notices that a dmuVideoIn
object is not receiving VLTranferComplete events, but is
receiving a number of other video events, it may want to restart
the tranfer (by deleting the dmuVideoIn object and recreating
it). Once the problem is tracked down, the object will only
receive TransferComplete events. If an error occurs in handling
an event, or if there is no valid event in the path's event
queue, then an error value is returned (see dmuError.h)