Microsoft DirectX 9.0

IMSVidCtl::View

This topic applies to Windows XP only.

The View method configures the Video Control to view an input source, which can be a tune request, a DVD, or a media file.

Syntax

HRESULT View(
  VARIANT*  pv
);

Parameters

  pv

[in]  Specifies the input source as a VARIANT type. This parameter must be one of the following:

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

If the Video Control already has an active input device, this method configures the device for the specified input. Otherwise, this method locates an input device that can handle the input and activates it.

An input device typically corresponds to a source filter. If the pv parameter is a tune request object, the Video Control determines which filter to use by examining the network type on the tune request. For digital television, the input device will be a BDA Network Provider filter. For analog television, it will be a WDM TV Tuner filter. The specific name and implementation of the filter are device-dependent.

After calling View, use the following methods to build and run the filter graph:

If the filter graph is already built and running, an application can call View to specify a new tune request, either on the same network type or on a different network type.

If the View method succeeds, you can obtain the input device by calling the IMSVidCtl::get_InputActive method.

You can specify a particular input device by calling the IMSVidCtl::put_InputActive method and then calling IMSVidInputDevice::View on the device, instead of calling View on the Video Control. This might be useful if the local system has multiple devices of the same type. The View method is preferred, however, because it automatically locates the correct device type.

Example Code

The following example shows how to submit a tune request to the Video Control:

ITuneRequest *pTuneReq;
/* Obtain the tune request (not shown). */
CComVariant varTuneRequest = pTuneReq;
hr = pVidControl->View(&varTuneRequest);

The next example shows how to play a local file:

CComVariant varFileName(OLESTR("C:Example.avi"));
hr = pVidControl->View(&varFileName);

See Also