blob: 22f07fb36c63bbbab2f7cb2b0e6d758ed49c8fb7 [file] [log] [blame]
# 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/chromeos/ui_mode.gni")
import("//media/media_options.gni")
import("//testing/test.gni")
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_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",
"playback_events_recorder.cc",
"playback_events_recorder.h",
"stable_video_decoder_factory_service.cc",
"stable_video_decoder_factory_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" ]
public_deps = [
"//base",
"//media",
"//media/gpu",
"//media/gpu/ipc/common",
"//media/mojo:buildflags",
"//media/mojo/mojom",
"//media/mojo/mojom/stable:stable_video_decoder_cpp_sources",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//services/service_manager/public/cpp",
"//url",
]
deps = [
"//build:chromeos_buildflags",
"//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 += [ "gpu_mojo_media_client_android.cc" ]
} else if (is_mac) {
sources += [ "gpu_mojo_media_client_mac.cc" ]
} else if (is_win) {
sources += [ "gpu_mojo_media_client_win.cc" ]
} else if (use_vaapi || use_v4l2_codec) {
sources += [ "gpu_mojo_media_client_cros.cc" ]
if (is_chromeos) {
deps +=
[ "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_gpu" ]
}
} else {
sources += [ "gpu_mojo_media_client_default.cc" ]
}
if (is_android) {
sources += [
"android_mojo_media_client.cc",
"android_mojo_media_client.h",
"android_mojo_util.cc",
"android_mojo_util.h",
]
}
if (enable_media_drm_storage) {
sources += [
"mojo_media_drm_storage.cc",
"mojo_media_drm_storage.h",
]
}
if (enable_library_cdms) {
sources += [
"cdm_service.cc",
"cdm_service.h",
"cdm_service_broker.cc",
"cdm_service_broker.h",
]
# TODO(xhwang): Ideally media should not worry about sandbox. Find a way to
# remove this dependency.
if (is_mac) {
deps += [ "//sandbox" ]
}
}
if (is_win || enable_library_cdms) {
sources += [
"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" ]
}
if (is_win) {
sources += [
"media_foundation_mojo_media_client.cc",
"media_foundation_mojo_media_client.h",
"media_foundation_renderer_wrapper.cc",
"media_foundation_renderer_wrapper.h",
"media_foundation_service.cc",
"media_foundation_service.h",
"media_foundation_service_broker.cc",
"media_foundation_service_broker.h",
]
deps += [ "//media/base/win:media_foundation_util" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"deferred_destroy_unique_receiver_set_unittest.cc",
"media_metrics_provider_unittest.cc",
"media_service_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",
"playback_events_recorder_test.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 = [
":services",
"//base",
"//base/test:test_support",
"//components/ukm:test_support",
"//media:test_support",
"//media/cdm:cdm_paths",
"//media/learning/common",
"//media/mojo:test_support",
"//media/mojo/clients",
"//media/mojo/common",
"//media/mojo/mojom",
"//mojo/core/embedder",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
"//services/metrics/public/cpp:ukm_builders",
"//services/service_manager/public/cpp",
"//services/service_manager/public/cpp/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
if (enable_library_cdms) {
sources += [
"cdm_service_broker_unittest.cc",
"cdm_service_unittest.cc",
"mojo_cdm_allocator_unittest.cc",
"mojo_cdm_file_io_unittest.cc",
"mojo_cdm_helper_unittest.cc",
]
deps += [ "//media/cdm:cdm_api" ]
}
if (is_chromeos_ash) {
deps += [
"//components/chromeos_camera:mjpeg_decode_accelerator_service_unittest",
]
}
}