Jump to content
  • Advertisement
Sign in to follow this  
simin

DirectShow/DirectX program doesn't work on 2 different computers.

This topic is 2316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!
I have a big problem with my DirectShow (DirectShow.Net)/ DirectX (SlimDX) application.

It worked perfectly fine on my notebook, but when I moved application to another machine output is not right.

This is how it looks like in correct output:
goodxc.png

And there is what i get on other machine:
badd.png



DirectShow graphs looks the same:
webcam -> smart tree -> Color Space converter -> Frame Grabber -> Null Renderer.

The application simply captures the frame and set it as a texture in DirectX.

I capture frames in ARGB32 format.

Computers:

Notebook (good result)
Intel Core 2 Duo T9300
ATI Mobility Radeon HD 3650
Windows 7 Pro x64 SP1
K-Lite Mega Codec Pack 6.6.0


PC (bad result)
Intel Core 2 Quad Q8300
MSI GeForce GTS250 1GB
Windows 7 Pro x64 SP1
K-Lite Mega Codec Pack 8.4.0

Webcam:
Logitech Pro HD C910


I suspect DirectShow problem with settings, but I dont know where to look for them. Can You tell me, so I can configure PC the same as notebook and run app on that?

Thanks,
Andrew

Share this post


Link to post
Share on other sites
Advertisement

It looks like you are making incorrect assumptions about the pitch of your D3D surface.

http://msdn.microsof...7(v=vs.85).aspx


Thanks a lot! Thanks to You I was able to find wrong part of my code.

It seems that on notebook pitch is the same size as the stride.

When I fill texture bytes it used to be:

var data = texture.LockRectangle(0, LockFlags.None);
for (int i = 0; i < Height; i++)
{
data.Data.Write(TextureBytes, (Height - 1 - i)*Stride, Stride);
}


And the corrent version is:

var data = texture.LockRectangle(0, LockFlags.None);
for (int i = 0; i < Height; i++)
{
data.Data.Write(TextureBytes, (Height - 1 - i)*Stride, Stride);
data.Data.Position += data.Pitch - Stride;
}

Share this post


Link to post
Share on other sites
Yea, the scanlines are always pitch bytes apart, regardless of the width of the surface.

Glad I could help :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!