1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//media/media_options.gni")
6 import("//testing/test.gni")
7 import("//mojo/public/mojo_application.gni")
9 # Target naming conventions:
10 # - converters: C++/Mojo type converters.
11 # - proxy: C++ implementations supported by mojo services.
12 # - service: Mojo interface implementations.
13 # - unittests: Unit tests for a particular class/file.
14 # - test: Tests for a particular app, e.g. media.
16 config("enable_mojo_media_config") {
17 assert(enable_mojo_media == "none" || enable_mojo_media == "browser" ||
18 enable_mojo_media == "utility")
20 if (enable_mojo_media != "none") {
21 defines = [ "ENABLE_MOJO_MEDIA" ]
24 if (enable_mojo_media == "browser") {
25 defines += [ "ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS" ]
26 } else if (enable_mojo_media == "utility") {
27 defines += [ "ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS" ]
31 source_set("converters") {
33 "media_type_converters.cc",
34 "media_type_converters.h",
40 "//media/mojo/interfaces",
42 "//mojo/converters/geometry",
43 "//mojo/environment:chromium",
44 "//third_party/mojo/src/mojo/public/c/system:for_component",
45 "//ui/mojo/geometry:interfaces",
49 # Implementations of media C++ interfaces using corresponding mojo services.
54 "mojo_cdm_factory.cc",
56 "mojo_demuxer_stream_impl.cc",
57 "mojo_demuxer_stream_impl.h",
58 "mojo_renderer_factory.cc",
59 "mojo_renderer_factory.h",
60 "mojo_renderer_impl.cc",
61 "mojo_renderer_impl.h",
65 public_configs = [ ":enable_mojo_media_config" ]
71 "//media/mojo/interfaces",
72 "//mojo/application/public/interfaces",
74 "//mojo/environment:chromium",
75 "//third_party/mojo/src/mojo/public/c/system:for_component",
79 source_set("cdm_service") {
84 "//media/mojo/interfaces",
85 "//mojo/application/public/interfaces",
87 "//mojo/environment:chromium",
88 "//third_party/mojo/src/mojo/public/c/system:for_component",
92 "mojo_cdm_promise.cc",
94 "mojo_cdm_service.cc",
96 "mojo_cdm_service_context.cc",
97 "mojo_cdm_service_context.h",
101 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
104 # Renderer service; without a specific config.
105 source_set("renderer_service_generic") {
107 "demuxer_stream_provider_shim.cc",
108 "demuxer_stream_provider_shim.h",
109 "mojo_demuxer_stream_adapter.cc",
110 "mojo_demuxer_stream_adapter.h",
111 "mojo_media_client.cc",
112 "mojo_media_client.h",
113 "mojo_renderer_service.cc",
114 "mojo_renderer_service.h",
121 "//media/mojo/interfaces",
122 "//media:shared_memory_support",
127 # Renderer service with a default config.
128 source_set("renderer_service") {
130 "default_mojo_media_client.cc",
133 public_configs = [ ":enable_mojo_media_config" ]
136 ":renderer_service_generic",
139 "//media:shared_memory_support",
143 source_set("application") {
145 "mojo_media_application.cc",
146 "mojo_media_application.h",
147 "service_factory_impl.cc",
148 "service_factory_impl.h",
151 public_configs = [ ":enable_mojo_media_config" ]
157 "//mojo/application/public/cpp",
158 "//third_party/mojo/src/mojo/public/c/system:for_component",
162 test("media_mojo_unittests") {
164 "media_type_converters_unittest.cc",
170 "//base/test:test_support",
172 "//media/mojo/interfaces",
173 "//mojo/environment:chromium",
175 "//third_party/mojo/src/mojo/edk/system",
176 "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
180 if (!is_component_build) {
181 mojo_native_application("media") {
188 "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
192 # Note, the following tests must be loaded via mojo_runner as an app, e.g.
194 # out/Debug/mojo_runner mojo:media_apptests
195 # out/Debug/mojo_runner mojo:media_pipeline_integration_apptests
197 mojo_native_application("media_apptests") {
206 "//media/base:test_support",
207 "//mojo/application/public/cpp:test_support",
212 data_deps = [ ":media" ]
215 mojo_native_application("media_pipeline_integration_apptests") {
219 "//media/test:mojo_pipeline_integration_tests",
222 data_deps = [ ":media" ]
231 if (!is_component_build) {
239 ":media_mojo_unittests",
242 if (!is_component_build) {
245 ":media_pipeline_integration_apptests",