Compaq Multimedia Services
for OpenVMS Alpha
Programmer's Guide


Previous Contents Index


videoSetBrightness

Name videoSetBrightness --- Set current brightness value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetBrightness(HVIDEO hVideo, 
                            DWORD dwBrightness); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwBrightness
Specifies the brightness value. This value ranges from 0 to 10,000.


Description

The videoSetBrightness function sets the current brightness value. This brightness value is applied to the 8-bit X image data returned to the application. This request is not supported for video playback using a single buffer.
Extensions The videoSetBrightness function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetBrightness

videoSetContrast

Name videoSetContrast --- Set current contrast value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetContrast(HVIDEO hVideo, 
                          DWORD dwContrast); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwContrast
Specifies the contrast value. This value ranges from 0 to 10,000.


Description

The videoSetContrast function sets the current contrast value. This contrast value is applied to the 8-bit X image data returned to the application. This request is not supported for video playback using a single buffer.
Extensions The videoSetContrast function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetContrast

videoSetFieldMode

Name videoSetFieldMode --- Set the current video field mode Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetFieldMode(HVIDEO hVideo, 
                           DWORD dwMode); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwMode
Specifies the field mode. The mode must be one of the following:

VIDEO_MODE_FRAME
VIDEO_MODE_FRAME_EVEN_DOM
VIDEO_MODE_FRAME_ODD_DOM
VIDEO_MODE_FIELD_BOTH
VIDEO_MODE_FIELD_ODD_ONLY
VIDEO_MODE_FIELD_EVEN_ONLY

Description

The videoSetFieldMode function sets the current video field mode. Call this function after any calls to the videoSetStandard function and before any calls to the videoConfigure function with the DVM_FORMAT and VIDEO_CONFIGURE_SET flags. If you want to change the field mode after calling videoConfigure , you must call videoConfigure again after calling videoSetFieldMode .

Not all field modes are supported on all devices and not all field modes are supported for all formats.

Interlaced video data contains both even and odd fields. Each field is half the height of a full frame. The lines in each of the fields represent the even or odd lines in the full frame. Sometimes, just odd or even fields are acceptable to capture and playback to reduce the overhead required in processing data. At other times, full frames are required to prevent any loss of content. Some devices cannot return full frames of data, however. They may, though, be able to return alternating even and odd fields.

VIDEO_MODE_FRAME tells the hardware device to use full frames and indicates the default dominance of the device. (For more information about field mode dominance, see the subsection entitled Field Mode Dominance later in this section.) VIDEO_MODE_FIELD_EVEN_ONLY and VIDEO_MODE_FIELD_ODD_ONLY tell the device to use just the even or odd fields, respectively, dropping half the video information. VIDEO_MODE_FIELD_BOTH tells the device to use both odd and even fields. In all but the last mode, only one type of frame or field can be exchanged with the device. However, when the mode is VIDEO_MODE_FIELD_BOTH, the application must tell the device which field is involved.

The functions videoFrame and videoStreamAddBuffer have been extended to recognize a flag in the VIDEOHDR dwFlags field. VHDR_FIELD_ODD and VHDR_FIELD_EVEN tell the device which field to use the buffer for. On capture, the device will wait until the next specified field and fill in the buffer with that field. On playback, the device will play back the buffer during that field period. If buffers are not queued before the next field time, then that field and the next field will be missed because the device will have to wait for the next odd or even field, depending on the field specification.

When composing a full frame from two fields or decomposing a frame into two fields, the first line of the frame contains the first line of the even field, the second line of the frame contains the odd field, and so on. The following C-code fragment shows code to decompose a frame into two fields:


 
        char * fieldEven, * fieldOdd, * frame; 
        int width, height; 
        int i; 
 
        for ( i=0; i < height/2; i++) { 
            bcopy(&frame[(i*2)*width], &fieldEven[i*width], width); 
            bcopy(&frame[(i*2+1)*width], &fieldOdd[i*width], width); 
        } 
 

Note

Dithering on some devices depends on adjacent lines. If the device is returning alternating odd and even fields in a dithered format, then the quality of a resulting frame will not be as good as the quality from a captured frame. It might be possible to capture data in a nondithered format (such as YUV), compose the frame in that format, and then dither the resulting frame, using the ICDecompress function. For example, you can capture the images in YUV format and then dither them by calling the ICDecompress function to convert the YUV format to 8-bit X image format.

Standard image sizes are as follows:
Mode NTSC PAL/SECAM
Frame 640x480 768x576
Field 640x240 768x288

Field Mode Dominance

The videoSetFieldMode function includes field mode dominance support. Capturing full-frame video requires combining two consecutive video fields in one frame. The first field in the pair is referred to as the dominant field. Source and destination video devices should agree on field dominance. If they do not, then reversed dominance, such as framing artifacts in full-frame mode, can occur. This can be seen by magnifying an area of motion in a captured frame to see temporal artifacts or jagged edges in the images.

The VIDEO_MODE_FRAME flag indicates the default dominance of a hardware device. Two flags, VIDEO_MODE_FRAME_EVEN_DOM and VIDEO_MODE_FRAME_ODD_DOM, specify even and odd dominance, respectively. If the field mode is set to VIDEO_MODE_FRAME and a query of the field mode using the videoGetFieldMode function is made, the device will return the field mode dominance it is using (video capture only at this time).

Not all devices can be adjusted. Setting the field mode to VIDEO_MODE_FRAME_EVEN_DOM or VIDEO_MODE_FRAME_ODD_DOM may result in an error if that particular dominance is not currently supported. Use VIDEO_MODE_FRAME if the dominance is not important to an application. Be aware of this error if your application deinterlaces images on its own. Be careful about placing even and odd fields in the frames your application composes (video capture) or decomposes (video output).

Extensions The videoSetFieldMode function is a Compaq extension to the Microsoft multimedia API specification.

Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_UNSUPPORTED The function is not supported for the device.
DV_ERR_PARAM1 The mode is invalid or not currently supported by the device.
DV_ERR_INVALHANDLE The specified device handle is invalid.
See Also videoGetFieldMode

videoSetMirror

Name videoSetMirror --- Set current mirroring value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetMirror(HVIDEO hVideo, 
                        BOOL mirror); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

BOOL mirror
Specifies the mirroring value. This value can be either TRUE or FALSE.


Description

The videoSetMirror function sets the current mirroring value for X image (8- and 24-bit) and YUV images.
Extensions The videoSetMirror function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetMirror

videoSetPortNum

Name videoSetPortNum --- Set current port number Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetPortNum(HVIDEO hVideo, 
                         DWORD dwPortNum); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwPortNum
Specifies the port number. This value can be 1 or 2.


Description

The videoSetPortNum function sets the current port number. The port number value specifies which device connector and/or connector configuration is to be used by the device. This function is not supported for playback operations because images are output to both ports. See Appendix B for specific device details.

The videoSetPortNum function has to be called before the videoConfigure call. This configures the port used on the channel to take effect on subsequent video capture operations.

Extensions The videoSetPortNum function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetPortNum , videoSetStandard

videoSetQuality

Name videoSetQuality --- Set current quality value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetQuality(HVIDEO hVideo, 
                         DWORD dwQuality); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwQuality
Specifies the quality value. This value ranges from 0 to 10,000. The value 10,000 denotes the best quality.


Description

The videoSetQuality function sets the current quality value.

This function is not supported for video playback operations.

See Chapter 7 for information about quality settings and see Appendix B for restrictions.

Extensions The videoSetQuality function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetQuality

videoSetSaturation

Name videoSetSaturation --- Set current saturation value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetSaturation(HVIDEO hVideo, 
                            DWORD dwSaturation); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwSaturation
Specifies the saturation value. This value ranges from 0 to 10,000.


Description

The videoSetSaturation function sets the current saturation value. This saturation value is applied to the 8-bit X image data returned to the application. This request is not supported for video playback using a single buffer.
Extensions The videoSetSaturation function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetSaturation

videoSetSharpening

Name videoSetSharpening --- Set current sharpening value Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetSharpening(HVIDEO hVideo, 
                            DWORD dwSharpening); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwSharpening
Specifies the sharpening value. This value ranges from 0 to 10,000.


Description

The videoSetSharpening function sets the current saturation value. This saturation value is applied to the 8-bit X image data returned to the application. This request is not supported for video playback using a single buffer.
Extensions The videoSetSharpening function is a Compaq extension to the Microsoft multimedia API specification.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetSharpening

videoSetStandard

Name videoSetStandard --- Set current video standard type Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoSetStandard(HVIDEO hVideo, 
                          DWORD dwStandard); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

DWORD dwStandard
Specifies the standard type. This value can be one of the following:

VIDEO_STANDARD_NTSC
VIDEO_STANDARD_PAL
VIDEO_STANDARD_SECAM
VIDEO_STANDARD_SVIDEO525
VIDEO_STANDARD_SVIDEO625

Description

The videoSetStandard function sets the current video standard type. To set the video standard type, call the videoSetStandard function immediately after the call to the videoOpen function that opens the video device. The videoSetStandard function has to be called before the videoConfigure call; otherwise, the standard type is not modified and the DV_ERR_BADFORMAT error code is returned.

The VIDEO_STANDARD_SECAM type is not supported for playback operations.

The VIDEO_STANDARD_SVIDEO525 and VIDEO_STANDARD_SVIDEO625 are S-video standards for the VIDEO_STANDARD_NTSC and VIDEO_STANDARD_PAL types, respectively.

Extensions The videoSetStandard function is a Compaq extension to the Microsoft multimedia API specification.

Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_BADFORMAT The specified format cannot be set.
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_PARAM1 The specified parameter is invalid.
DV_ERR_NOTSUPPORTED The function is not supported.
See Also videoGetStandard , videoSetPortNum

videoStreamAddBuffer

Name videoStreamAddBuffer --- Send a buffer to a video device channel Syntax


#include <mme/mme_api.h> 
 
MMRESULT videoStreamAddBuffer(HVIDEO hVideo, 
                              LPVIDEOHDR lpVHdr, 
                              DWORD dwSize); 
Arguments HVIDEO hVideo
Specifies a handle to a video device channel.

LPVIDEOHDR lpVHdr
Specifies a pointer to a VIDEOHDR data structure that identifies the buffer.

The VIDEOHDR data structure must be allocated with the mmeAllocMem function before being passed to the videoStreamAddBuffer function. The data buffer pointed to by its lpData field or the data buffers pointed to by its lpData2 field must be allocated using the mmeAllocBuffer or mmeAllocBufferAndGetShminfo function. Once the buffer is allocated, it must be prepared with the videoStreamPrepareHeader function.

DWORD dwSize
Specifies the size of the VIDEOHDR data structure.


Description

The videoStreamAddBuffer function sends a buffer to a video device channel. After the buffer is processed by the device, the device sends it back to the application by sending a callback message.

To determine the size of the buffer needed for capturing or playing back data, use the videoConfigure function. If the buffer size is not large enough, the videoStreamAddBuffer function can fail. See the description of the videoConfigure function for detailed information about determining the size of the buffer required.

For video playback, the dwBytesUsed field of the VIDEOHDR data structure is filled with the size of the buffer that was passed to the videoStreamAddBuffer function.

If the input image data to be played back is in JPEG format, a dual buffers scheme can be used to simultaneously play back the input image and return an uncompressed image (8- or 24-bit X image, YUV, or BI_BITFIELDS format) to the application. The uncompressed image can be used to display to the screen the same image that is being played to the output device.

In Microsoft Video For Windows (VFW), the VIDEOHDR data structure fields dwFlags and dwBytesUsed are frequently updated to reflect the state of the buffer as it is processed by the driver. On OpenVMS systems, these fields are updated only once when the buffer has finished processing and returns to the client in the callback.

Extensions The VIDEOHDR data structure has been extended by three fields: lpData2, dwBufferLength2, and dwBytesUsed2 to support dual buffers for use with the video option modules that support dual buffering.

The videoStreamAddBuffer function has been extended to recognize the flags VHDR_FIELD_EVEN and VHDR_FIELD_ODD in the dwFlags field of the data structure VIDEOHDR. When the VIDEO_MODE_FIELD_BOTH field mode is used, the application tells the device which field to use by setting the dwFlags field to either VHDR_FIELD_EVEN or VHDR_FIELD_ODD. On capture, the device fills the buffer with the field from the next captured frame. On playback, the device places the data in the buffer of the next frame's field.

See Section 4.4.2 and Section 4.5 for more information about the VIDEOHDR data structure and using multiple buffers.

Compaq has extended the Microsoft video and ICM (Installable Compression Manager) interfaces to provide for memory optimization. See Section 1.5.8 for more information.


Return Values

1
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
DV_ERR_CREATEPALETTE A palette must have been set previous to this operation when the biCompression is BICOMP_DECXIMAGEDIB and the biBitCount is 8; otherwise, this error is returned.
DV_ERR_INVALHANDLE The specified device handle is invalid.
DV_ERR_UNPREPARED The VIDEOHDR data structure has not been prepared.
See Also videoStreamPrepareHeader , videoStreamReset , videoStreamStart


Previous Next Contents Index