DirectShow IVideoWindow and Full Screen - Can I write to my main D3D surface?

Writing a game, and I would like some videos in the middle. In windowed mode, DirectShow classes work great and are easy to use. But when the game is full-screen, I can not get DirectShow to show full-screen mode.

Basically, when my D3D device is initialized, I can’t display the video, even with IVideoWindow.put_Fullscreen (true). I guess DirectShow just can't do full screen mode with a D3D device.

So, I tried to free my D3D device while the video is playing and reinitializing it again. This seems to work very well, but when DirectShow plays full screen, it seems that it stole the focus from the main application window and did not return it when it was done. This causes DirectInput to not be able to retrieve the device again after this (gives me the "Access denied" error code). I tried SetForegroundWindow () before the acquisition, but this does not fix it, so this may not be a problem.

In any case, the long story, all I want is a full-screen video in the middle of my D3D application. Is there a preferred way to do this? Can I do this by getting DirectShow on my main D3D surface? I think this will fix the problems that I have.

+6
delphi directx directshow
source share
2 answers

You want to create your own distributor for Video Mixing Renderer 9. This is much easier than creating your own rendering filter, and it is specifically designed for D3D interaction.

There is an example in the Windows SDK. Here is the mine:

C: \ Program Files \ Microsoft SDK \ Windows \ v7.0 \ Samples \ Multimedia \ directshow \ vmr9 \ vmr9allocator

+2
source share

Look at the "DumpFilter". Using this, you can easily write a filter that will be directly written to the D3D texture. Also, keep in mind that you do not need to support external compilation. You can simply specify the class and use it. It does not need to be opened outside your application ...

Edit: DumpFilter is one example of the DirectShow API.

+2
source share

All Articles