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