Revert of Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320) (patchset...
[chromium-blink-merge.git] / media / mojo / services / BUILD.gn
blob2a56e2e53542befa2537c51179abec5ee27b7854
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" ]
19   }
22 source_set("converters") {
23   sources = [
24     "media_type_converters.cc",
25     "media_type_converters.h",
26   ]
28   deps = [
29     "//base",
30     "//media",
31     "//media/mojo/interfaces",
32     "//mojo/common",
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",
37   ]
40 source_set("cdm_proxy") {
41   deps = [
42     ":converters",
43     "//base",
44     "//media",
45     "//media/mojo/interfaces",
46     "//mojo/common",
47     "//mojo/environment:chromium",
48     "//third_party/mojo/src/mojo/public/interfaces/application",
49     "//third_party/mojo/src/mojo/public/c/system:for_component",
50   ]
52   sources = [
53     "mojo_cdm.cc",
54     "mojo_cdm.h",
55     "mojo_type_trait.h",
56   ]
59 source_set("cdm_service") {
60   deps = [
61     ":converters",
62     "//base",
63     "//media",
64     "//media/mojo/interfaces",
65     "//mojo/common",
66     "//mojo/environment:chromium",
67     "//third_party/mojo/src/mojo/public/interfaces/application",
68     "//third_party/mojo/src/mojo/public/c/system:for_component",
69   ]
71   sources = [
72     "mojo_cdm_promise.cc",
73     "mojo_cdm_promise.h",
74     "mojo_cdm_service.cc",
75     "mojo_cdm_service.h",
76     "mojo_type_trait.h",
77   ]
79   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
82 # media::Renderer implementation using mojo::MediaRenderer.
83 source_set("renderer_proxy") {
84   sources = [
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",
91   ]
93   public_configs = [ ":enable_media_mojo_renderer_config" ]
95   deps = [
96     ":converters",
97     "//base",
98     "//media",
99     "//media/mojo/interfaces",
100     "//mojo/common",
101     "//mojo/environment:chromium",
102     "//third_party/mojo/src/mojo/public/c/system:for_component",
103     "//third_party/mojo/src/mojo/public/interfaces/application",
104   ]
107 # MediaRenderer service; without a specific config.
108 source_set("renderer_service_generic") {
109   sources = [
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",
117     "renderer_config.h",
118   ]
120   deps = [
121     ":converters",
122     "//base",
123     "//media",
124     "//media/mojo/interfaces",
125     "//media:shared_memory_support",
126     "//mojo/common",
127   ]
130 # MediaRenderer service with a default config.
131 source_set("renderer_service") {
132   sources = [
133     "renderer_config_default.cc",
134   ]
136   public_configs = [ ":enable_media_mojo_renderer_config" ]
138   deps = [
139     ":renderer_service_generic",
140     "//base",
141     "//media",
142     "//media:shared_memory_support",
143   ]
146 test("media_mojo_unittests") {
147   sources = [
148     "media_type_converters_unittest.cc",
149   ]
151   deps = [
152     ":converters",
153     "//base",
154     "//base/test:test_support",
155     "//media",
156     "//media/mojo/interfaces",
157     "//mojo/environment:chromium",
158     "//testing/gtest",
159     "//third_party/mojo/src/mojo/edk/system",
160     "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
161   ]
164 if (!is_component_build) {
165   mojo_native_application("media") {
166     sources = [
167       "mojo_media_application.cc",
168     ]
170     deps = [
171       ":renderer_service",
172       "//mojo/application",
173       "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
174     ]
175   }
177   # Note, this 'test' must be loaded via mojo_shell as an app:
178   #
179   #   out/Debug/mojo_shell mojo:media_test
180   #
181   mojo_native_application("media_test") {
182     testonly = true
184     deps = [
185       "//media/test:mojo_pipeline_integration_tests",
186     ]
187   }
190 group("services") {
191   deps = [
192     ":cdm_proxy",
193     ":renderer_proxy",
194   ]
196   if (!is_component_build) {
197     deps += [ ":media" ]
198   }
201 group("tests") {
202   testonly = true
203   deps = [
204     ":media_mojo_unittests",
205   ]
207   if (!is_component_build) {
208     deps += [ ":media_test" ]
209   }