# 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/features.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", ] } # 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_capture_types.cc", "video_capture_types.h", ] deps = [ "//base", "//base:i18n", "//media", "//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", ] if (is_win) { # TODO(jschuh): https://crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } 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/screen_capture_device_core.cc", "content/screen_capture_device_core.h", "content/smooth_event_sampler.cc", "content/smooth_event_sampler.h", "content/thread_safe_capture_oracle.cc", "content/thread_safe_capture_oracle.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/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", "//gpu/command_buffer/client", "//media", "//media/capture/mojom:image_capture", "//media/capture/mojom:image_capture_types", "//media/mojo/interfaces:interfaces", "//third_party/libyuv", "//ui/gfx", ] } component("capture_lib") { defines = [ "CAPTURE_IMPLEMENTATION" ] sources = [ "video/linux/camera_config_chromeos.cc", "video/linux/camera_config_chromeos.h", "video/linux/v4l2_capture_delegate.cc", "video/linux/v4l2_capture_delegate.h", "video/linux/video_capture_device_chromeos.cc", "video/linux/video_capture_device_chromeos.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", "video/mac/video_capture_device_avfoundation_mac.h", "video/mac/video_capture_device_avfoundation_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/scoped_buffer_pool_reservation.h", "video/shared_memory_buffer_tracker.cc", "video/shared_memory_buffer_tracker.h", "video/shared_memory_handle_provider.cc", "video/shared_memory_handle_provider.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_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_jpeg_decoder.h", "video/video_capture_system.h", "video/video_capture_system_impl.cc", "video/video_capture_system_impl.h", "video/video_frame_receiver.h", "video/video_frame_receiver_on_task_runner.cc", "video/video_frame_receiver_on_task_runner.h", "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/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_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", "video_capturer_source.cc", "video_capturer_source.h", ] public_deps = [ ":capture_base", ":capture_device_specific", ] deps = [ "//base", "//base:i18n", "//media", "//media/capture/mojom:image_capture", "//media/capture/mojom:image_capture_types", "//media/capture/mojom:video_capture", "//media/mojo/interfaces:interfaces", "//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) { deps += [ "//third_party/decklink" ] libs = [ "AVFoundation.framework", "CoreFoundation.framework", "CoreGraphics.framework", "CoreMedia.framework", "CoreVideo.framework", "Foundation.framework", ] } if (is_win) { deps += [ "//media/base/win" ] libs = [ "mf.lib", "mfplat.lib", "mfreadwrite.lib", "mfuuid.lib", ] ldflags = [ "/DELAYLOAD:mf.dll", "/DELAYLOAD:mfplat.dll", "/DELAYLOAD:mfreadwrite.dll", ] # TODO(jschuh): https://crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } if (is_chromeos) { sources += [ "video/chromeos/camera_3a_controller.cc", "video/chromeos/camera_3a_controller.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/display_rotation_observer.cc", "video/chromeos/display_rotation_observer.h", "video/chromeos/pixel_format_utils.cc", "video/chromeos/pixel_format_utils.h", "video/chromeos/stream_buffer_manager.cc", "video/chromeos/stream_buffer_manager.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", ] deps += [ "//chromeos:chromeos", "//media/capture/video/chromeos/mojo:cros_camera", "//mojo/edk", "//third_party/libsync", ] } } source_set("test_support") { sources = [ "video/mock_video_frame_receiver.cc", "video/mock_video_frame_receiver.h", ] deps = [ ":capture_lib", "//base/test:test_support", "//media:test_support", "//media/capture/mojom:image_capture", "//media/capture/mojom:image_capture_types", "//testing/gmock", "//ui/gfx:test_support", ] testonly = true } test("capture_unittests") { 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/linux/camera_config_chromeos_unittest.cc", "video/linux/v4l2_capture_delegate_unittest.cc", "video/mac/video_capture_device_factory_mac_unittest.mm", "video/mock_gpu_memory_buffer_manager.cc", "video/mock_gpu_memory_buffer_manager.h", "video/shared_memory_handle_provider_unittest.cc", "video/video_capture_device_client_unittest.cc", "video/video_capture_device_unittest.cc", "video_capture_types_unittest.cc", ] data = [ "//media/test/data/bear.mjpeg", ] deps = [ ":capture", ":test_support", "//base/test:test_support", "//gpu/command_buffer/client", "//media:test_support", "//media/capture/mojom:image_capture", "//media/capture/mojom:image_capture_types", "//mojo/edk", "//testing/gmock", "//testing/gtest", "//ui/gfx:test_support", ] if (is_android) { deps += [ "//media/capture/video/android", "//media/capture/video/android:capture_java", ] } if (is_win) { sources += [ "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", ] ldflags = [ "/DELAYLOAD:mf.dll", "/DELAYLOAD:mfplat.dll", "/DELAYLOAD:mfreadwrite.dll", ] # TODO(jschuh): https://crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } if (is_chromeos) { 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/local_gpu_memory_buffer_manager.cc", "video/chromeos/mock_camera_module.cc", "video/chromeos/mock_camera_module.h", "video/chromeos/mock_video_capture_client.cc", "video/chromeos/mock_video_capture_client.h", "video/chromeos/stream_buffer_manager_unittest.cc", ] deps += [ "//chromeos:chromeos", "//media/capture/video/chromeos/mojo:cros_camera", "//mojo/edk", "//third_party/libdrm", "//third_party/libsync", "//third_party/minigbm", ] } }