views:

322

answers:

2

Hello,

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?

+1  A: 

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

Geraint Davies
I took a brief look at the docs, but there isn't Open method. I assume you meant IFileSourceFilter::Load method? I'll start playing with this in a couple of hours and I'll let you know if it works. Thanks!
mkurek
A: 

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.

proxon