1

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.

  • It is possible that you video codec is using a hardware chip for decoding the stream, in such case you might not be able to decode more that one stream at a time if the chip does not support it. – yms Oct 19 '12 at 14:16
  • It is unclear what goes wrong exactly. Chances are high the problem is somewhere not too deep, where you can work it around. – Roman R. May 20 '14 at 11:55

2 Answers2

0

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;
}
zzhong2
  • 16
  • 1
  • Funny to see the answer after 9 years. Anyway it looks like an answer to me so checking this (definitely helpful) but I am not willing to try this. I moved from windows long time ago. – Lukasz Foniok Mar 04 '22 at 06:41
-1

I am surprised that you are able to get the streaming going at all. I read this:

IMediaControl interface are not supported on Windows Embedded Compact either. Attempting to access either member will generate an E_NOTIMPL error

In: http://msdn.microsoft.com/en-us/library/ee494426.aspx

fizruk
  • 1,855
  • 14
  • 24
  • 1
    You appear to have misread your source. Only the get_FilterCollection and get_RegFilterCollection members are unsupported. – Nick Udell May 20 '14 at 11:19