| # Copyright 2014 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/chromecast_build.gni") |
| import("//build/config/jumbo.gni") |
| import("//media/media_options.gni") |
| import("//services/service_manager/public/cpp/service_executable.gni") |
| import("//testing/test.gni") |
| |
| jumbo_component("services") { |
| output_name = "media_mojo_services" |
| sources = [ |
| "deferred_destroy_unique_receiver_set.h", |
| "gpu_mojo_media_client.cc", |
| "gpu_mojo_media_client.h", |
| "interface_factory_impl.cc", |
| "interface_factory_impl.h", |
| "media_interface_provider.cc", |
| "media_interface_provider.h", |
| "media_metrics_provider.cc", |
| "media_metrics_provider.h", |
| "media_mojo_export.h", |
| "media_resource_shim.cc", |
| "media_resource_shim.h", |
| "media_service.cc", |
| "media_service.h", |
| "media_service_factory.cc", |
| "media_service_factory.h", |
| "mojo_audio_decoder_service.cc", |
| "mojo_audio_decoder_service.h", |
| "mojo_audio_input_stream.cc", |
| "mojo_audio_input_stream.h", |
| "mojo_audio_output_stream.cc", |
| "mojo_audio_output_stream.h", |
| "mojo_audio_output_stream_provider.cc", |
| "mojo_audio_output_stream_provider.h", |
| "mojo_cdm_promise.cc", |
| "mojo_cdm_promise.h", |
| "mojo_cdm_service.cc", |
| "mojo_cdm_service.h", |
| "mojo_cdm_service_context.cc", |
| "mojo_cdm_service_context.h", |
| "mojo_decryptor_service.cc", |
| "mojo_decryptor_service.h", |
| "mojo_demuxer_stream_adapter.cc", |
| "mojo_demuxer_stream_adapter.h", |
| "mojo_media_client.cc", |
| "mojo_media_client.h", |
| "mojo_media_log.cc", |
| "mojo_media_log.h", |
| "mojo_provision_fetcher.cc", |
| "mojo_provision_fetcher.h", |
| "mojo_renderer_service.cc", |
| "mojo_renderer_service.h", |
| "mojo_video_decoder_service.cc", |
| "mojo_video_decoder_service.h", |
| "mojo_video_encode_accelerator_provider.cc", |
| "mojo_video_encode_accelerator_provider.h", |
| "mojo_video_encode_accelerator_service.cc", |
| "mojo_video_encode_accelerator_service.h", |
| "test_mojo_media_client.cc", |
| "test_mojo_media_client.h", |
| "video_decode_perf_history.cc", |
| "video_decode_perf_history.h", |
| "video_decode_stats_recorder.cc", |
| "video_decode_stats_recorder.h", |
| "watch_time_recorder.cc", |
| "watch_time_recorder.h", |
| ] |
| |
| defines = [ "MEDIA_MOJO_IMPLEMENTATION" ] |
| |
| # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| |
| public_deps = [ |
| "//base", |
| "//media", |
| "//media/gpu", |
| "//media/gpu/ipc/common", |
| "//media/mojo:buildflags", |
| "//media/mojo/mojom", |
| "//mojo/public/cpp/bindings", |
| "//mojo/public/cpp/system", |
| "//services/service_manager/public/cpp", |
| "//url", |
| ] |
| |
| deps = [ |
| "//gpu/ipc/service", |
| "//media", |
| "//media:shared_memory_support", |
| "//media/gpu", |
| "//media/gpu:buildflags", |
| "//media/gpu/ipc/service", |
| "//media/learning/impl", |
| "//media/learning/mojo:impl", |
| "//media/mojo/common", |
| "//media/mojo/common:mojo_shared_buffer_video_frame", |
| "//services/metrics/public/cpp:metrics_cpp", |
| "//services/metrics/public/cpp:ukm_builders", |
| "//services/service_manager/public/mojom", |
| ] |
| |
| if (is_android) { |
| sources += [ |
| "android_mojo_media_client.cc", |
| "android_mojo_media_client.h", |
| "android_mojo_util.cc", |
| "android_mojo_util.h", |
| "mojo_media_drm_storage.cc", |
| "mojo_media_drm_storage.h", |
| ] |
| } |
| |
| if (enable_library_cdms) { |
| sources += [ |
| "cdm_service.cc", |
| "cdm_service.h", |
| "mojo_cdm_allocator.cc", |
| "mojo_cdm_allocator.h", |
| "mojo_cdm_file_io.cc", |
| "mojo_cdm_file_io.h", |
| "mojo_cdm_helper.cc", |
| "mojo_cdm_helper.h", |
| ] |
| deps += [ |
| "//media/cdm:cdm_api", |
| "//media/cdm:cdm_paths", |
| ] |
| |
| if (enable_cdm_proxy) { |
| sources += [ |
| "mojo_cdm_proxy.cc", |
| "mojo_cdm_proxy.h", |
| "mojo_cdm_proxy_service.cc", |
| "mojo_cdm_proxy_service.h", |
| ] |
| deps += [ |
| # Needed by test_mojo_media_client.cc to create ClearKeyCdmProxy. |
| "//media/cdm/library_cdm/clear_key_cdm:clear_key_cdm_proxy", |
| ] |
| } |
| |
| # TODO(xhwang): Ideally media should not worry about sandbox. Find a way to |
| # remove this dependency. |
| if (is_mac) { |
| deps += [ "//sandbox" ] |
| } |
| } |
| } |
| |
| source_set("cdm_manifest") { |
| sources = [ |
| "cdm_manifest.cc", |
| "cdm_manifest.h", |
| ] |
| deps = [ |
| "//base", |
| "//media/mojo/mojom", |
| "//media/mojo/mojom:constants", |
| "//services/service_manager/public/cpp", |
| ] |
| } |
| |
| source_set("media_manifest") { |
| sources = [ |
| "media_manifest.cc", |
| "media_manifest.h", |
| ] |
| deps = [ |
| "//base", |
| "//media/mojo:buildflags", |
| "//media/mojo/mojom", |
| "//media/mojo/mojom:constants", |
| "//services/service_manager/public/cpp", |
| ] |
| if (is_chromecast) { |
| defines = [ "IS_CHROMECAST" ] |
| deps += [ "//chromecast/common/mojom" ] |
| } |
| } |
| |
| # Unit Tests |
| |
| source_set("unit_tests") { |
| testonly = true |
| |
| sources = [ |
| "deferred_destroy_unique_receiver_set_unittest.cc", |
| "media_metrics_provider_unittest.cc", |
| "mojo_audio_input_stream_unittest.cc", |
| "mojo_audio_output_stream_provider_unittest.cc", |
| "mojo_audio_output_stream_unittest.cc", |
| "mojo_video_encode_accelerator_service_unittest.cc", |
| "test_helpers.cc", |
| "test_helpers.h", |
| "video_decode_perf_history_unittest.cc", |
| "video_decode_stats_recorder_unittest.cc", |
| "watch_time_recorder_unittest.cc", |
| ] |
| |
| deps = [ |
| "//base", |
| "//base/test:test_support", |
| "//components/ukm:test_support", |
| "//media:test_support", |
| "//media/learning/common", |
| "//media/mojo:test_support", |
| "//mojo/core/embedder", |
| "//mojo/public/interfaces/bindings/tests:test_interfaces", |
| "//services/metrics/public/cpp:ukm_builders", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| if (enable_library_cdms) { |
| sources += [ |
| "mojo_cdm_allocator_unittest.cc", |
| "mojo_cdm_file_io_unittest.cc", |
| "mojo_cdm_helper_unittest.cc", |
| ] |
| |
| if (enable_cdm_proxy) { |
| sources += [ "mojo_cdm_proxy_unittest.cc" ] |
| } |
| |
| deps += [ "//media/cdm:cdm_api" ] |
| } |
| |
| if (is_chromeos) { |
| deps += [ |
| "//components/chromeos_camera:mjpeg_decode_accelerator_service_unittest", |
| ] |
| } |
| } |
| |
| # Service Tests |
| |
| # MediaService is tested by using a standalone "media" service, which runs the |
| # service out-of-process. While CdmService is tested as a packaged service, |
| # which runs the service in-process. |
| |
| service_executable("media") { |
| testonly = true |
| |
| sources = [ |
| "main.cc", |
| ] |
| |
| public_deps = [ |
| "//base", |
| "//media", |
| ] |
| |
| deps = [ |
| ":services", |
| "//mojo/public/c/system", |
| "//services/service_manager/public/cpp", |
| ] |
| } |
| |
| test("media_service_unittests") { |
| testonly = true |
| |
| sources = [ |
| "media_service_unittest.cc", |
| ] |
| |
| if (enable_library_cdms) { |
| sources += [ "cdm_service_unittest.cc" ] |
| } |
| |
| deps = [ |
| ":media_manifest", |
| ":services", |
| "//base", |
| "//base/test:test_support", |
| "//media:test_support", |
| "//media/cdm:cdm_paths", |
| "//media/mojo/clients", |
| "//media/mojo/common", |
| "//media/mojo/mojom", |
| "//media/mojo/mojom:constants", |
| "//mojo/core/test:run_all_unittests", |
| "//services/service_manager/public/cpp", |
| "//services/service_manager/public/cpp/test:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| data_deps = [ |
| ":media", |
| ] |
| } |