Platform SDK: Broadcast Architecture

Setting a Tuner to Receive VBI Data

Broadcast Architecture supports receiving data transmitted in the vertical blanking interval (VBI), which exists between successive scans of analog television images. Examples of types of data transmitted over the VBI are enhancement files and updates to television listings.

To receive VBI data, the television tuner must be tuned to the channel on which the data is sent. In the case where the user is watching television on the same channel on which VBI data is transmitted, the tuner is already set to the necessary channel. However, if the user is not watching television, you must programmatically set the tuner to the appropriate channel to receive VBI data.

You can do this by using methods of an BPCVBIControl object to tune the television tuner to the appropriate channel. Using this type of object does not start Microsoft® WebTV™ for Windows®, nor does it display video on the client. For example, you can use BPCVBIControl to tune to a channel during the middle of the night to receive updated television listings.

However, if an application is already using the tuner, for example if the user is watching television, BPCVBIControl returns an error when your application attempts to tune to a different channel. The user watching video always has higher priority than VBI data acquisition.

Thus, BPCVBIControl is disabled while any application is using video. Any tuners not used by a current video application stay tuned to the last channel requested. If your application needs to tune to a VBI transmission while another application is using video, it must create a new instance of the Video control in order to access a tuner not in use. Your application then uses a BPCVBIControl object for that control instance to receive VBI data from that tuner.

In order to tune a tuner to the VBI data channel, you must create an instance of BPCVBIControl and call the BPCVBIControl.VBITune method. When your application no longer needs to receive VBI data on the specified channel, it should release the BPCVBIControl object. Doing this causes the tuner to receive VBI data on the default channel, if any, defined in the registry. Switching to the default channel enables applications such as Guide database loaders to run in the background and acquire their data.

This process is demonstrated in the following code:

Dim vbictrl As BPCVBIControl
Set vbictrl = New BPCVBIControl
 
' Set the tuner to receive VBI data on channel 27.
vbictrl.VBITune 0, 2, 27, AMTUNER_SUBCHAN_DEFAULT, _
                                AMTUNER_SUBCHAN_DEFAULT 
 
' Code to receive and process the VBI data.
' Your application can use the VBI client interface
' to retrieve data from the VBI of a television signal.
' For more information on this client interface, see the
' Broadcast Architecture Driver Development Kit.
 
' Release the tuner to receive VBI data using the default channel
' specified in the computer registry.
Set vbictrl = Nothing

Note that BPCVBIControl should only be used by applications that need to receive VBI data for limited amounts of time. If your application is intended to run as a constant background process, it should use the default VBI channel values specified by the VBITS and VBIChan registry values. These values specify the tuning space and channel used by applications that update the Program Guide. If your application is a constant background process and it tunes the tuner to a different channel, applications that update the television programming information in the Guide database are unable to receive the VBI-encoded programming data.

If you are writing an application that performs background data collection and VBITS and VBIChan do not exist in the registry, your application can create them. If these values do exist, your application should query the user before it alters these settings.

Your application should query the user because another data collection application may already be installed. In this case, if your application changes the default VBI settings it prevents the previously installed application from collecting VBI data. This occurs because Broadcast Architecture currently only supports background data collection from one VBI channel and tuning space.

To resolve the resource conflict, the user should specify which of the data collection applications should run. For example, suppose two companies provide Program Guide information, each with a custom loader application that receives VBI data on a different channel. In this case, the user has to choose which company to receive Program Guide data from. For more information about VBITS and VBIChan, see Registry Values for the Video Control.