Jump to content
  • Advertisement
Sign in to follow this  

Directshow in 3d.... some success!

This topic is 4826 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 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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

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!