DirectShow - passing parameters to custom source push filter
I'm working on a solution that will be used to receive video stream from remote hosts and to put various texts on the top of it. Currently it consists of custom DirectShow push filter (C++) which receives data from remote hosts usi开发者_开发技巧ng RTP protocol and tiny C# application that sets up the DirectShow graph and is used as a container for the video. I'm using DirectShowLib interop library. However, I'm not sure how to pass parameters from this C# app to my custom filter. What are possible ways to do it?
the simplest way is to register your own protocol (create a key myproto under HKCR, and then create a value "Source Filter" containing your clsid under that). Then you can render "myproto://ip=192.168.0.1&port=12¶m1=x" and these are passed to your IFileSourceFilter::Load method.
G
Creating the key:
HKEY_CLASS_ROOT
- myproto
- "Source Filter" = "187463A0-5BB7-11D3-ACBE-0080C75E246E"
is not enough on Windows 7. There are two issues with that:
- you need to wrap your CLSID with curly brackets
- you need to add "Url Protocol"
The correct version looks like that:
HKEY_CLASS_ROOT
- myproto
- "Source Filter" = "{187463A0-5BB7-11D3-ACBE-0080C75E246E}"
- "Url Protocol" = ""
Moreover, you can check HKEY_CLASS_ROOT->MMS for reference.
精彩评论