[wdmaudiodev] Re: Sending KSProperty to Streaming Pin

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 04 Feb 2009 17:27:09 -0800

KS wrote:
> Thanks for your advise. My current way of getting handle is different
> from what you've told me, but I think it is quite possible for me to
> use the method that you suggested.
> Just one more question. After I've obtain IPin, what is the method to
> call to get the IKsControl interface from it?.
> Can I get the IKsControl interface for targetting the filter from
> IBaseFilter, and if so, what is the method to call for this?

This is just basic COM.  Once you have a COM interface from the filter
object, or from a pin object, you can get any of the other interfaces
that object supports by using the standard QueryInterface call.  Or,
assuming you want to make your life easier, use the ATL wrappers, like

Assuming you have an IBaseFilter called pMyFilter, you'd do:
    CComQIPtr< IKsControl > pFilterKs( pMyFilter );
Then, you can call pFilterKs->KsProperty.

Or, if you have an IPin called pMyPin1, you'd do:
    CComQIPtr< IKsControl > pPinKs( pMyPin1 );

But remember that the filter's IKsControl and the pin's IKsControl go to
different places.

If you look at the only code snippet I posted in this thread, you'll see
there is a helper routine in dshowutil.cpp called FindPinInterface which
will search the pins of a filter looking for a particular interface. 
Since the full source code is included, you can see how they did it, as

Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.


WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: