get out of windowless mode

Tech-Archive recommends: Fix windows errors by optimizing your registry



I have created a class to handle my webcams in C++/CLI (I further use
C# code for the application). I am trying to use an attach/detach
approach, meaning you can attach the preview video of a webcam to a
window, and after detach it.

So, in the constructor I am creating the main interfaces, in the attach
method I am setting the windowless mode and the window that receives
the video, then call Render Stream and Run. The detach method doesn't
do much, just releases few interfaces. I want to know what is the
proper way to 'detach' the preview video from the window. Logically, it
should bring my object into the state it was before the attach was
performed.

Here's the code for my attach method:

// get the vmr filter config interface
IVMRFilterConfig9* pConfig = NULL;
hr = _pVmrFilter->QueryInterface(IID_IVMRFilterConfig9, (void**)
&pConfig);
_pConfig = pConfig;
TREATCODE(hr);

// set the rendering mode to windowless
hr = _pConfig->SetRenderingMode(VMRMode_Windowless);
TREATCODE(hr);

// interface for vmr windowless previewing
IVMRWindowlessControl9* pVMRwc9 = NULL;
hr = _pVmrFilter->QueryInterface(IID_IVMRWindowlessControl9, (void **)
&pVMRwc9);
_pVMRwc9 = pVMRwc9;
TREATCODE(hr);

// set the display control window
hr = _pVMRwc9->SetVideoClippingWindow((HWND)display->Handle.ToInt32());
TREATCODE(hr);

// ask the capture builder to link the filters
hr = _pCapture->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,
_pSrcFilter, _pColor, _pVmrFilter);
TREATCODE(hr);

// set the output window size
RECT r;
r.left = 0;
r.top = 0;
r.right = display->Width;
r.bottom = display->Height;
hr = _pVMRwc9->SetVideoPosition(NULL, &r);
TREATCODE(hr);

// get the media control interface
IMediaControl* pMC = NULL;
hr = _pGraph->QueryInterface(IID_IMediaControl, (void **) &pMC);
_pMC = pMC;
TREATCODE(hr);

// start previewing
hr = _pMC->Run();
TREATCODE(hr);

How do I undo these actions?

.



Relevant Pages

  • Re: Roguelike Interface
    ... I've made a screenshot of my roguelike for you, ... The interface is MDI. ... a set of child windows which are contained inside one parent window. ... The player can make any layout they like, ...
    (rec.games.roguelike.development)
  • MicroSoft update fix KB935807 (and others?)
    ... including SoftwareDistrubution folder and Catroot2 folder. ... After pasting the above commands, please close the Notepad window. ... System Configuration Utility when Windows starts" box and click OK. ... Icon to click in order to attach a file. ...
    (microsoft.public.windowsupdate)
  • Re: the new interface
    ... multi-documents-based applications in MacOS X (like QuickTime, AppleWorks, TextEdit, etc. which keep the multi-window interface). ... As such, it seems appropriate to me that all associated components should be contained in a single window, while each window represents a unique RB document. ... TextEdit, ... The important thing to realize is the difference between separating documents into different windows, and separating information into different windows. ...
    (comp.lang.basic.realbasic)
  • Re: List boxes in Microfocus Dialog System/Net Express?
    ... > are the row indexes of the drop-down and that's the value that's ... > The interface works quite well for choosing the status from the list ... > yet another window to the process (this window is for a small sub-set ... I fired up Word and, using the default settings, Times Roman 11.5pt, I typed ...
    (comp.lang.cobol)
  • Re: ipAttach error
    ... ifAddrSet to attach to dc1 device. ... Would that be part of the BSP? ... Attaching network interface lo0... ... present for fei0 and fei1, and if present, check if any of them is ...
    (comp.os.vxworks)