|
|
|
date: Mon, 21 Jul 2008 19:12:50 -0700 (PDT),
group: microsoft.public.win32.programmer.directx.video
back
Re: Question about implementing IBaseFilte
On Mon, 21 Jul 2008 19:12:50 -0700 (PDT), SaxenKo@gmail.com wrote:
> My IBaseFilter needs to export IAMStramConfig interface. But I can't
> get
> enough information when AMCap use
> hr = gcap.pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
> &MEDIATYPE_Video,
> gcap.pVCap,
> IID_IAMStreamConfig, (void
> **)&gcap.pVSC);
> to query my IAMStramConfig interface. I can't get the inputs about the
> first
> 1 and 2 parameters. The standard IUnknown QI only has two inputs.
> QueryInterface( REFIID riid, void** ppv )
> Is there anyone who knows how to get additional information?
From the documentation, you need to support IKsPropertySet on your capture
pin and return PIN_CATEGORY_CAPTURE for Get(AMPROPSETID_Pin,
AMPROPERTY_PIN_CATEGORY, ...). See the SDK docs topic "Pin Property Set".
It has sample code for querying for this interface.
Also, there is a sample virtual video capture device on my downloads page
(provided by Vivek). I don't know if he implemented support for this.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
date: Mon, 21 Jul 2008 20:38:59 -0600
author: The March Hare [MVP] erland
Re: Question about implementing IBaseFilte
On 7$B7n(B22$BF|(B, $B>e8a(B10$B;~(B38$BJ,(B, "The March Hare [MVP]"
<themarchh...@alice.in.wonderland> wrote:
> From the documentation, you need to support IKsPropertySet on your capture
> pin and return PIN_CATEGORY_CAPTURE for Get(AMPROPSETID_Pin,
> AMPROPERTY_PIN_CATEGORY, ...). See the SDK docs topic "Pin Property Set".
> It has sample code for querying for this interface.
>
> Also, there is a sample virtual video capture device on my downloads page
> (provided by Vivek). I don't know if he implemented support for this.
>
Thanks for your reply, but actually I am not talking about the IPin. I
am wondering the IBaseFilter..
For example, below are codes from AMCap.cpp:
// !!! What if this interface isn't supported?
// we use this interface to set the frame rate and get the capture
size
hr = gcap.pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
gcap.pVCap, IID_IAMStreamConfig,
(void **)&gcap.pVSC);
if(hr != NOERROR)
{
hr = gcap.pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
gcap.pVCap,
IID_IAMStreamConfig, (void
**)&gcap.pVSC);
if(hr != NOERROR)
{
// this means we can't set frame rate (non-DV only)
ErrMsg(TEXT("Error %x: Cannot find
VCapture:IAMStreamConfig"), hr);
}
}
/*----------------*/
The AMCap will try to QI IAMStreamConfig that is belong to
PIN_CATEGORY_CAPTURE and MEDIATYPE_Video or MEDIATYPE_Interleaved
through IBaseFilter. In my IBaseFilter, I need to know upper layer is
querying PIN_CATEGORY_CAPTURE or PIN_CATEGORY_PREVIEW?
MEDIATYPE_Interleaved or MEDIATYPE_Video? my declare is
STDMETHODIMP CSNBaseFilter::QueryInterface( REFIID riid, void** ppv );
So I could only get two input. riid is IID of the Interface's GUID and
ppv is for return. I don't have any information about the Category
GUID. Without the right Category GUID, I may return
MEDIATYPE_Interleaved's IAMStreamConfig even I don't support
MEDIATYPE_Interleaved. It is really bad and wrong. And it will make
the AMCap to get wrong config about my device.
So I would like to know if there any function can get these
information I need?
date: Mon, 21 Jul 2008 20:17:15 -0700 (PDT)
author: unknown
Re: Question about implementing IBaseFilte
On 7$B7n(B30$BF|(B, $B2<8a(B2$B;~(B17$BJ,(B, Saxe...@gmail.com wrote:
> On 7$B7n(B30$BF|(B, $B>e8a(B11$B;~(B50$BJ,(B, "The March Hare [MVP]"<themarchh...@alice.in.wonderland> wrote:
> > AFIAK, you can't and you are approaching the problem incorrectly. You need
> > to use the approach I outlined already by implementing the IAMStreamConfig
> > on each of the pins and supporting IKsPropertySet on them.
>
> > Why do you think implementing IAMStreamConfig the filter instead of the
> > pins will work? Did you read that this can support what you want
> > somewhere? From what I understood reading the Windows source code, I don't
> > think it is possible.
>
> Sure. I have implemented IAMStreamConfig and IKsPropertySet on my
> created IPin. But it never come into my IPin to QI IAMStreamConfig.
> And on IKsPropertySet, I saw it query AMPROPSETID_Pin and PropID=0.
> And I return PIN_CATEGORY_CAPTURE. It looks nothing about the
> IAMStreamConfig. I really wondering about where does it come.
>
> My propose is to change the Pin property page's content without
> writing a new property page. I can use system provided page and change
> its content as I desire.
Oh! I found what's going wrong. I don't reply the correct answer on
IBaseFilter:EnumPins. So it nerver get into my IPin's function. What
stupid am I.
March, Thanks and sorry for wasting your time.
date: Tue, 29 Jul 2008 23:31:14 -0700 (PDT)
author: unknown
|
|