Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Output much GREEN with custom DShow Transform filter

Output much GREEN with custom DShow Transform filter

Output much GREEN with custom DShow Transform filter

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)

RE: Output much GREEN with custom DShow Transform filter


Does this behaviour also occur when playing files in GraphEdit?


RE: Output much GREEN with custom DShow Transform filter

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.

RE: Output much GREEN with custom DShow Transform filter

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.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close