DirectShow -- 2 easy questions

Started by
3 comments, last by mdias 18 years, 10 months ago
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?
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?
No one knows directshow or what?
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.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
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

This topic is closed to new replies.

Advertisement