Directshow in 3d.... some success!

Started by
1 comment, last by sipickles 19 years, 1 month ago
Hi, I have managed to integrate (to some degree) the CAllocator class, found in the SDK sample VMR9Allocator, into my own app. Two problemmos: 1) the videos play back in strange colours, RGB is now BRG or something like that! 2)Having difficulty combining actual video texture rendering routine with my own scene.....I'm no multithreading expert! My scene has its own beginscene, endscene and present, but so does the CPlaneScene::DrawScene function (this one is running in a seperate thread? i think?). Both parts will work on their own, but together they flicker most horrid! ANy advice how i might integrate the two? Thanks Si
Advertisement
Quote:1) the videos play back in strange colours, RGB is now BRG or something like that!

Theres some code in there that copies the data from the video stream to your texture; you need to make sure that the input matches the output - if not, you need to convert it. It is quite possible that your video format and/or texture format are of the same width but not necessarily the same order.

Quote:2)Having difficulty combining actual video texture rendering routine with my own scene.....I'm no multithreading expert!

My scene has its own beginscene, endscene and present, but so does the CPlaneScene::DrawScene function (this one is running in a seperate thread? i think?).

Direct3D generally doesn't like multithreaded access to the same resources/device - you need to create your device with D3DCREATE_MULTITHREADED (it comes at a speed cost). Even then, you might well have problems with this.

You might be able to get away with removing the BeginScene, EndScene and Present calls (definitely the Present call) provided your own code definitely initiates them at the right times. Alternatively - try and get more control of the rendering process and use the CAllocator and DirectShow just for copying data into the texture. Leave the rendering to your own code.

I have to admit, I tried getting DShow's VMR9Allocator sample to integrate with my graphics engine and got similar results. Tried everything I could think of and it never really wanted to play ball [sad].

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:you need to create your device with D3DCREATE_MULTITHREADED (it comes at a speed cost).


Yeah this i am doing,

Quote:try and get more control of the rendering process and use the CAllocator and DirectShow just for copying data into the texture. Leave the rendering to your own code.


This sounds good, thanks!

Is there a way I can get the colour format of an avi?

Si

This topic is closed to new replies.

Advertisement