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",
36 "//third_party/mojo/src/mojo/public/c/system:for_component",
37 "//third_party/mojo_services/src/geometry/public/interfaces",
41 source_set("cdm_proxy") {
46 "//media/mojo/interfaces",
48 "//mojo/environment:chromium",
49 "//third_party/mojo/src/mojo/public/interfaces/application",
50 "//third_party/mojo/src/mojo/public/c/system:for_component",
60 source_set("cdm_service") {
65 "//media/mojo/interfaces",
67 "//mojo/environment:chromium",
68 "//third_party/mojo/src/mojo/public/interfaces/application",
69 "//third_party/mojo/src/mojo/public/c/system:for_component",
73 "mojo_cdm_promise.cc",
75 "mojo_cdm_service.cc",
81 # media::Renderer implementation using mojo::MediaRenderer.
82 source_set("renderer_proxy") {
84 "mojo_demuxer_stream_impl.cc",
85 "mojo_demuxer_stream_impl.h",
86 "mojo_renderer_factory.cc",
87 "mojo_renderer_factory.h",
88 "mojo_renderer_impl.cc",
89 "mojo_renderer_impl.h",
92 public_configs = [ ":enable_media_mojo_renderer_config" ]
98 "//media/mojo/interfaces",
100 "//mojo/environment:chromium",
101 "//third_party/mojo/src/mojo/public/c/system:for_component",
102 "//third_party/mojo/src/mojo/public/interfaces/application",
106 # MediaRenderer service; without a specific config.
107 source_set("renderer_service_generic") {
109 "demuxer_stream_provider_shim.cc",
110 "demuxer_stream_provider_shim.h",
111 "mojo_demuxer_stream_adapter.cc",
112 "mojo_demuxer_stream_adapter.h",
113 "mojo_renderer_service.cc",
114 "mojo_renderer_service.h",
115 "renderer_config.cc",
123 "//media/mojo/interfaces",
124 "//media:shared_memory_support",
129 # MediaRenderer service with a default config.
130 source_set("renderer_service") {
132 "renderer_config_default.cc",
135 public_configs = [ ":enable_media_mojo_renderer_config" ]
138 ":renderer_service_generic",
141 "//media:shared_memory_support",
145 test("media_mojo_unittests") {
147 "media_type_converters_unittest.cc",
153 "//base/test:test_support",
155 "//media/mojo/interfaces",
156 "//mojo/environment:chromium",
158 "//third_party/mojo/src/mojo/edk/system",
159 "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
163 if (!is_component_build) {
164 mojo_native_application("media") {
166 "mojo_media_application.cc",
171 "//mojo/application",
172 "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
176 # Note, this 'test' must be loaded via mojo_shell as an app:
178 # out/Debug/mojo_shell mojo:media_test
180 # To get "mojo_shell" you must specify "use_prebuilt_mojo_shell=true" in GN.
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" ]