Previous Next

IKsControl

The IKsControl interface is a COM-style interface implemented on AVStream filters and pins. It allows clients in kernel mode to access AVStream automation objects (properties, methods, and events). See the IKsControl kernel-streaming proxy COM interface for information on the user-mode equivalent of this interface.

Methods

The following IUnknown methods are listed in Vtable order.

IUnknown method Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

The following IKsControl methods are listed in Vtable order.

IKsControl method Description
KsProperty Sets a property or retrieves property information.
KsMethod Sends a method to a KS object.
KsEvent Enables or disables an event.

Comments

Minidrivers typically acquire the IKsControl interface through a call to KsPinGetConnectedFilterInterface or KsPinGetConnectedPinInterface. Because this is a COM-style interface, the function call to get this interface calls the QueryInterface method, which in turn calls the AddRef method. Therefore, the minidriver does not have to perform these steps. However, once the client is done with the IKsControl interface, it must release IKsControl with a call to the Release method.

Minidrivers written in C manipulate the IKsControl interface as a structure containing a pointer to a table of functions instead of a C++ abstract base class. A client written in C++ does the following:

    IKsControl *Control;

    if (NT_SUCCESS (
      KsPinGetConnectedPinInterface (
        Pin,
        IID_IKsControl,
        (PVOID *)&Control)
{
        Control -> KsProperty (…);
        Control -> Release ();
    }

However, a client written in C uses this code instead:

    IKsControl *Control;

    If (NT_SUCCESS (
      KsPinGetConnectedPinInterface (
        Pin,
        IID_IKsControl,
        (PVOID *)&Control)
    ) {
      Control -> lpVtbl -> KsProperty (…);
      Control -> lpVtbl -> Release ();
    }

For more information, see AVStream Overview.

See Also

KsPinGetConnectedPinInterface, KsPinGetConnectedFilterInterface