In relation to the Auto zoom/crop discussed in this i need to be able to have MediaPortal call methods on the AutoCrop DirectShow filter(to set properties etc) through a custom interface. I dont really have any experience with COM and only a bit with C# Interop so im having a few difficulties.
My DirectShow filter called AutoCrop already exposes an interface called IAutopCrop(this was autogenerated by the wizard that set it up). I have added a test method to this interface which i want to call from a test C# program.
The interface (and related stuff) is declared like this(i simplified it for testing purposes the actual interface has more methods):
On the C# side i have declared the following(based on how things are done in the MediaPortal DirectShowLib source):
I can see in the MediaPortal source code that Marshal.BindMoniker is used to obtain IBaseFilter instances(which should be no different from what i am doing), but im a bit unsure as to what a 'moniker' is. I have the CLSID and IID GUID's (as seen above) but what am i supposed to do with them ?
A little help, or a link to something that explains this clearly would be greatly appreciated.
My DirectShow filter called AutoCrop already exposes an interface called IAutopCrop(this was autogenerated by the wizard that set it up). I have added a test method to this interface which i want to call from a test C# program.
The interface (and related stuff) is declared like this(i simplified it for testing purposes the actual interface has more methods):
// 4211E930-0EEB-4649-895B-4FD47824646E
DEFINE_GUID(CLSID_AutoCrop,
0x4211e930, 0xeeb, 0x4649, 0x89, 0x5b, 0x4f, 0xd4, 0x78, 0x24, 0x64, 0x6e);
....
// C19647D5-A861-4845-97A6-EBD0A135D0BF
DEFINE_GUID(IID_IAutoCrop,
0xc19647d5, 0xa861, 0x4845, 0x97, 0xa6, 0xeb, 0xd0, 0xa1, 0x35, 0xd0, 0xbf);
DECLARE_INTERFACE_(IAutoCrop, IUnknown)
{
STDMETHOD(RequestCrop) (
) PURE;
};
On the C# side i have declared the following(based on how things are done in the MediaPortal DirectShowLib source):
[Guid("C19647D5-A861-4845-97A6-EBD0A135D0BF"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAutoCrop
{
[PreserveSig]
new int RequestCrop();
}
I can see in the MediaPortal source code that Marshal.BindMoniker is used to obtain IBaseFilter instances(which should be no different from what i am doing), but im a bit unsure as to what a 'moniker' is. I have the CLSID and IID GUID's (as seen above) but what am i supposed to do with them ?
A little help, or a link to something that explains this clearly would be greatly appreciated.