I have written a video player using SlimDX and DirectShow which is displaying the video on a SlimDX texture.

I am extracting the video frames using the ISampleGrabberCB interface from DirectShow and storing them in a byte array, writing the array into the texture whenever a new frame is available.

The problem is that my video is exhibiting tearing when playing a high definition video, but displays correctly for normal video playback, what can the causes for this problem be, and what possible solutions are there for displaying high definition video from DirectShow via SlimDX?

_OutputFrame.LockRectangle(i, LockFlags.Discard).Data.WriteRange<byte>_VideoFrameBytes);
  • \$\begingroup\$ How does this tearing manifest and how long are your frames in time and how long does texture data uploads take? How do you upload your texture data (UpdateSubresource or Map/Unmap)? Which DirectX version are you using? Are you reusing a single texture or alternating between several textures? What 'usage' does your texture have? \$\endgroup\$ – Lars Viklund Aug 17 '11 at 11:59
  • \$\begingroup\$ I am using directx 9 API in the slimdx and is not using map/unmap or update subresourced and is doing the stuff of writing the extracted video bytes by the code mentioned above by the help of texture.LockRectangle. I am not using any "usage for the texture". I am using a single texture only. \$\endgroup\$ – Yashwinder Aug 18 '11 at 11:04
  • \$\begingroup\$ I am new to directx programming and it's for the first time I am working with a video rendering on a slimdx direct3d9 texture. If there is any other method to render a video on a slimdx direct3d9 Texture then please give me an idea or some code about it. \$\endgroup\$ – Yashwinder Aug 18 '11 at 13:23

Browse other questions tagged or ask your own question.