Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output much GREEN with custom DShow Transform filter

Status
Not open for further replies.

maderlock

Programmer
Mar 10, 2003
3
IN
Here's an odd thing. I am using the DirectX 9 SDK to develop a DirectShow app using live input from a firewire camera.

Using just a capture input and default renderer, I build the filter graph and set it to run. No problem. Lovely live output onto the screen.

However, when I use my custom transform filter inbetween these filters, I just get green on the screen. Debugging shows that even the input to the Transform(IMediaSample *pSource, IMediaSample *pDest) function is entirely green.

Even better, when I set my filter to just make pDest = pSource, the output is still green so I have tried setting the first 100 pixels to 0 and the output is... yes indeed... green.

Going a little mad here. Any suggestions? Would a dump of some of my code help (there is much)
 
Hi,

Does this behaviour also occur when playing files in GraphEdit?

Pjotr
 
My filter is compiled directly into my app, so I'm not sure I can use GraphEdit without registering the filter first. So, I don't know. If no-one has come across this problem before, then I'll spend the time needed to make the filter into a dll and COM object.
 
Right. A friend on IRC solved this for me. Basically, I was not copying memory correctly so my output was uninitialised memory. Because my camera outputs UYVY and therefore my filter outputs UYVY, when this is uninitialised (in windows, this has a value), the RGB output is converted to green. Sorry, no way for anyone to have guessed that. The correct was wasto use CopyMemory e.g. CopyMemory((PVOID) pBufferOut,(PVOID) pBufferIn, lSourceSize); (this is in fact used in the contrast filter example in the SDK).

So I guess, in this case RTFMandExamplesInTheSDK.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top