Eliminate video capture thread in renderer
[chromium-blink-merge.git] / media / media.gyp
blob3f1b2e80339902e93f1c6519512f7d413f5f4c72
1 # Copyright (c) 2012 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     # Override to dynamically link the cras (ChromeOS audio) library.
9     'use_cras%': 0,
10     # Option e.g. for Linux distributions to link pulseaudio directly
11     # (DT_NEEDED) instead of using dlopen. This helps with automated
12     # detection of ABI mismatches and prevents silent errors.
13     'linux_link_pulseaudio%': 0,
14     'conditions': [
15       ['OS=="android"', {
16         # Android doesn't use ffmpeg.
17         'media_use_ffmpeg%': 0,
18         # Android doesn't use libvpx.
19         'media_use_libvpx%': 0,
20       }, {  # 'OS!="android"'
21         'media_use_ffmpeg%': 1,
22         'media_use_libvpx%': 1,
23       }],
24       # Enable ALSA and Pulse for runtime selection.
25       ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1 and use_cras==0', {
26         'use_alsa%': 1,
27         'use_pulseaudio%': 1,
28       }, {
29         'use_alsa%': 0,
30         'use_pulseaudio%': 0,
31       }],
32     ],
33   },
34   'includes': [
35     'media_cdm.gypi',
36   ],
37   'targets': [
38     {
39       'target_name': 'media',
40       'type': '<(component)',
41       'dependencies': [
42         '../base/base.gyp:base',
43         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
44         '../crypto/crypto.gyp:crypto',
45         '../net/net.gyp:net',
46         '../gpu/gpu.gyp:command_buffer_common',
47         '../skia/skia.gyp:skia',
48         '../third_party/opus/opus.gyp:opus',
49         '../ui/events/events.gyp:events_base',
50         '../ui/gfx/gfx.gyp:gfx',
51         '../ui/gfx/gfx.gyp:gfx_geometry',
52         '../url/url.gyp:url_lib',
53         'shared_memory_support',
54       ],
55       'defines': [
56         'MEDIA_IMPLEMENTATION',
57       ],
58       'include_dirs': [
59         '..',
60       ],
61       'sources': [
62         'audio/agc_audio_stream.h',
63         'audio/alsa/alsa_input.cc',
64         'audio/alsa/alsa_input.h',
65         'audio/alsa/alsa_output.cc',
66         'audio/alsa/alsa_output.h',
67         'audio/alsa/alsa_util.cc',
68         'audio/alsa/alsa_util.h',
69         'audio/alsa/alsa_wrapper.cc',
70         'audio/alsa/alsa_wrapper.h',
71         'audio/alsa/audio_manager_alsa.cc',
72         'audio/alsa/audio_manager_alsa.h',
73         'audio/android/audio_manager_android.cc',
74         'audio/android/audio_manager_android.h',
75         'audio/android/audio_record_input.cc',
76         'audio/android/audio_record_input.h',
77         'audio/android/opensles_input.cc',
78         'audio/android/opensles_input.h',
79         'audio/android/opensles_output.cc',
80         'audio/android/opensles_output.h',
81         'audio/android/opensles_wrapper.cc',
82         'audio/audio_buffers_state.cc',
83         'audio/audio_buffers_state.h',
84         'audio/audio_device_name.cc',
85         'audio/audio_device_name.h',
86         'audio/audio_device_thread.cc',
87         'audio/audio_device_thread.h',
88         'audio/audio_input_controller.cc',
89         'audio/audio_input_controller.h',
90         'audio/audio_input_device.cc',
91         'audio/audio_input_device.h',
92         'audio/audio_input_ipc.cc',
93         'audio/audio_input_ipc.h',
94         'audio/audio_io.h',
95         'audio/audio_manager.cc',
96         'audio/audio_manager.h',
97         'audio/audio_manager_base.cc',
98         'audio/audio_manager_base.h',
99         'audio/audio_output_controller.cc',
100         'audio/audio_output_controller.h',
101         'audio/audio_output_device.cc',
102         'audio/audio_output_device.h',
103         'audio/audio_output_dispatcher.cc',
104         'audio/audio_output_dispatcher.h',
105         'audio/audio_output_dispatcher_impl.cc',
106         'audio/audio_output_dispatcher_impl.h',
107         'audio/audio_output_ipc.cc',
108         'audio/audio_output_ipc.h',
109         'audio/audio_output_proxy.cc',
110         'audio/audio_output_proxy.h',
111         'audio/audio_output_resampler.cc',
112         'audio/audio_output_resampler.h',
113         'audio/audio_power_monitor.cc',
114         'audio/audio_power_monitor.h',
115         'audio/audio_source_diverter.h',
116         'audio/clockless_audio_sink.cc',
117         'audio/clockless_audio_sink.h',
118         'audio/cras/audio_manager_cras.cc',
119         'audio/cras/audio_manager_cras.h',
120         'audio/cras/cras_input.cc',
121         'audio/cras/cras_input.h',
122         'audio/cras/cras_unified.cc',
123         'audio/cras/cras_unified.h',
124         'audio/fake_audio_consumer.cc',
125         'audio/fake_audio_consumer.h',
126         'audio/fake_audio_input_stream.cc',
127         'audio/fake_audio_input_stream.h',
128         'audio/fake_audio_log_factory.h',
129         'audio/fake_audio_log_factory.cc',
130         'audio/fake_audio_manager.cc',
131         'audio/fake_audio_manager.h',
132         'audio/fake_audio_output_stream.cc',
133         'audio/fake_audio_output_stream.h',
134         'audio/linux/audio_manager_linux.cc',
135         'audio/mac/aggregate_device_manager.cc',
136         'audio/mac/aggregate_device_manager.h',
137         'audio/mac/audio_auhal_mac.cc',
138         'audio/mac/audio_auhal_mac.h',
139         'audio/mac/audio_device_listener_mac.cc',
140         'audio/mac/audio_device_listener_mac.h',
141         'audio/mac/audio_input_mac.cc',
142         'audio/mac/audio_input_mac.h',
143         'audio/mac/audio_low_latency_input_mac.cc',
144         'audio/mac/audio_low_latency_input_mac.h',
145         'audio/mac/audio_low_latency_output_mac.cc',
146         'audio/mac/audio_low_latency_output_mac.h',
147         'audio/mac/audio_manager_mac.cc',
148         'audio/mac/audio_manager_mac.h',
149         'audio/mac/audio_synchronized_mac.cc',
150         'audio/mac/audio_synchronized_mac.h',
151         'audio/mac/audio_unified_mac.cc',
152         'audio/mac/audio_unified_mac.h',
153         'audio/null_audio_sink.cc',
154         'audio/null_audio_sink.h',
155         'audio/openbsd/audio_manager_openbsd.cc',
156         'audio/openbsd/audio_manager_openbsd.h',
157         'audio/pulse/audio_manager_pulse.cc',
158         'audio/pulse/audio_manager_pulse.h',
159         'audio/pulse/pulse_input.cc',
160         'audio/pulse/pulse_input.h',
161         'audio/pulse/pulse_output.cc',
162         'audio/pulse/pulse_output.h',
163         'audio/pulse/pulse_unified.cc',
164         'audio/pulse/pulse_unified.h',
165         'audio/pulse/pulse_util.cc',
166         'audio/pulse/pulse_util.h',
167         'audio/sample_rates.cc',
168         'audio/sample_rates.h',
169         'audio/scoped_task_runner_observer.cc',
170         'audio/scoped_task_runner_observer.h',
171         'audio/simple_sources.cc',
172         'audio/simple_sources.h',
173         'audio/sounds/audio_stream_handler.cc',
174         'audio/sounds/audio_stream_handler.h',
175         'audio/sounds/sounds_manager.cc',
176         'audio/sounds/sounds_manager.h',
177         'audio/sounds/wav_audio_handler.cc',
178         'audio/sounds/wav_audio_handler.h',
179         'audio/virtual_audio_input_stream.cc',
180         'audio/virtual_audio_input_stream.h',
181         'audio/virtual_audio_output_stream.cc',
182         'audio/virtual_audio_output_stream.h',
183         'audio/win/audio_device_listener_win.cc',
184         'audio/win/audio_device_listener_win.h',
185         'audio/win/audio_low_latency_input_win.cc',
186         'audio/win/audio_low_latency_input_win.h',
187         'audio/win/audio_low_latency_output_win.cc',
188         'audio/win/audio_low_latency_output_win.h',
189         'audio/win/audio_manager_win.cc',
190         'audio/win/audio_manager_win.h',
191         'audio/win/audio_unified_win.cc',
192         'audio/win/audio_unified_win.h',
193         'audio/win/avrt_wrapper_win.cc',
194         'audio/win/avrt_wrapper_win.h',
195         'audio/win/core_audio_util_win.cc',
196         'audio/win/core_audio_util_win.h',
197         'audio/win/device_enumeration_win.cc',
198         'audio/win/device_enumeration_win.h',
199         'audio/win/wavein_input_win.cc',
200         'audio/win/wavein_input_win.h',
201         'audio/win/waveout_output_win.cc',
202         'audio/win/waveout_output_win.h',
203         'base/android/demuxer_android.h',
204         'base/android/demuxer_stream_player_params.cc',
205         'base/android/demuxer_stream_player_params.h',
206         'base/android/media_player_manager.h',
207         'base/android/media_resource_getter.cc',
208         'base/android/media_resource_getter.h',
209         'base/audio_buffer.cc',
210         'base/audio_buffer.h',
211         'base/audio_buffer_queue.cc',
212         'base/audio_buffer_queue.h',
213         'base/audio_capturer_source.h',
214         'base/audio_converter.cc',
215         'base/audio_converter.h',
216         'base/audio_decoder.cc',
217         'base/audio_decoder.h',
218         'base/audio_decoder_config.cc',
219         'base/audio_decoder_config.h',
220         'base/audio_fifo.cc',
221         'base/audio_fifo.h',
222         'base/audio_hardware_config.cc',
223         'base/audio_hardware_config.h',
224         'base/audio_hash.cc',
225         'base/audio_hash.h',
226         'base/audio_pull_fifo.cc',
227         'base/audio_pull_fifo.h',
228         'base/audio_renderer.cc',
229         'base/audio_renderer.h',
230         'base/audio_renderer_mixer.cc',
231         'base/audio_renderer_mixer.h',
232         'base/audio_renderer_mixer_input.cc',
233         'base/audio_renderer_mixer_input.h',
234         'base/audio_renderer_sink.h',
235         'base/audio_splicer.cc',
236         'base/audio_splicer.h',
237         'base/audio_timestamp_helper.cc',
238         'base/audio_timestamp_helper.h',
239         'base/audio_video_metadata_extractor.cc',
240         'base/audio_video_metadata_extractor.h',
241         'base/bind_to_current_loop.h',
242         'base/bit_reader.cc',
243         'base/bit_reader.h',
244         'base/bitstream_buffer.h',
245         'base/buffers.h',
246         'base/byte_queue.cc',
247         'base/byte_queue.h',
248         'base/channel_mixer.cc',
249         'base/channel_mixer.h',
250         'base/clock.cc',
251         'base/clock.h',
252         'base/container_names.cc',
253         'base/container_names.h',
254         'base/data_buffer.cc',
255         'base/data_buffer.h',
256         'base/data_source.cc',
257         'base/data_source.h',
258         'base/decoder_buffer.cc',
259         'base/decoder_buffer.h',
260         'base/decoder_buffer_queue.cc',
261         'base/decoder_buffer_queue.h',
262         'base/decrypt_config.cc',
263         'base/decrypt_config.h',
264         'base/decryptor.cc',
265         'base/decryptor.h',
266         'base/demuxer.cc',
267         'base/demuxer.h',
268         'base/demuxer_stream.cc',
269         'base/demuxer_stream.h',
270         'base/djb2.cc',
271         'base/djb2.h',
272         'base/filter_collection.cc',
273         'base/filter_collection.h',
274         'base/keyboard_event_counter.cc',
275         'base/keyboard_event_counter.h',
276         'base/media.cc',
277         'base/media.h',
278         'base/media_file_checker.cc',
279         'base/media_file_checker.h',
280         'base/media_keys.cc',
281         'base/media_keys.h',
282         'base/media_log.cc',
283         'base/media_log.h',
284         'base/media_log_event.h',
285         'base/media_posix.cc',
286         'base/media_switches.cc',
287         'base/media_switches.h',
288         'base/media_win.cc',
289         'base/multi_channel_resampler.cc',
290         'base/multi_channel_resampler.h',
291         'base/pipeline.cc',
292         'base/pipeline.h',
293         'base/pipeline_status.h',
294         'base/ranges.cc',
295         'base/ranges.h',
296         'base/sample_format.cc',
297         'base/sample_format.h',
298         'base/scoped_histogram_timer.h',
299         'base/seekable_buffer.cc',
300         'base/seekable_buffer.h',
301         'base/serial_runner.cc',
302         'base/serial_runner.h',
303         'base/simd/convert_rgb_to_yuv.h',
304         'base/simd/convert_rgb_to_yuv_c.cc',
305         'base/simd/convert_yuv_to_rgb.h',
306         'base/simd/convert_yuv_to_rgb_c.cc',
307         'base/simd/filter_yuv.h',
308         'base/simd/filter_yuv_c.cc',
309         'base/simd/yuv_to_rgb_table.cc',
310         'base/simd/yuv_to_rgb_table.h',
311         'base/sinc_resampler.cc',
312         'base/sinc_resampler.h',
313         'base/stream_parser.cc',
314         'base/stream_parser.h',
315         'base/stream_parser_buffer.cc',
316         'base/stream_parser_buffer.h',
317         'base/text_cue.cc',
318         'base/text_cue.h',
319         'base/text_renderer.cc',
320         'base/text_renderer.h',
321         'base/text_track.h',
322         'base/text_track_config.cc',
323         'base/text_track_config.h',
324         'base/user_input_monitor.cc',
325         'base/user_input_monitor.h',
326         'base/user_input_monitor_linux.cc',
327         'base/user_input_monitor_mac.cc',
328         'base/user_input_monitor_win.cc',
329         'base/video_decoder.cc',
330         'base/video_decoder.h',
331         'base/video_decoder_config.cc',
332         'base/video_decoder_config.h',
333         'base/video_frame.cc',
334         'base/video_frame.h',
335         'base/video_frame_pool.cc',
336         'base/video_frame_pool.h',
337         'base/video_renderer.cc',
338         'base/video_renderer.h',
339         'base/video_util.cc',
340         'base/video_util.h',
341         'base/yuv_convert.cc',
342         'base/yuv_convert.h',
343         'cdm/aes_decryptor.cc',
344         'cdm/aes_decryptor.h',
345         'cdm/json_web_key.cc',
346         'cdm/json_web_key.h',
347         'cdm/key_system_names.cc',
348         'cdm/key_system_names.h',
349         'ffmpeg/ffmpeg_common.cc',
350         'ffmpeg/ffmpeg_common.h',
351         'filters/audio_decoder_selector.cc',
352         'filters/audio_decoder_selector.h',
353         'filters/audio_file_reader.cc',
354         'filters/audio_file_reader.h',
355         'filters/audio_renderer_algorithm.cc',
356         'filters/audio_renderer_algorithm.h',
357         'filters/audio_renderer_impl.cc',
358         'filters/audio_renderer_impl.h',
359         'filters/blocking_url_protocol.cc',
360         'filters/blocking_url_protocol.h',
361         'filters/chunk_demuxer.cc',
362         'filters/chunk_demuxer.h',
363         'filters/decrypting_audio_decoder.cc',
364         'filters/decrypting_audio_decoder.h',
365         'filters/decrypting_demuxer_stream.cc',
366         'filters/decrypting_demuxer_stream.h',
367         'filters/decrypting_video_decoder.cc',
368         'filters/decrypting_video_decoder.h',
369         'filters/ffmpeg_audio_decoder.cc',
370         'filters/ffmpeg_audio_decoder.h',
371         'filters/ffmpeg_demuxer.cc',
372         'filters/ffmpeg_demuxer.h',
373         'filters/ffmpeg_glue.cc',
374         'filters/ffmpeg_glue.h',
375         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
376         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
377         'filters/ffmpeg_video_decoder.cc',
378         'filters/ffmpeg_video_decoder.h',
379         'filters/file_data_source.cc',
380         'filters/file_data_source.h',
381         'filters/gpu_video_accelerator_factories.cc',
382         'filters/gpu_video_accelerator_factories.h',
383         'filters/gpu_video_decoder.cc',
384         'filters/gpu_video_decoder.h',
385         'filters/h264_bit_reader.cc',
386         'filters/h264_bit_reader.h',
387         'filters/h264_parser.cc',
388         'filters/h264_parser.h',
389         'filters/h264_to_annex_b_bitstream_converter.cc',
390         'filters/h264_to_annex_b_bitstream_converter.h',
391         'filters/in_memory_url_protocol.cc',
392         'filters/in_memory_url_protocol.h',
393         'filters/opus_audio_decoder.cc',
394         'filters/opus_audio_decoder.h',
395         'filters/skcanvas_video_renderer.cc',
396         'filters/skcanvas_video_renderer.h',
397         'filters/source_buffer_stream.cc',
398         'filters/source_buffer_stream.h',
399         'filters/stream_parser_factory.cc',
400         'filters/stream_parser_factory.h',
401         'filters/video_decoder_selector.cc',
402         'filters/video_decoder_selector.h',
403         'filters/video_frame_stream.cc',
404         'filters/video_frame_stream.h',
405         'filters/video_renderer_impl.cc',
406         'filters/video_renderer_impl.h',
407         'filters/vpx_video_decoder.cc',
408         'filters/vpx_video_decoder.h',
409         'filters/webvtt_util.h',
410         'filters/wsola_internals.cc',
411         'filters/wsola_internals.h',
412         'midi/midi_manager.cc',
413         'midi/midi_manager.h',
414         'midi/midi_manager_alsa.cc',
415         'midi/midi_manager_alsa.h',
416         'midi/midi_manager_mac.cc',
417         'midi/midi_manager_mac.h',
418         'midi/midi_message_queue.cc',
419         'midi/midi_message_queue.h',
420         'midi/midi_message_util.cc',
421         'midi/midi_message_util.h',
422         'midi/midi_manager_win.cc',
423         'midi/midi_manager_win.h',
424         'midi/midi_port_info.cc',
425         'midi/midi_port_info.h',
426         'midi/usb_midi_descriptor_parser.cc',
427         'midi/usb_midi_descriptor_parser.h',
428         'midi/usb_midi_jack.h',
429         'video/capture/android/video_capture_device_android.cc',
430         'video/capture/android/video_capture_device_android.h',
431         'video/capture/fake_video_capture_device.cc',
432         'video/capture/fake_video_capture_device.h',
433         'video/capture/file_video_capture_device.cc',
434         'video/capture/file_video_capture_device.h',
435         'video/capture/linux/video_capture_device_linux.cc',
436         'video/capture/linux/video_capture_device_linux.h',
437         'video/capture/mac/avfoundation_glue.h',
438         'video/capture/mac/avfoundation_glue.mm',
439         'video/capture/mac/coremedia_glue.h',
440         'video/capture/mac/coremedia_glue.mm',
441         'video/capture/mac/platform_video_capturing_mac.h',
442         'video/capture/mac/video_capture_device_avfoundation_mac.h',
443         'video/capture/mac/video_capture_device_avfoundation_mac.mm',
444         'video/capture/mac/video_capture_device_mac.h',
445         'video/capture/mac/video_capture_device_mac.mm',
446         'video/capture/mac/video_capture_device_qtkit_mac.h',
447         'video/capture/mac/video_capture_device_qtkit_mac.mm',
448         'video/capture/video_capture.h',
449         'video/capture/video_capture_device.cc',
450         'video/capture/video_capture_device.h',
451         'video/capture/video_capture_proxy.cc',
452         'video/capture/video_capture_proxy.h',
453         'video/capture/video_capture_types.cc',
454         'video/capture/video_capture_types.h',
455         'video/capture/win/capability_list_win.cc',
456         'video/capture/win/capability_list_win.h',
457         'video/capture/win/filter_base_win.cc',
458         'video/capture/win/filter_base_win.h',
459         'video/capture/win/pin_base_win.cc',
460         'video/capture/win/pin_base_win.h',
461         'video/capture/win/sink_filter_observer_win.h',
462         'video/capture/win/sink_filter_win.cc',
463         'video/capture/win/sink_filter_win.h',
464         'video/capture/win/sink_input_pin_win.cc',
465         'video/capture/win/sink_input_pin_win.h',
466         'video/capture/win/video_capture_device_mf_win.cc',
467         'video/capture/win/video_capture_device_mf_win.h',
468         'video/capture/win/video_capture_device_win.cc',
469         'video/capture/win/video_capture_device_win.h',
470         'video/picture.cc',
471         'video/picture.h',
472         'video/video_decode_accelerator.cc',
473         'video/video_decode_accelerator.h',
474         'video/video_encode_accelerator.cc',
475         'video/video_encode_accelerator.h',
476         'webm/webm_audio_client.cc',
477         'webm/webm_audio_client.h',
478         'webm/webm_cluster_parser.cc',
479         'webm/webm_cluster_parser.h',
480         'webm/webm_constants.cc',
481         'webm/webm_constants.h',
482         'webm/webm_content_encodings.cc',
483         'webm/webm_content_encodings.h',
484         'webm/webm_content_encodings_client.cc',
485         'webm/webm_content_encodings_client.h',
486         'webm/webm_crypto_helpers.cc',
487         'webm/webm_crypto_helpers.h',
488         'webm/webm_info_parser.cc',
489         'webm/webm_info_parser.h',
490         'webm/webm_parser.cc',
491         'webm/webm_parser.h',
492         'webm/webm_stream_parser.cc',
493         'webm/webm_stream_parser.h',
494         'webm/webm_tracks_parser.cc',
495         'webm/webm_tracks_parser.h',
496         'webm/webm_video_client.cc',
497         'webm/webm_video_client.h',
498         'webm/webm_webvtt_parser.cc',
499         'webm/webm_webvtt_parser.h'
500       ],
501       'direct_dependent_settings': {
502         'include_dirs': [
503           '..',
504         ],
505       },
506       'conditions': [
507         ['arm_neon==1', {
508           'defines': [
509             'USE_NEON'
510           ],
511         }],
512         ['media_use_ffmpeg==1', {
513           'dependencies': [
514             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
515           ],
516         }, {  # media_use_ffmpeg==0
517           # Exclude the sources that depend on ffmpeg.
518           'sources!': [
519             'base/audio_video_metadata_extractor.cc',
520             'base/audio_video_metadata_extractor.h',
521             'base/container_names.cc',
522             'base/container_names.h',
523             'base/media_file_checker.cc',
524             'base/media_file_checker.h',
525             'base/media_posix.cc',
526             'ffmpeg/ffmpeg_common.cc',
527             'ffmpeg/ffmpeg_common.h',
528             'filters/audio_file_reader.cc',
529             'filters/audio_file_reader.h',
530             'filters/blocking_url_protocol.cc',
531             'filters/blocking_url_protocol.h',
532             'filters/ffmpeg_audio_decoder.cc',
533             'filters/ffmpeg_audio_decoder.h',
534             'filters/ffmpeg_demuxer.cc',
535             'filters/ffmpeg_demuxer.h',
536             'filters/ffmpeg_glue.cc',
537             'filters/ffmpeg_glue.h',
538             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
539             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
540             'filters/ffmpeg_video_decoder.cc',
541             'filters/ffmpeg_video_decoder.h',
542           ],
543         }],
544         ['media_use_libvpx==1', {
545           'dependencies': [
546             '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
547           ],
548         }, {  # media_use_libvpx==0
549           'direct_dependent_settings': {
550             'defines': [
551               'MEDIA_DISABLE_LIBVPX',
552             ],
553           },
554           # Exclude the sources that depend on libvpx.
555           'sources!': [
556             'filters/vpx_video_decoder.cc',
557             'filters/vpx_video_decoder.h',
558           ],
559         }],
560         ['OS=="android"', {
561           'dependencies': [
562             'media_android_jni_headers',
563             'player_android',
564             'video_capture_android_jni_headers',
565           ],
566           'sources': [
567             'base/media.cc',
568             'base/media.h',
569             'base/media_stub.cc',
570           ],
571           'sources!': [
572             'filters/opus_audio_decoder.cc',
573             'filters/opus_audio_decoder.h',
574           ],
575           'conditions': [
576             ['android_webview_build==0', {
577               'dependencies': [
578                 'media_java',
579               ],
580             }],
581           ],
582           'defines': [
583             'DISABLE_USER_INPUT_MONITOR',
584           ],
585         }],
586         # A simple WebM encoder for animated avatars on ChromeOS.
587         ['chromeos==1', {
588           'dependencies': [
589             '../third_party/libvpx/libvpx.gyp:libvpx',
590             '../third_party/libyuv/libyuv.gyp:libyuv',
591           ],
592           'sources': [
593             'webm/chromeos/ebml_writer.cc',
594             'webm/chromeos/ebml_writer.h',
595             'webm/chromeos/webm_encoder.cc',
596             'webm/chromeos/webm_encoder.h',
597           ],
598         }],
599         ['use_alsa==1', {
600           'link_settings': {
601             'libraries': [
602               '-lasound',
603             ],
604           },
605           'defines': [
606             'USE_ALSA',
607           ],
608         }, { # use_alsa==0
609           'sources/': [
610             ['exclude', '(^|/)alsa/'],
611             ['exclude', '_alsa\\.(h|cc)$'],
612           ],
613         }],
614         ['OS!="openbsd"', {
615           'sources!': [
616             'audio/openbsd/audio_manager_openbsd.cc',
617             'audio/openbsd/audio_manager_openbsd.h',
618           ],
619         }],
620         ['OS=="linux"', {
621           'variables': {
622             'conditions': [
623               ['sysroot!=""', {
624                 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
625               }, {
626                 'pkg-config': 'pkg-config'
627               }],
628             ],
629           },
630           'conditions': [
631             ['use_x11==1', {
632               'link_settings': {
633                 'libraries': [
634                   '-lX11',
635                   '-lXdamage',
636                   '-lXext',
637                   '-lXfixes',
638                   '-lXtst',
639                 ],
640               },
641             }, {  # else: use_x11==0
642               'sources!': [
643                 'base/user_input_monitor_linux.cc',
644               ],
645               'defines': [
646                 'DISABLE_USER_INPUT_MONITOR',
647               ],
648             }],
649             ['use_cras==1', {
650               'cflags': [
651                 '<!@(<(pkg-config) --cflags libcras)',
652               ],
653               'link_settings': {
654                 'libraries': [
655                   '<!@(<(pkg-config) --libs libcras)',
656                 ],
657               },
658               'defines': [
659                 'USE_CRAS',
660               ],
661             }, {  # else: use_cras==0
662               'sources!': [
663                 'audio/cras/audio_manager_cras.cc',
664                 'audio/cras/audio_manager_cras.h',
665                 'audio/cras/cras_input.cc',
666                 'audio/cras/cras_input.h',
667                 'audio/cras/cras_unified.cc',
668                 'audio/cras/cras_unified.h',
669               ],
670             }],
671           ],
672         }],
673         ['OS!="linux"', {
674           'sources!': [
675             'audio/cras/audio_manager_cras.cc',
676             'audio/cras/audio_manager_cras.h',
677             'audio/cras/cras_input.cc',
678             'audio/cras/cras_input.h',
679             'audio/cras/cras_unified.cc',
680             'audio/cras/cras_unified.h',
681           ],
682         }],
683         ['use_pulseaudio==1', {
684           'cflags': [
685             '<!@(pkg-config --cflags libpulse)',
686           ],
687           'defines': [
688             'USE_PULSEAUDIO',
689           ],
690           'conditions': [
691             ['linux_link_pulseaudio==0', {
692               'defines': [
693                 'DLOPEN_PULSEAUDIO',
694               ],
695               'variables': {
696                 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py',
697                 'extra_header': 'audio/pulse/pulse_stub_header.fragment',
698                 'sig_files': ['audio/pulse/pulse.sigs'],
699                 'outfile_type': 'posix_stubs',
700                 'stubs_filename_root': 'pulse_stubs',
701                 'project_path': 'media/audio/pulse',
702                 'intermediate_dir': '<(INTERMEDIATE_DIR)',
703                 'output_root': '<(SHARED_INTERMEDIATE_DIR)/pulse',
704               },
705               'include_dirs': [
706                 '<(output_root)',
707               ],
708               'actions': [
709                 {
710                   'action_name': 'generate_stubs',
711                   'inputs': [
712                     '<(generate_stubs_script)',
713                     '<(extra_header)',
714                     '<@(sig_files)',
715                   ],
716                   'outputs': [
717                     '<(intermediate_dir)/<(stubs_filename_root).cc',
718                     '<(output_root)/<(project_path)/<(stubs_filename_root).h',
719                   ],
720                   'action': ['python',
721                              '<(generate_stubs_script)',
722                              '-i', '<(intermediate_dir)',
723                              '-o', '<(output_root)/<(project_path)',
724                              '-t', '<(outfile_type)',
725                              '-e', '<(extra_header)',
726                              '-s', '<(stubs_filename_root)',
727                              '-p', '<(project_path)',
728                              '<@(_inputs)',
729                   ],
730                   'process_outputs_as_sources': 1,
731                   'message': 'Generating Pulse stubs for dynamic loading',
732                 },
733               ],
734               'conditions': [
735                 # Linux/Solaris need libdl for dlopen() and friends.
736                 ['OS=="linux" or OS=="solaris"', {
737                   'link_settings': {
738                     'libraries': [
739                       '-ldl',
740                     ],
741                   },
742                 }],
743               ],
744             }, {  # else: linux_link_pulseaudio==0
745               'link_settings': {
746                 'ldflags': [
747                   '<!@(pkg-config --libs-only-L --libs-only-other libpulse)',
748                 ],
749                 'libraries': [
750                   '<!@(pkg-config --libs-only-l libpulse)',
751                 ],
752               },
753             }],
754           ],
755         }, {  # else: use_pulseaudio==0
756           'sources!': [
757             'audio/pulse/audio_manager_pulse.cc',
758             'audio/pulse/audio_manager_pulse.h',
759             'audio/pulse/pulse_input.cc',
760             'audio/pulse/pulse_input.h',
761             'audio/pulse/pulse_output.cc',
762             'audio/pulse/pulse_output.h',
763             'audio/pulse/pulse_unified.cc',
764             'audio/pulse/pulse_unified.h',
765             'audio/pulse/pulse_util.cc',
766             'audio/pulse/pulse_util.h',
767           ],
768         }],
769         ['OS=="mac"', {
770           'link_settings': {
771             'libraries': [
772               '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
773               '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
774               '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
775               '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
776               '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
777               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
778               '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
779             ],
780           },
781         }],
782         ['OS=="win"', {
783           'link_settings':  {
784             'libraries': [
785               '-lmf.lib',
786               '-lmfplat.lib',
787               '-lmfreadwrite.lib',
788               '-lmfuuid.lib',
789             ],
790           },
791           # Specify delayload for media.dll.
792           'msvs_settings': {
793             'VCLinkerTool': {
794               'DelayLoadDLLs': [
795                 'mf.dll',
796                 'mfplat.dll',
797                 'mfreadwrite.dll',
798               ],
799             },
800           },
801           # Specify delayload for components that link with media.lib.
802           'all_dependent_settings': {
803             'msvs_settings': {
804               'VCLinkerTool': {
805                 'DelayLoadDLLs': [
806                   'mf.dll',
807                   'mfplat.dll',
808                   'mfreadwrite.dll',
809                 ],
810               },
811             },
812           },
813           # TODO(wolenetz): Fix size_t to int truncations in win64. See
814           # http://crbug.com/171009
815           'conditions': [
816             ['target_arch=="x64"', {
817               'msvs_disabled_warnings': [ 4267, ],
818             }],
819           ],
820         }],
821         ['proprietary_codecs==1', {
822           'sources': [
823             'mp2t/es_parser.h',
824             'mp2t/es_parser_adts.cc',
825             'mp2t/es_parser_adts.h',
826             'mp2t/es_parser_h264.cc',
827             'mp2t/es_parser_h264.h',
828             'mp2t/mp2t_common.h',
829             'mp2t/mp2t_stream_parser.cc',
830             'mp2t/mp2t_stream_parser.h',
831             'mp2t/ts_packet.cc',
832             'mp2t/ts_packet.h',
833             'mp2t/ts_section.h',
834             'mp2t/ts_section_pat.cc',
835             'mp2t/ts_section_pat.h',
836             'mp2t/ts_section_pes.cc',
837             'mp2t/ts_section_pes.h',
838             'mp2t/ts_section_pmt.cc',
839             'mp2t/ts_section_pmt.h',
840             'mp2t/ts_section_psi.cc',
841             'mp2t/ts_section_psi.h',
842             'mp3/mp3_stream_parser.cc',
843             'mp3/mp3_stream_parser.h',
844             'mp4/aac.cc',
845             'mp4/aac.h',
846             'mp4/avc.cc',
847             'mp4/avc.h',
848             'mp4/box_definitions.cc',
849             'mp4/box_definitions.h',
850             'mp4/box_reader.cc',
851             'mp4/box_reader.h',
852             'mp4/cenc.cc',
853             'mp4/cenc.h',
854             'mp4/es_descriptor.cc',
855             'mp4/es_descriptor.h',
856             'mp4/mp4_stream_parser.cc',
857             'mp4/mp4_stream_parser.h',
858             'mp4/offset_byte_queue.cc',
859             'mp4/offset_byte_queue.h',
860             'mp4/track_run_iterator.cc',
861             'mp4/track_run_iterator.h',
862           ],
863         }],
864         ['toolkit_uses_gtk==1', {
865           'dependencies': [
866             '../build/linux/system.gyp:gtk',
867           ],
868         }],
869         ['target_arch=="ia32" or target_arch=="x64"', {
870           'dependencies': [
871             'media_asm',
872             'media_mmx',
873             'media_sse',
874             'media_sse2',
875           ],
876           'sources': [
877             'base/simd/convert_yuv_to_rgb_x86.cc',
878           ],
879         }],
880         ['google_tv==1', {
881           'defines': [
882             'ENABLE_EAC3_PLAYBACK',
883           ],
884         }],
885         ['OS!="linux" and OS!="win"', {
886           'sources!': [
887             'base/keyboard_event_counter.cc',
888             'base/keyboard_event_counter.h',
889           ],
890         }],
891       ],
892     },
893     {
894       'target_name': 'media_unittests',
895       'type': '<(gtest_target_type)',
896       'dependencies': [
897         'media',
898         'media_test_support',
899         'shared_memory_support',
900         '../base/base.gyp:base',
901         '../base/base.gyp:base_i18n',
902         '../base/base.gyp:test_support_base',
903         '../gpu/gpu.gyp:command_buffer_common',
904         '../skia/skia.gyp:skia',
905         '../testing/gmock.gyp:gmock',
906         '../testing/gtest.gyp:gtest',
907         '../ui/gfx/gfx.gyp:gfx',
908         '../ui/gfx/gfx.gyp:gfx_geometry',
909         '../ui/ui.gyp:ui',
910       ],
911       'sources': [
912         'audio/android/audio_android_unittest.cc',
913         'audio/alsa/alsa_output_unittest.cc',
914         'audio/audio_input_controller_unittest.cc',
915         'audio/audio_input_unittest.cc',
916         'audio/audio_input_volume_unittest.cc',
917         'audio/audio_low_latency_input_output_unittest.cc',
918         'audio/audio_manager_unittest.cc',
919         'audio/audio_output_controller_unittest.cc',
920         'audio/audio_output_device_unittest.cc',
921         'audio/audio_output_proxy_unittest.cc',
922         'audio/audio_parameters_unittest.cc',
923         'audio/audio_power_monitor_unittest.cc',
924         'audio/fake_audio_consumer_unittest.cc',
925         'audio/mac/audio_auhal_mac_unittest.cc',
926         'audio/mac/audio_device_listener_mac_unittest.cc',
927         'audio/mac/audio_low_latency_input_mac_unittest.cc',
928         'audio/simple_sources_unittest.cc',
929         'audio/sounds/audio_stream_handler_unittest.cc',
930         'audio/sounds/sounds_manager_unittest.cc',
931         'audio/sounds/test_data.cc',
932         'audio/sounds/test_data.h',
933         'audio/sounds/wav_audio_handler_unittest.cc',
934         'audio/virtual_audio_input_stream_unittest.cc',
935         'audio/virtual_audio_output_stream_unittest.cc',
936         'audio/win/audio_device_listener_win_unittest.cc',
937         'audio/win/audio_low_latency_input_win_unittest.cc',
938         'audio/win/audio_low_latency_output_win_unittest.cc',
939         'audio/win/audio_output_win_unittest.cc',
940         'audio/win/audio_unified_win_unittest.cc',
941         'audio/win/core_audio_util_win_unittest.cc',
942         'base/android/media_codec_bridge_unittest.cc',
943         'base/android/media_source_player_unittest.cc',
944         'base/audio_buffer_unittest.cc',
945         'base/audio_buffer_queue_unittest.cc',
946         'base/audio_bus_unittest.cc',
947         'base/audio_converter_unittest.cc',
948         'base/audio_fifo_unittest.cc',
949         'base/audio_hardware_config_unittest.cc',
950         'base/audio_hash_unittest.cc',
951         'base/audio_pull_fifo_unittest.cc',
952         'base/audio_renderer_mixer_input_unittest.cc',
953         'base/audio_renderer_mixer_unittest.cc',
954         'base/audio_splicer_unittest.cc',
955         'base/audio_timestamp_helper_unittest.cc',
956         'base/audio_video_metadata_extractor_unittest.cc',
957         'base/bind_to_current_loop_unittest.cc',
958         'base/bit_reader_unittest.cc',
959         'base/callback_holder.h',
960         'base/callback_holder_unittest.cc',
961         'base/channel_mixer_unittest.cc',
962         'base/clock_unittest.cc',
963         'base/container_names_unittest.cc',
964         'base/data_buffer_unittest.cc',
965         'base/decoder_buffer_queue_unittest.cc',
966         'base/decoder_buffer_unittest.cc',
967         'base/djb2_unittest.cc',
968         'base/gmock_callback_support_unittest.cc',
969         'base/media_file_checker_unittest.cc',
970         'base/multi_channel_resampler_unittest.cc',
971         'base/pipeline_unittest.cc',
972         'base/ranges_unittest.cc',
973         'base/run_all_unittests.cc',
974         'base/scoped_histogram_timer_unittest.cc',
975         'base/serial_runner_unittest.cc',
976         'base/seekable_buffer_unittest.cc',
977         'base/sinc_resampler_unittest.cc',
978         'base/test_data_util.cc',
979         'base/test_data_util.h',
980         'base/text_renderer_unittest.cc',
981         'base/user_input_monitor_unittest.cc',
982         'base/vector_math_testing.h',
983         'base/vector_math_unittest.cc',
984         'base/video_frame_unittest.cc',
985         'base/video_frame_pool_unittest.cc',
986         'base/video_util_unittest.cc',
987         'base/yuv_convert_unittest.cc',
988         'cdm/aes_decryptor_unittest.cc',
989         'cdm/json_web_key_unittest.cc',
990         'ffmpeg/ffmpeg_common_unittest.cc',
991         'filters/audio_decoder_selector_unittest.cc',
992         'filters/audio_file_reader_unittest.cc',
993         'filters/audio_renderer_algorithm_unittest.cc',
994         'filters/audio_renderer_impl_unittest.cc',
995         'filters/blocking_url_protocol_unittest.cc',
996         'filters/chunk_demuxer_unittest.cc',
997         'filters/decrypting_audio_decoder_unittest.cc',
998         'filters/decrypting_demuxer_stream_unittest.cc',
999         'filters/decrypting_video_decoder_unittest.cc',
1000         'filters/fake_demuxer_stream.cc',
1001         'filters/fake_demuxer_stream.h',
1002         'filters/fake_demuxer_stream_unittest.cc',
1003         'filters/fake_video_decoder.cc',
1004         'filters/fake_video_decoder.h',
1005         'filters/fake_video_decoder_unittest.cc',
1006         'filters/ffmpeg_audio_decoder_unittest.cc',
1007         'filters/ffmpeg_demuxer_unittest.cc',
1008         'filters/ffmpeg_glue_unittest.cc',
1009         'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1010         'filters/ffmpeg_video_decoder_unittest.cc',
1011         'filters/file_data_source_unittest.cc',
1012         'filters/h264_bit_reader_unittest.cc',
1013         'filters/h264_parser_unittest.cc',
1014         'filters/h264_to_annex_b_bitstream_converter_unittest.cc',
1015         'filters/pipeline_integration_test.cc',
1016         'filters/pipeline_integration_test_base.cc',
1017         'filters/skcanvas_video_renderer_unittest.cc',
1018         'filters/source_buffer_stream_unittest.cc',
1019         'filters/video_decoder_selector_unittest.cc',
1020         'filters/video_frame_stream_unittest.cc',
1021         'filters/video_renderer_impl_unittest.cc',
1022         'midi/midi_message_queue_unittest.cc',
1023         'midi/midi_message_util_unittest.cc',
1024         'midi/usb_midi_descriptor_parser_unittest.cc',
1025         'video/capture/video_capture_device_unittest.cc',
1026         'webm/cluster_builder.cc',
1027         'webm/cluster_builder.h',
1028         'webm/tracks_builder.cc',
1029         'webm/tracks_builder.h',
1030         'webm/webm_cluster_parser_unittest.cc',
1031         'webm/webm_content_encodings_client_unittest.cc',
1032         'webm/webm_parser_unittest.cc',
1033         'webm/webm_tracks_parser_unittest.cc',
1034         'webm/webm_webvtt_parser_unittest.cc',
1035       ],
1036       'conditions': [
1037         ['arm_neon==1', {
1038           'defines': [
1039             'USE_NEON'
1040           ],
1041         }],
1042         ['media_use_ffmpeg==1', {
1043           'dependencies': [
1044             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1045           ],
1046         }, {  # media_use_ffmpeg== 0
1047           'sources!': [
1048             'base/audio_video_metadata_extractor_unittest.cc',
1049             'base/media_file_checker_unittest.cc',
1050           ],
1051         }],
1052         ['use_alsa==1', {
1053           'defines': [
1054             'USE_ALSA',
1055           ],
1056         }],
1057         ['use_pulseaudio==1', {
1058           'defines': [
1059             'USE_PULSEAUDIO',
1060           ],
1061         }],
1062         ['os_posix==1 and OS!="mac"', {
1063           'conditions': [
1064             ['linux_use_tcmalloc==1', {
1065               'dependencies': [
1066                 '../base/allocator/allocator.gyp:allocator',
1067               ],
1068             }],
1069           ],
1070         }],
1071         ['OS=="android"', {
1072           'sources!': [
1073             'audio/audio_input_volume_unittest.cc',
1074             'base/container_names_unittest.cc',
1075             'ffmpeg/ffmpeg_common_unittest.cc',
1076             'filters/audio_file_reader_unittest.cc',
1077             'filters/blocking_url_protocol_unittest.cc',
1078             'filters/ffmpeg_audio_decoder_unittest.cc',
1079             'filters/ffmpeg_demuxer_unittest.cc',
1080             'filters/ffmpeg_glue_unittest.cc',
1081             'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1082             'filters/ffmpeg_video_decoder_unittest.cc',
1083             'filters/pipeline_integration_test.cc',
1084             'filters/pipeline_integration_test_base.cc',
1085           ],
1086           'conditions': [
1087             ['gtest_target_type=="shared_library"', {
1088               'dependencies': [
1089                 '../testing/android/native_test.gyp:native_test_native_code',
1090                 'player_android',
1091               ],
1092             }],
1093           ],
1094         }],
1095         ['OS=="linux"', {
1096           'conditions': [
1097             ['use_cras==1', {
1098               'sources': [
1099                 'audio/cras/cras_input_unittest.cc',
1100                 'audio/cras/cras_unified_unittest.cc',
1101               ],
1102               'defines': [
1103                 'USE_CRAS',
1104               ],
1105             }],
1106           ],
1107         }],
1108         ['use_alsa==0', {
1109           'sources!': [
1110             'audio/alsa/alsa_output_unittest.cc',
1111             'audio/audio_low_latency_input_output_unittest.cc',
1112           ],
1113         }],
1114         ['target_arch=="ia32" or target_arch=="x64"', {
1115           'sources': [
1116             'base/simd/convert_rgb_to_yuv_unittest.cc',
1117           ],
1118         }],
1119         ['proprietary_codecs==1', {
1120           'sources': [
1121             'mp2t/mp2t_stream_parser_unittest.cc',
1122             'mp3/mp3_stream_parser_unittest.cc',
1123             'mp4/aac_unittest.cc',
1124             'mp4/avc_unittest.cc',
1125             'mp4/box_reader_unittest.cc',
1126             'mp4/es_descriptor_unittest.cc',
1127             'mp4/mp4_stream_parser_unittest.cc',
1128             'mp4/offset_byte_queue_unittest.cc',
1129             'mp4/track_run_iterator_unittest.cc',
1130           ],
1131         }],
1132         # TODO(wolenetz): Fix size_t to int truncations in win64. See
1133         # http://crbug.com/171009
1134         ['OS=="win" and target_arch=="x64"', {
1135           'msvs_disabled_warnings': [ 4267, ],
1136         }],
1137       ],
1138     },
1139     {
1140       'target_name': 'media_perftests',
1141       'type': '<(gtest_target_type)',
1142       'dependencies': [
1143         'media',
1144         'media_test_support',
1145         'shared_memory_support',
1146         '../base/base.gyp:test_support_base',
1147         '../testing/gmock.gyp:gmock',
1148         '../testing/gtest.gyp:gtest',
1149         '../testing/perf/perf_test.gyp:perf_test',
1150         '../ui/gfx/gfx.gyp:gfx',
1151         '../ui/gfx/gfx.gyp:gfx_geometry',
1152         '../ui/gl/gl.gyp:gl',
1153         '../ui/ui.gyp:ui',
1154       ],
1155       'sources': [
1156         'base/audio_bus_perftest.cc',
1157         'base/audio_converter_perftest.cc',
1158         'base/demuxer_perftest.cc',
1159         'base/run_all_unittests.cc',
1160         'base/sinc_resampler_perftest.cc',
1161         'base/test_data_util.cc',
1162         'base/vector_math_perftest.cc',
1163         'filters/pipeline_integration_perftest.cc',
1164         'filters/pipeline_integration_test_base.cc',
1165       ],
1166       'conditions': [
1167         ['arm_neon==1', {
1168           'defines': [
1169             'USE_NEON'
1170           ],
1171         }],
1172         ['OS=="android"', {
1173           'conditions': [
1174             ['gtest_target_type=="shared_library"', {
1175               'dependencies': [
1176                 '../testing/android/native_test.gyp:native_test_native_code',
1177               ],
1178             }],
1179           ],
1180         }],
1181         ['media_use_ffmpeg==1', {
1182           'dependencies': [
1183             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1184           ],
1185         }, {  # media_use_ffmpeg==0
1186           'sources!': [
1187             'base/demuxer_perftest.cc',
1188             'filters/pipeline_integration_perftest.cc',
1189             'filters/pipeline_integration_test_base.cc',
1190           ],
1191         }],
1192       ],
1193     },
1194     {
1195       'target_name': 'media_test_support',
1196       'type': 'static_library',
1197       'dependencies': [
1198         'media',
1199         'shared_memory_support',
1200         '../base/base.gyp:base',
1201         '../skia/skia.gyp:skia',
1202         '../testing/gmock.gyp:gmock',
1203         '../testing/gtest.gyp:gtest',
1204       ],
1205       'sources': [
1206         'audio/mock_audio_manager.cc',
1207         'audio/mock_audio_manager.h',
1208         'audio/test_audio_input_controller_factory.cc',
1209         'audio/test_audio_input_controller_factory.h',
1210         'base/fake_audio_render_callback.cc',
1211         'base/fake_audio_render_callback.h',
1212         'base/fake_audio_renderer_sink.cc',
1213         'base/fake_audio_renderer_sink.h',
1214         'base/fake_text_track_stream.cc',
1215         'base/fake_text_track_stream.h',
1216         'base/gmock_callback_support.h',
1217         'base/mock_audio_renderer_sink.cc',
1218         'base/mock_audio_renderer_sink.h',
1219         'base/mock_data_source_host.cc',
1220         'base/mock_data_source_host.h',
1221         'base/mock_demuxer_host.cc',
1222         'base/mock_demuxer_host.h',
1223         'base/mock_filters.cc',
1224         'base/mock_filters.h',
1225         'base/test_helpers.cc',
1226         'base/test_helpers.h',
1227         'filters/mock_gpu_video_accelerator_factories.cc',
1228         'filters/mock_gpu_video_accelerator_factories.h',
1229         'video/capture/mock_video_capture_event_handler.cc',
1230         'video/capture/mock_video_capture_event_handler.h',
1231         'video/mock_video_decode_accelerator.cc',
1232         'video/mock_video_decode_accelerator.h',
1233       ],
1234     },
1235     {
1236       # Minimal target for NaCl and other renderer side media clients which
1237       # only need to send audio data across the shared memory to the browser
1238       # process.
1239       'target_name': 'shared_memory_support',
1240       'type': '<(component)',
1241       'dependencies': [
1242         '../base/base.gyp:base',
1243       ],
1244       'defines': [
1245         'MEDIA_IMPLEMENTATION',
1246       ],
1247       'include_dirs': [
1248         '..',
1249       ],
1250       'includes': [
1251         'shared_memory_support.gypi',
1252       ],
1253       'sources': [
1254         '<@(shared_memory_support_sources)',
1255       ],
1256       'conditions': [
1257         ['arm_neon==1', {
1258           'defines': [
1259             'USE_NEON'
1260           ],
1261         }],
1262         ['target_arch=="ia32" or target_arch=="x64"', {
1263           'dependencies': [
1264             'shared_memory_support_sse'
1265           ],
1266         }],
1267       ],
1268     },
1269   ],
1270   'conditions': [
1271     ['target_arch!="arm"', {
1272       'targets': [
1273        {
1274           'target_name': 'media_asm',
1275           'type': 'static_library',
1276           'sources': [
1277             'base/simd/convert_rgb_to_yuv_ssse3.asm',
1278             'base/simd/convert_yuv_to_rgb_mmx.asm',
1279             'base/simd/convert_yuv_to_rgb_sse.asm',
1280             'base/simd/convert_yuva_to_argb_mmx.asm',
1281             'base/simd/empty_register_state_mmx.asm',
1282             'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
1283             'base/simd/linear_scale_yuv_to_rgb_sse.asm',
1284             'base/simd/scale_yuv_to_rgb_mmx.asm',
1285             'base/simd/scale_yuv_to_rgb_sse.asm',
1286           ],
1287           'conditions': [
1288             ['component=="shared_library"', {
1289               'variables': {
1290                 'yasm_flags': ['-DEXPORT_SYMBOLS'],
1291               },
1292             }],
1293             ['target_arch=="x64"', {
1294               # Source files optimized for X64 systems.
1295               'sources': [
1296                 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
1297                 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
1298               ],
1299               'variables': {
1300                 'yasm_flags': ['-DARCH_X86_64'],
1301               },
1302             }],
1303             ['OS=="mac"', {
1304               'variables': {
1305                 'yasm_flags': [
1306                   '-DPREFIX',
1307                   '-DMACHO',
1308                 ],
1309               },
1310               'sources': [
1311                 # XCode doesn't want to link a pure assembly target and will
1312                 # fail to link when it creates an empty file list.  So add a
1313                 # dummy file keep the linker happy.  See http://crbug.com/157073
1314                 'base/simd/xcode_hack.c',
1315               ],
1316             }],
1317             ['os_posix==1 and OS!="mac"', {
1318               'variables': {
1319                 'conditions': [
1320                   ['target_arch=="ia32"', {
1321                     'yasm_flags': [
1322                       '-DX86_32',
1323                       '-DELF',
1324                     ],
1325                   }, {
1326                     'yasm_flags': [
1327                       '-DELF',
1328                       '-DPIC',
1329                     ],
1330                   }],
1331                 ],
1332               },
1333             }],
1334           ],
1335           'variables': {
1336             'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
1337             'yasm_flags': [
1338               '-DCHROMIUM',
1339               # In addition to the same path as source asm, let yasm %include
1340               # search path be relative to src/ per Chromium policy.
1341               '-I..',
1342             ],
1343             'yasm_includes': [
1344               '../third_party/x86inc/x86inc.asm',
1345               'base/simd/convert_rgb_to_yuv_ssse3.inc',
1346               'base/simd/convert_yuv_to_rgb_mmx.inc',
1347               'base/simd/convert_yuva_to_argb_mmx.inc',
1348               'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
1349               'base/simd/media_export.asm',
1350               'base/simd/scale_yuv_to_rgb_mmx.inc',
1351             ],
1352           },
1353           'msvs_2010_disable_uldi_when_referenced': 1,
1354           'includes': [
1355             '../third_party/yasm/yasm_compile.gypi',
1356           ],
1357         },
1358         {
1359           'target_name': 'media_mmx',
1360           'type': 'static_library',
1361           'cflags': [
1362             '-mmmx',
1363           ],
1364           'defines': [
1365             'MEDIA_IMPLEMENTATION',
1366           ],
1367           'include_dirs': [
1368             '..',
1369           ],
1370           'sources': [
1371             'base/simd/filter_yuv_mmx.cc',
1372           ],
1373         },
1374         {
1375           'target_name': 'media_sse',
1376           'type': 'static_library',
1377           'cflags': [
1378             '-msse',
1379           ],
1380           'defines': [
1381             'MEDIA_IMPLEMENTATION',
1382           ],
1383           'include_dirs': [
1384             '..',
1385           ],
1386           'sources': [
1387             'base/simd/sinc_resampler_sse.cc',
1388           ],
1389         },
1390         {
1391           'target_name': 'media_sse2',
1392           'type': 'static_library',
1393           'cflags': [
1394             '-msse2',
1395           ],
1396           'defines': [
1397             'MEDIA_IMPLEMENTATION',
1398           ],
1399           'include_dirs': [
1400             '..',
1401           ],
1402           'sources': [
1403             'base/simd/convert_rgb_to_yuv_sse2.cc',
1404             'base/simd/convert_rgb_to_yuv_ssse3.cc',
1405             'base/simd/filter_yuv_sse2.cc',
1406           ],
1407         },
1408         {
1409           'target_name': 'shared_memory_support_sse',
1410           'type': 'static_library',
1411           'cflags': [
1412             '-msse',
1413           ],
1414           'defines': [
1415             'MEDIA_IMPLEMENTATION',
1416           ],
1417           'include_dirs': [
1418             '..',
1419           ],
1420           'sources': [
1421             'base/simd/vector_math_sse.cc',
1422           ],
1423         },
1424       ], # targets
1425     }],
1426     ['use_x11==1', {
1427       'targets': [
1428         {
1429           'target_name': 'player_x11',
1430           'type': 'executable',
1431           'dependencies': [
1432             'media',
1433             '../base/base.gyp:base',
1434             '../ui/gl/gl.gyp:gl',
1435             '../ui/gfx/gfx.gyp:gfx',
1436             '../ui/gfx/gfx.gyp:gfx_geometry',
1437           ],
1438           'link_settings': {
1439             'libraries': [
1440               '-lX11',
1441               '-lXrender',
1442               '-lXext',
1443             ],
1444           },
1445           'conditions': [
1446             # Linux/Solaris need libdl for dlopen() and friends.
1447             ['OS=="linux" or OS=="solaris"', {
1448               'link_settings': {
1449                 'libraries': [
1450                   '-ldl',
1451                 ],
1452               },
1453             }],
1454           ],
1455           'sources': [
1456             'tools/player_x11/data_source_logger.cc',
1457             'tools/player_x11/data_source_logger.h',
1458             'tools/player_x11/gl_video_renderer.cc',
1459             'tools/player_x11/gl_video_renderer.h',
1460             'tools/player_x11/player_x11.cc',
1461             'tools/player_x11/x11_video_renderer.cc',
1462             'tools/player_x11/x11_video_renderer.h',
1463           ],
1464         },
1465       ],
1466     }],
1467     # Special target to wrap a gtest_target_type==shared_library
1468     # media_unittests into an android apk for execution.
1469     ['OS=="android" and gtest_target_type=="shared_library"', {
1470       'targets': [
1471         {
1472           'target_name': 'media_unittests_apk',
1473           'type': 'none',
1474           'dependencies': [
1475             'media_java',
1476             'media_unittests',
1477           ],
1478           'variables': {
1479             'test_suite_name': 'media_unittests',
1480             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
1481           },
1482           'includes': ['../build/apk_test.gypi'],
1483         },
1484         {
1485           'target_name': 'media_perftests_apk',
1486           'type': 'none',
1487           'dependencies': [
1488             'media_java',
1489             'media_perftests',
1490           ],
1491           'variables': {
1492             'test_suite_name': 'media_perftests',
1493             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_perftests<(SHARED_LIB_SUFFIX)',
1494           },
1495           'includes': ['../build/apk_test.gypi'],
1496         },
1497       ],
1498     }],
1499     ['OS=="android"', {
1500       'targets': [
1501         {
1502           'target_name': 'media_android_jni_headers',
1503           'type': 'none',
1504           'sources': [
1505             'base/android/java/src/org/chromium/media/AudioManagerAndroid.java',
1506             'base/android/java/src/org/chromium/media/AudioRecordInput.java',
1507             'base/android/java/src/org/chromium/media/MediaCodecBridge.java',
1508             'base/android/java/src/org/chromium/media/MediaDrmBridge.java',
1509             'base/android/java/src/org/chromium/media/MediaPlayerBridge.java',
1510             'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1511             'base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java',
1512           ],
1513           'variables': {
1514             'jni_gen_package': 'media',
1515             'jni_generator_ptr_type': 'long',
1516           },
1517           'includes': ['../build/jni_generator.gypi'],
1518         },
1519         {
1520           'target_name': 'video_capture_android_jni_headers',
1521           'type': 'none',
1522           'sources': [
1523             'base/android/java/src/org/chromium/media/VideoCapture.java',
1524           ],
1525           'variables': {
1526             'jni_gen_package': 'media',
1527             'jni_generator_ptr_type': 'long',
1528           },
1529           'includes': ['../build/jni_generator.gypi'],
1530         },
1531         {
1532           'target_name': 'player_android',
1533           'type': 'static_library',
1534           'sources': [
1535             'base/android/audio_decoder_job.cc',
1536             'base/android/audio_decoder_job.h',
1537             'base/android/media_codec_bridge.cc',
1538             'base/android/media_codec_bridge.h',
1539             'base/android/media_decoder_job.cc',
1540             'base/android/media_decoder_job.h',
1541             'base/android/media_drm_bridge.cc',
1542             'base/android/media_drm_bridge.h',
1543             'base/android/media_jni_registrar.cc',
1544             'base/android/media_jni_registrar.h',
1545             'base/android/media_player_android.cc',
1546             'base/android/media_player_android.h',
1547             'base/android/media_player_bridge.cc',
1548             'base/android/media_player_bridge.h',
1549             'base/android/media_player_listener.cc',
1550             'base/android/media_player_listener.h',
1551             'base/android/media_source_player.cc',
1552             'base/android/media_source_player.h',
1553             'base/android/video_decoder_job.cc',
1554             'base/android/video_decoder_job.h',
1555             'base/android/webaudio_media_codec_bridge.cc',
1556             'base/android/webaudio_media_codec_bridge.h',
1557             'base/android/webaudio_media_codec_info.h',
1558           ],
1559           'dependencies': [
1560             '../base/base.gyp:base',
1561             '../ui/gl/gl.gyp:gl',
1562             '../url/url.gyp:url_lib',
1563             'media_android_jni_headers',
1564           ],
1565           'defines': [
1566             'MEDIA_IMPLEMENTATION',
1567           ],
1568         },
1569         {
1570           'target_name': 'media_java',
1571           'type': 'none',
1572           'dependencies': [
1573             '../base/base.gyp:base',
1574             'media_android_imageformat_list',
1575           ],
1576           'export_dependent_settings': [
1577             '../base/base.gyp:base',
1578           ],
1579           'variables': {
1580             'java_in_dir': 'base/android/java',
1581           },
1582           'includes': ['../build/java.gypi'],
1583         },
1584         {
1585           'target_name': 'media_android_imageformat_list',
1586           'type': 'none',
1587           'sources': [
1588             'base/android/java/src/org/chromium/media/ImageFormat.template',
1589           ],
1590           'variables': {
1591             'package_name': 'org/chromium/media',
1592             'template_deps': ['video/capture/android/imageformat_list.h'],
1593           },
1594           'includes': [ '../build/android/java_cpp_template.gypi' ],
1595         },
1596       ],
1597     }],
1598     ['media_use_ffmpeg==1', {
1599       'targets': [
1600         {
1601           'target_name': 'ffmpeg_unittests',
1602           'type': 'executable',
1603           'dependencies': [
1604             '../base/base.gyp:base',
1605             '../base/base.gyp:base_i18n',
1606             '../base/base.gyp:test_support_base',
1607             '../base/base.gyp:test_support_perf',
1608             '../testing/gtest.gyp:gtest',
1609             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1610             'media',
1611             'media_test_support',
1612           ],
1613           'sources': [
1614             'ffmpeg/ffmpeg_unittest.cc',
1615           ],
1616           'conditions': [
1617             ['toolkit_uses_gtk==1', {
1618               'dependencies': [
1619                 # Needed for the following #include chain:
1620                 #   base/run_all_unittests.cc
1621                 #   ../base/test_suite.h
1622                 #   gtk/gtk.h
1623                 '../build/linux/system.gyp:gtk',
1624               ],
1625               'conditions': [
1626                 ['linux_use_tcmalloc==1', {
1627                   'dependencies': [
1628                     '../base/allocator/allocator.gyp:allocator',
1629                   ],
1630                 }],
1631               ],
1632             }],
1633           ],
1634         },
1635         {
1636           'target_name': 'ffmpeg_regression_tests',
1637           'type': 'executable',
1638           'dependencies': [
1639             '../base/base.gyp:test_support_base',
1640             '../testing/gmock.gyp:gmock',
1641             '../testing/gtest.gyp:gtest',
1642             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1643             'media',
1644             'media_test_support',
1645           ],
1646           'sources': [
1647             'base/run_all_unittests.cc',
1648             'base/test_data_util.cc',
1649             'ffmpeg/ffmpeg_regression_tests.cc',
1650             'filters/pipeline_integration_test_base.cc',
1651           ],
1652           'conditions': [
1653             ['os_posix==1 and OS!="mac"', {
1654               'conditions': [
1655                 ['linux_use_tcmalloc==1', {
1656                   'dependencies': [
1657                     '../base/allocator/allocator.gyp:allocator',
1658                   ],
1659                 }],
1660               ],
1661             }],
1662           ],
1663         },
1664       ],
1665     }],
1666   ],