capture_switches.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "media/capture/capture_switches.h"
  5. #include "base/command_line.h"
  6. namespace switches {
  7. // Enables GpuMemoryBuffer-based buffer pool.
  8. const char kVideoCaptureUseGpuMemoryBuffer[] =
  9. "video-capture-use-gpu-memory-buffer";
  10. // This is for the same feature controlled by kVideoCaptureUseGpuMemoryBuffer.
  11. // kVideoCaptureUseGpuMemoryBuffer is settled by chromeos overlays. This flag is
  12. // necessary to overwrite the settings via chrome:// flag. The behavior of
  13. // chrome://flag#zero-copy-video-capture is as follows;
  14. // Default : Respect chromeos overlays settings.
  15. // Enabled : Force to enable kVideoCaptureUseGpuMemoryBuffer.
  16. // Disabled : Force to disable kVideoCaptureUseGpuMemoryBuffer.
  17. const char kDisableVideoCaptureUseGpuMemoryBuffer[] =
  18. "disable-video-capture-use-gpu-memory-buffer";
  19. CAPTURE_EXPORT bool IsVideoCaptureUseGpuMemoryBufferEnabled() {
  20. return !base::CommandLine::ForCurrentProcess()->HasSwitch(
  21. switches::kDisableVideoCaptureUseGpuMemoryBuffer) &&
  22. base::CommandLine::ForCurrentProcess()->HasSwitch(
  23. switches::kVideoCaptureUseGpuMemoryBuffer);
  24. }
  25. } // namespace switches