[This is preliminary documentation and subject to change.]
Before your application can enable users to run the Microsoft® ActiveX® control for video (the Video control) in all its possible ways, it needs information on which device to use. In many cases, users must select one or more devices to use. For example, your application could provide a user the option to select a video camera, a VCR, or a television tuner as the input device for video. Your application can thus retrieve the list of available devices before it starts presenting video and audio, and potentially it can present a list box of devices to select from. If video and audio are instrinsic to your application's functionality, your application in most cases should retrieve the list of available devices when it starts.
Additionally, your application might need to retrieve (and potentially present to the user) a list of available devices whenever some new video or audio capability is required or desirable.
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 with 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 then obtains a string representing the name of each available video device with the Name property of the BPCDeviceBase object 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 this release 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 friendly 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.
To locate more information on working with display surfaces, see Further Information on Development Tasks in Broadcast Architecture.