Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chromecast / media / media.gyp
blobd7d25da9a9673df8001ca5d7dfb03c55d25bcc3f
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.
6   'variables': {
7     'chromium_code': 1,
8     'chromecast_branding%': 'public',
9     'libcast_media_gyp%': '',
10     'use_default_libcast_media%': 1,
11   },
12   'target_defaults': {
13     'include_dirs': [
14       '../public/', # Public APIs
15     ],
16   },
17   'targets': [
18     # TODO(slan): delete this target once Chromecast M44/earlier is obsolete.
19     # See: b/21639416
20     {
21       'target_name': 'libffmpegsumo',
22       'type': 'loadable_module',
23       'sources': ['empty.cc'],
24     },
25     {
26       'target_name': 'media_audio',
27       'type': '<(component)',
28       'dependencies': [
29         '../../media/media.gyp:media',
30       ],
31       'sources': [
32         'audio/cast_audio_manager.cc',
33         'audio/cast_audio_manager.h',
34         'audio/cast_audio_manager_factory.cc',
35         'audio/cast_audio_manager_factory.h',
36         'audio/cast_audio_output_stream.cc',
37         'audio/cast_audio_output_stream.h',
38       ],
39     },
40     {
41       'target_name': 'media_base',
42       'type': '<(component)',
43       'dependencies': [
44         '../../base/base.gyp:base',
45         '../../crypto/crypto.gyp:crypto',
46         '../../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
47         '<(libcast_media_gyp):libcast_media_1.0',
48       ],
49       'sources': [
50         'base/decrypt_context_impl.cc',
51         'base/decrypt_context_impl.h',
52         'base/decrypt_context_impl_clearkey.cc',
53         'base/decrypt_context_impl_clearkey.h',
54         'base/key_systems_common.cc',
55         'base/key_systems_common.h',
56         'base/media_caps.cc',
57         'base/media_caps.h',
58         'base/media_codec_support.cc',
59         'base/media_codec_support.h',
60         'base/media_message_loop.cc',
61         'base/media_message_loop.h',
62         'base/switching_media_renderer.cc',
63         'base/switching_media_renderer.h',
64       ],
65       'conditions': [
66         ['chromecast_branding!="public"', {
67           'dependencies': [
68             '../internal/chromecast_internal.gyp:media_base_internal',
69           ],
70         }, {
71           'sources': [
72             'base/key_systems_common_simple.cc',
73           ],
74         }],
75       ],
76     },
77     {
78       'target_name': 'media_cdm',
79       'type': '<(component)',
80       'dependencies': [
81         'media_base',
82         '../../base/base.gyp:base',
83         '../../media/media.gyp:media',
84       ],
85       'sources': [
86         'cdm/browser_cdm_cast.cc',
87         'cdm/browser_cdm_cast.h',
88         'cdm/chromecast_init_data.cc',
89         'cdm/chromecast_init_data.h',
90       ],
91       'conditions': [
92         ['use_playready==1', {
93           'sources': [
94             'cdm/playready_drm_delegate_android.cc',
95             'cdm/playready_drm_delegate_android.h',
96           ],
97         }],
98       ],
99     },
100     {
101       'target_name': 'cma_base',
102       'type': '<(component)',
103       'dependencies': [
104         '../chromecast.gyp:cast_base',
105         '../../base/base.gyp:base',
106         '../../media/media.gyp:media',
107       ],
108       'include_dirs': [
109         '../..',
110       ],
111       'sources': [
112         'cma/base/balanced_media_task_runner_factory.cc',
113         'cma/base/balanced_media_task_runner_factory.h',
114         'cma/base/buffering_controller.cc',
115         'cma/base/buffering_controller.h',
116         'cma/base/buffering_defs.cc',
117         'cma/base/buffering_defs.h',
118         'cma/base/buffering_frame_provider.cc',
119         'cma/base/buffering_frame_provider.h',
120         'cma/base/buffering_state.cc',
121         'cma/base/buffering_state.h',
122         'cma/base/cast_decoder_buffer_impl.cc',
123         'cma/base/cast_decoder_buffer_impl.h',
124         'cma/base/cast_decrypt_config_impl.cc',
125         'cma/base/cast_decrypt_config_impl.h',
126         'cma/base/cma_logging.h',
127         'cma/base/coded_frame_provider.cc',
128         'cma/base/coded_frame_provider.h',
129         'cma/base/decoder_buffer_adapter.cc',
130         'cma/base/decoder_buffer_adapter.h',
131         'cma/base/decoder_config_adapter.cc',
132         'cma/base/decoder_config_adapter.h',
133         'cma/base/media_task_runner.cc',
134         'cma/base/media_task_runner.h',
135         'cma/base/simple_media_task_runner.cc',
136         'cma/base/simple_media_task_runner.h',
137       ],
138     },
139     {
140       'target_name': 'default_cma_backend',
141       'type': '<(component)',
142       'dependencies': [
143         '../chromecast.gyp:cast_base',
144         '../../base/base.gyp:base',
145       ],
146       'include_dirs': [
147         '../..',
148       ],
149       'sources': [
150         'cma/backend/audio_pipeline_device_default.cc',
151         'cma/backend/audio_pipeline_device_default.h',
152         'cma/backend/media_clock_device_default.cc',
153         'cma/backend/media_clock_device_default.h',
154         'cma/backend/media_component_device_default.cc',
155         'cma/backend/media_component_device_default.h',
156         'cma/backend/media_pipeline_backend_default.cc',
157         'cma/backend/media_pipeline_backend_default.h',
158         'cma/backend/video_pipeline_device_default.cc',
159         'cma/backend/video_pipeline_device_default.h',
160       ],
161     },
162     {
163       'target_name': 'cma_ipc',
164       'type': '<(component)',
165       'dependencies': [
166         '../../base/base.gyp:base',
167       ],
168       'sources': [
169         'cma/ipc/media_memory_chunk.cc',
170         'cma/ipc/media_memory_chunk.h',
171         'cma/ipc/media_message.cc',
172         'cma/ipc/media_message.h',
173         'cma/ipc/media_message_fifo.cc',
174         'cma/ipc/media_message_fifo.h',
175       ],
176     },
177     {
178       'target_name': 'cma_ipc_streamer',
179       'type': '<(component)',
180       'dependencies': [
181         '../../base/base.gyp:base',
182         '../../media/media.gyp:media',
183         'cma_base',
184       ],
185       'sources': [
186         'cma/ipc_streamer/audio_decoder_config_marshaller.cc',
187         'cma/ipc_streamer/audio_decoder_config_marshaller.h',
188         'cma/ipc_streamer/av_streamer_proxy.cc',
189         'cma/ipc_streamer/av_streamer_proxy.h',
190         'cma/ipc_streamer/coded_frame_provider_host.cc',
191         'cma/ipc_streamer/coded_frame_provider_host.h',
192         'cma/ipc_streamer/decoder_buffer_base_marshaller.cc',
193         'cma/ipc_streamer/decoder_buffer_base_marshaller.h',
194         'cma/ipc_streamer/decrypt_config_marshaller.cc',
195         'cma/ipc_streamer/decrypt_config_marshaller.h',
196         'cma/ipc_streamer/video_decoder_config_marshaller.cc',
197         'cma/ipc_streamer/video_decoder_config_marshaller.h',
198       ],
199     },
200     {
201       'target_name': 'cma_pipeline',
202       'type': '<(component)',
203       'dependencies': [
204         'cma_base',
205         'media_base',
206         'media_cdm',
207         '../../base/base.gyp:base',
208         '../../crypto/crypto.gyp:crypto',
209         '../../media/media.gyp:media',
210         '../../third_party/boringssl/boringssl.gyp:boringssl',
211       ],
212       'sources': [
213         'cma/pipeline/audio_pipeline.cc',
214         'cma/pipeline/audio_pipeline.h',
215         'cma/pipeline/audio_pipeline_impl.cc',
216         'cma/pipeline/audio_pipeline_impl.h',
217         'cma/pipeline/av_pipeline_client.cc',
218         'cma/pipeline/av_pipeline_client.h',
219         'cma/pipeline/av_pipeline_impl.cc',
220         'cma/pipeline/av_pipeline_impl.h',
221         'cma/pipeline/decrypt_util.cc',
222         'cma/pipeline/decrypt_util.h',
223         'cma/pipeline/frame_status_cb_impl.cc',
224         'cma/pipeline/frame_status_cb_impl.h',
225         'cma/pipeline/load_type.h',
226         'cma/pipeline/media_component_device_client_impl.cc',
227         'cma/pipeline/media_component_device_client_impl.h',
228         'cma/pipeline/media_pipeline.h',
229         'cma/pipeline/media_pipeline_client.cc',
230         'cma/pipeline/media_pipeline_client.h',
231         'cma/pipeline/media_pipeline_impl.cc',
232         'cma/pipeline/media_pipeline_impl.h',
233         'cma/pipeline/video_pipeline.cc',
234         'cma/pipeline/video_pipeline.h',
235         'cma/pipeline/video_pipeline_client.cc',
236         'cma/pipeline/video_pipeline_client.h',
237         'cma/pipeline/video_pipeline_device_client_impl.cc',
238         'cma/pipeline/video_pipeline_device_client_impl.h',
239         'cma/pipeline/video_pipeline_impl.cc',
240         'cma/pipeline/video_pipeline_impl.h',
241       ],
242     },
243     {
244       'target_name': 'cma_filters',
245       'type': '<(component)',
246       'dependencies': [
247         '../../base/base.gyp:base',
248         '../../media/media.gyp:media',
249         'cma_base',
250       ],
251       'sources': [
252         'cma/filters/cma_renderer.cc',
253         'cma/filters/cma_renderer.h',
254         'cma/filters/demuxer_stream_adapter.cc',
255         'cma/filters/demuxer_stream_adapter.h',
256         'cma/filters/hole_frame_factory.cc',
257         'cma/filters/hole_frame_factory.h',
258       ],
259     },
260     {
261       'target_name': 'cast_media',
262       'type': 'none',
263       'dependencies': [
264         'cma_base',
265         'cma_filters',
266         'cma_ipc',
267         'cma_ipc_streamer',
268         'cma_pipeline',
269         'default_cma_backend',
270         'media_audio',
271         'media_cdm',
272       ],
273     },
274     {
275       'target_name': 'cast_media_unittests',
276       'type': '<(gtest_target_type)',
277       'dependencies': [
278         'cast_media',
279         '../../base/base.gyp:base',
280         '../../base/base.gyp:base_i18n',
281         '../../base/base.gyp:test_support_base',
282         '../../chromecast/chromecast.gyp:cast_metrics_test_support',
283         '../../gpu/gpu.gyp:gpu_unittest_utils',
284         '../../media/media.gyp:media_test_support',
285         '../../testing/gmock.gyp:gmock',
286         '../../testing/gtest.gyp:gtest',
287         '../../testing/gtest.gyp:gtest_main',
288         '../../ui/gfx/gfx.gyp:gfx_test_support',
289       ],
290       'sources': [
291         'audio/cast_audio_output_stream_unittest.cc',
292         'cdm/chromecast_init_data_unittest.cc',
293         'cma/backend/audio_video_pipeline_device_unittest.cc',
294         'cma/base/balanced_media_task_runner_unittest.cc',
295         'cma/base/buffering_controller_unittest.cc',
296         'cma/base/buffering_frame_provider_unittest.cc',
297         'cma/filters/demuxer_stream_adapter_unittest.cc',
298         'cma/filters/multi_demuxer_stream_adapter_unittest.cc',
299         'cma/ipc/media_message_fifo_unittest.cc',
300         'cma/ipc/media_message_unittest.cc',
301         'cma/ipc_streamer/av_streamer_unittest.cc',
302         'cma/pipeline/audio_video_pipeline_impl_unittest.cc',
303         'cma/test/cma_end_to_end_test.cc',
304         'cma/test/demuxer_stream_for_test.cc',
305         'cma/test/demuxer_stream_for_test.h',
306         'cma/test/frame_generator_for_test.cc',
307         'cma/test/frame_generator_for_test.h',
308         'cma/test/frame_segmenter_for_test.cc',
309         'cma/test/frame_segmenter_for_test.h',
310         'cma/test/media_component_device_feeder_for_test.cc',
311         'cma/test/media_component_device_feeder_for_test.h',
312         'cma/test/mock_frame_consumer.cc',
313         'cma/test/mock_frame_consumer.h',
314         'cma/test/mock_frame_provider.cc',
315         'cma/test/mock_frame_provider.h',
316         'cma/test/run_all_unittests.cc',
317       ],
318     },
319   ], # end of targets
320   'conditions': [
321     ['use_default_libcast_media==1', {
322       'targets': [
323         {
324           'target_name': 'libcast_media_1.0',
325           'type': 'shared_library',
326           'dependencies': [
327             '../../chromecast/chromecast.gyp:cast_public_api',
328             'default_cma_backend'
329           ],
330           'include_dirs': [
331             '../..',
332           ],
333           'sources': [
334             'base/cast_media_default.cc',
335           ],
336         }
337       ]
338     }],
339   ],