Bewerken

Delen via


IKsControl interface (ks.h)

The IKsControl interface is a COM-style interface implemented on AVStream filters and pins. It enables clients in kernel mode to access AVStream automation objects (properties, methods, and events).

See the IKsControl (ksproxy.h) kernel-streaming proxy COM interface for information about the kernel-mode equivalent of this interface.

Inheritance

The IKsControl interface inherits from the IUnknown interface.

Methods

The IKsControl interface has these methods.

 
IKsControl::KsEvent

The IKsControl::KsEvent method enables or disables an event, together with any other defined support operations available on an event set.
IKsControl::KsMethod

The IKsControl::KsMethod method sends a method to a KS object, together with any other defined support operations available on a method set.
IKsControl::KsProperty

The IKsControl::KsProperty method sets a property or retrieves property information, together with any other defined support operations available on a property set.

Remarks

NOTE: The IKsControl interface should not be used with KSPROPERTY_CAMERACONTROL_EXTENDED_PROPERTY properties under KSPROPERTYSETID_ExtendedCameraControl property set, please use IMFExtendedCameraController.

Minidrivers typically acquire the IKsControl interface through a call to KsPinGetConnectedFilterInterface or KsPinGetConnectedPinInterface. Because this is a COM-style interface, the function call to obtain this interface calls the QueryInterface method, which in turn calls the AddRef method. Therefore, the minidriver does not have to perform these steps.

However, as soon as the client is finished with the IKsControl interface, it must release IKsControl with a call to the Release method.

Minidrivers that are written in C manipulate the IKsControl interface as a structure that contains a pointer to a table of functions instead of a C++ abstract base class.

A client that is written in C++ does the following:

IKsControl *Control;

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

However, a client that is 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.

Requirements

Requirement Value
Target Platform Windows
Header ks.h (include Ks.h)

See also

IKsControl(ksproxy.h)

KsPinGetConnectedFilterInterface

KsPinGetConnectedPinInterface