How to use windowless Video Mixing Renderer Filter to show video fullscreen

The question is being asked from time to time. Everyone knows what is full screen video. Video renderers implement full screen capability since long ago through their IVideoWindow::put_FullScreenMode property, and even Filter Graph Manager exposes its own IVideoWindow interface to forward calls to filter’s implementation of IVideoWindow interface.

However, for Video Mixing Renderers, version 7 and 9, the preferred and recommended mode is windowless, where no IVideoWindow interface is available.

Note The IVMRWindowlessControl or IVMRWindowlessControl9 interface is now preferred over IVideoWindow. For more information, see Using Windowless Mode.

So in order to implement full screen mode it takes the application to attach Video Mixing Renderer filter to a private frameless window, to its entire client area and expand the window to entire monitor area.

The sample project FullScreenWindowlessVmrSample01 is illustrating this technique.

FullScreenWindowlessVmrSample01 Main Dialog

Main application dialog owns a special window to host renderer, implemented by CRendererDialog class.

class CRendererDialog :
    public CDialogImpl<CRendererDialog>
{
public:

    enum { IDD = IDD_RENDERER };

BEGIN_MSG_MAP_EX(CRendererDialog)
    MSG_WM_INITDIALOG(OnInitDialog)
    MSG_WM_DESTROY(OnDestroy)
    MSG_WM_ERASEBKGND(OnEraseBkgnd)
    MSG_WM_PAINT(OnPaint)
    MSG_WM_DISPLAYCHANGE(OnDisplayChange)
    MSG_WM_KEYDOWN(OnKeyDown)
    COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
END_MSG_MAP()

private:
    CMainDialog& m_Owner;
//...

The dialog template does not have a caption, it has no frame and has its window rectangle equal to client area. As a result, spanning the Video Mixing Renderer to the entire client area and proper positioning of the dialog window is showing video on the entire monitor.

ATLVERIFY(m_RendererDialog.Create(m_hWnd));
ATLVERIFY(m_RendererDialog.MoveWindow(MonitorData.m_Position));
m_RendererDialog.ShowWindow(SW_SHOWNORMAL);
// ...
ATLENSURE_SUCCEEDED(pVmrWindowlessControl->SetVideoClippingWindow(m_RendererDialog));
ATLENSURE_SUCCEEDED(pVmrWindowlessControl->SetVideoPosition(NULL, m_RendererDialog.GetVideoPosition()));

Visual C++ .NET 2008 source code is available from SVN, release binary included. The project is using ATL and WTL libraries.

4 Replies to “How to use windowless Video Mixing Renderer Filter to show video fullscreen”

  1. Since there is no clock.avi on Windows 7, the application looks for an .AVI file in the following order:

    • FullScreenWindowlessVmrSample01.avi in the directory of .EXE file
    • FullScreenWindowlessVmrSample01.avi in the directory, parent to directory of .EXE file
    • clock.avi in Windows directory

    It might be required to provide an .AVI file for the application to start working.

  2. Hello!

    I came across this in a web search. I am programming in Delphi. Do you have any experience with that language? Do you think it would be possible for me to convert this source to Delphi?
    I am impressed with how efficiently the monitor updates and how few resources are used! Great job!!

    Tony

  3. I am programming in Delphi. Do you have any experience with that language? Do you think it would be possible for me to convert this source to Delphi?

    Last time I was in touch with Delphi about 10 years ago. Back in time it was definitely possible to implement the same with Dephi, perhaps it is also quite possible now. Delphi has been having support for COM interfaces and basically DirectShow headers is what you need. And I am sure they are available.

  4. I am using DSPack which is a DirectShow wrapper for Delphi so I’ll check there. Thank you again for the cool idea you have implemented, it is something I have been looking for.

    Tony

Leave a Reply