summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/content_main_delegate_qt.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 708d175f3..f93a3c0ea 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -48,6 +48,7 @@
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
+#include "media/gpu/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
@@ -71,8 +72,23 @@
#include "ui/base/ui_base_switches.h"
#endif
+// must be included before vaapi_wrapper.h
#include <QtCore/qcoreapplication.h>
+#if defined(OS_WIN)
+#include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
+#include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h"
+#endif
+
+#if defined(OS_MACOSX)
+#include "content/public/common/content_features.h"
+#include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
+#endif
+
+#if BUILDFLAG(USE_VAAPI)
+#include "media/gpu/vaapi/vaapi_wrapper.h"
+#endif
+
namespace content {
ContentClient *GetContentClient();
}
@@ -188,6 +204,22 @@ void ContentMainDelegateQt::PreSandboxStartup()
if (parsedCommandLine->HasSwitch(switches::kSingleProcess))
setlocale(LC_NUMERIC, "C");
#endif
+
+ // from gpu_main.cc:
+#if BUILDFLAG(USE_VAAPI)
+ media::VaapiWrapper::PreSandboxInitialization();
+#endif
+#if defined(OS_WIN)
+ media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
+ media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
+#endif
+
+#if defined(OS_MACOSX)
+ if (base::FeatureList::IsEnabled(features::kMacV2GPUSandbox)) {
+ TRACE_EVENT0("gpu", "Initialize VideoToolbox");
+ media::InitializeVideoToolbox();
+ }
+#endif
}
content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient()