MCI_SETVIDEO

This MCI command message sets various values associated with video and image playback and capture.

Parameters

DWORD lParam1

The following flags apply to all devices supporting MCI_SETVIDEO:


MCI_NOTIFY

Specifies that MCI should post the MM_MCINOTIFY message when this command completes. The window that receives this message is specified in the dwCallback field of the data structure identified by lParam2.

MCI_TEST

Queries the device to determine if it can execute the command. The device returns an error if it is incapable of executing the command. It returns no error if it can handle the command. MCI returns control to the application without executing the command.

MCI_WAIT

Specifies that the set operation should finish before MCI returns control to the application.

MCI_DGV_SETVIDEO_ITEM

Indicates a video constant is specified in the dwAdjustParm field of the data structure identified by lParam2. The constant identifies the value that is being set. The following constants are defined:


MCI_DGV_SETVIDEO_BRIGHTNESS

Indicates that the video brightness level is specified as a factor in the dwValue field of the data structure identified by lParam2.

MCI_DGV_SETVIDEO_BITSPERPEL

Indicates that the number of bits per pixel is specified in the dwValue field of the data structure identified by lParam2. The number of bits per pixel is used for saving captured or recorded data.

MCI_DGV_SETVIDEO_COLOR

Indicates that the video color saturation level is specified as a factor in the dwValue field of the data structure identified by lParam2.

MCI_DGV_SETVIDEO_CONTRAST

Indicates that the video contrast level is specified as a factor in the dwValue field of the data structure identified by lParam2.

MCI_DGV_SETVIDEO_GAMMA

Indicates that a gamma correction exponent value is specified in the dwValue field of the data structure identified by lParam2. Gamma correction adjusts the mapping between the intensity encoded in the presentation source and the displayed brightness. The value is the exponent multiplied by 1000. For example, 2200 indicates an exponent of 2.2. A value of 1000 indicates an exponent of 1 which applies no gamma correction.

MCI_DGV_SETVIDEO_SOURCE

Indicates a constant specifying the source of the video input is specified in the dwValue field of the data structure identified by lParam2. The following constants are defined:

MCI_DGV_SETVIDEO_SRC_NTSC—

Specifies NTSC.

MCI_DGV_SETVIDEO_SRC_RGB—

Specifies RGB.

MCI_DGV_SETVIDEO_SRC_SVIDEO—

Specifies SVIDEO.

MCI_DGV_SETVIDEO_SRC_PAL—

Specifies PAL.

MCI_DGV_SETVIDEO_SRC_SECAM—

Specifies SECAM.

MCI_DGV_SETVIDEO_TINT

Indicates a video tint value is specified as a factor in the dwValue field of the data structure identified by lParam2. Typically, this adjustment is modeled after the tint control of many color television sets, with 250 meaning green, 750 meaning red, and 0 (or 1000) meaning blue. The nominal value is always 500.

MCI_DGV_SETVIDEO_SHARPNESS

Indicates a video sharpness value is specified as a factor in the dwValue field of the data structure identified by lParam2.

MCI_DGV_SETVIDEO_PALHANDLE

Indicates a palette handle is specified in the dwValue field of the data structure identified by lParam2. The palette handle is contained in the low-order word. Digital-video devices should not free the palette passed with this command. Applications should free it after they close the device. This flag is supported only by devices that use palettes. If this specified palette handle is zero then the default palette is used.

MCI_DGV_SETVIDEO_FRAME_RATE

Indicates a frame rate is specified in the dwValue field of the data structure identified by lParam2. The rate is specified in units of frames per second times 1000. For example, 29.97 frames per second is specified as 29970.

MCI_DGV_SETVIDEO_KEY_INDEX

Indicates a key index value is specified in the dwValue field of the data structure identified by lParam2. The index parameter is a physical palette index.

MCI_DGV_SETVIDEO_KEY_COLOR

Indicates a key color is specified in the dwValue field of the data structure identified by lParam2. The key color is a Windows RGB value.

MCI_DGV_SETVIDEO_STREAM

Indicates a video stream is specified in the dwValue field of the data structure identified by lParam2. The integer value specifies the video stream played back from the workspace. If the stream is not specified and the file format does not define a default stream, the first physically interleaved video stream is played.


MCI_DGV_SETVIDEO_ALG

Indicates the lpstrAlgorithm field of the MCI_DGV_SETAUDIO_PARMS data structure contains a pointer to a buffer containing the name of a video compression algorithm. The compression algorithm is used by subsequent MCI_RESERVE or MCI_RECORD commands. The available algorithms are device dependent.

If the specified algorithm is incompatible with the current file format, the file format is changed to the default format for the algorithm.

MCI_DGV_SETVIDEO_CLOCKTIME

When used with MCI_DGV_SETAUDIO_OVER, indicates time is specified in milliseconds and is absolute time. (This time is not in step with the playing of the workspace.)

MCI_DGV_SETVIDEO_OVER

Specifies a transition length parameter is included in the dwOver field of the data structure identified by lParam2. The transition length specifies how long (in units of the current time format) it should take to make a change. If this flag is not used, the change occurs immediately.

MCI_DGV_SETVIDEO_RECORD

Specifies whether recording should include or exclude video data. When combined with MCI_SET_ON, video data is recorded. When combined with MCI_SET_OFF video data is excluded. The default includes video data.

MCI_DGV_SETVIDEO_STILL

Indicates the algorithm name or quality value specified applies to still images.

Every device driver must support an algorithm of "none", which means no compression, and this is the default. In this case, digital-video devices save still images as RGB format DIBs.

MCI_SET_ON

Enables video output.

MCI_SET_OFF

Disables video output. For digital-video devices, disabling video sets the pixels in the destination rectangle defined by MCI_PUT (or its default

the client region of the current window) to a solid color but it has no effect on the frame buffer. You can hide the window with the MCI_WINDOW command if desired. The source of video, whether it's the workspace or an external input, might continue to store new images in the frame buffer but they will not be displayed until the video is enabled. While applications should use the MCI_SETVIDEO command to control this function, digital-video devices still must support this flag. The default value after an open is on.

MCI_DGV_SETVIDEO_QUALITY

Indicates the lpstrQuality field of the MCI_DGV_SETAUDIO_PARMS data structure contains a pointer to a buffer describing the video quality. A text-string in the buffer specifies the characteristics of the video compression algorithm.

The MCI_DGV_SETVIDEO_ALG flag can be used to select a quality desciptor for the specified algorithm. If this flag is omitted then the current algorithm is used.

The algorithms and descriptor names available depend on the device. Each device will supply documentation for the available algorithms and a description of the applicable descriptor names. The MCI_QUALITY command can define additional descriptor names.All devices support the descriptors low, medium and high. The default is driver specific.

MCI_DGV_SETVIDEO_SRC_NUMBER

Indicates a number for the video source is specified in the dwSourceNumber field of the data structure identified by lParam2. If there is more than one input of the type specified by the MCI_DGV_SETVIDEO_VALUE flag, the value selects the input. This flag must always be used with MCI_DGV_SETVIDEO_SOURCE but if the MCI_DGV_SETVIDEO_VALUE flag is omitted then the specified source number indicates the absolute source to used as specified in the MCI_LIST command.

MCI_DGV_SETVIDEO_VALUE

Indicates a value is included in the dwValue field of the data structure identified by lParam2. The meaning of the value is specified by the MCI_DGV_SETVIDEO_ITEM flag.

MCI_DGV_SETVIDEO_INPUT

Modifies the MCI_DGV_SETVIDEO_BRIGHTNESS, MCI_DGV_SETVIDEO_COLOR, MCI_DGV_SETVIDEO_CONTRAST, MCI_DGV_SETVIDEO_GAMMA, MCI_DGV_SETVIDEO_SHARPNESS, or MCI_DGV_SETVIDEO_TINT so that it affects the input signal and modifies what is recorded. If possible, this is the default when monitoring the input.

MCI_DGV_SETVIDEO_OUTPUT

Modifies the MCI_DGV_SETVIDEO_BRIGHTNESS, MCI_DGV_SETVIDEO_COLOR, MCI_DGV_SETVIDEO_CONTRAST, MCI_DGV_SETVIDEO_GAMMA, MCI_DGV_SETVIDEO_SHARPNESS, or MCI_DGV_SETVIDEO_TINT flag so that it modifies only the displayed signal and not what is recorded. If possible, this is the default when monitoring file.

LPMCI_DGV_SETVIDEO_PARMS lParam2

Specifies a far pointer to the MCI_DGV_SETVIDEO_PARMS data structure. This parameter replaces the standard default parameter data structure identified by lParam2.

Return Value

Returns zero if successful. Otherwise, it returns an MCI error code.

Comments

Some values are specified as factors. For these values, 0 represents a minimal amount of the specified characteristic, and 1000 represents the maximum value. The linearity of the mapping for these values is device-specific. If a device cannot set the requested value, it does the best it can, and it returns the actual setting for the characteristic in response to the MCI_STATUS command.