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("//third_party/mojo/src/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_media_mojo_renderer_config") {
17 if (enable_media_mojo_renderer) {
18 defines = [ "ENABLE_MEDIA_MOJO_RENDERER" ]
22 source_set("converters") {
24 "media_type_converters.cc",
25 "media_type_converters.h",
31 "//media/mojo/interfaces",
33 "//mojo/converters/geometry",
34 "//mojo/environment:chromium",
35 "//third_party/mojo/src/mojo/public/c/system:for_component",
36 "//third_party/mojo_services/src/geometry/public/interfaces",
40 source_set("cdm_proxy") {
45 "//media/mojo/interfaces",
47 "//mojo/environment:chromium",
48 "//third_party/mojo/src/mojo/public/interfaces/application",
49 "//third_party/mojo/src/mojo/public/c/system:for_component",
59 source_set("cdm_service") {
64 "//media/mojo/interfaces",
66 "//mojo/environment:chromium",
67 "//third_party/mojo/src/mojo/public/interfaces/application",
68 "//third_party/mojo/src/mojo/public/c/system:for_component",
72 "mojo_cdm_promise.cc",
74 "mojo_cdm_service.cc",
79 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
82 # media::Renderer implementation using mojo::MediaRenderer.
83 source_set("renderer_proxy") {
85 "mojo_demuxer_stream_impl.cc",
86 "mojo_demuxer_stream_impl.h",
87 "mojo_renderer_factory.cc",
88 "mojo_renderer_factory.h",
89 "mojo_renderer_impl.cc",
90 "mojo_renderer_impl.h",
93 public_configs = [ ":enable_media_mojo_renderer_config" ]
99 "//media/mojo/interfaces",
101 "//mojo/environment:chromium",
102 "//third_party/mojo/src/mojo/public/c/system:for_component",
103 "//third_party/mojo/src/mojo/public/interfaces/application",
107 # MediaRenderer service; without a specific config.
108 source_set("renderer_service_generic") {
110 "demuxer_stream_provider_shim.cc",
111 "demuxer_stream_provider_shim.h",
112 "mojo_demuxer_stream_adapter.cc",
113 "mojo_demuxer_stream_adapter.h",
114 "mojo_renderer_service.cc",
115 "mojo_renderer_service.h",
116 "renderer_config.cc",
124 "//media/mojo/interfaces",
125 "//media:shared_memory_support",
130 # MediaRenderer service with a default config.
131 source_set("renderer_service") {
133 "renderer_config_default.cc",
136 public_configs = [ ":enable_media_mojo_renderer_config" ]
139 ":renderer_service_generic",
142 "//media:shared_memory_support",
146 test("media_mojo_unittests") {
148 "media_type_converters_unittest.cc",
154 "//base/test:test_support",
156 "//media/mojo/interfaces",
157 "//mojo/environment:chromium",
159 "//third_party/mojo/src/mojo/edk/system",
160 "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
164 if (!is_component_build) {
165 mojo_native_application("media") {
167 "mojo_media_application.cc",
172 "//mojo/application",
173 "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
177 # Note, this 'test' must be loaded via mojo_shell as an app:
179 # out/Debug/mojo_shell mojo:media_test
181 mojo_native_application("media_test") {
185 "//media/test:mojo_pipeline_integration_tests",
196 if (!is_component_build) {
204 ":media_mojo_unittests",
207 if (!is_component_build) {
208 deps += [ ":media_test" ]