| # Copyright 2016 The Chromium Authors. All rights reserved. |
| # 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("//build/config/features.gni") |
| import("//build/config/ui.gni") |
| import("//media/media_options.gni") |
| import("//testing/test.gni") |
| |
| group("capture") { |
| public_deps = [ |
| ":capture_lib", |
| "//media/capture/mojom:image_capture", |
| "//media/capture/mojom:image_capture_types", |
| "//media/capture/mojom:video_capture", |
| "//services/service_manager/public/cpp", |
| ] |
| } |
| |
| component("capture_switches") { |
| defines = [ "CAPTURE_IMPLEMENTATION" ] |
| sources = [ |
| "capture_export.h", |
| "capture_switches.cc", |
| "capture_switches.h", |
| ] |
| deps = [ "//base" ] |
| } |
| |
| # Things needed by //media/capture/mojom/video_capture_types.mojom. |
| component("capture_base") { |
| defines = [ "CAPTURE_IMPLEMENTATION" ] |
| sources = [ |
| "capture_export.h", |
| "video/video_capture_device_descriptor.cc", |
| "video/video_capture_device_descriptor.h", |
| "video/video_capture_device_info.cc", |
| "video/video_capture_device_info.h", |
| "video/video_capture_feedback.cc", |
| "video/video_capture_feedback.h", |
| "video_capture_types.cc", |
| "video_capture_types.h", |
| ] |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//media:shared_memory_support", |
| "//media/base:video_facing", |
| "//ui/gfx", |
| ] |
| } |
| |
| # Target which allows breakout of Android BUILD.gn files. |
| source_set("capture_device_specific") { |
| visibility = [ |
| ":capture_lib", |
| "//media/capture/content/android", |
| "//media/capture/video/android", |
| ] |
| defines = [ "CAPTURE_IMPLEMENTATION" ] |
| sources = [ |
| "content/animated_content_sampler.cc", |
| "content/animated_content_sampler.h", |
| "content/capture_resolution_chooser.cc", |
| "content/capture_resolution_chooser.h", |
| "content/smooth_event_sampler.cc", |
| "content/smooth_event_sampler.h", |
| "content/video_capture_oracle.cc", |
| "content/video_capture_oracle.h", |
| "video/blob_utils.cc", |
| "video/blob_utils.h", |
| "video/fake_video_capture_device.cc", |
| "video/fake_video_capture_device.h", |
| "video/fake_video_capture_device_factory.cc", |
| "video/fake_video_capture_device_factory.h", |
| "video/file_video_capture_device.cc", |
| "video/file_video_capture_device.h", |
| "video/file_video_capture_device_factory.cc", |
| "video/file_video_capture_device_factory.h", |
| "video/gpu_memory_buffer_utils.cc", |
| "video/gpu_memory_buffer_utils.h", |
| "video/video_capture_buffer_handle.cc", |
| "video/video_capture_buffer_handle.h", |
| "video/video_capture_device.cc", |
| "video/video_capture_device.h", |
| "video/video_capture_device_factory.cc", |
| "video/video_capture_device_factory.h", |
| ] |
| |
| public_deps = [ ":capture_base" ] |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//build:chromeos_buildflags", |
| "//gpu/command_buffer/client", |
| "//gpu/ipc/common:common", |
| "//media", |
| "//media/capture/mojom:image_capture", |
| "//media/capture/mojom:image_capture_types", |
| "//media/mojo/mojom", |
| "//media/parsers", |
| "//skia", |
| "//third_party/libyuv", |
| "//ui/gfx", |
| ] |
| } |
| |
| component("capture_lib") { |
| defines = [ "CAPTURE_IMPLEMENTATION" ] |
| sources = [ |
| "video/create_video_capture_device_factory.cc", |
| "video/create_video_capture_device_factory.h", |
| "video/scoped_buffer_pool_reservation.h", |
| "video/shared_memory_buffer_tracker.cc", |
| "video/shared_memory_buffer_tracker.h", |
| "video/video_capture_buffer_pool.h", |
| "video/video_capture_buffer_pool_impl.cc", |
| "video/video_capture_buffer_pool_impl.h", |
| "video/video_capture_buffer_pool_util.cc", |
| "video/video_capture_buffer_pool_util.h", |
| "video/video_capture_buffer_tracker.cc", |
| "video/video_capture_buffer_tracker.h", |
| "video/video_capture_buffer_tracker_factory.h", |
| "video/video_capture_buffer_tracker_factory_impl.cc", |
| "video/video_capture_buffer_tracker_factory_impl.h", |
| "video/video_capture_device_client.cc", |
| "video/video_capture_device_client.h", |
| "video/video_capture_metrics.cc", |
| "video/video_capture_metrics.h", |
| "video/video_capture_system.h", |
| "video/video_capture_system_impl.cc", |
| "video/video_capture_system_impl.h", |
| "video/video_frame_receiver.cc", |
| "video/video_frame_receiver.h", |
| "video/video_frame_receiver_on_task_runner.cc", |
| "video/video_frame_receiver_on_task_runner.h", |
| "video_capturer_source.cc", |
| "video_capturer_source.h", |
| ] |
| |
| public_deps = [ |
| ":capture_base", |
| ":capture_device_specific", |
| ":capture_switches", |
| ] |
| |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//build:chromeos_buildflags", |
| "//media", |
| "//media/capture/mojom:image_capture", |
| "//media/capture/mojom:image_capture_types", |
| "//media/capture/mojom:video_capture", |
| "//media/mojo/mojom", |
| "//services/service_manager/public/cpp", |
| "//third_party/libyuv", |
| "//ui/display", |
| "//ui/gfx", |
| ] |
| |
| if (is_android) { |
| public_deps += [ |
| "content/android", |
| "video/android", |
| ] |
| deps += [ |
| "content/android:screen_capture_jni_headers", |
| "video/android:capture_jni_headers", |
| ] |
| } |
| |
| if (is_mac) { |
| sources += [ |
| "video/mac/gpu_memory_buffer_tracker_mac.cc", |
| "video/mac/gpu_memory_buffer_tracker_mac.h", |
| "video/mac/pixel_buffer_pool_mac.cc", |
| "video/mac/pixel_buffer_pool_mac.h", |
| "video/mac/pixel_buffer_transferer_mac.cc", |
| "video/mac/pixel_buffer_transferer_mac.h", |
| "video/mac/sample_buffer_transformer_mac.cc", |
| "video/mac/sample_buffer_transformer_mac.h", |
| "video/mac/video_capture_device_avfoundation_mac.h", |
| "video/mac/video_capture_device_avfoundation_mac.mm", |
| "video/mac/video_capture_device_avfoundation_utils_mac.h", |
| "video/mac/video_capture_device_avfoundation_utils_mac.mm", |
| "video/mac/video_capture_device_decklink_mac.h", |
| "video/mac/video_capture_device_decklink_mac.mm", |
| "video/mac/video_capture_device_factory_mac.h", |
| "video/mac/video_capture_device_factory_mac.mm", |
| "video/mac/video_capture_device_mac.h", |
| "video/mac/video_capture_device_mac.mm", |
| "video/mac/video_capture_metrics_mac.h", |
| "video/mac/video_capture_metrics_mac.mm", |
| ] |
| deps += [ |
| "//components/crash/core/common:crash_key", |
| "//services/video_capture/public/uma", |
| "//third_party/decklink", |
| ] |
| frameworks = [ |
| "AVFoundation.framework", |
| "CoreFoundation.framework", |
| "CoreGraphics.framework", |
| "CoreMedia.framework", |
| "CoreVideo.framework", |
| "Foundation.framework", |
| "IOSurface.framework", |
| "VideoToolbox.framework", |
| ] |
| } |
| |
| if (is_win) { |
| sources += [ |
| "video/win/capability_list_win.cc", |
| "video/win/capability_list_win.h", |
| "video/win/filter_base_win.cc", |
| "video/win/filter_base_win.h", |
| "video/win/gpu_memory_buffer_tracker.cc", |
| "video/win/gpu_memory_buffer_tracker.h", |
| "video/win/metrics.cc", |
| "video/win/metrics.h", |
| "video/win/pin_base_win.cc", |
| "video/win/pin_base_win.h", |
| "video/win/sink_filter_observer_win.h", |
| "video/win/sink_filter_win.cc", |
| "video/win/sink_filter_win.h", |
| "video/win/sink_input_pin_win.cc", |
| "video/win/sink_input_pin_win.h", |
| "video/win/video_capture_buffer_tracker_factory_win.cc", |
| "video/win/video_capture_buffer_tracker_factory_win.h", |
| "video/win/video_capture_device_factory_win.cc", |
| "video/win/video_capture_device_factory_win.h", |
| "video/win/video_capture_device_mf_win.cc", |
| "video/win/video_capture_device_mf_win.h", |
| "video/win/video_capture_device_utils_win.cc", |
| "video/win/video_capture_device_utils_win.h", |
| "video/win/video_capture_device_win.cc", |
| "video/win/video_capture_device_win.h", |
| ] |
| deps += [ "//media/base/win:media_foundation_util" ] |
| libs = [ |
| "mf.lib", |
| "mfplat.lib", |
| "mfreadwrite.lib", |
| "mfuuid.lib", |
| ] |
| ldflags = [ |
| "/DELAYLOAD:mf.dll", |
| "/DELAYLOAD:mfplat.dll", |
| "/DELAYLOAD:mfreadwrite.dll", |
| ] |
| } |
| |
| if (is_linux || is_chromeos_lacros) { |
| sources += [ |
| "video/linux/scoped_v4l2_device_fd.cc", |
| "video/linux/scoped_v4l2_device_fd.h", |
| "video/linux/v4l2_capture_delegate.cc", |
| "video/linux/v4l2_capture_delegate.h", |
| "video/linux/v4l2_capture_device.h", |
| "video/linux/v4l2_capture_device_impl.cc", |
| "video/linux/v4l2_capture_device_impl.h", |
| "video/linux/video_capture_device_factory_linux.cc", |
| "video/linux/video_capture_device_factory_linux.h", |
| "video/linux/video_capture_device_linux.cc", |
| "video/linux/video_capture_device_linux.h", |
| ] |
| } |
| |
| if (is_chromeos_ash) { |
| sources += [ |
| "video/chromeos/camera_3a_controller.cc", |
| "video/chromeos/camera_3a_controller.h", |
| "video/chromeos/camera_app_device_bridge_impl.cc", |
| "video/chromeos/camera_app_device_bridge_impl.h", |
| "video/chromeos/camera_app_device_impl.cc", |
| "video/chromeos/camera_app_device_impl.h", |
| "video/chromeos/camera_app_device_provider_impl.cc", |
| "video/chromeos/camera_app_device_provider_impl.h", |
| "video/chromeos/camera_buffer_factory.cc", |
| "video/chromeos/camera_buffer_factory.h", |
| "video/chromeos/camera_device_context.cc", |
| "video/chromeos/camera_device_context.h", |
| "video/chromeos/camera_device_delegate.cc", |
| "video/chromeos/camera_device_delegate.h", |
| "video/chromeos/camera_hal_delegate.cc", |
| "video/chromeos/camera_hal_delegate.h", |
| "video/chromeos/camera_hal_dispatcher_impl.cc", |
| "video/chromeos/camera_hal_dispatcher_impl.h", |
| "video/chromeos/camera_metadata_utils.cc", |
| "video/chromeos/camera_metadata_utils.h", |
| "video/chromeos/capture_metadata_dispatcher.h", |
| "video/chromeos/display_rotation_observer.cc", |
| "video/chromeos/display_rotation_observer.h", |
| "video/chromeos/gpu_memory_buffer_tracker.cc", |
| "video/chromeos/gpu_memory_buffer_tracker.h", |
| "video/chromeos/pixel_format_utils.cc", |
| "video/chromeos/pixel_format_utils.h", |
| "video/chromeos/request_builder.cc", |
| "video/chromeos/request_builder.h", |
| "video/chromeos/request_manager.cc", |
| "video/chromeos/request_manager.h", |
| "video/chromeos/scoped_video_capture_jpeg_decoder.cc", |
| "video/chromeos/scoped_video_capture_jpeg_decoder.h", |
| "video/chromeos/stream_buffer_manager.cc", |
| "video/chromeos/stream_buffer_manager.h", |
| "video/chromeos/token_manager.cc", |
| "video/chromeos/token_manager.h", |
| "video/chromeos/vendor_tag_ops_delegate.cc", |
| "video/chromeos/vendor_tag_ops_delegate.h", |
| "video/chromeos/video_capture_device_chromeos_delegate.cc", |
| "video/chromeos/video_capture_device_chromeos_delegate.h", |
| "video/chromeos/video_capture_device_chromeos_halv3.cc", |
| "video/chromeos/video_capture_device_chromeos_halv3.h", |
| "video/chromeos/video_capture_device_factory_chromeos.cc", |
| "video/chromeos/video_capture_device_factory_chromeos.h", |
| "video/chromeos/video_capture_features_chromeos.cc", |
| "video/chromeos/video_capture_features_chromeos.h", |
| "video/chromeos/video_capture_jpeg_decoder.h", |
| "video/chromeos/video_capture_jpeg_decoder_impl.cc", |
| "video/chromeos/video_capture_jpeg_decoder_impl.h", |
| ] |
| public_deps += [ "//media/capture/video/chromeos/public" ] |
| deps += [ |
| "//ash/constants", |
| "//build/config/linux/libdrm", |
| "//chromeos/components/camera_app_ui:document_scanning", |
| "//chromeos/components/sensors:sensors", |
| "//chromeos/dbus/power", |
| "//components/chromeos_camera:mojo_mjpeg_decode_accelerator", |
| "//components/chromeos_camera/common", |
| "//components/device_event_log", |
| "//gpu/ipc/common:common", |
| "//media/capture/video/chromeos/mojom:cros_camera", |
| "//third_party/libsync", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| sources += [ |
| "video/fuchsia/video_capture_device_factory_fuchsia.cc", |
| "video/fuchsia/video_capture_device_factory_fuchsia.h", |
| "video/fuchsia/video_capture_device_fuchsia.cc", |
| "video/fuchsia/video_capture_device_fuchsia.h", |
| ] |
| deps += [ |
| "//media/fuchsia/common", |
| "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.camera3", |
| "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp", |
| "//third_party/libyuv", |
| ] |
| } |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| |
| sources = [ |
| "video/mock_device.cc", |
| "video/mock_device.h", |
| "video/mock_device_factory.cc", |
| "video/mock_device_factory.h", |
| "video/mock_gpu_memory_buffer_manager.cc", |
| "video/mock_gpu_memory_buffer_manager.h", |
| "video/mock_video_capture_device_client.cc", |
| "video/mock_video_capture_device_client.h", |
| "video/mock_video_frame_receiver.cc", |
| "video/mock_video_frame_receiver.h", |
| ] |
| |
| deps = [ |
| ":capture_lib", |
| "//base/test:test_support", |
| "//build:chromeos_buildflags", |
| "//gpu/command_buffer/client", |
| "//gpu/command_buffer/common:common", |
| "//media:test_support", |
| "//media/capture/mojom:image_capture", |
| "//media/capture/mojom:image_capture_types", |
| "//testing/gmock", |
| "//ui/gfx:test_support", |
| ] |
| |
| if (is_linux || is_chromeos_lacros) { |
| sources += [ |
| "video/linux/fake_device_provider.cc", |
| "video/linux/fake_device_provider.h", |
| "video/linux/fake_v4l2_impl.cc", |
| "video/linux/fake_v4l2_impl.h", |
| ] |
| } |
| |
| if (is_chromeos_ash) { |
| sources += [ |
| "video/chromeos/mock_camera_module.cc", |
| "video/chromeos/mock_camera_module.h", |
| "video/chromeos/mock_vendor_tag_ops.cc", |
| "video/chromeos/mock_vendor_tag_ops.h", |
| "video/chromeos/mock_video_capture_client.cc", |
| "video/chromeos/mock_video_capture_client.h", |
| ] |
| deps += [ |
| "//media/capture/video/chromeos/mojom:cros_camera", |
| "//media/capture/video/chromeos/public", |
| ] |
| } |
| |
| testonly = true |
| } |
| |
| test("capture_unittests") { |
| use_xvfb = use_xvfb_in_this_config |
| |
| sources = [ |
| "content/animated_content_sampler_unittest.cc", |
| "content/capture_resolution_chooser_unittest.cc", |
| "content/smooth_event_sampler_unittest.cc", |
| "content/video_capture_oracle_unittest.cc", |
| "run_all_unittests.cc", |
| "video/fake_video_capture_device_unittest.cc", |
| "video/file_video_capture_device_unittest.cc", |
| "video/video_capture_device_client_unittest.cc", |
| "video/video_capture_device_unittest.cc", |
| "video/video_capture_metrics_unittest.cc", |
| "video_capture_types_unittest.cc", |
| ] |
| |
| data = [ "//media/test/data/bear.mjpeg" ] |
| |
| deps = [ |
| ":capture", |
| ":test_support", |
| "//base/test:test_support", |
| "//build:chromeos_buildflags", |
| "//gpu/command_buffer/client", |
| "//media:test_support", |
| "//media/capture/mojom:image_capture", |
| "//media/capture/mojom:image_capture_types", |
| "//mojo/core/embedder", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//third_party/libyuv:libyuv", |
| "//ui/gfx:test_support", |
| ] |
| |
| if (is_linux || is_chromeos_lacros) { |
| sources += [ |
| "video/linux/v4l2_capture_delegate_unittest.cc", |
| "video/linux/video_capture_device_factory_linux_unittest.cc", |
| ] |
| } |
| |
| if (is_android) { |
| deps += [ |
| "//media/capture/video/android", |
| "//media/capture/video/android:capture_java", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| deps += [ |
| "//media/fuchsia/camera:test_support", |
| "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.camera3", |
| "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.sysmem", |
| "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp", |
| ] |
| sources += [ |
| "video/fuchsia/video_capture_device_factory_fuchsia_test.cc", |
| "video/fuchsia/video_capture_device_fuchsia_test.cc", |
| ] |
| additional_manifest_fragments = [ |
| "//build/config/fuchsia/test/web_engine_required_capabilities.test-cmx", |
| ] |
| } |
| |
| if (is_mac) { |
| sources += [ |
| "video/mac/pixel_buffer_pool_mac_unittest.mm", |
| "video/mac/pixel_buffer_transferer_mac_unittest.mm", |
| "video/mac/sample_buffer_transformer_mac_unittest.mm", |
| "video/mac/test/mock_video_capture_device_avfoundation_frame_receiver_mac.h", |
| "video/mac/test/mock_video_capture_device_avfoundation_frame_receiver_mac.mm", |
| "video/mac/test/pixel_buffer_test_utils_mac.cc", |
| "video/mac/test/pixel_buffer_test_utils_mac.h", |
| "video/mac/test/video_capture_test_utils_mac.h", |
| "video/mac/test/video_capture_test_utils_mac.mm", |
| "video/mac/video_capture_device_avfoundation_mac_unittest.mm", |
| "video/mac/video_capture_device_factory_mac_unittest.mm", |
| "video/mac/video_capture_device_mac_unittest.mm", |
| "video/mac/video_capture_metrics_mac_unittest.mm", |
| ] |
| frameworks = [ |
| "AVFoundation.framework", |
| "CoreMedia.framework", |
| "CoreVideo.framework", |
| "IOSurface.framework", |
| ] |
| deps += [ "//third_party/ocmock" ] |
| } |
| |
| if (is_win) { |
| sources += [ |
| "video/win/d3d_capture_test_utils.cc", |
| "video/win/d3d_capture_test_utils.h", |
| "video/win/gpu_memory_buffer_tracker_unittest.cc", |
| "video/win/video_capture_device_factory_win_unittest.cc", |
| "video/win/video_capture_device_mf_win_unittest.cc", |
| ] |
| libs = [ |
| "mf.lib", |
| "mfplat.lib", |
| "mfreadwrite.lib", |
| "mfuuid.lib", |
| "dxguid.lib", |
| ] |
| ldflags = [ |
| "/DELAYLOAD:mf.dll", |
| "/DELAYLOAD:mfplat.dll", |
| "/DELAYLOAD:mfreadwrite.dll", |
| ] |
| |
| deps += [ "//media/base/win:media_foundation_util" ] |
| } |
| |
| # TODO(https://crbug.com/1043007): use is_linux. |
| if (is_chromeos_ash) { |
| deps += [ "//media/gpu/test:local_gpu_memory_buffer_manager" ] |
| } |
| |
| if (is_chromeos_ash) { |
| sources += [ |
| "video/chromeos/camera_3a_controller_unittest.cc", |
| "video/chromeos/camera_device_delegate_unittest.cc", |
| "video/chromeos/camera_hal_delegate_unittest.cc", |
| "video/chromeos/camera_hal_dispatcher_impl_unittest.cc", |
| "video/chromeos/request_manager_unittest.cc", |
| "video/chromeos/token_manager_unittest.cc", |
| ] |
| deps += [ |
| "//build/config/linux/libdrm", |
| "//chromeos/dbus/power", |
| "//media/capture/video/chromeos/mojom:cros_camera", |
| "//media/capture/video/chromeos/public", |
| "//mojo/core/embedder", |
| "//third_party/libsync", |
| "//third_party/minigbm", |
| ] |
| } |
| } |