Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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);
                _OutputFrame.UnlockRectangle(i);                                                                                            
share|improve this question
    
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? –  Lars Viklund Aug 17 '11 at 11:59
    
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. –  Yashwinder Aug 18 '11 at 11:04
    
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. –  Yashwinder Aug 18 '11 at 13:23
add comment

closed as too broad by Josh Petrie Dec 19 '13 at 3:51

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.