Sign in to follow this  
simin

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

Recommended Posts

simin    100
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:
[URL=http://imageshack.us/photo/my-images/23/goodxc.png/][IMG]http://img23.imageshack.us/img23/3191/goodxc.png[/IMG][/URL]

And there is what i get on other machine:
[URL=http://imageshack.us/photo/my-images/542/badd.png/][IMG]http://img542.imageshack.us/img542/9168/badd.png[/IMG][/URL]



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
Nik02    4348
It looks like you are making incorrect assumptions about the pitch of your D3D surface.

[url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb206357(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb206357(v=vs.85).aspx[/url]

Share this post


Link to post
Share on other sites
simin    100
[quote name='Nik02' timestamp='1329549194' post='4914129']
It looks like you are making incorrect assumptions about the pitch of your D3D surface.

[url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb206357(v=vs.85).aspx"]http://msdn.microsof...7(v=vs.85).aspx[/url]
[/quote]

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:
[code]
var data = texture.LockRectangle(0, LockFlags.None);
for (int i = 0; i < Height; i++)
{
data.Data.Write(TextureBytes, (Height - 1 - i)*Stride, Stride);
}[/code]

And the corrent version is:
[code]
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;
}[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this