Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

DirectShow -- 2 easy questions

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

1.) When I call MediaControl->Play() I read that the thread pause's and plays and you had to do something special to have it keep going. But in my app, it just keeps going, which is fine, although weird seeing my game and me moving around with a video overlayed...Is this normal? 2.) When I switch my game to fullscreen mode, my game works fine, I can hear the video music, but there is no video. Is there something I have to do to get it to work in fullscreen mode?

Share this post


Link to post
Share on other sites
Advertisement
Okay my main concern now:

I start my app in fullscreen mode, the video plays fine, in fullscreen mode, I can switch to windowed and back again and it keeps playing. Of course in windowed mode it is still aligned for fullscreen mode so it looks funny.

Does this mean, during a fullscren to windowed or vice versa switch I have to ge the position of a video, release it, reload it, set the position and begin playing it in the new video setting?

Share this post


Link to post
Share on other sites
Well, there are all sorts of different ways to render things with DirectShow. I myself won't probably be able to help you, since I'm only use to use the VMR9 in Renderless mode to render a video to a texture. But I'll see what I can suggest.

I'm guessing you're rendering using an overlay. Your renderer might likely support an IVideoWindow or IOverlay interface, which might help you to reposition the video.

And if you are indeed using an overlay, then the overlay works by drawing the video wherever the overlay's color key is on the screen. If you're playing your game at the same time, the game is likely drawing over the area where the video should be displayed, and thus the color in those pixels is no longer set to your overlay's color key, so no video gets displayed. I don't know how the best way to fix this would be, but if this is the case, then you could probably just draw a solid colored quad to the appropriate area of the screen, using the overlay's color key as the solid color, and your video should hopefully show up.

Share this post


Link to post
Share on other sites
If you are using the Overlay Mixer you should query it for the IDDrawExclModeVideo and then call IDDrawExclModeVideo::SetDrawParameters to set the source and destination rects of the stream.

Be aware that the source rect positions range from 0 to 10000:
e.g. if you have a video that is 640x480 and want to display the left half of the video your source rect should be something like:
top=0
bottom=10000
left=0
right=5000


Hope I helped

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!