Platform SDK: Broadcast Architecture

Getting Available Devices

Before your application can enable users to run the Microsoft® ActiveX® control for video (the Video control) in all its possible ways, your application needs information on which device to use. In many cases, users must select one or more devices to use. For example, future applications might provide a user the option to select a video camera, a VCR, or a television tuner as the input device for video. The current version of Broadcast Architecture only supports analog television tuner cards as input devices.

Your application should thus retrieve the list of available devices before it starts presenting video and audio. Potentially, your application can present a list box of devices to select from. If video and audio are intrinsic to your application's functionality, your application in most cases should retrieve the list of available devices when it starts.

For your application to retrieve this list, it must first declare and allocate storage for variables of BPCDevices and BPCDeviceBase object types. Your application then assigns the collection of all the available input and output devices to the BPCDevices variable by using the BPCVid object's Devices property. Your application next enters a loop to get each BPCDeviceBase object that represents an available device for video. Your application can use the BPCVid object's DeviceCount property to determine the number of times to loop.

Your application next obtains a string representing the name of each available video device by using the BPCDeviceBase.Name property and adds those strings to an array of string elements. When user device selection is required, your application also adds those strings to a list box or combo box on the user interface.

The best way to add initialization functionality to your application depends on how you develop your application. With the Microsoft® Visual Basic® development system, you implement initialization in the Form_Load procedure. With MFC, you implement initialization in the OnInitDialog method of your dialog class. With a Hypertext Markup Language (HTML) document, you implement initialization in the script that runs when a Web browser loads the page.

In the current version of Broadcast Architecture, hardware configurations only support sending analog video to the digital VGA display surface of the control itself. Therefore, the Video control cannot set an output device; it can only set which input device to receive video from. If a user's computer has an analog television tuner card installed and your application provides a list of available devices, the user name of the WDM stream class minidriver for the tuner device is listed as an input source. WDM here stands for (Microsoft®) Windows® Driver Model. Otherwise, no input source is listed.