mediafoundation: Use core dispatcher of current view instead of main view

Main view might be hidden depending on application's view tree.
In that case, ICoreApplication object doesn't return get_MainView() method

Note that nothing about this behavior was documented by Microsoft
https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.core.coreapplication.mainview

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1310>
This commit is contained in:
Seungha Yang 2020-05-29 22:55:56 +09:00
parent 00caf46e3f
commit 12532cc8bb

View file

@ -940,13 +940,8 @@ MediaCaptureWrapper::findCoreDispatcher()
if (!gst_mf_result(hr))
return;
ComPtr<ICoreImmersiveApplication> core_immersive_app;
hr = core_app.As(&core_immersive_app);
if (!gst_mf_result(hr))
return;
ComPtr<ICoreApplicationView> core_app_view;
hr = core_immersive_app->get_MainView (&core_app_view);
hr = core_app->GetCurrentView (&core_app_view);
if (!gst_mf_result(hr))
return;