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.
8 # Override to dynamically link the cras (ChromeOS audio) library.
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,
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,
25 ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
30 ['os_posix==1 and OS!="mac" and OS!="ios" and OS!="android" and chromeos!=1', {
39 'target_name': 'media',
40 'type': '<(component)',
42 '../base/base.gyp:base',
43 '../crypto/crypto.gyp:crypto',
44 '../skia/skia.gyp:skia',
45 '../third_party/opus/opus.gyp:opus',
47 '../url/url.gyp:url_lib',
50 'MEDIA_IMPLEMENTATION',
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/async_socket_io_handler.h',
64 'audio/async_socket_io_handler_posix.cc',
65 'audio/async_socket_io_handler_win.cc',
66 'audio/audio_buffers_state.cc',
67 'audio/audio_buffers_state.h',
68 'audio/audio_device_name.cc',
69 'audio/audio_device_name.h',
70 'audio/audio_device_thread.cc',
71 'audio/audio_device_thread.h',
72 'audio/audio_input_controller.cc',
73 'audio/audio_input_controller.h',
74 'audio/audio_input_device.cc',
75 'audio/audio_input_device.h',
76 'audio/audio_input_ipc.cc',
77 'audio/audio_input_ipc.h',
79 'audio/audio_manager.cc',
80 'audio/audio_manager.h',
81 'audio/audio_manager_base.cc',
82 'audio/audio_manager_base.h',
83 'audio/audio_output_controller.cc',
84 'audio/audio_output_controller.h',
85 'audio/audio_output_device.cc',
86 'audio/audio_output_device.h',
87 'audio/audio_output_dispatcher.cc',
88 'audio/audio_output_dispatcher.h',
89 'audio/audio_output_dispatcher_impl.cc',
90 'audio/audio_output_dispatcher_impl.h',
91 'audio/audio_output_ipc.cc',
92 'audio/audio_output_ipc.h',
93 'audio/audio_output_proxy.cc',
94 'audio/audio_output_proxy.h',
95 'audio/audio_output_resampler.cc',
96 'audio/audio_output_resampler.h',
97 'audio/audio_silence_detector.cc',
98 'audio/audio_silence_detector.h',
99 'audio/audio_source_diverter.h',
100 'audio/audio_util.cc',
101 'audio/audio_util.h',
102 'audio/cras/audio_manager_cras.cc',
103 'audio/cras/audio_manager_cras.h',
104 'audio/cras/cras_input.cc',
105 'audio/cras/cras_input.h',
106 'audio/cras/cras_unified.cc',
107 'audio/cras/cras_unified.h',
108 'audio/cross_process_notification.cc',
109 'audio/cross_process_notification.h',
110 'audio/cross_process_notification_posix.cc',
111 'audio/cross_process_notification_win.cc',
112 'audio/fake_audio_consumer.cc',
113 'audio/fake_audio_consumer.h',
114 'audio/fake_audio_input_stream.cc',
115 'audio/fake_audio_input_stream.h',
116 'audio/fake_audio_output_stream.cc',
117 'audio/fake_audio_output_stream.h',
118 'audio/ios/audio_manager_ios.h',
119 'audio/ios/audio_manager_ios.mm',
120 'audio/ios/audio_session_util_ios.h',
121 'audio/ios/audio_session_util_ios.mm',
122 'audio/linux/alsa_input.cc',
123 'audio/linux/alsa_input.h',
124 'audio/linux/alsa_output.cc',
125 'audio/linux/alsa_output.h',
126 'audio/linux/alsa_util.cc',
127 'audio/linux/alsa_util.h',
128 'audio/linux/alsa_wrapper.cc',
129 'audio/linux/alsa_wrapper.h',
130 'audio/linux/audio_manager_linux.cc',
131 'audio/linux/audio_manager_linux.h',
132 'audio/mac/aggregate_device_manager.cc',
133 'audio/mac/aggregate_device_manager.h',
134 'audio/mac/audio_auhal_mac.cc',
135 'audio/mac/audio_auhal_mac.h',
136 'audio/mac/audio_device_listener_mac.cc',
137 'audio/mac/audio_device_listener_mac.h',
138 'audio/mac/audio_input_mac.cc',
139 'audio/mac/audio_input_mac.h',
140 'audio/mac/audio_low_latency_input_mac.cc',
141 'audio/mac/audio_low_latency_input_mac.h',
142 'audio/mac/audio_low_latency_output_mac.cc',
143 'audio/mac/audio_low_latency_output_mac.h',
144 'audio/mac/audio_manager_mac.cc',
145 'audio/mac/audio_manager_mac.h',
146 'audio/mac/audio_synchronized_mac.cc',
147 'audio/mac/audio_synchronized_mac.h',
148 'audio/mac/audio_unified_mac.cc',
149 'audio/mac/audio_unified_mac.h',
150 'audio/null_audio_sink.cc',
151 'audio/null_audio_sink.h',
152 'audio/openbsd/audio_manager_openbsd.cc',
153 'audio/openbsd/audio_manager_openbsd.h',
154 'audio/pulse/audio_manager_pulse.cc',
155 'audio/pulse/audio_manager_pulse.h',
156 'audio/pulse/pulse_output.cc',
157 'audio/pulse/pulse_output.h',
158 'audio/pulse/pulse_input.cc',
159 'audio/pulse/pulse_input.h',
160 'audio/pulse/pulse_unified.cc',
161 'audio/pulse/pulse_unified.h',
162 'audio/pulse/pulse_util.cc',
163 'audio/pulse/pulse_util.h',
164 'audio/sample_rates.cc',
165 'audio/sample_rates.h',
166 'audio/scoped_loop_observer.cc',
167 'audio/scoped_loop_observer.h',
168 'audio/simple_sources.cc',
169 'audio/simple_sources.h',
170 'audio/virtual_audio_input_stream.cc',
171 'audio/virtual_audio_input_stream.h',
172 'audio/virtual_audio_output_stream.cc',
173 'audio/virtual_audio_output_stream.h',
174 'audio/win/audio_device_listener_win.cc',
175 'audio/win/audio_device_listener_win.h',
176 'audio/win/audio_low_latency_input_win.cc',
177 'audio/win/audio_low_latency_input_win.h',
178 'audio/win/audio_low_latency_output_win.cc',
179 'audio/win/audio_low_latency_output_win.h',
180 'audio/win/audio_manager_win.cc',
181 'audio/win/audio_manager_win.h',
182 'audio/win/audio_unified_win.cc',
183 'audio/win/audio_unified_win.h',
184 'audio/win/avrt_wrapper_win.cc',
185 'audio/win/avrt_wrapper_win.h',
186 'audio/win/device_enumeration_win.cc',
187 'audio/win/device_enumeration_win.h',
188 'audio/win/core_audio_util_win.cc',
189 'audio/win/core_audio_util_win.h',
190 'audio/win/wavein_input_win.cc',
191 'audio/win/wavein_input_win.h',
192 'audio/win/waveout_output_win.cc',
193 'audio/win/waveout_output_win.h',
194 'base/android/demuxer_stream_player_params.cc',
195 'base/android/demuxer_stream_player_params.h',
196 'base/android/media_player_manager.h',
197 'base/android/media_resource_getter.cc',
198 'base/android/media_resource_getter.h',
199 'base/audio_buffer.cc',
200 'base/audio_buffer.h',
201 'base/audio_buffer_queue.cc',
202 'base/audio_buffer_queue.h',
203 'base/audio_capturer_source.h',
204 'base/audio_converter.cc',
205 'base/audio_converter.h',
206 'base/audio_decoder.cc',
207 'base/audio_decoder.h',
208 'base/audio_decoder_config.cc',
209 'base/audio_decoder_config.h',
210 'base/audio_fifo.cc',
212 'base/audio_hardware_config.cc',
213 'base/audio_hardware_config.h',
214 'base/audio_hash.cc',
216 'base/audio_pull_fifo.cc',
217 'base/audio_pull_fifo.h',
218 'base/audio_renderer.cc',
219 'base/audio_renderer.h',
220 'base/audio_renderer_sink.h',
221 'base/audio_renderer_mixer.cc',
222 'base/audio_renderer_mixer.h',
223 'base/audio_renderer_mixer_input.cc',
224 'base/audio_renderer_mixer_input.h',
225 'base/audio_splicer.cc',
226 'base/audio_splicer.h',
227 'base/audio_timestamp_helper.cc',
228 'base/audio_timestamp_helper.h',
229 'base/bind_to_loop.h',
230 'base/bitstream_buffer.h',
231 'base/bit_reader.cc',
234 'base/byte_queue.cc',
236 'base/callback_holder.h',
237 'base/channel_mixer.cc',
238 'base/channel_mixer.h',
241 'base/container_names.cc',
242 'base/container_names.h',
243 'base/data_buffer.cc',
244 'base/data_buffer.h',
245 'base/data_source.cc',
246 'base/data_source.h',
247 'base/decoder_buffer.cc',
248 'base/decoder_buffer.h',
249 'base/decoder_buffer_queue.cc',
250 'base/decoder_buffer_queue.h',
253 'base/decrypt_config.cc',
254 'base/decrypt_config.h',
257 'base/demuxer_stream.cc',
258 'base/demuxer_stream.h',
261 'base/filter_collection.cc',
262 'base/filter_collection.h',
265 'base/media_keys.cc',
269 'base/media_log_event.h',
270 'base/media_posix.cc',
271 'base/media_switches.cc',
272 'base/media_switches.h',
274 'base/multi_channel_resampler.cc',
275 'base/multi_channel_resampler.h',
278 'base/pipeline_status.cc',
279 'base/pipeline_status.h',
282 'base/sample_format.cc',
283 'base/sample_format.h',
284 'base/scoped_histogram_timer.h',
285 'base/seekable_buffer.cc',
286 'base/seekable_buffer.h',
287 'base/serial_runner.cc',
288 'base/serial_runner.h',
289 'base/simd/convert_rgb_to_yuv.h',
290 'base/simd/convert_rgb_to_yuv_c.cc',
291 'base/simd/convert_yuv_to_rgb.h',
292 'base/simd/convert_yuv_to_rgb_c.cc',
293 'base/simd/filter_yuv.h',
294 'base/simd/filter_yuv_c.cc',
295 'base/simd/yuv_to_rgb_table.cc',
296 'base/simd/yuv_to_rgb_table.h',
297 'base/sinc_resampler.cc',
298 'base/sinc_resampler.h',
299 'base/stream_parser.cc',
300 'base/stream_parser.h',
301 'base/stream_parser_buffer.cc',
302 'base/stream_parser_buffer.h',
304 'base/video_decoder.cc',
305 'base/video_decoder.h',
306 'base/video_decoder_config.cc',
307 'base/video_decoder_config.h',
308 'base/video_frame.cc',
309 'base/video_frame.h',
310 'base/video_renderer.cc',
311 'base/video_renderer.h',
312 'base/video_util.cc',
314 'base/yuv_convert.cc',
315 'base/yuv_convert.h',
316 'crypto/aes_decryptor.cc',
317 'crypto/aes_decryptor.h',
318 'ffmpeg/ffmpeg_common.cc',
319 'ffmpeg/ffmpeg_common.h',
320 'filters/audio_decoder_selector.cc',
321 'filters/audio_decoder_selector.h',
322 'filters/audio_file_reader.cc',
323 'filters/audio_file_reader.h',
324 'filters/audio_renderer_algorithm.cc',
325 'filters/audio_renderer_algorithm.h',
326 'filters/audio_renderer_impl.cc',
327 'filters/audio_renderer_impl.h',
328 'filters/blocking_url_protocol.cc',
329 'filters/blocking_url_protocol.h',
330 'filters/chunk_demuxer.cc',
331 'filters/chunk_demuxer.h',
332 'filters/decrypting_audio_decoder.cc',
333 'filters/decrypting_audio_decoder.h',
334 'filters/decrypting_demuxer_stream.cc',
335 'filters/decrypting_demuxer_stream.h',
336 'filters/decrypting_video_decoder.cc',
337 'filters/decrypting_video_decoder.h',
338 'filters/fake_demuxer_stream.cc',
339 'filters/fake_demuxer_stream.h',
340 'filters/fake_video_decoder.cc',
341 'filters/fake_video_decoder.h',
342 'filters/ffmpeg_audio_decoder.cc',
343 'filters/ffmpeg_audio_decoder.h',
344 'filters/ffmpeg_demuxer.cc',
345 'filters/ffmpeg_demuxer.h',
346 'filters/ffmpeg_glue.cc',
347 'filters/ffmpeg_glue.h',
348 'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
349 'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
350 'filters/ffmpeg_video_decoder.cc',
351 'filters/ffmpeg_video_decoder.h',
352 'filters/file_data_source.cc',
353 'filters/file_data_source.h',
354 'filters/gpu_video_decoder.cc',
355 'filters/gpu_video_decoder.h',
356 'filters/h264_to_annex_b_bitstream_converter.cc',
357 'filters/h264_to_annex_b_bitstream_converter.h',
358 'filters/in_memory_url_protocol.cc',
359 'filters/in_memory_url_protocol.h',
360 'filters/opus_audio_decoder.cc',
361 'filters/opus_audio_decoder.h',
362 'filters/skcanvas_video_renderer.cc',
363 'filters/skcanvas_video_renderer.h',
364 'filters/source_buffer_stream.cc',
365 'filters/source_buffer_stream.h',
366 'filters/stream_parser_factory.cc',
367 'filters/stream_parser_factory.h',
368 'filters/video_decoder_selector.cc',
369 'filters/video_decoder_selector.h',
370 'filters/video_frame_stream.cc',
371 'filters/video_frame_stream.h',
372 'filters/video_renderer_base.cc',
373 'filters/video_renderer_base.h',
374 'filters/vpx_video_decoder.cc',
375 'filters/vpx_video_decoder.h',
376 'midi/midi_manager.h',
377 'midi/midi_manager.cc',
378 'midi/midi_manager_mac.h',
379 'midi/midi_manager_mac.cc',
380 'midi/midi_port_info.h',
381 'midi/midi_port_info.cc',
382 'video/capture/android/video_capture_device_android.cc',
383 'video/capture/android/video_capture_device_android.h',
384 'video/capture/fake_video_capture_device.cc',
385 'video/capture/fake_video_capture_device.h',
386 'video/capture/linux/video_capture_device_linux.cc',
387 'video/capture/linux/video_capture_device_linux.h',
388 'video/capture/mac/video_capture_device_mac.h',
389 'video/capture/mac/video_capture_device_mac.mm',
390 'video/capture/mac/video_capture_device_qtkit_mac.h',
391 'video/capture/mac/video_capture_device_qtkit_mac.mm',
393 'video/capture/video_capture.h',
394 'video/capture/video_capture_device.h',
395 'video/capture/video_capture_device_dummy.cc',
396 'video/capture/video_capture_device_dummy.h',
397 'video/capture/video_capture_proxy.cc',
398 'video/capture/video_capture_proxy.h',
399 'video/capture/video_capture_types.h',
400 'video/capture/win/capability_list_win.cc',
401 'video/capture/win/capability_list_win.h',
402 'video/capture/win/filter_base_win.cc',
403 'video/capture/win/filter_base_win.h',
404 'video/capture/win/pin_base_win.cc',
405 'video/capture/win/pin_base_win.h',
406 'video/capture/win/sink_filter_observer_win.h',
407 'video/capture/win/sink_filter_win.cc',
408 'video/capture/win/sink_filter_win.h',
409 'video/capture/win/sink_input_pin_win.cc',
410 'video/capture/win/sink_input_pin_win.h',
411 'video/capture/win/video_capture_device_mf_win.cc',
412 'video/capture/win/video_capture_device_mf_win.h',
413 'video/capture/win/video_capture_device_win.cc',
414 'video/capture/win/video_capture_device_win.h',
417 'video/video_decode_accelerator.cc',
418 'video/video_decode_accelerator.h',
419 'webm/webm_audio_client.cc',
420 'webm/webm_audio_client.h',
421 'webm/webm_cluster_parser.cc',
422 'webm/webm_cluster_parser.h',
423 'webm/webm_constants.cc',
424 'webm/webm_constants.h',
425 'webm/webm_content_encodings.cc',
426 'webm/webm_content_encodings.h',
427 'webm/webm_content_encodings_client.cc',
428 'webm/webm_content_encodings_client.h',
429 'webm/webm_crypto_helpers.cc',
430 'webm/webm_crypto_helpers.h',
431 'webm/webm_info_parser.cc',
432 'webm/webm_info_parser.h',
433 'webm/webm_parser.cc',
434 'webm/webm_parser.h',
435 'webm/webm_stream_parser.cc',
436 'webm/webm_stream_parser.h',
437 'webm/webm_tracks_parser.cc',
438 'webm/webm_tracks_parser.h',
439 'webm/webm_video_client.cc',
440 'webm/webm_video_client.h',
441 'webm/webm_webvtt_parser.cc',
442 'webm/webm_webvtt_parser.h'
444 'direct_dependent_settings': {
457 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
458 '../gpu/gpu.gyp:command_buffer_common',
459 'shared_memory_support',
462 ['media_use_ffmpeg==1', {
464 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
466 }, { # media_use_ffmpeg==0
467 # Exclude the sources that depend on ffmpeg.
469 'base/container_names.cc',
470 'base/container_names.h',
471 'base/media_posix.cc',
472 'ffmpeg/ffmpeg_common.cc',
473 'ffmpeg/ffmpeg_common.h',
474 'filters/audio_file_reader.cc',
475 'filters/audio_file_reader.h',
476 'filters/blocking_url_protocol.cc',
477 'filters/blocking_url_protocol.h',
478 'filters/ffmpeg_audio_decoder.cc',
479 'filters/ffmpeg_audio_decoder.h',
480 'filters/ffmpeg_demuxer.cc',
481 'filters/ffmpeg_demuxer.h',
482 'filters/ffmpeg_glue.cc',
483 'filters/ffmpeg_glue.h',
484 'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
485 'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
486 'filters/ffmpeg_video_decoder.cc',
487 'filters/ffmpeg_video_decoder.h',
490 ['media_use_libvpx==1', {
492 '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
494 }, { # media_use_libvpx==0
495 'direct_dependent_settings': {
497 'MEDIA_DISABLE_LIBVPX',
500 # Exclude the sources that depend on libvpx.
502 'filters/vpx_video_decoder.cc',
503 'filters/vpx_video_decoder.h',
508 # For shared_memory_support_sources variable.
509 'shared_memory_support.gypi',
512 'base/media_stub.cc',
513 # These sources are normally built via a dependency on the
514 # shared_memory_support target, but that target is not built on iOS.
515 # Instead, directly build only the files that are needed for iOS.
516 '<@(shared_memory_support_sources)',
519 # Exclude everything but iOS-specific files.
520 ['exclude', '\\.(cc|mm)$'],
521 ['include', '_ios\\.(cc|mm)$'],
522 ['include', '(^|/)ios/'],
523 # Re-include specific pieces.
524 # iOS support is limited to audio input only.
525 ['include', '^audio/audio_buffers_state\\.'],
526 ['include', '^audio/audio_input_controller\\.'],
527 ['include', '^audio/audio_manager\\.'],
528 ['include', '^audio/audio_manager_base\\.'],
529 ['include', '^audio/audio_parameters\\.'],
530 ['include', '^audio/fake_audio_consumer\\.'],
531 ['include', '^audio/fake_audio_input_stream\\.'],
532 ['include', '^audio/fake_audio_output_stream\\.'],
533 ['include', '^base/audio_bus\\.'],
534 ['include', '^base/channel_layout\\.'],
535 ['include', '^base/media\\.cc$'],
536 ['include', '^base/media_stub\\.cc$'],
537 ['include', '^base/media_switches\\.'],
538 ['include', '^base/vector_math\\.'],
542 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
543 '$(SDKROOT)/System/Library/Frameworks/AVFoundation.framework',
544 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
545 '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
556 '<(SHARED_INTERMEDIATE_DIR)/media',
559 'media_android_jni_headers',
561 'video_capture_android_jni_headers',
566 'base/media_stub.cc',
569 ['android_webview_build==0', {
576 # A simple WebM encoder for animated avatars on ChromeOS.
579 '../third_party/libvpx/libvpx.gyp:libvpx',
580 '../third_party/libyuv/libyuv.gyp:libyuv',
583 'webm/chromeos/ebml_writer.cc',
584 'webm/chromeos/ebml_writer.h',
585 'webm/chromeos/webm_encoder.cc',
586 'webm/chromeos/webm_encoder.h',
596 'sources/': [ ['exclude', '/alsa_'],
597 ['exclude', '/audio_manager_linux'] ],
601 'audio/openbsd/audio_manager_openbsd.cc',
602 'audio/openbsd/audio_manager_openbsd.h',
609 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
611 'pkg-config': 'pkg-config'
628 '<!@(<(pkg-config) --cflags libcras)',
632 '<!@(<(pkg-config) --libs libcras)',
638 }, { # else: use_cras==0
640 'audio/cras/audio_manager_cras.cc',
641 'audio/cras/audio_manager_cras.h',
642 'audio/cras/cras_input.cc',
643 'audio/cras/cras_input.h',
644 'audio/cras/cras_unified.cc',
645 'audio/cras/cras_unified.h',
652 'audio/cras/audio_manager_cras.cc',
653 'audio/cras/audio_manager_cras.h',
654 'audio/cras/cras_input.cc',
655 'audio/cras/cras_input.h',
656 'audio/cras/cras_unified.cc',
657 'audio/cras/cras_unified.h',
660 ['use_pulseaudio==1', {
662 '<!@(pkg-config --cflags libpulse)',
668 ['linux_link_pulseaudio==0', {
673 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py',
674 'extra_header': 'audio/pulse/pulse_stub_header.fragment',
675 'sig_files': ['audio/pulse/pulse.sigs'],
676 'outfile_type': 'posix_stubs',
677 'stubs_filename_root': 'pulse_stubs',
678 'project_path': 'media/audio/pulse',
679 'intermediate_dir': '<(INTERMEDIATE_DIR)',
680 'output_root': '<(SHARED_INTERMEDIATE_DIR)/pulse',
687 'action_name': 'generate_stubs',
689 '<(generate_stubs_script)',
694 '<(intermediate_dir)/<(stubs_filename_root).cc',
695 '<(output_root)/<(project_path)/<(stubs_filename_root).h',
698 '<(generate_stubs_script)',
699 '-i', '<(intermediate_dir)',
700 '-o', '<(output_root)/<(project_path)',
701 '-t', '<(outfile_type)',
702 '-e', '<(extra_header)',
703 '-s', '<(stubs_filename_root)',
704 '-p', '<(project_path)',
707 'process_outputs_as_sources': 1,
708 'message': 'Generating Pulse stubs for dynamic loading.',
712 # Linux/Solaris need libdl for dlopen() and friends.
713 ['OS=="linux" or OS=="solaris"', {
721 }, { # else: linux_link_pulseaudio==0
724 '<!@(pkg-config --libs-only-L --libs-only-other libpulse)',
727 '<!@(pkg-config --libs-only-l libpulse)',
732 }, { # else: use_pulseaudio==0
734 'audio/pulse/audio_manager_pulse.cc',
735 'audio/pulse/audio_manager_pulse.h',
736 'audio/pulse/pulse_input.cc',
737 'audio/pulse/pulse_input.h',
738 'audio/pulse/pulse_output.cc',
739 'audio/pulse/pulse_output.h',
740 'audio/pulse/pulse_unified.cc',
741 'audio/pulse/pulse_unified.h',
742 'audio/pulse/pulse_util.cc',
743 'audio/pulse/pulse_util.h',
748 'video/capture/video_capture_device_dummy.cc',
749 'video/capture/video_capture_device_dummy.h',
755 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
756 '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
757 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
758 '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
759 '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
760 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
761 '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
767 'video/capture/video_capture_device_dummy.cc',
768 'video/capture/video_capture_device_dummy.h',
778 # Specify delayload for media.dll.
788 # Specify delayload for components that link with media.lib.
789 'all_dependent_settings': {
800 # TODO(wolenetz): Fix size_t to int truncations in win64. See
801 # http://crbug.com/171009
803 ['target_arch=="x64"', {
804 'msvs_disabled_warnings': [ 4267, ],
808 ['proprietary_codecs==1 or branding=="Chrome"', {
814 'mp4/box_definitions.cc',
815 'mp4/box_definitions.h',
820 'mp4/es_descriptor.cc',
821 'mp4/es_descriptor.h',
822 'mp4/mp4_stream_parser.cc',
823 'mp4/mp4_stream_parser.h',
824 'mp4/offset_byte_queue.cc',
825 'mp4/offset_byte_queue.h',
826 'mp4/track_run_iterator.cc',
827 'mp4/track_run_iterator.h',
830 ['toolkit_uses_gtk==1', {
832 '../build/linux/system.gyp:gtk',
835 # ios check is necessary due to http://crbug.com/172682.
836 ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', {
844 'base/simd/convert_yuv_to_rgb_x86.cc',
849 'ENABLE_EAC3_PLAYBACK',
853 'target_conditions': [
856 # Pull in specific Mac files for iOS (which have been filtered out
857 # by file name rules).
858 ['include', '^audio/mac/audio_input_mac\\.'],
864 'target_name': 'media_unittests',
865 'type': '<(gtest_target_type)',
868 'media_test_support',
869 '../base/base.gyp:base',
870 '../base/base.gyp:base_i18n',
871 '../base/base.gyp:test_support_base',
872 '../skia/skia.gyp:skia',
873 '../testing/gmock.gyp:gmock',
874 '../testing/gtest.gyp:gtest',
878 'audio/async_socket_io_handler_unittest.cc',
879 'audio/audio_input_controller_unittest.cc',
880 'audio/audio_input_device_unittest.cc',
881 'audio/audio_input_unittest.cc',
882 'audio/audio_input_volume_unittest.cc',
883 'audio/audio_low_latency_input_output_unittest.cc',
884 'audio/audio_output_controller_unittest.cc',
885 'audio/audio_output_device_unittest.cc',
886 'audio/audio_output_proxy_unittest.cc',
887 'audio/audio_parameters_unittest.cc',
888 'audio/audio_silence_detector_unittest.cc',
889 'audio/cross_process_notification_unittest.cc',
890 'audio/fake_audio_consumer_unittest.cc',
891 'audio/ios/audio_manager_ios_unittest.cc',
892 'audio/linux/alsa_output_unittest.cc',
893 'audio/mac/audio_auhal_mac_unittest.cc',
894 'audio/mac/audio_device_listener_mac_unittest.cc',
895 'audio/mac/audio_low_latency_input_mac_unittest.cc',
896 'audio/simple_sources_unittest.cc',
897 'audio/virtual_audio_input_stream_unittest.cc',
898 'audio/virtual_audio_output_stream_unittest.cc',
899 'audio/win/audio_device_listener_win_unittest.cc',
900 'audio/win/audio_low_latency_input_win_unittest.cc',
901 'audio/win/audio_low_latency_output_win_unittest.cc',
902 'audio/win/audio_output_win_unittest.cc',
903 'audio/win/audio_unified_win_unittest.cc',
904 'audio/win/core_audio_util_win_unittest.cc',
905 'base/android/media_codec_bridge_unittest.cc',
906 'base/android/media_source_player_unittest.cc',
907 'base/audio_buffer_unittest.cc',
908 'base/audio_buffer_queue_unittest.cc',
909 'base/audio_bus_unittest.cc',
910 'base/audio_converter_unittest.cc',
911 'base/audio_fifo_unittest.cc',
912 'base/audio_hardware_config_unittest.cc',
913 'base/audio_hash_unittest.cc',
914 'base/audio_pull_fifo_unittest.cc',
915 'base/audio_renderer_mixer_input_unittest.cc',
916 'base/audio_renderer_mixer_unittest.cc',
917 'base/audio_splicer_unittest.cc',
918 'base/audio_timestamp_helper_unittest.cc',
919 'base/bind_to_loop_unittest.cc',
920 'base/bit_reader_unittest.cc',
921 'base/callback_holder_unittest.cc',
922 'base/channel_mixer_unittest.cc',
923 'base/clock_unittest.cc',
924 'base/container_names_unittest.cc',
925 'base/data_buffer_unittest.cc',
926 'base/decoder_buffer_queue_unittest.cc',
927 'base/decoder_buffer_unittest.cc',
928 'base/djb2_unittest.cc',
929 'base/gmock_callback_support_unittest.cc',
930 'base/multi_channel_resampler_unittest.cc',
931 'base/pipeline_unittest.cc',
932 'base/ranges_unittest.cc',
933 'base/run_all_unittests.cc',
934 'base/scoped_histogram_timer_unittest.cc',
935 'base/seekable_buffer_unittest.cc',
936 'base/sinc_resampler_unittest.cc',
937 'base/test_data_util.cc',
938 'base/test_data_util.h',
939 'base/vector_math_testing.h',
940 'base/vector_math_unittest.cc',
941 'base/video_frame_unittest.cc',
942 'base/video_util_unittest.cc',
943 'base/yuv_convert_unittest.cc',
944 'crypto/aes_decryptor_unittest.cc',
945 'ffmpeg/ffmpeg_common_unittest.cc',
946 'filters/audio_decoder_selector_unittest.cc',
947 'filters/audio_file_reader_unittest.cc',
948 'filters/audio_renderer_algorithm_unittest.cc',
949 'filters/audio_renderer_impl_unittest.cc',
950 'filters/blocking_url_protocol_unittest.cc',
951 'filters/chunk_demuxer_unittest.cc',
952 'filters/decrypting_audio_decoder_unittest.cc',
953 'filters/decrypting_demuxer_stream_unittest.cc',
954 'filters/decrypting_video_decoder_unittest.cc',
955 'filters/fake_demuxer_stream_unittest.cc',
956 'filters/fake_video_decoder_unittest.cc',
957 'filters/ffmpeg_audio_decoder_unittest.cc',
958 'filters/ffmpeg_demuxer_unittest.cc',
959 'filters/ffmpeg_glue_unittest.cc',
960 'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
961 'filters/ffmpeg_video_decoder_unittest.cc',
962 'filters/file_data_source_unittest.cc',
963 'filters/h264_to_annex_b_bitstream_converter_unittest.cc',
964 'filters/pipeline_integration_test.cc',
965 'filters/pipeline_integration_test_base.cc',
966 'filters/skcanvas_video_renderer_unittest.cc',
967 'filters/source_buffer_stream_unittest.cc',
968 'filters/video_decoder_selector_unittest.cc',
969 'filters/video_frame_stream_unittest.cc',
970 'filters/video_renderer_base_unittest.cc',
971 'video/capture/video_capture_device_unittest.cc',
972 'webm/cluster_builder.cc',
973 'webm/cluster_builder.h',
974 'webm/tracks_builder.cc',
975 'webm/tracks_builder.h',
976 'webm/webm_cluster_parser_unittest.cc',
977 'webm/webm_content_encodings_client_unittest.cc',
978 'webm/webm_parser_unittest.cc',
979 'webm/webm_tracks_parser_unittest.cc',
980 'webm/webm_webvtt_parser_unittest.cc',
990 '../gpu/gpu.gyp:command_buffer_common',
991 'shared_memory_support',
994 ['media_use_ffmpeg==1', {
996 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
999 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1001 ['linux_use_tcmalloc==1', {
1003 '../base/allocator/allocator.gyp:allocator',
1011 ['include', '^audio/audio_input_controller_unittest\\.cc$'],
1012 ['include', '^audio/audio_input_unittest\\.cc$'],
1013 ['include', '^audio/audio_parameters_unittest\\.cc$'],
1014 ['include', '^audio/ios/audio_manager_ios_unittest\\.cc$'],
1015 ['include', '^base/mock_reader\\.h$'],
1016 ['include', '^base/run_all_unittests\\.cc$'],
1021 'audio/audio_input_volume_unittest.cc',
1022 'base/container_names_unittest.cc',
1023 'ffmpeg/ffmpeg_common_unittest.cc',
1024 'filters/audio_file_reader_unittest.cc',
1025 'filters/blocking_url_protocol_unittest.cc',
1026 'filters/chunk_demuxer_unittest.cc',
1027 'filters/ffmpeg_audio_decoder_unittest.cc',
1028 'filters/ffmpeg_demuxer_unittest.cc',
1029 'filters/ffmpeg_glue_unittest.cc',
1030 'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1031 'filters/ffmpeg_video_decoder_unittest.cc',
1032 'filters/pipeline_integration_test.cc',
1033 'filters/pipeline_integration_test_base.cc',
1034 'mp4/mp4_stream_parser_unittest.cc',
1035 'webm/webm_cluster_parser_unittest.cc',
1038 ['gtest_target_type=="shared_library"', {
1040 '../testing/android/native_test.gyp:native_test_native_code',
1050 'audio/cras/cras_input_unittest.cc',
1051 'audio/cras/cras_unified_unittest.cc',
1061 'audio/linux/alsa_output_unittest.cc',
1062 'audio/audio_low_latency_input_output_unittest.cc',
1065 ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', {
1067 'base/simd/convert_rgb_to_yuv_unittest.cc',
1070 ['proprietary_codecs==1 or branding=="Chrome"', {
1072 'mp4/aac_unittest.cc',
1073 'mp4/avc_unittest.cc',
1074 'mp4/box_reader_unittest.cc',
1075 'mp4/es_descriptor_unittest.cc',
1076 'mp4/mp4_stream_parser_unittest.cc',
1077 'mp4/offset_byte_queue_unittest.cc',
1078 'mp4/track_run_iterator_unittest.cc',
1081 # TODO(wolenetz): Fix size_t to int truncations in win64. See
1082 # http://crbug.com/171009
1083 ['OS=="win" and target_arch=="x64"', {
1084 'msvs_disabled_warnings': [ 4267, ],
1089 'target_name': 'media_test_support',
1090 'type': 'static_library',
1093 '../base/base.gyp:base',
1094 '../skia/skia.gyp:skia',
1095 '../testing/gmock.gyp:gmock',
1096 '../testing/gtest.gyp:gtest',
1099 'audio/mock_audio_manager.cc',
1100 'audio/mock_audio_manager.h',
1101 'audio/test_audio_input_controller_factory.cc',
1102 'audio/test_audio_input_controller_factory.h',
1103 'base/fake_audio_render_callback.cc',
1104 'base/fake_audio_render_callback.h',
1105 'base/gmock_callback_support.h',
1106 'base/mock_audio_renderer_sink.cc',
1107 'base/mock_audio_renderer_sink.h',
1108 'base/mock_data_source_host.cc',
1109 'base/mock_data_source_host.h',
1110 'base/mock_demuxer_host.cc',
1111 'base/mock_demuxer_host.h',
1112 'base/mock_filters.cc',
1113 'base/mock_filters.h',
1114 'base/test_helpers.cc',
1115 'base/test_helpers.h',
1120 ['OS!="ios" and target_arch!="arm"', {
1123 'target_name': 'media_asm',
1124 'type': 'static_library',
1126 'base/simd/convert_rgb_to_yuv_ssse3.asm',
1127 'base/simd/convert_yuv_to_rgb_mmx.asm',
1128 'base/simd/convert_yuv_to_rgb_sse.asm',
1129 'base/simd/convert_yuva_to_argb_mmx.asm',
1130 'base/simd/empty_register_state_mmx.asm',
1131 'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
1132 'base/simd/linear_scale_yuv_to_rgb_sse.asm',
1133 'base/simd/scale_yuv_to_rgb_mmx.asm',
1134 'base/simd/scale_yuv_to_rgb_sse.asm',
1137 ['component=="shared_library"', {
1139 'yasm_flags': ['-DEXPORT_SYMBOLS'],
1142 ['target_arch=="x64"', {
1143 # Source files optimized for X64 systems.
1145 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
1146 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
1149 'yasm_flags': ['-DARCH_X86_64'],
1160 # XCode doesn't want to link a pure assembly target and will
1161 # fail to link when it creates an empty file list. So add a
1162 # dummy file keep the linker happy. See http://crbug.com/157073
1163 'base/simd/xcode_hack.c',
1166 ['os_posix==1 and OS!="mac"', {
1169 ['target_arch=="ia32"', {
1185 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
1188 # In addition to the same path as source asm, let yasm %include
1189 # search path be relative to src/ per Chromium policy.
1193 '../third_party/x86inc/x86inc.asm',
1194 'base/simd/convert_rgb_to_yuv_ssse3.inc',
1195 'base/simd/convert_yuv_to_rgb_mmx.inc',
1196 'base/simd/convert_yuva_to_argb_mmx.inc',
1197 'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
1198 'base/simd/media_export.asm',
1199 'base/simd/scale_yuv_to_rgb_mmx.inc',
1202 'msvs_2010_disable_uldi_when_referenced': 1,
1204 '../third_party/yasm/yasm_compile.gypi',
1208 'target_name': 'media_mmx',
1209 'type': 'static_library',
1217 'MEDIA_IMPLEMENTATION',
1220 # TODO(jschuh): Get MMX enabled on Win64. crbug.com/179657
1221 ['OS!="win" or target_arch=="ia32"', {
1223 'base/simd/filter_yuv_mmx.cc',
1229 'target_name': 'media_sse',
1230 'type': 'static_library',
1238 'MEDIA_IMPLEMENTATION',
1241 'base/simd/sinc_resampler_sse.cc',
1245 'target_name': 'media_sse2',
1246 'type': 'static_library',
1254 'MEDIA_IMPLEMENTATION',
1257 'base/simd/convert_rgb_to_yuv_sse2.cc',
1258 'base/simd/convert_rgb_to_yuv_ssse3.cc',
1259 'base/simd/filter_yuv_sse2.cc',
1263 'target_name': 'shared_memory_support_sse',
1264 'type': 'static_library',
1272 'MEDIA_IMPLEMENTATION',
1275 'base/simd/vector_math_sse.cc',
1283 # Minimal target for NaCl and other renderer side media clients which
1284 # only need to send audio data across the shared memory to the browser
1286 'target_name': 'shared_memory_support',
1287 'type': '<(component)',
1289 '../base/base.gyp:base',
1292 'MEDIA_IMPLEMENTATION',
1298 'shared_memory_support.gypi',
1301 '<@(shared_memory_support_sources)',
1309 ['target_arch=="ia32" or target_arch=="x64"', {
1311 'shared_memory_support_sse'
1317 'target_name': 'seek_tester',
1318 'type': 'executable',
1321 '../base/base.gyp:base',
1324 'tools/seek_tester/seek_tester.cc',
1328 'target_name': 'demuxer_bench',
1329 'type': 'executable',
1332 '../base/base.gyp:base',
1335 'tools/demuxer_bench/demuxer_bench.cc',
1337 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1338 'msvs_disabled_warnings': [ 4267, ],
1342 ['(OS=="win" or toolkit_uses_gtk==1) and use_aura!=1', {
1345 'target_name': 'shader_bench',
1346 'type': 'executable',
1349 '../base/base.gyp:base',
1350 '../ui/gl/gl.gyp:gl',
1354 'tools/shader_bench/cpu_color_painter.cc',
1355 'tools/shader_bench/cpu_color_painter.h',
1356 'tools/shader_bench/gpu_color_painter.cc',
1357 'tools/shader_bench/gpu_color_painter.h',
1358 'tools/shader_bench/gpu_painter.cc',
1359 'tools/shader_bench/gpu_painter.h',
1360 'tools/shader_bench/painter.cc',
1361 'tools/shader_bench/painter.h',
1362 'tools/shader_bench/shader_bench.cc',
1363 'tools/shader_bench/window.cc',
1364 'tools/shader_bench/window.h',
1367 ['toolkit_uses_gtk==1', {
1369 '../build/linux/system.gyp:gtk',
1372 'tools/shader_bench/window_linux.cc',
1377 '<(angle_path)/src/build_angle.gyp:libEGL',
1378 '<(angle_path)/src/build_angle.gyp:libGLESv2',
1381 'tools/shader_bench/window_win.cc',
1384 # See http://crbug.com/162998#c4 for why this is needed.
1385 ['OS=="linux" and linux_use_tcmalloc==1', {
1387 '../base/allocator/allocator.gyp:allocator',
1391 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1392 'msvs_disabled_warnings': [ 4267, ],
1399 'target_name': 'player_x11',
1400 'type': 'executable',
1403 '../base/base.gyp:base',
1404 '../ui/gl/gl.gyp:gl',
1416 'tools/player_x11/data_source_logger.cc',
1417 'tools/player_x11/data_source_logger.h',
1418 'tools/player_x11/gl_video_renderer.cc',
1419 'tools/player_x11/gl_video_renderer.h',
1420 'tools/player_x11/player_x11.cc',
1421 'tools/player_x11/x11_video_renderer.cc',
1422 'tools/player_x11/x11_video_renderer.h',
1427 # Special target to wrap a gtest_target_type==shared_library
1428 # media_unittests into an android apk for execution.
1429 ['OS=="android" and gtest_target_type=="shared_library"', {
1432 'target_name': 'media_unittests_apk',
1439 'test_suite_name': 'media_unittests',
1440 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
1442 'includes': ['../build/apk_test.gypi'],
1449 'target_name': 'media_player_jni_headers',
1452 'jni_gen_package': 'media',
1453 'input_java_class': 'android/media/MediaPlayer.class',
1455 'includes': ['../build/jar_file_jni_generator.gypi'],
1458 'target_name': 'media_android_jni_headers',
1461 'media_player_jni_headers',
1464 'base/android/java/src/org/chromium/media/AudioManagerAndroid.java',
1465 'base/android/java/src/org/chromium/media/MediaCodecBridge.java',
1466 'base/android/java/src/org/chromium/media/MediaPlayerBridge.java',
1467 'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1468 'base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java',
1471 'jni_gen_package': 'media',
1473 'includes': ['../build/jni_generator.gypi'],
1476 'target_name': 'video_capture_android_jni_headers',
1479 'base/android/java/src/org/chromium/media/VideoCapture.java',
1482 'jni_gen_package': 'media',
1484 'includes': ['../build/jni_generator.gypi'],
1487 'target_name': 'player_android',
1488 'type': 'static_library',
1490 'base/android/media_codec_bridge.cc',
1491 'base/android/media_codec_bridge.h',
1492 'base/android/media_drm_bridge.cc',
1493 'base/android/media_drm_bridge.h',
1494 'base/android/media_jni_registrar.cc',
1495 'base/android/media_jni_registrar.h',
1496 'base/android/media_player_android.cc',
1497 'base/android/media_player_android.h',
1498 'base/android/media_player_bridge.cc',
1499 'base/android/media_player_bridge.h',
1500 'base/android/media_player_listener.cc',
1501 'base/android/media_player_listener.h',
1502 'base/android/media_source_player.cc',
1503 'base/android/media_source_player.h',
1504 'base/android/webaudio_media_codec_bridge.cc',
1505 'base/android/webaudio_media_codec_bridge.h',
1506 'base/android/webaudio_media_codec_info.h',
1509 '../base/base.gyp:base',
1510 '../ui/gl/gl.gyp:gl',
1511 '../url/url.gyp:url_lib',
1512 'media_android_jni_headers',
1515 '<(SHARED_INTERMEDIATE_DIR)/media',
1519 'target_name': 'media_java',
1522 '../base/base.gyp:base',
1524 'export_dependent_settings': [
1525 '../base/base.gyp:base',
1528 'java_in_dir': 'base/android/java',
1530 'includes': ['../build/java.gypi'],
1535 ['media_use_ffmpeg==1', {
1538 'target_name': 'ffmpeg_unittests',
1539 'type': 'executable',
1541 '../base/base.gyp:base',
1542 '../base/base.gyp:base_i18n',
1543 '../base/base.gyp:test_support_base',
1544 '../base/base.gyp:test_support_perf',
1545 '../testing/gtest.gyp:gtest',
1546 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1548 'media_test_support',
1551 'ffmpeg/ffmpeg_unittest.cc',
1554 ['toolkit_uses_gtk==1', {
1556 # Needed for the following #include chain:
1557 # base/run_all_unittests.cc
1558 # ../base/test_suite.h
1560 '../build/linux/system.gyp:gtk',
1563 ['linux_use_tcmalloc==1', {
1565 '../base/allocator/allocator.gyp:allocator',
1573 'target_name': 'ffmpeg_regression_tests',
1574 'type': 'executable',
1576 '../base/base.gyp:test_support_base',
1577 '../testing/gmock.gyp:gmock',
1578 '../testing/gtest.gyp:gtest',
1579 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1581 'media_test_support',
1584 'base/run_all_unittests.cc',
1585 'base/test_data_util.cc',
1586 'ffmpeg/ffmpeg_regression_tests.cc',
1587 'filters/pipeline_integration_test_base.cc',
1590 ['os_posix==1 and OS!="mac"', {
1592 ['linux_use_tcmalloc==1', {
1594 '../base/allocator/allocator.gyp:allocator',
1602 'target_name': 'ffmpeg_tests',
1603 'type': 'executable',
1605 '../base/base.gyp:base',
1606 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1610 'test/ffmpeg_tests/ffmpeg_tests.cc',
1612 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1613 'msvs_disabled_warnings': [ 4267, ],
1616 'target_name': 'media_bench',
1617 'type': 'executable',
1619 '../base/base.gyp:base',
1620 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1624 'tools/media_bench/media_bench.cc',
1626 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1627 'msvs_disabled_warnings': [ 4267, ],