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>
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;