chromium/services/video_capture/BUILD.gn

# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//testing/test.gni")

source_set("lib") {
  sources = [
    "broadcasting_receiver.cc",
    "broadcasting_receiver.h",
    "device.h",
    "device_factory.h",
    "device_factory_impl.cc",
    "device_factory_impl.h",
    "device_media_to_mojo_adapter.cc",
    "device_media_to_mojo_adapter.h",
    "devices_changed_notifier.cc",
    "devices_changed_notifier.h",
    "gpu_memory_buffer_virtual_device_mojo_adapter.cc",
    "gpu_memory_buffer_virtual_device_mojo_adapter.h",
    "push_video_stream_subscription_impl.cc",
    "push_video_stream_subscription_impl.h",
    "shared_memory_virtual_device_mojo_adapter.cc",
    "shared_memory_virtual_device_mojo_adapter.h",
    "testing_controls_impl.cc",
    "testing_controls_impl.h",
    "texture_virtual_device_mojo_adapter.cc",
    "texture_virtual_device_mojo_adapter.h",
    "video_capture_service_impl.cc",
    "video_capture_service_impl.h",
    "video_source_impl.cc",
    "video_source_impl.h",
    "video_source_provider_impl.cc",
    "video_source_provider_impl.h",
    "virtual_device_enabled_device_factory.cc",
    "virtual_device_enabled_device_factory.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  public_deps = [
    "//base",
    "//media",
    "//media/capture:capture",
    "//media/capture/mojom:image_capture",
    "//media/mojo/common:common",
    "//mojo/public/cpp/system",
    "//services/video_capture/public/cpp",
    "//services/video_capture/public/mojom",
    "//services/video_capture/public/mojom:constants",
    "//services/video_effects:buildflags",
    "//services/video_effects/public/mojom:mojom",
    "//services/viz/public/cpp/gpu",
  ]

  deps = [
    "//build:chromeos_buildflags",
    "//media/capture:capture_lib",
    "//media/capture:capture_switches",
  ]

  if (is_chromeos) {
    deps += [ "//chromeos/crosapi/mojom" ]
  }

  if (is_chromeos_ash) {
    sources += [
      "ash/video_capture_device_ash.cc",
      "ash/video_capture_device_ash.h",
      "ash/video_capture_device_factory_ash.cc",
      "ash/video_capture_device_factory_ash.h",
      "ash/video_frame_handler_ash.cc",
      "ash/video_frame_handler_ash.h",
    ]

    deps += [
      "//base",
      "//services/video_capture/public/cpp:cpp",
      "//services/video_capture/public/mojom",
    ]

    public_deps += [ "//media/capture/video/chromeos/mojom:cros_camera" ]
  }

  if (is_chromeos_lacros) {
    sources += [
      "lacros/device_factory_adapter_lacros.cc",
      "lacros/device_factory_adapter_lacros.h",
      "lacros/device_proxy_lacros.cc",
      "lacros/device_proxy_lacros.h",
      "lacros/video_buffer_adapters.cc",
      "lacros/video_buffer_adapters.h",
      "lacros/video_frame_handler_proxy_lacros.cc",
      "lacros/video_frame_handler_proxy_lacros.h",
    ]

    deps += [ "//chromeos/lacros" ]
  }
}

source_set("tests") {
  testonly = true

  sources = [
    "broadcasting_receiver_unittest.cc",
    "device_media_to_mojo_adapter_unittest.cc",
    "devices_changed_notifier_unittest.cc",
    "gpu_memory_buffer_virtual_device_mojo_adapter_unittest.cc",
    "test/fake_device_descriptor_test.cc",
    "test/fake_device_descriptor_test.h",
    "test/fake_video_capture_device_test.cc",
    "test/fake_video_capture_device_test.h",
    "test/fake_video_capture_device_unittest.cc",
    "test/mock_devices_changed_observer.cc",
    "test/mock_devices_changed_observer.h",
    "test/mock_video_capture_device_shared_access_unittest.cc",
    "test/mock_video_capture_device_test.cc",
    "test/mock_video_capture_device_test.h",
    "test/mock_video_capture_device_unittest.cc",
    "test/service_lifecycle_unittest.cc",
    "test/video_capture_service_test.cc",
    "test/video_capture_service_test.h",
    "test/video_capture_service_unittest.cc",
    "test/virtual_device_unittest.cc",
    "texture_virtual_device_mojo_adapter_unittest.cc",
  ]

  deps = [
    ":lib",
    "//base/test:test_support",
    "//build:chromeos_buildflags",
    "//media/capture:test_support",
    "//media/capture/mojom:video_capture",
    "//services/video_capture/public/cpp:mocks",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/gfx:test_support",
  ]
}