AVI Playback in full screen D3D application

AVI Playback in full screen D3D application

Post by Antony Carte » Sat, 25 Jan 2003 07:26:13



The videos always play at the begining of the game but
the video picture does not always get displayed, although
the audio can always be heard.

I have disabled the D3D rendering in the main game loop,
so i know its not D3D trying to draw to the screen.

I create the AVI window using
hr = pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS );
DBG_ASSERT( !FAILED( hr ) );
pVW->SetWindowForeground(OATRUE);

//RESIZE VIDEO SO THAT ITS FULL SCREEN
RECT rect;
wndH->GetClientRect(&rect);
pVW->SetWindowPosition0,0,rect.right,rect.bottom);

To load the file im using the RenderFile function.

The only feedback im getting from the de* is it
occasionaly says "There is a window on top of us!", but
it does not say this everytime the picture is displayed.

 
 
 

AVI Playback in full screen D3D application

Post by Daniel Ludwi » Sun, 26 Jan 2003 02:57:26



Quote:

> The videos always play at the begining of the game but
> the video picture does not always get displayed, although
> the audio can always be heard.

AFAIK, video is only visible when the correct render
buffer is on top of the flipping chain. It has to be
the "desktop" buffer, the one set as primary (visible)
buffer after D3D device creation. Then, video is visible
only after every other Present() call - assuming you have
a backbuffer count of 1.

So, to make sure video is visible, you may simply count
your Present() calls, and call it again until your
counter reaches (count % (num_of_backbuffers + 1)) == 0.

Daniel

 
 
 

AVI Playback in full screen D3D application

Post by Antony Carte » Thu, 30 Jan 2003 02:02:16


Cheers mate you were right, the picture works everytime
now, do you happen to know where you read about videos
only being able to play on the primary surface cos ive
been trying to solve this bug for a while

>-----Original Message-----


>> The videos always play at the begining of the game but
>> the video picture does not always get displayed,
although
>> the audio can always be heard.

>AFAIK, video is only visible when the correct render
>buffer is on top of the flipping chain. It has to be
>the "desktop" buffer, the one set as primary (visible)
>buffer after D3D device creation. Then, video is visible
>only after every other Present() call - assuming you have
>a backbuffer count of 1.

>So, to make sure video is visible, you may simply count
>your Present() calls, and call it again until your
>counter reaches (count % (num_of_backbuffers + 1)) == 0.

>Daniel

>.

 
 
 

AVI Playback in full screen D3D application

Post by Daniel Ludwi » Thu, 30 Jan 2003 04:02:43




Quote:

> Cheers mate you were right, the picture works everytime
> now, do you happen to know where you read about videos
> only being able to play on the primary surface cos ive
> been trying to solve this bug for a while

I'm not sure. I can remember that in past DirectX versions,
there was a function to check if the current primary
surface was "equal to" the GDI surface. Plus, if you did
a program shutdown while the other surface was in place,
you'd end with a messed up Windows desktop (I think this
still can happen sometimes).

Anyway, I recently had to display some mixed AVI videos
and logo screens. I stumbled over the same problem,
remembered the above and just gave it a try. :)

Daniel

 
 
 

1. Scaled AVI playback in screen saver in NT 4.0

I'm tinkering with a screensaver that moves an avi window around the
screen.  On eof the configuration options is to scale the AVI to make it
larger or smaller than its default playback size.  When the screen
saver's window is created, in the WM_CREATE handler, I create a child
window for the AVI playback.  After the window is created, I call MCI
send string with "open <filename> alias vid" then "window vid handle
<playback hwnd>" then I resize the window, call "put vid destination",
and finally "play vid window repeat".

Here's the kicker-When I test the screen saver manually everything works
fine.  When NT kicks off the screen saver itself, the window gets
resized, but the AVI file is still playing full-size in the video
window, which clips the frames to the size of the window.

What am I missing?  I'm currently running NT 4.0 (service Pack 1)

Any thoughts would be greatly appreciated.

Chris Conti
--

---------------------------------------------------------
The one good thing about repeating your mistakes is that
you know when to cringe.

**SPAMicide**
replace .--- with .com for e-mail

2. Randall with software

3. assert message box problem in D3D full screen mode

4. Best Launcher

5. Detect If an Application is in Full Screen Mode

6. test 100% 102

7. Switch console mode application to full screen ?

8. Can someone tell me?

9. Write to Full Screen Application

10. Full screen application

11. Full screen applications

12. Full-Screen Windows Applications - How To ??

13. Fixing the frame rate in full screen d3d8 application