videoOpen(3mms) — Subroutines
Name
videoOpen --- Open a channel on the specified video device
Syntax
#include <mme/mme_api.h>
MMRESULT videoOpen(LPHVIDEO lphvideo,
DWORD dwDeviceID,
DWORD dwFlags);
Arguments
LPHVIDEO lphvideo
Specifies a pointer to an HVIDEO handle. The video capture and playback interface uses this location to return a handle that uniquely identifies the opened video device channel. Use this handle to identify the device channel when calling other video functions.
DWORD dwDeviceID
Identifies the video device to open. The value of dwDeviceID varies from zero to one fewer than the number of video capture devices installed in the system.
DWORD dwFlags
Flags for opening the video device. The following flags are defined:
VIDEO_EXTERNALIN
Specifies that the channel is opened for external input. Typically, external input channels capture images into a capture hardware frame buffer.
VIDEO_EXTERNALOUT
Specifies that the channel is opened for external output. Typically, external output channels display images stored in a playback hardware frame buffer on an auxiliary monitor or overlay.
VIDEO_IN
Specifies that the channel is opened for video input. Video input channels transfer images from a capture hardware frame buffer to system memory buffers.
VIDEO_OUT
Specifies that the channel is opened for video output. Video output channels transfer images from system memory buffers to a playback hardware frame buffer.
Description
The videoOpen function opens a channel on the specified video device. At a minimum, all video capture devices support a VIDEO_EXTERNALIN and a VIDEO_IN channel. The FullVideo Supreme, FullVideo Supreme JPEG, and Sound and Motion J300 option modules also supports VIDEO_EXTERNALOUT and VIDEO_OUT, but it does not support simultaneous video capture and playback. The FullVideo Supreme, FullVideo Supreme JPEG, and Sound and Motion J300 option modules can be opened as either a capture channel or a playback channel at any given time. Only one playback channel can be opened per currently supported video option modules.
The DV_ERR_ALLOCATED error code is returned if an attempt is made to open a device as one type (capture or playback) when it is already open as the other type.
Use the videoGetNumDevs function to determine the number of video devices present in the system.
Note that you must use the videoOpen function before calling the videoGetChannelCaps function. You must open a channel before calling the videoGetChannelCaps function.
Extensions
Digital has supplied software control of the external-out (VIDEO_EXTERNALOUT) and video-out (VIDEO_OUT) channels.
Return Values
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
DV_ERR_ALLOCATED@T{ The specified resource is already allocated. T} DV_ERR_BADDEVICEID@T{ The specified device ID is out of range. T} DV_ERR_NOMEM@T{ Unable to allocate or lock memory. T}
See Also
videoClose(3mms), videoGetNumDevs(3mms), videoStreamGetError(3mms),
videoStreamInit(3mms)