DirectShow - passing parameters to custom source push filter

孤街醉人 提交于 2019-12-21 20:04:03

问题


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:


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




回答2:


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.



来源:https://stackoverflow.com/questions/2142739/directshow-passing-parameters-to-custom-source-push-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!