Commit 7e9346d4 authored by Shik Chen's avatar Shik Chen Committed by Commit Bot

Only start CameraHalDispatcher when using cros-camera service

We already did this in Chrome [1], and we should also do it here to
prevent confusing error messages for old devices that are not using
cros-camera service.

[1] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/media_stream_manager.cc?l=541&rcl=db450183134eacfd8b877f7c55ada55f52d4dd1f

  "bind /var/run/camera/camera3.sock: Permission denied (13)"
  on old devices.

Bug: b:132770443
Test: Passes capture_unittests, and there is no error message like
Change-Id: I02a0bab188a242b0690fb1f24f123305bb2d5dcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627273
Auto-Submit: Shik Chen <shik@chromium.org>
Commit-Queue: Tommi <tommi@chromium.org>
Reviewed-by: default avatarTommi <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662583}
parent 9a816135
......@@ -259,7 +259,8 @@ class VideoCaptureDeviceTest
std::make_unique<LocalGpuMemoryBufferManager>();
VideoCaptureDeviceFactoryChromeOS::SetGpuBufferManager(
local_gpu_memory_buffer_manager_.get());
if (!CameraHalDispatcherImpl::GetInstance()->IsStarted()) {
if (media::ShouldUseCrosCameraService() &&
!CameraHalDispatcherImpl::GetInstance()->IsStarted()) {
CameraHalDispatcherImpl::GetInstance()->Start(
base::DoNothing::Repeatedly<
chromeos_camera::mojom::MjpegDecodeAcceleratorRequest>(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment