Digital Video Camcorder Support in Windows — 9
A raw AV/C command is processed as follows:
A DV camcorder application issues a command.
The COM interface calls the DV camcorder driver to enable the notification event.
The COM layer issues an IOCTL to the driver to set a property of the device.
The MSDV driver receives a stream request block (labeled SRB1 in Figure 1) and creates an IRP, which is used to send the raw AV/C command through the AV/C command layer (not shown) to the device.
The device responds in one of the following ways:
If the device can complete the command within 100 milliseconds, it queues the final result and returns a success result, which the driver maps to STATUS_SUCCESS in the IRP. (Step 8)
If the device requires more than 100 milliseconds to complete the command, it returns an interim result, which the driver maps to STATUS_MORE_ENTRIES in the IRP. (Step 6)
If the device cannot complete the command, it returns an error result, which the driver maps to STATUS_NOT_SUPPORTED in the IRP. (Step 11)
If the device does not respond within 200 milliseconds, the driver sets the IRP status to STATUS_TIMEOUT. (Step 11)
If the device returned an interim result, indicating that it needs more time to complete the command successfully, the driver completes the SRB1 with STATUS_MORE_ENTRIES.
The COM layer waits for the notification event to signal.
When the device returns a final result and a success status (either within the first 100 milliseconds or after previously returning an interim result), the driver completes the IRP with STATUS_SUCCESS.
The MSDV driver processes the final result from the device, queues it in an output buffer, and signals UserEvent.
The COM layer issues an IOCTL to the driver to get a property of the device.
If the device executed the command successfully, the MSDV driver receives another stream request block (labeled SRB2 in the figure), and dequeues the result into the block.
The driver completes this block with STATUS_SUCCESS.
Otherwise, the MSDV driver completes the first SRB with STATUS_NOT_SUPPORTED if the device failed the command or STATUS_TIMEOUT if the device failed to respond.
The COM layer returns status to the application with an appropriate user return value. If the command succeeded, this is NOERROR.
If the command succeeded, the application retrieves the final result from the stream request block.
Registering for Removal Events
An application can request notification when a DV camcorder device is physically removed from the system by registering for a device-removal event, which is signaled if the device is disconnected. The following code fragment shows how to register for a device-removal event.
In this example, m_pDVcrExtTransport is a property page class member previously initialized with a pointer to IAMExtDevice.
HANDLE hEventDevRemoved = NULL;
// Get an event to detect device removal
hr = m_pDVcrExtTransport->GetStatus(ED_DEV_REMOVED_HEVENT_GET, (long *) &hEventDevRemoved);
September 28, 2001