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