0

[MappableSI] Do not use IsVideoCaptureUseGpuMemoryBufferEnabled.

Do not use switches::IsVideoCaptureUseGpuMemoryBufferEnabled() to
determine if GpuChannel needs to be enabled on a given platform or not.
This will result in always establishing gpu channel for
media capture process instead of establishing it conditionally based
on the switches.

Note that whether GpuChannel will be established in capture process for
a given platform is decided by the build flag
ENABLE_GPU_CHANNEL_MEDIA_CAPTURE.

Bug: 40264379
Change-Id: I3847ade7bb12e150bc290cbb55cffcdaecb33ed1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021617
Auto-Submit: vikas soni <vikassoni@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/main@{#1384594}
This commit is contained in:
vikas soni
2024-11-18 22:29:05 +00:00
committed by Chromium LUCI CQ
parent c0430f7c02
commit 4b40a36017
2 changed files with 7 additions and 18 deletions
content/utility
services/video_capture

@ -335,18 +335,12 @@ auto RunVideoCapture(
auto service = std::make_unique<UtilityThreadVideoCaptureServiceImpl>(
std::move(receiver), base::SingleThreadTaskRunner::GetCurrentDefault());
#if BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE)
#if BUILDFLAG(IS_CHROMEOS_ASH)
{
#else
if (switches::IsVideoCaptureUseGpuMemoryBufferEnabled()) {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
mojo::PendingRemote<viz::mojom::Gpu> remote_gpu;
UtilityThread::Get()->BindHostReceiver(
remote_gpu.InitWithNewPipeAndPassReceiver());
std::unique_ptr<viz::Gpu> viz_gpu = viz::Gpu::Create(
std::move(remote_gpu), UtilityThread::Get()->GetIOTaskRunner());
service->SetVizGpu(std::move(viz_gpu));
}
mojo::PendingRemote<viz::mojom::Gpu> remote_gpu;
UtilityThread::Get()->BindHostReceiver(
remote_gpu.InitWithNewPipeAndPassReceiver());
std::unique_ptr<viz::Gpu> viz_gpu = viz::Gpu::Create(
std::move(remote_gpu), UtilityThread::Get()->GetIOTaskRunner());
service->SetVizGpu(std::move(viz_gpu));
#endif // BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE)
return service;

@ -329,17 +329,12 @@ void VideoCaptureServiceImpl::LazyInitializeGpuDependenciesContext() {
if (!gpu_dependencies_context_)
gpu_dependencies_context_ = std::make_unique<GpuDependenciesContext>();
// Gpu channel is enabled on all platforms except Lacros.
#if BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE)
#if BUILDFLAG(IS_CHROMEOS_ASH)
{
#else
if (switches::IsVideoCaptureUseGpuMemoryBufferEnabled()) {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
if (!viz_gpu_context_provider_) {
viz_gpu_context_provider_ =
std::make_unique<VizGpuContextProvider>(std::move(viz_gpu_));
}
}
#endif // BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE)
}