X hits on this document

Word document

Designing Hardware and Drivers for the Microsoft® Windows® Family of Operating Systems - page 5 / 13





5 / 13

Digital Video Camcorder Support in Windows 5

In this example, m_pDVcrExtDevice is a property page class member previously initialized with a pointer to IAMExtDevice.

LONG lDeviceType = 0;

m_pDVcrExtDevice->GetCapability(ED_DEVCAP_DEVICE_TYPE, &lDeviceType, 0);

if(lDeviceType == ED_DEVTYPE_VCR) {

//lDeviceType can be one of the following:




//If ED_DEVTYPE_VCR, enable VCR-specific controls.

} else {

// Camera can only RECORD and RECORD_PAUSE.

// Unknown device is assumed not to have VCR capabilities.


// disable VCR-specific controls.

Getting Information about Media

An application uses IAMExtTransport::GetStatus to get information about the media in the device. The following code fragment shows how an application would determine whether the DV camcorder contains a tape and whether the tape is write-protected. This fragment assumes that the device type is ED_DEVTYPE_VCR and the device has recording capabilities, as determined by a previous call to GetCapabilities with ED_DEVCAP_DEVICE_TYPE combined with ED_DEVCAP_CAN_RECORD.

In this example, m_pDVcrExtTransport is a property page class member previously initialized with a pointer to IAMExtTransport.

LONG lMediaType = 0;

BOOL bRecordInhibit = FALSE;

// Find out whether the transport contains a tape

m_pDVcrExtTransport->GetStatus(ED_MEDIA_TYPE, &lMediaType);

// Media type can be one of the following:




// Find out whether tape is write-protected

m_pDVcrExtTransport->GetStatus(ED_RECORD_INHIBIT, (long *)&bRecordInhibit);

Getting Information about the Signal Mode and Transport State

An application should check the state of the DV camcorder’s transport on initialization and after any command that might change the transport state. Because the device might not be able to respond immediately after such a command, an application should be prepared to handle a pending result. For details, see “Managing Time-Consuming Operations” later in this article.

The following code fragment shows how an application would call IAMExtTransport::GetTransportVideoParameters to determine the input signal mode of the device and then call IAMExtTransport::get_Mode to get the current state of the transport (playing, paused, recording, and so on).

long lCurXPrtState;

September 28, 2001

Document info
Document views30
Page views30
Page last viewedThu Oct 27 15:48:53 UTC 2016