{"id":1082,"date":"2009-10-09T19:04:27","date_gmt":"2009-10-09T17:04:27","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1082"},"modified":"2009-10-09T19:04:27","modified_gmt":"2009-10-09T17:04:27","slug":"how-to-use-windowless-video-mixing-renderer-filter-to-show-video-fullscreen","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1082","title":{"rendered":"How to use windowless Video Mixing Renderer Filter to show video fullscreen"},"content":{"rendered":"<p>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 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd377320(VS.85).aspx\">IVideoWindow::put_FullScreenMode<\/a> property, and even <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd375786(VS.85).aspx\">Filter Graph Manager<\/a> exposes its own <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd377276%28VS.85%29.aspx\">IVideoWindow<\/a> interface to forward calls to filter&#8217;s implementation of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd377276%28VS.85%29.aspx\">IVideoWindow<\/a> interface.<\/p>\n<p>However, for Video Mixing Renderers, version <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd407343(VS.85).aspx\">7<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd407344%28VS.85%29.aspx\">9<\/a>, the preferred and recommended mode is windowless, where no IVideoWindow interface is available.<\/p>\n<blockquote><p><strong>Note<\/strong> The <a id=\"ctl00_MTCS_main_ctl01\" onclick=\"javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl01',this);\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd390536%28VS.85%29.aspx\"><strong>IVMRWindowlessControl<\/strong><\/a> or <a id=\"ctl00_MTCS_main_ctl02\" onclick=\"javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl02',this);\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd390537%28VS.85%29.aspx\"><strong>IVMRWindowlessControl9<\/strong><\/a> interface is now preferred over <strong>IVideoWindow<\/strong>. For more information, see <a id=\"ctl00_MTCS_main_ctl03\" onclick=\"javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl03',this);\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd407299%28VS.85%29.aspx\">Using Windowless Mode<\/a>.<\/p><\/blockquote>\n<p>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.<\/p>\n<p>The sample project <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/FullScreenWindowlessVmrSample01\">FullScreenWindowlessVmrSample01<\/a> is illustrating this technique.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1083\" title=\"FullScreenWindowlessVmrSample01 Main Dialog\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/10\/09-Image001.png\" alt=\"FullScreenWindowlessVmrSample01 Main Dialog\" width=\"489\" height=\"141\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/10\/09-Image001.png 489w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/10\/09-Image001-320x92.png 320w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/p>\n<p><!--more-->Main application dialog owns a special window to host renderer, implemented by CRendererDialog class.<\/p>\n<pre>\r\n<pre style=\"background: #ffffff none repeat scroll 0% 0%; color: #000000;\"><span style=\"color: #800000; font-weight: bold;\">class<\/span> CRendererDialog <span style=\"color: #800080;\">:<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">public<\/span> CDialogImpl<span style=\"color: #800080;\">&lt;<\/span>CRendererDialog<span style=\"color: #800080;\">&gt;<\/span>\r\n<span style=\"color: #800080;\">{<\/span>\r\n<span style=\"color: #800000; font-weight: bold;\">public<\/span><span style=\"color: #e34adc;\">:<\/span>\r\n\r\n    <span style=\"color: #800000; font-weight: bold;\">enum<\/span> <span style=\"color: #800080;\">{<\/span> IDD <span style=\"color: #808030;\">=<\/span> IDD_RENDERER <span style=\"color: #800080;\">}<\/span><span style=\"color: #800080;\">;<\/span>\r\n\r\nBEGIN_MSG_MAP_EX<span style=\"color: #808030;\">(<\/span>CRendererDialog<span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_INITDIALOG<span style=\"color: #808030;\">(<\/span>OnInitDialog<span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_DESTROY<span style=\"color: #808030;\">(<\/span>OnDestroy<span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_ERASEBKGND<span style=\"color: #808030;\">(<\/span><span style=\"color: #400000;\">OnEraseBkgnd<\/span><span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_PAINT<span style=\"color: #808030;\">(<\/span>OnPaint<span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_DISPLAYCHANGE<span style=\"color: #808030;\">(<\/span>OnDisplayChange<span style=\"color: #808030;\">)<\/span>\r\n    MSG_WM_KEYDOWN<span style=\"color: #808030;\">(<\/span>OnKeyDown<span style=\"color: #808030;\">)<\/span>\r\n    COMMAND_ID_HANDLER_EX<span style=\"color: #808030;\">(<\/span>IDCANCEL<span style=\"color: #808030;\">,<\/span> OnCancel<span style=\"color: #808030;\">)<\/span>\r\nEND_MSG_MAP<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span>\r\n\r\n<span style=\"color: #800000; font-weight: bold;\">private<\/span><span style=\"color: #e34adc;\">:<\/span>\r\n    CMainDialog<span style=\"color: #808030;\">&amp;<\/span> m_Owner<span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/...<\/span><\/pre>\n<p>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.<\/p>\n<pre>\r\n<pre style=\"background: #ffffff none repeat scroll 0% 0%; color: #000000;\">ATLVERIFY<span style=\"color: #808030;\">(<\/span>m_RendererDialog<span style=\"color: #808030;\">.<\/span>Create<span style=\"color: #808030;\">(<\/span>m_hWnd<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nATLVERIFY<span style=\"color: #808030;\">(<\/span>m_RendererDialog<span style=\"color: #808030;\">.<\/span><span style=\"color: #400000;\">MoveWindow<\/span><span style=\"color: #808030;\">(<\/span>MonitorData<span style=\"color: #808030;\">.<\/span>m_Position<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nm_RendererDialog<span style=\"color: #808030;\">.<\/span><span style=\"color: #400000;\">ShowWindow<\/span><span style=\"color: #808030;\">(<\/span>SW_SHOWNORMAL<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/ ...<\/span>\r\nATLENSURE_SUCCEEDED<span style=\"color: #808030;\">(<\/span>pVmrWindowlessControl<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>SetVideoClippingWindow<span style=\"color: #808030;\">(<\/span>m_RendererDialog<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nATLENSURE_SUCCEEDED<span style=\"color: #808030;\">(<\/span>pVmrWindowlessControl<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>SetVideoPosition<span style=\"color: #808030;\">(<\/span><span style=\"color: #7d0045;\">NULL<\/span><span style=\"color: #808030;\">,<\/span> m_RendererDialog<span style=\"color: #808030;\">.<\/span>GetVideoPosition<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span><\/pre>\n<p>Visual C++ .NET 2008 source code is <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/FullScreenWindowlessVmrSample01\">available from SVN<\/a>, release binary <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/FullScreenWindowlessVmrSample01\/Release\/FullScreenWindowlessVmrSample01.exe?format=raw\">included<\/a>. The project is using ATL and <a href=\"http:\/\/wtl.sourceforge.net\/\">WTL<\/a> libraries.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s implementation of IVideoWindow interface. However, for Video Mixing Renderers, version 7&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1082\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13,12,10,20],"tags":[78,275,276,277,121,137,488,486,111,149],"class_list":["post-1082","post","type-post","status-publish","format-standard","hentry","category-atl","category-source","category-technology","category-video","category-wtl","tag-directshow","tag-fullscreen","tag-ivideowidow","tag-ivmrwindowlesscontrol","tag-renderer","tag-sample","tag-source","tag-video","tag-vmr","tag-windowless"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1082"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1082\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}