Microsoft DirectX 9.0

Activating Video Control Features (Script)

This topic applies to Windows XP only.

Applications work with two separate collections of features. One contains the available features, and the other contains the features that are currently active. The available features collection is read-only and is obtained through the FeaturesAvailable property on the MSVidCtl object. It always contains the features listed in the table below.

Feature Class ID String Friendly Name String
Data Services {334125C0-77E5-11D3-B653-00C04F79498E} BDA IPSink
Closed Captioning {7F9CB14D-48E4-43B6-9346-1AEBC39C64D3} Line 21 Decoder
Encoding    

The application enumerates through those features and populates a new feature collection that contains the features to be activated. It passes this new collection to the Video Control in the FeaturesActive property. The Video Control uses this collection to create a new filter graph or to modify an existing one. There is no need to create a FeaturesActive collection unless you require one or more of the features.

The FeaturesActive collection remains in effect even when you change inputs. Features are identified by their class ID strings, which are listed in the following table. The friendly name string is the string that is returned from the IMSVidDevice.Name property.

The following code shows one way to create an ActiveFeatures collection and use it to configure the Video Control:

' Create variables with easy-to-remember names to hold the GUIDs.
strDS = "{334125C0-77E5-11D3-B653-00C04F79498E}"
strCA = "{1600F101-6666-4F66-B1E2-BF3C9FBB9BA6}"
strCC = "{7F9CB14D-48E4-43B6-9346-1AEBC39C64D3}"

' Create our two "features" collections.
Dim colFeaturesActive
Set colFeaturesActive = CreateObject("MSVidCtl.MSVidFeatures")
Dim colFeaturesAvailable
Set colFeaturesAvailable = objVidCtl.FeaturesAvailable

' Here we specify Data Services
For Each MSVidFeature in colFeaturesAvailable 
    If (MSVidFeature.ClassID = strDS)Then
       colFeaturesActive.Add MSVidFeature
    End if
Next

objVidCtl.FeaturesActive = colFeaturesActive