DirectShow - passing parameters to custom source p

2019-04-10 01:26发布

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 using 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?

2条回答
在下西门庆
2楼-- · 2019-04-10 01:56

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.

查看更多
一纸荒年 Trace。
3楼-- · 2019-04-10 02:15

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&param1=x" and these are passed to your IFileSourceFilter::Load method.

G

查看更多
登录 后发表回答