Hello i am struggling for past few days, with simple application which could create multiple previews for simultaneous video playback of different video streams ( but same formats in example mpeg4 ). On my platform there are no Xaml runtime so i am using simple WinApi32 functions with DirectShow.
But no matter what i do i can not achieve more than one video stream playing at once. I am in doubt right now if it is even possible with DirectShow on windows Embedded Compact. But maybe i am wrong since i didn't descend in details of creating filters graphs.
My approach was to simply create few IBuilderGraph, IMediaControl, and IMediaEventEx interfaces. Then i use RenderFile method for each graph builder to create filter graph, then create IVideoWindow for each sets notification window and use IMediaControl::Run to start playing file.
This works on desktop windows 7 platform, but simply doesn't work on CE. Only one preview is actually playing video stream, and the other ones are black and doesn't show anything.
So my question is "Is this possible to have multiply video playbacks on windows embedded compact 7?" and if it is, please explain what tool could i use.
Microsoft official website has explained https://learn.microsoft.com/en-us/windows/win32/api/control/nn-control-ivideowindow IVideoWindow interface (control.h)
The IVideoWindow interface sets properties on the video window. Applications can use it to set the window owner, the position and dimensions of the window, and other properties.
Note The IVMRWindowlessControl or IVMRWindowlessControl9 interface is now preferred over IVideoWindow. For more information, see Using Windowless Mode.
The Video Renderer filter and the Filter Graph Manager both expose this interface. The Filter Graph Manager forwards all method calls to the Video Renderer. It also forwards certain window messages that the Video Renderer needs to receive, such as WM_DISPLAYCHANGE. Because the video window is usually a child of an application window, the filter would not otherwise receive these messages. Therefore it relies on the Filter Graph Manager to forward them. In most cases, an application should query the Filter Graph Manager for this interface, and not call the filter directly, because of the messaging issue just described. However, if the filter graph has more than one Video Renderer, the Filter Graph Manager only communicates with one of them, selected arbitrarily. Therefore, if your application uses multiple video windows, use the IVideoWindow interface directly on the filters. In that case, you must forward window messages to each Video Renderer instance, using the IVideoWindow::NotifyOwnerMessage method.
Example code is as follows https://cpp.hotexamples.com/examples/-/IVideoWindow/-/cpp-ivideowindow-class-examples.html
HRESULT
recChannel_t::unmap(void)
{
__CONTEXT("recChannel_t::unmap");
IBaseFilter *pFilter = NULL;
int hr = 0;
hr = pGraph->FindFilterByName(L"Video Renderer", &pFilter);
if (!hr)
{
IVideoWindow *pWindowInfo = NULL;
hr = pFilter->QueryInterface(IID_IVideoWindow, (void **)&pWindowInfo);
errorCheck(hr);
pWindowInfo->put_Visible(OAFALSE);
pWindowInfo->put_AutoShow(OAFALSE);
pWindowInfo->Release();
}
pControl->StopWhenReady();
#ifdef _WINDOWS
if (fControl)
{
fControl->CWnd::ShowWindow(SW_HIDE);
}
#endif
mapping = false;
return 0;
}