Hi guys,
I’m tearing my hair out on this one! I have a rendering minidriver, and I
want it to implement frame stepping, which is IVideoFrameStep to user mode,
and AM_KSPROPSETID_FrameStep to the driver.
The code I’m working on already has examples of custom interfaces aggregated
via KsProxy to do property pages. However, in all those cases, the property
set ID is the same as the user mode IID - and it works fine.
However, when it comes to trying to get my new interface working, nothing
happens!
More specifically KsProxy seems to instantiate the user mode COM object in
my helper DLL, but it never queries that same object for IVideoFrameStep,
and trying to single step in GraphEdit does nothing. I suspect the problem
may be due to confusion between IID’s and Prop set ID’s.
The .INF file for the driver registers the aggregated interface via KsProxy
as follows:
;IVideoFrameStep
HKCR,CLSID%AM_KSPROPSETID_FrameStep%,%PlugIn_IVideoFrameStep%
HKCR,CLSID%AM_KSPROPSETID_FrameStep%\InprocServer32,mediaxks.dll
HKCR,CLSID%AM_KSPROPSETID_FrameStep%\InprocServer32,ThreadingModel,Both
; N.B. IID_IVideoFrameStep is NOT the same as AM_KSPROPSETID_FrameStep
; There is no absolute requirement for User mode IID to be the same as
property set GUID.
;AM_KSPROPSETID_FrameStep = “{C830ACBD-AB07-492F-8852-45B6987C2979}”
;IID_IVideoFrameStep = “{E46A9787-2B71-444D-A4B5-1FAB7B708D6A}”
HKLM,%MediaInterfaces%%AM_KSPROPSETID_FrameStep%,%PlugIn_IVideoFrameStep%
HKLM,%MediaInterfaces%%AM_KSPROPSETID_FrameStep%,IID,%REG_BINARY%,87,97,6A,E4,7
1,2B,4D,44,A4,B5,1F,AB,7B,70,8D,6A
; Note binary coding is for IID_IVideoFrameStep
And since the property set is meant to be exposed on a pin, I’ve also got
this little gem, which doesn’t appear to be documented anywhere, but seems
to be the way of indicating that the interface is meant to be exposed on a
pin:
; Registry for interfaces
[InterfaceRender.AddReg]
HKR,CLSID,%CLSID_PROXY%
HKR,FriendlyName,%mediaxm2v.DeviceDesc%
HKR,PinFactory\0\Interfaces%PROPSETID_CONNECTION%,%PROPSETID_CONNECTION%
; TODO - should the IID below be the user mode IID or the KS Propsetid?
HKR,PinFactory\0\Interfaces%IID_IVideoFrameStep%,%IID_IVideoFrameStep%
(The propsetid_connection is there so we can suggest an allocator framing).
In my user mode DLL that implements the plug in, I then have code very
similar to the sample available on MSDN (which, ISTR is IAMCameraControl or
such like). Most of the code is not that relevant, except, perhaps, the
QueryInterface, which (not unsurprisingly) looks like this:
STDMETHODIMP CFrameStepInterfaceHandler::NonDelegatingQueryInterface(REFIID
riid, void ** ppv)
{
HRESULT result;
CheckPointer(ppv,E_POINTER);
PrintGUID(“CFrameStepInterfaceHandler::NDQI”, &riid);
if (riid == __uuidof(IVideoFrameStep))
{
MYTRACE((“IID_IVideoFrameStep\n”));
result = GetInterface(static_cast(this), ppv);
}
else
{
result = CUnknown::NonDelegatingQueryInterface(riid, ppv);
}
MYTRACE((“CFrameStepInterfaceHandler::NDQI %08X\n”, result));
return result;
}
Anyways, to cut a long story short, in my DLL, I see something like this
from the debug output of my DLL, which indicates the COM object is
instantiated, but unfortunately, none of the methods in it are called - and
I don’t get any debug from my methods or from my driver upon trying to frame
step.
CFrameStepInterfaceHandler::CreateInstance pOuter 009667DC
CFrameStepInterfaceHandler::CFrameStepInterfaceHandler pOuter 009667DC
CFrameStepInterfaceHandler::CFrameStepInterfaceHandler QI 00000000
CFrameStepInterfaceHandler::CreateInstance hr 00000000 pObj 00EC3E28
CFrameStepInterfaceHandler::NDQI: 00000000-0000-0000-C0-00-00-00-00-00-00-46
CFrameStepInterfaceHandler::NDQI 00000000
CFrameStepInterfaceHandler::NDQI: 00000000-0000-0000-C0-00-00-00-00-00-00-46
CFrameStepInterfaceHandler::NDQI 00000000
CFrameStepInterfaceHandler::NDQI: 56A868AF-0AD4-11ce-B0-3A-00-20-AF-0B-A7-70
CFrameStepInterfaceHandler::NDQI 80004002
Any ideas? I’m at my wits end on this one.
MH.
This email and any attachments is confidential, may be legally privileged and is intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.