Published by Roman on 24 Dec 2009 at 03:07 pm
DirectShow Spy: Filter Mapper Spy
DirectShow Filter Graph Spy was updated to add new functionality: spying over another DirectShow object – Filter Mapper. Filter Mapper object is used for filter registration purposes and also internally by DirectShow’s Intelligent Connect. IFilterMapper2 interface traces provide detailed description on steps DirectShow takes in order to connect and/or render filter pins. For example when trying to render MEDIATYPE_Audio pin, Filter Mapper suggested “RDP DShow Redirection Filter” and, then, “Default DirectSound Device”:
FilterMapperSpy.h(186): CFilterMapperSpy::EnumMatchingFilters: nFlags 0x0, bExactMatch 0, nMinimalMerit 0x00200001, bInputNeeded 1, nInputTypeCount 1, pInputPinCategory NULL, bRender 1, bOutputNeeded 0, nOutputTypeCount 0, pOutputPinCategory NULL FilterMapperSpy.h(191): CFilterMapperSpy::EnumMatchingFilters: nInputTypeIndex 0, MajorType {73647561-0000-0010-8000-00AA00389B71}, Subtype {00000000-0000-0000-0000-000000000000} FilterMapperSpy.h(212): CFilterMapperSpy::EnumMatchingFilters: pMoniker @device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{AB9D6472-752F-43F6-B29E-61207BDA8E06} FilterMapperSpy.h(220): CFilterMapperSpy::EnumMatchingFilters: sFriendlyName "RDP DShow Redirection Filter", sDescription "", sDevicePath "" FilterMapperSpy.h(212): CFilterMapperSpy::EnumMatchingFilters: pMoniker @device:cm:{E0F158E1-CB04-11D0-BD4E-00A0C911CE86}\Default DirectSound Device FilterMapperSpy.h(220): CFilterMapperSpy::EnumMatchingFilters: sFriendlyName "Default DirectSound Device", sDescription "", sDevicePath ""
Important is that DirectShow’s internals are using the mapper through COM instantiation and this provides a safe method to override default behavior process wide in order to, for example, extend Intelligent Connect functionality onto custom, unregistered globally, private filters.
Also, the binary is renamed from FilterGraphSpy.dll to DirectShowSpy.dll.
Partial Visual C++ .NET 2008 source code is available from SVN, release binary included (Win32, x64); installation instructions are in another post.
9 Responses to “DirectShow Spy: Filter Mapper Spy”
Leave a Reply
You must be logged in to post a comment.

ocinem on 07 Feb 2010 at 21:15 #
I noticed that with the latest release DirectShowSpy.dll rev187, the crash in COM surrogate process has been resolved and thank you for this.
I noticed another problem with MediaPlayer Classic Home Cinema, when selecting the external filters crashes.
is possible to solve this problem?
Thanks
Roman on 07 Feb 2010 at 21:16 #
Sure. Will you please provide me step by step instructions how to reproduce the problem?
ocinem on 08 Feb 2010 at 13:14 #
The procedure is very simple.
1 – Register the DLL (regsvr32 / s DirectShowSpy.dll)
2 – Open MPCHC, right click> Options> External filters
At this point MPCHC crashes, if I cancel the registration (regsvr32 / u DirectShowSpy.dll), works quite regular
Thanks
Roman on 08 Feb 2010 at 13:22 #
I don’t have this problem, I am using MPC-HC version 1.3.1249.0. EXternal Filters opens just fine, thought I don’t have any filters listed there. Do you have a “C:\ProgramData\DirectShowSpy.log” created/populated at the time of crash? Or perhaps you can attach with debugger and provide call stack and/or crash minidump.
ocinem on 08 Feb 2010 at 14:15 #
I’m using the latest release 1.3.1635.0
http://www.xvidvideo.ru/media-player-classic-home-cinema-x86-x64/
ocinem on 08 Feb 2010 at 14:32 #
Roman on 08 Feb 2010 at 20:13 #
OK I see now. Actually from my point of view it’s a problem of either DirectShow core, or Media Player Classic. I think more likely is the latter (it’s using deprecated IAMFilterData, but losing COM interface reference from it). But I think I will want to make a workaround for this.
Roman on 08 Feb 2010 at 20:48 #
ocinem, have fun! Here is the update: http://alax.info/blog/1111
ocinem on 09 Feb 2010 at 10:20 #
Perfect!
The release 190 works regularly with MPCHC, was also fixed the crash initial opening.
THANKS