Device Contention

[This is preliminary documentation and subject to change.]

The Video control uses a cooperative mechanism to prevent device conflicts. This prevents multiple instances of the Video control from attempting to control a particular device at the same time, which would cause unpredictable results.

The BPCVid.GotControl and BPCVid.LostControl event notifications are used to inform an application that it has control or must relinquish control of a particular device.

For example, if your application needs to use a particular device it must first request control of the device by setting the input or output property of the Video control equal to the device. Your application should then wait until it receives a GotControl notification before it uses the device. If the application attempts to access the device before it has control, unexpected behavior can occur.

Similarly, if your application receives a LostControl notification, it should immediately stop using the device in question until it can regain control. Otherwise, unexpected behavior occurs when multiple applications access the device.

Thus, in order to handle device contention, your application must implement GotControl and LostControl event handlers.

The device contention protocol also implements priority levels for application access to devices. These priority levels are used when two applications are in contention for a device. In this case, control is given to the application with higher priority. If both applications have equal priority, the application that currently has control of the device retains control. You can set the priority for an instance of the Video control using the BPCVid.Priority property.