Monday, February 18, 2008

Register the Protocol in Directshow

Register the Protocol for the Filter:
--------------------------------------
The objective is if we opened the protocol URL in a GraphEdit,we need to insert our filter and capture the data.
Example :
----------
I opened the RTP protocol as in GraphEdit as follows in Render URL option:
rtp://127.0.0.1:5000/
it must insert the Source Filter.
it is not having the separate Source Filter.
I developed the Source Filter. while rendering the RTP, I want to insert my filter.
what we need to do ?
---------------------
Develop the Registry setup for the RTP protocol with our source Filter
RTP.reg contents :
------------------
REGEDIT4
[HKEY_CLASSES_ROOT\rtp]@="RTP : Realtime Transfer Protocol""EditFlags"=hex:02,00,00,00"URL Protocol"="""Source Filter"="{fd501041-8ebe-11ce-8183-00aa00577da1}"
[HKEY_CLASSES_ROOT\rtp\DefaultIcon]@="c:\\Program Files\\Windows Media Player\\wmplayer.exe,0"
[HKEY_CLASSES_ROOT\rtp\QuickView]@="*"
[HKEY_CLASSES_ROOT\rtp\Shell]@=""
[HKEY_CLASSES_ROOT\rtp\Shell\open]"EditFlags"=hex:01,00,00,00
[HKEY_CLASSES_ROOT\rtp\Shell\open\command]@="C:\\Program Files\\Windows Media Player\\wmplayer.exe %1"
By double clicking this file we can link our source Filter with the RTP protocol.But In the source Filter we need to implement the IFileSourceFilter interface.
What I have done ? I implemented the IFileSourceFilter in a Ball Source Filter and need to insert this filter whenever the the RTP protocol is rendered. Then within Load and GetCurFile() fn we got the control in a source Filter.
If I opened the rtp stream in a Windows media player 9 ( wmplayer.exe) rtp://127.0.0.1:4000/,it is not working. But if I opened the rtp stream in windows media player 6( mplayer2.exe), it inserts the The ball filter and renders the data in a player.

mplayer2.exe
=============
How can we run the .reg file and modify the registry ?.
.------------------------------------------------------
start rtp.reg


Output of the RTP source Filter :
-------------------------------------
MEDIATYPE : MEDIATYPE_Video
Compression : DIVX
Width : 176
Height : 144

No comments: