# 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/jumbo.gni") import("//media/media_options.gni") import("//services/catalog/public/tools/catalog.gni") import("//services/service_manager/public/cpp/service.gni") import("//services/service_manager/public/service_manifest.gni") import("//services/service_manager/public/tools/test/service_test.gni") import("//testing/test.gni") jumbo_component("services") { output_name = "media_mojo_services" sources = [ "deferred_destroy_strong_binding_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_jpeg_decode_accelerator_service.cc", "mojo_jpeg_decode_accelerator_service.h", "mojo_jpeg_encode_accelerator_service.cc", "mojo_jpeg_encode_accelerator_service.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/interfaces", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", "//url", ] deps = [ "//gpu/ipc/service", "//media:shared_memory_support", "//media/cdm:cdm_manager", "//media/gpu", "//media/gpu:buildflags", "//media/gpu/ipc/service", "//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", "mojo_cdm_proxy.cc", "mojo_cdm_proxy.h", "mojo_cdm_proxy_service.cc", "mojo_cdm_proxy_service.h", ] deps += [ "//media/cdm:cdm_api", "//media/cdm:cdm_paths", "//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" ] } } } service_manifest("cdm_manifest") { name = "cdm" source = "cdm_manifest.json" } service_manifest("media_manifest") { name = "media" source = "media_manifest.json" } # Unit Tests source_set("unit_tests") { testonly = true sources = [ "deferred_destroy_strong_binding_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_jpeg_decode_accelerator_service_unittest.cc", "mojo_video_encode_accelerator_service_unittest.cc", "video_decode_perf_history_unittest.cc", "watch_time_recorder_unittest.cc", ] deps = [ "//base", "//base/test:test_support", "//components/ukm:test_support", "//media:test_support", "//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", "mojo_cdm_proxy_unittest.cc", ] deps += [ "//media/cdm:cdm_api" ] } } # 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("media") { testonly = true sources = [ "main.cc", ] public_deps = [ "//base", "//media", ] deps = [ ":services", "//mojo/public/c/system", "//services/service_manager/public/cpp", ] } service_test("media_service_unittests") { testonly = true sources = [ "media_service_unittest.cc", ] if (enable_library_cdms) { sources += [ "cdm_service_unittest.cc" ] } catalog = ":service_tests_catalog" deps = [ ":services", "//base", "//media:test_support", "//media/cdm:cdm_paths", "//media/mojo/clients", "//media/mojo/common", "//media/mojo/interfaces", "//media/mojo/interfaces:constants", "//services/service_manager/public/cpp:service_test_support", "//testing/gmock", "//testing/gtest", ] data_deps = [ ":media", ] } service_manifest("media_service_unittest_manifest") { name = "media_service_unittests" source = "test_manifest.json" } catalog("media_service_unittest_catalog") { testonly = true embedded_services = [ ":media_service_unittest_manifest" ] standalone_services = [ ":media_manifest" ] } service_manifest("cdm_service_unittest_manifest") { name = "cdm_service_unittest" source = "cdm_service_unittest_manifest.json" packaged_services = [ ":cdm_manifest" ] } catalog("cdm_service_unittest_catalog") { testonly = true embedded_services = [ ":cdm_service_unittest_manifest" ] } catalog("service_tests_catalog") { testonly = true catalog_deps = [ ":cdm_service_unittest_catalog", ":media_service_unittest_catalog", ] } # media_pipeline_integration_unittests is out of date and disabled by default. service_test("media_pipeline_integration_unittests") { testonly = true catalog = ":media_pipeline_integration_unittests_catalog" deps = [ "//media/test:mojo_pipeline_integration_tests", ] data_deps = [ ":media", ] } service_manifest("pipeline_test_manifest") { name = "media_pipeline_integration_unittests" source = "pipeline_test_manifest.json" } catalog("media_pipeline_integration_unittests_catalog") { embedded_services = [ ":pipeline_test_manifest" ] standalone_services = [ ":media_manifest" ] }