View Full Version : Directshow filter positioning
Kaiousama
29th March 2005, 12:52
I'm writing a DirectShow transofrm filter, i'd like that when the graph is created by graphedit's "render file" menu command my filter will get inserted right before the video render in the video processing chain, how can I force it to be placed in that position?
(actually it is inserted right after the avi splitter, before the video coded, since i've used the NullIP example as template from DirectX SDK)
Thanks.
diehardii
29th March 2005, 15:23
Hi,
Give your filter the highest merit. It will connect automatically. If you have a second filter that also goes before the renderer, there is no way to ensure the order short of building the graph manually, or possibly using a made up format type that only your filters will connect to. For example:
[decoder]->[real media format pin->fake media format pin]->[fake MFP -> real MFP]-> [Renderer]
Now, here comes the lecture :). As a filter developer, I hate that many filters interject themselves automatically. This has hosed multimedia on my machine several times. Especially if you are redistibuting this and you have a bug, there is no way for the average user to tell what the problem is when their WMP keeps crashing. If you are writing your own front end, I would suggest just adding it manually. Failing that, if you have a separate program to set the properties, allow people to adjust the merit in there. Good luck.
~Steve
Manao
30th March 2005, 20:52
If it inserts itselft between the avi splitter and the codec, that means that it doesn't specify that it can only handle uncompressed video streams. There are samples in the SDK that show how to make transform filters that handle video only.
Kaiousama
1st April 2005, 08:41
Thanks people, i've solved my filter positioning issue by accepting uncompressed video streams only.
I'm now facing another problem: in order to access the picture contained in a MediaSample, a pointer to the first pixel and the length of the data structure are provided; Is the picture in the data structure stored Left->Right and Top->Bottom or in other directions? May I only access the frame by pixels or may I even access a whole scanline per times?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.