Valgrind reports Uninitialized with GetStrikeMetrics on Mac
[chromium-blink-merge.git] / media / media.gyp
blob430da1d172877fa68378bfbc3603e4715fbc6cc5
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 PulseAudio library.
9     'use_pulseaudio%': 0,
10     # Override to dynamically link the cras (ChromeOS audio) library.
11     'use_cras%': 0,
12   },
13   'targets': [
14     {
15       'target_name': 'media',
16       'type': '<(component)',
17       'dependencies': [
18         'yuv_convert',
19         '../base/base.gyp:base',
20         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
21         '../build/temp_gyp/googleurl.gyp:googleurl',
22         '../crypto/crypto.gyp:crypto',
23         '../third_party/openmax/openmax.gyp:il',
24         '../ui/ui.gyp:ui',
25       ],
26       'defines': [
27         'MEDIA_IMPLEMENTATION',
28       ],
29       'include_dirs': [
30         '..',
31       ],
32       'sources': [
33         'audio/android/audio_manager_android.cc',
34         'audio/android/audio_manager_android.h',
35         'audio/android/audio_track_output_android.cc',
36         'audio/android/audio_track_output_android.h',
37         'audio/android/opensles_input.cc',
38         'audio/android/opensles_input.h',
39         'audio/android/opensles_output.cc',
40         'audio/android/opensles_output.h',
41         'audio/async_socket_io_handler.h',
42         'audio/async_socket_io_handler_posix.cc',
43         'audio/async_socket_io_handler_win.cc',
44         'audio/audio_buffers_state.cc',
45         'audio/audio_buffers_state.h',
46         'audio/audio_io.h',
47         'audio/audio_input_controller.cc',
48         'audio/audio_input_controller.h',
49         'audio/audio_input_stream_impl.cc',
50         'audio/audio_input_stream_impl.h',
51         'audio/audio_device_name.cc',
52         'audio/audio_device_name.h',
53         'audio/audio_manager.cc',
54         'audio/audio_manager.h',
55         'audio/audio_manager_base.cc',
56         'audio/audio_manager_base.h',
57         'audio/audio_output_controller.cc',
58         'audio/audio_output_controller.h',
59         'audio/audio_output_dispatcher.cc',
60         'audio/audio_output_dispatcher.h',
61         'audio/audio_output_dispatcher_impl.cc',
62         'audio/audio_output_dispatcher_impl.h',
63         'audio/audio_output_mixer.cc',
64         'audio/audio_output_mixer.h',
65         'audio/audio_output_proxy.cc',
66         'audio/audio_output_proxy.h',
67         'audio/audio_parameters.cc',
68         'audio/audio_parameters.h',
69         'audio/audio_util.cc',
70         'audio/audio_util.h',
71         'audio/cross_process_notification.cc',
72         'audio/cross_process_notification.h',
73         'audio/cross_process_notification_win.cc',
74         'audio/cross_process_notification_posix.cc',
75         'audio/fake_audio_input_stream.cc',
76         'audio/fake_audio_input_stream.h',
77         'audio/fake_audio_output_stream.cc',
78         'audio/fake_audio_output_stream.h',
79         'audio/linux/audio_manager_linux.cc',
80         'audio/linux/audio_manager_linux.h',
81         'audio/linux/alsa_input.cc',
82         'audio/linux/alsa_input.h',
83         'audio/linux/alsa_output.cc',
84         'audio/linux/alsa_output.h',
85         'audio/linux/alsa_util.cc',
86         'audio/linux/alsa_util.h',
87         'audio/linux/alsa_wrapper.cc',
88         'audio/linux/alsa_wrapper.h',
89         'audio/linux/cras_input.cc',
90         'audio/linux/cras_input.h',
91         'audio/linux/cras_output.cc',
92         'audio/linux/cras_output.h',
93         'audio/openbsd/audio_manager_openbsd.cc',
94         'audio/openbsd/audio_manager_openbsd.h',
95         'audio/mac/audio_input_mac.cc',
96         'audio/mac/audio_input_mac.h',
97         'audio/mac/audio_low_latency_input_mac.cc',
98         'audio/mac/audio_low_latency_input_mac.h',
99         'audio/mac/audio_low_latency_output_mac.cc',
100         'audio/mac/audio_low_latency_output_mac.h',
101         'audio/mac/audio_manager_mac.cc',
102         'audio/mac/audio_manager_mac.h',
103         'audio/mac/audio_output_mac.cc',
104         'audio/mac/audio_output_mac.h',
105         'audio/null_audio_sink.cc',
106         'audio/null_audio_sink.h',
107         'audio/pulse/pulse_output.cc',
108         'audio/pulse/pulse_output.h',
109         'audio/sample_rates.cc',
110         'audio/sample_rates.h',
111         'audio/simple_sources.cc',
112         'audio/simple_sources.h',
113         'audio/win/audio_low_latency_input_win.cc',
114         'audio/win/audio_low_latency_input_win.h',
115         'audio/win/audio_low_latency_output_win.cc',
116         'audio/win/audio_low_latency_output_win.h',
117         'audio/win/audio_manager_win.cc',
118         'audio/win/audio_manager_win.h',
119         'audio/win/avrt_wrapper_win.cc',
120         'audio/win/avrt_wrapper_win.h',
121         'audio/win/device_enumeration_win.cc',
122         'audio/win/device_enumeration_win.h',
123         'audio/win/wavein_input_win.cc',
124         'audio/win/wavein_input_win.h',
125         'audio/win/waveout_output_win.cc',
126         'audio/win/waveout_output_win.h',
127         'base/android/media_jni_registrar.cc',
128         'base/android/media_jni_registrar.h',
129         'base/audio_decoder.cc',
130         'base/audio_decoder.h',
131         'base/audio_decoder_config.cc',
132         'base/audio_decoder_config.h',
133         'base/audio_renderer.h',
134         'base/audio_renderer_mixer.cc',
135         'base/audio_renderer_mixer.h',
136         'base/audio_renderer_mixer_input.cc',
137         'base/audio_renderer_mixer_input.h',
138         'base/bitstream_buffer.h',
139         'base/buffers.cc',
140         'base/buffers.h',
141         'base/byte_queue.cc',
142         'base/byte_queue.h',
143         'base/channel_layout.cc',
144         'base/channel_layout.h',
145         'base/clock.cc',
146         'base/clock.h',
147         'base/composite_filter.cc',
148         'base/composite_filter.h',
149         'base/data_buffer.cc',
150         'base/data_buffer.h',
151         'base/data_source.cc',
152         'base/data_source.h',
153         'base/decoder_buffer.cc',
154         'base/decoder_buffer.h',
155         'base/decrypt_config.cc',
156         'base/decrypt_config.h',
157         'base/decryptor.h',
158         'base/decryptor_client.h',
159         'base/demuxer.cc',
160         'base/demuxer.h',
161         'base/demuxer_stream.cc',
162         'base/demuxer_stream.h',
163         'base/djb2.cc',
164         'base/djb2.h',
165         'base/filter_collection.cc',
166         'base/filter_collection.h',
167         'base/filter_host.h',
168         'base/filters.cc',
169         'base/filters.h',
170         'base/media.h',
171         'base/media_android.cc',
172         'base/media_export.h',
173         'base/media_log.cc',
174         'base/media_log.h',
175         'base/media_log_event.h',
176         'base/media_posix.cc',
177         'base/media_switches.cc',
178         'base/media_switches.h',
179         'base/media_win.cc',
180         'base/message_loop_factory.cc',
181         'base/message_loop_factory.h',
182         'base/multi_channel_resampler.cc',
183         'base/multi_channel_resampler.h',
184         'base/pipeline.cc',
185         'base/pipeline.h',
186         'base/pipeline_status.cc',
187         'base/pipeline_status.h',
188         'base/ranges.cc',
189         'base/ranges.h',
190         'base/seekable_buffer.cc',
191         'base/seekable_buffer.h',
192         'base/sinc_resampler.cc',
193         'base/sinc_resampler.h',
194         'base/state_matrix.cc',
195         'base/state_matrix.h',
196         'base/stream_parser.cc',
197         'base/stream_parser.h',
198         'base/stream_parser_buffer.cc',
199         'base/stream_parser_buffer.h',
200         'base/video_decoder.cc',
201         'base/video_decoder.h',
202         'base/video_decoder_config.cc',
203         'base/video_decoder_config.h',
204         'base/video_frame.cc',
205         'base/video_frame.h',
206         'base/video_renderer.h',
207         'base/video_util.cc',
208         'base/video_util.h',
209         'crypto/aes_decryptor.cc',
210         'crypto/aes_decryptor.h',
211         'ffmpeg/ffmpeg_common.cc',
212         'ffmpeg/ffmpeg_common.h',
213         'ffmpeg/file_protocol.cc',
214         'ffmpeg/file_protocol.h',
215         'filters/audio_file_reader.cc',
216         'filters/audio_file_reader.h',
217         'filters/audio_renderer_algorithm.cc',
218         'filters/audio_renderer_algorithm.h',
219         'filters/audio_renderer_impl.cc',
220         'filters/audio_renderer_impl.h',
221         'filters/chunk_demuxer.cc',
222         'filters/chunk_demuxer.h',
223         'filters/chunk_demuxer_client.h',
224         'filters/dummy_demuxer.cc',
225         'filters/dummy_demuxer.h',
226         'filters/ffmpeg_audio_decoder.cc',
227         'filters/ffmpeg_audio_decoder.h',
228         'filters/ffmpeg_demuxer.cc',
229         'filters/ffmpeg_demuxer.h',
230         'filters/ffmpeg_glue.cc',
231         'filters/ffmpeg_glue.h',
232         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
233         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
234         'filters/ffmpeg_video_decoder.cc',
235         'filters/ffmpeg_video_decoder.h',
236         'filters/file_data_source.cc',
237         'filters/file_data_source.h',
238         'filters/gpu_video_decoder.cc',
239         'filters/gpu_video_decoder.h',
240         'filters/h264_to_annex_b_bitstream_converter.cc',
241         'filters/h264_to_annex_b_bitstream_converter.h',
242         'filters/in_memory_url_protocol.cc',
243         'filters/in_memory_url_protocol.h',
244         'filters/source_buffer_stream.cc',
245         'filters/source_buffer_stream.h',
246         'filters/video_frame_generator.cc',
247         'filters/video_frame_generator.h',
248         'filters/video_renderer_base.cc',
249         'filters/video_renderer_base.h',
250         'video/capture/fake_video_capture_device.cc',
251         'video/capture/fake_video_capture_device.h',
252         'video/capture/linux/video_capture_device_linux.cc',
253         'video/capture/linux/video_capture_device_linux.h',
254         'video/capture/mac/video_capture_device_mac.h',
255         'video/capture/mac/video_capture_device_mac.mm',
256         'video/capture/mac/video_capture_device_qtkit_mac.h',
257         'video/capture/mac/video_capture_device_qtkit_mac.mm',
258         'video/capture/video_capture.h',
259         'video/capture/video_capture_device.h',
260         'video/capture/video_capture_device_dummy.cc',
261         'video/capture/video_capture_device_dummy.h',
262         'video/capture/video_capture_proxy.cc',
263         'video/capture/video_capture_proxy.h',
264         'video/capture/video_capture_types.h',
265         'video/capture/win/filter_base_win.cc',
266         'video/capture/win/filter_base_win.h',
267         'video/capture/win/pin_base_win.cc',
268         'video/capture/win/pin_base_win.h',
269         'video/capture/win/sink_filter_observer_win.h',
270         'video/capture/win/sink_filter_win.cc',
271         'video/capture/win/sink_filter_win.h',
272         'video/capture/win/sink_input_pin_win.cc',
273         'video/capture/win/sink_input_pin_win.h',
274         'video/capture/win/video_capture_device_win.cc',
275         'video/capture/win/video_capture_device_win.h',
276         'video/picture.cc',
277         'video/picture.h',
278         'video/video_decode_accelerator.cc',
279         'video/video_decode_accelerator.h',
280         'webm/webm_constants.h',
281         'webm/webm_cluster_parser.cc',
282         'webm/webm_cluster_parser.h',
283         'webm/webm_content_encodings.cc',
284         'webm/webm_content_encodings.h',
285         'webm/webm_content_encodings_client.cc',
286         'webm/webm_content_encodings_client.h',
287         'webm/webm_info_parser.cc',
288         'webm/webm_info_parser.h',
289         'webm/webm_parser.cc',
290         'webm/webm_parser.h',
291         'webm/webm_stream_parser.cc',
292         'webm/webm_stream_parser.h',
293         'webm/webm_tracks_parser.cc',
294         'webm/webm_tracks_parser.h',
295       ],
296       'direct_dependent_settings': {
297         'include_dirs': [
298           '..',
299         ],
300       },
301       'conditions': [
302         # Android doesn't use ffmpeg, so make the dependency conditional
303         # and exclude the sources which depend on ffmpeg.
304         ['OS != "android"', {
305           'dependencies': [
306             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
307           ],
308         }],
309         ['OS == "android"', {
310           'sources!': [
311             'base/media_posix.cc',
312             'ffmpeg/ffmpeg_common.cc',
313             'ffmpeg/ffmpeg_common.h',
314             'ffmpeg/file_protocol.cc',
315             'ffmpeg/file_protocol.h',
316             'filters/audio_file_reader.cc',
317             'filters/audio_file_reader.h',
318             'filters/chunk_demuxer.cc',
319             'filters/chunk_demuxer.h',
320             'filters/chunk_demuxer_client.h',
321             'filters/ffmpeg_audio_decoder.cc',
322             'filters/ffmpeg_audio_decoder.h',
323             'filters/ffmpeg_demuxer.cc',
324             'filters/ffmpeg_demuxer.h',
325             'filters/ffmpeg_glue.cc',
326             'filters/ffmpeg_glue.h',
327             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
328             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
329             'filters/ffmpeg_video_decoder.cc',
330             'filters/ffmpeg_video_decoder.h',
331             'filters/gpu_video_decoder.cc',
332             'filters/gpu_video_decoder.h',
333             'webm/webm_cluster_parser.cc',
334             'webm/webm_cluster_parser.h',
335             'webm/webm_stream_parser.cc',
336             'webm/webm_stream_parser.h',
337           ],
338         }],
339         # The below 'android' condition were added temporarily and should be
340         # removed in downstream, because there is no Java environment setup in
341         # upstream yet.
342         ['OS == "android"', {
343           'sources!':[
344             'audio/android/audio_track_output_android.cc',
345           ],
346           'sources':[
347             'audio/android/audio_track_output_stub_android.cc',
348           ],
349           'link_settings': {
350             'libraries': [
351               '-lOpenSLES',
352             ],
353           },
354         }],
355         ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
356           'link_settings': {
357             'libraries': [
358               '-lasound',
359             ],
360           },
361         }],
362         ['OS=="openbsd"', {
363           'sources/': [ ['exclude', '/alsa_' ],
364                         ['exclude', '/audio_manager_linux' ] ],
365           'link_settings': {
366             'libraries': [
367             ],
368           },
369         }],
370         ['OS!="openbsd"', {
371           'sources!': [
372             'audio/openbsd/audio_manager_openbsd.cc',
373             'audio/openbsd/audio_manager_openbsd.h',
374           ],
375         }],
376         ['OS=="linux"', {
377           'variables': {
378             'conditions': [
379               ['sysroot!=""', {
380                 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
381               }, {
382                 'pkg-config': 'pkg-config'
383               }],
384             ],
385           },
386           'conditions': [
387             ['use_cras == 1', {
388               'cflags': [
389                 '<!@(<(pkg-config) --cflags libcras)',
390               ],
391               'link_settings': {
392                 'libraries': [
393                   '<!@(<(pkg-config) --libs libcras)',
394                 ],
395               },
396               'defines': [
397                 'USE_CRAS',
398               ],
399             }, {  # else: use_cras == 0
400               'sources!': [
401                 'audio/linux/cras_input.cc',
402                 'audio/linux/cras_input.h',
403                 'audio/linux/cras_output.cc',
404                 'audio/linux/cras_output.h',
405               ],
406             }],
407           ],
408         }],
409         ['os_posix == 1', {
410           'conditions': [
411             ['use_pulseaudio == 1', {
412               'cflags': [
413                 '<!@(pkg-config --cflags libpulse)',
414               ],
415               'link_settings': {
416                 'libraries': [
417                   '<!@(pkg-config --libs-only-l libpulse)',
418                 ],
419               },
420               'defines': [
421                 'USE_PULSEAUDIO',
422               ],
423             }, {  # else: use_pulseaudio == 0
424               'sources!': [
425                 'audio/pulse/pulse_output.cc',
426                 'audio/pulse/pulse_output.h',
427               ],
428             }],
429           ],
430         }],
431         ['os_posix == 1 and OS != "android"', {
432           # Video capture isn't supported in Android yet.
433           'sources!': [
434             'video/capture/video_capture_device_dummy.cc',
435             'video/capture/video_capture_device_dummy.h',
436           ],
437         }],
438         ['OS=="mac"', {
439           'link_settings': {
440             'libraries': [
441               '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
442               '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
443               '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
444               '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
445               '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
446             ],
447           },
448         }],
449         ['OS=="win"', {
450           'sources!': [
451             'audio/pulse/pulse_output.cc',
452             'audio/pulse/pulse_output.h',
453             'video/capture/video_capture_device_dummy.cc',
454             'video/capture/video_capture_device_dummy.h',
455           ],
456         }],
457         ['proprietary_codecs==1 or branding=="Chrome"', {
458           'sources': [
459             'mp4/avc.cc',
460             'mp4/avc.h',
461             'mp4/box_definitions.cc',
462             'mp4/box_definitions.h',
463             'mp4/box_reader.cc',
464             'mp4/box_reader.h',
465             'mp4/cenc.cc',
466             'mp4/cenc.h',
467             'mp4/mp4_stream_parser.cc',
468             'mp4/mp4_stream_parser.h',
469             'mp4/offset_byte_queue.cc',
470             'mp4/offset_byte_queue.h',
471             'mp4/track_run_iterator.cc',
472             'mp4/track_run_iterator.h',
473           ],
474         }],
475       ],
476     },
477     {
478       'target_name': 'yuv_convert',
479       'type': 'static_library',
480       'include_dirs': [
481         '..',
482       ],
483       'conditions': [
484         ['order_profiling != 0', {
485           'target_conditions' : [
486             ['_toolset=="target"', {
487               'cflags!': [ '-finstrument-functions' ],
488             }],
489           ],
490         }],
491         [ 'target_arch == "ia32" or target_arch == "x64"', {
492           'dependencies': [
493             'yuv_convert_simd_x86',
494           ],
495         }],
496         [ 'target_arch == "arm"', {
497           'dependencies': [
498             'yuv_convert_simd_arm',
499           ],
500         }],
501       ],
502       'sources': [
503         'base/yuv_convert.cc',
504         'base/yuv_convert.h',
505       ],
506     },
507     {
508       'target_name': 'yuv_convert_simd_x86',
509       'type': 'static_library',
510       'include_dirs': [
511         '..',
512       ],
513       'sources': [
514         'base/simd/convert_rgb_to_yuv_c.cc',
515         'base/simd/convert_rgb_to_yuv_sse2.cc',
516         'base/simd/convert_rgb_to_yuv_ssse3.asm',
517         'base/simd/convert_rgb_to_yuv_ssse3.cc',
518         'base/simd/convert_rgb_to_yuv_ssse3.inc',
519         'base/simd/convert_yuv_to_rgb_c.cc',
520         'base/simd/convert_yuv_to_rgb_x86.cc',
521         'base/simd/convert_yuv_to_rgb_mmx.asm',
522         'base/simd/convert_yuv_to_rgb_mmx.inc',
523         'base/simd/convert_yuv_to_rgb_sse.asm',
524         'base/simd/filter_yuv.h',
525         'base/simd/filter_yuv_c.cc',
526         'base/simd/filter_yuv_mmx.cc',
527         'base/simd/filter_yuv_sse2.cc',
528         'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
529         'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
530         'base/simd/linear_scale_yuv_to_rgb_sse.asm',
531         'base/simd/scale_yuv_to_rgb_mmx.asm',
532         'base/simd/scale_yuv_to_rgb_mmx.inc',
533         'base/simd/scale_yuv_to_rgb_sse.asm',
534         'base/simd/yuv_to_rgb_table.cc',
535         'base/simd/yuv_to_rgb_table.h',
536       ],
537       'conditions': [
538         ['order_profiling != 0', {
539           'target_conditions' : [
540             ['_toolset=="target"', {
541               'cflags!': [ '-finstrument-functions' ],
542             }],
543           ],
544         }],
545         [ 'target_arch == "x64"', {
546           # Source files optimized for X64 systems.
547           'sources': [
548             'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
549             'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
550           ],
551         }],
552         [ 'os_posix == 1 and OS != "mac" and OS != "android"', {
553           'cflags': [
554             '-msse2',
555           ],
556         }],
557         [ 'OS == "mac"', {
558           'configurations': {
559             'Debug': {
560               'xcode_settings': {
561                 # gcc on the mac builds horribly unoptimized sse code in debug
562                 # mode. Since this is rarely going to be debugged, run with full
563                 # optimizations in Debug as well as Release.
564                 'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
565                },
566              },
567           },
568         }],
569         [ 'OS=="win"', {
570           'variables': {
571             'yasm_flags': [
572               '-DWIN32',
573               '-DMSVC',
574               '-DCHROMIUM',
575               '-Isimd',
576             ],
577           },
578         }],
579         [ 'OS=="mac"', {
580           'variables': {
581             'yasm_flags': [
582               '-DPREFIX',
583               '-DMACHO',
584               '-DCHROMIUM',
585               '-Isimd',
586             ],
587           },
588         }],
589         [ 'os_posix==1 and OS!="mac"', {
590           'variables': {
591             'conditions': [
592               [ 'target_arch=="ia32"', {
593                 'yasm_flags': [
594                   '-DX86_32',
595                   '-DELF',
596                   '-DCHROMIUM',
597                   '-Isimd',
598                 ],
599               }, {
600                 'yasm_flags': [
601                   '-DARCH_X86_64',
602                   '-DELF',
603                   '-DPIC',
604                   '-DCHROMIUM',
605                   '-Isimd',
606                 ],
607               }],
608             ],
609           },
610         }],
611       ],
612       'variables': {
613         'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
614       },
615       'msvs_2010_disable_uldi_when_referenced': 1,
616       'includes': [
617         '../third_party/yasm/yasm_compile.gypi',
618       ],
619     },
620     {
621       'target_name': 'yuv_convert_simd_arm',
622       'type': 'static_library',
623       'include_dirs': [
624         '..',
625       ],
626       'sources': [
627         'base/simd/convert_rgb_to_yuv_c.cc',
628         'base/simd/convert_rgb_to_yuv.h',
629         'base/simd/convert_yuv_to_rgb_c.cc',
630         'base/simd/convert_yuv_to_rgb.h',
631         'base/simd/filter_yuv.h',
632         'base/simd/filter_yuv_c.cc',
633         'base/simd/yuv_to_rgb_table.cc',
634         'base/simd/yuv_to_rgb_table.h',
635       ],
636     },
637     {
638       'target_name': 'media_unittests',
639       'type': '<(gtest_target_type)',
640       'dependencies': [
641         'media',
642         'media_test_support',
643         'yuv_convert',
644         '../base/base.gyp:base',
645         '../base/base.gyp:base_i18n',
646         '../base/base.gyp:test_support_base',
647         '../testing/gmock.gyp:gmock',
648         '../testing/gtest.gyp:gtest',
649         '../ui/ui.gyp:ui',
650       ],
651       'sources': [
652         'audio/async_socket_io_handler_unittest.cc',
653         'audio/audio_input_controller_unittest.cc',
654         'audio/audio_input_device_unittest.cc',
655         'audio/audio_input_unittest.cc',
656         'audio/audio_input_volume_unittest.cc',
657         'audio/audio_low_latency_input_output_unittest.cc',
658         'audio/audio_output_controller_unittest.cc',
659         'audio/audio_output_proxy_unittest.cc',
660         'audio/audio_parameters_unittest.cc',
661         'audio/audio_util_unittest.cc',
662         'audio/cross_process_notification_unittest.cc',
663         'audio/linux/alsa_output_unittest.cc',
664         'audio/mac/audio_low_latency_input_mac_unittest.cc',
665         'audio/mac/audio_output_mac_unittest.cc',
666         'audio/simple_sources_unittest.cc',
667         'audio/win/audio_low_latency_input_win_unittest.cc',
668         'audio/win/audio_low_latency_output_win_unittest.cc',
669         'audio/win/audio_output_win_unittest.cc',
670         'base/audio_renderer_mixer_unittest.cc',
671         'base/audio_renderer_mixer_input_unittest.cc',
672         'base/buffers_unittest.cc',
673         'base/clock_unittest.cc',
674         'base/composite_filter_unittest.cc',
675         'base/data_buffer_unittest.cc',
676         'base/decoder_buffer_unittest.cc',
677         'base/djb2_unittest.cc',
678         'base/filter_collection_unittest.cc',
679         'base/multi_channel_resampler_unittest.cc',
680         'base/pipeline_unittest.cc',
681         'base/ranges_unittest.cc',
682         'base/run_all_unittests.cc',
683         'base/seekable_buffer_unittest.cc',
684         'base/sinc_resampler_unittest.cc',
685         'base/state_matrix_unittest.cc',
686         'base/test_data_util.cc',
687         'base/test_data_util.h',
688         'base/video_frame_unittest.cc',
689         'base/video_util_unittest.cc',
690         'base/yuv_convert_unittest.cc',
691         'crypto/aes_decryptor_unittest.cc',
692         'ffmpeg/ffmpeg_common_unittest.cc',
693         'filters/audio_renderer_algorithm_unittest.cc',
694         'filters/audio_renderer_impl_unittest.cc',
695         'filters/chunk_demuxer_unittest.cc',
696         'filters/ffmpeg_audio_decoder_unittest.cc',
697         'filters/ffmpeg_decoder_unittest.h',
698         'filters/ffmpeg_demuxer_unittest.cc',
699         'filters/ffmpeg_glue_unittest.cc',
700         'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
701         'filters/ffmpeg_video_decoder_unittest.cc',
702         'filters/file_data_source_unittest.cc',
703         'filters/h264_to_annex_b_bitstream_converter_unittest.cc',
704         'filters/pipeline_integration_test.cc',
705         'filters/pipeline_integration_test_base.cc',
706         'filters/source_buffer_stream_unittest.cc',
707         'filters/video_renderer_base_unittest.cc',
708         'video/capture/video_capture_device_unittest.cc',
709         'webm/cluster_builder.cc',
710         'webm/cluster_builder.h',
711         'webm/webm_cluster_parser_unittest.cc',
712         'webm/webm_content_encodings_client_unittest.cc',
713         'webm/webm_parser_unittest.cc',
714       ],
715       'conditions': [
716         ['os_posix==1 and OS!="mac"', {
717           'conditions': [
718             ['linux_use_tcmalloc==1', {
719               'dependencies': [
720                 '../base/allocator/allocator.gyp:allocator',
721               ],
722             }],
723           ],
724         }],
725         ['OS=="android"', {
726           'sources!': [
727             'audio/audio_input_volume_unittest.cc',
728             'base/test_data_util.cc',
729             'base/test_data_util.h',
730             'ffmpeg/ffmpeg_common_unittest.cc',
731             'filters/ffmpeg_audio_decoder_unittest.cc',
732             'filters/chunk_demuxer_unittest.cc',
733             'filters/ffmpeg_demuxer_unittest.cc',
734             'filters/ffmpeg_glue_unittest.cc',
735             'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
736             'filters/ffmpeg_video_decoder_unittest.cc',
737             'filters/pipeline_integration_test.cc',
738             'filters/pipeline_integration_test_base.cc',
739             'mp4/mp4_stream_parser_unittest.cc',
740             'webm/webm_cluster_parser_unittest.cc',
741           ],
742           'conditions': [
743             ['gtest_target_type == "shared_library"', {
744               'dependencies': [
745                 '../testing/android/native_test.gyp:native_test_native_code',
746               ],
747             }],
748           ],
749         }, {  # OS!=android
750           'dependencies': [
751             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
752           ],
753         }],
754         ['OS == "linux"', {
755           'conditions': [
756             ['use_cras == 1', {
757               'sources': [
758                 'audio/linux/cras_input_unittest.cc',
759                 'audio/linux/cras_output_unittest.cc',
760               ],
761               'defines': [
762                 'USE_CRAS',
763               ],
764             }],
765           ],
766         }],
767         [ 'target_arch=="ia32" or target_arch=="x64"', {
768           'sources': [
769             'base/simd/convert_rgb_to_yuv_unittest.cc',
770           ],
771         }],
772         ['proprietary_codecs==1 or branding=="Chrome"', {
773           'sources': [
774             'mp4/avc_unittest.cc',
775             'mp4/box_reader_unittest.cc',
776             'mp4/mp4_stream_parser_unittest.cc',
777             'mp4/offset_byte_queue_unittest.cc',
778           ],
779         }],
780       ],
781     },
782     {
783       'target_name': 'media_test_support',
784       'type': 'static_library',
785       'dependencies': [
786         'media',
787         '../base/base.gyp:base',
788         '../testing/gmock.gyp:gmock',
789         '../testing/gtest.gyp:gtest',
790       ],
791       'sources': [
792         'audio/mock_audio_manager.cc',
793         'audio/mock_audio_manager.h',
794         'audio/test_audio_input_controller_factory.cc',
795         'audio/test_audio_input_controller_factory.h',
796         'base/fake_audio_render_callback.cc',
797         'base/fake_audio_render_callback.h',
798         'base/mock_audio_renderer_sink.cc',
799         'base/mock_audio_renderer_sink.h',
800         'base/mock_callback.cc',
801         'base/mock_callback.h',
802         'base/mock_data_source_host.cc',
803         'base/mock_data_source_host.h',
804         'base/mock_demuxer_host.cc',
805         'base/mock_demuxer_host.h',
806         'base/mock_filter_host.cc',
807         'base/mock_filter_host.h',
808         'base/mock_filters.cc',
809         'base/mock_filters.h',
810       ],
811     },
812     {
813       'target_name': 'scaler_bench',
814       'type': 'executable',
815       'dependencies': [
816         'media',
817         'yuv_convert',
818         '../base/base.gyp:base',
819         '../skia/skia.gyp:skia',
820       ],
821       'sources': [
822         'tools/scaler_bench/scaler_bench.cc',
823       ],
824     },
825     {
826       'target_name': 'qt_faststart',
827       'type': 'executable',
828       'sources': [
829         'tools/qt_faststart/qt_faststart.c'
830       ],
831     },
832     {
833       'target_name': 'seek_tester',
834       'type': 'executable',
835       'dependencies': [
836         'media',
837         '../base/base.gyp:base',
838       ],
839       'sources': [
840         'tools/seek_tester/seek_tester.cc',
841       ],
842     },
843   ],
844   'conditions': [
845     ['OS=="win"', {
846       'targets': [
847         {
848           'target_name': 'player_wtl',
849           'type': 'executable',
850           'dependencies': [
851             'media',
852             'yuv_convert',
853             '../base/base.gyp:base',
854             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
855             '../ui/ui.gyp:ui',
856           ],
857           'include_dirs': [
858             '<(DEPTH)/third_party/wtl/include',
859           ],
860           'sources': [
861             'tools/player_wtl/list.h',
862             'tools/player_wtl/mainfrm.h',
863             'tools/player_wtl/movie.cc',
864             'tools/player_wtl/movie.h',
865             'tools/player_wtl/player_wtl.cc',
866             'tools/player_wtl/player_wtl.rc',
867             'tools/player_wtl/props.h',
868             'tools/player_wtl/seek.h',
869             'tools/player_wtl/resource.h',
870             'tools/player_wtl/view.h',
871           ],
872           'msvs_settings': {
873             'VCLinkerTool': {
874               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
875             },
876           },
877           'defines': [
878             '_CRT_SECURE_NO_WARNINGS=1',
879           ],
880         },
881       ],
882     }],
883     ['OS == "win" or toolkit_uses_gtk == 1', {
884       'targets': [
885         {
886           'target_name': 'shader_bench',
887           'type': 'executable',
888           'dependencies': [
889             'media',
890             'yuv_convert',
891             '../base/base.gyp:base',
892             '../ui/gl/gl.gyp:gl',
893           ],
894           'sources': [
895             'tools/shader_bench/shader_bench.cc',
896             'tools/shader_bench/cpu_color_painter.cc',
897             'tools/shader_bench/cpu_color_painter.h',
898             'tools/shader_bench/gpu_color_painter.cc',
899             'tools/shader_bench/gpu_color_painter.h',
900             'tools/shader_bench/gpu_painter.cc',
901             'tools/shader_bench/gpu_painter.h',
902             'tools/shader_bench/painter.cc',
903             'tools/shader_bench/painter.h',
904             'tools/shader_bench/window.cc',
905             'tools/shader_bench/window.h',
906           ],
907           'conditions': [
908             ['toolkit_uses_gtk == 1', {
909               'dependencies': [
910                 '../build/linux/system.gyp:gtk',
911               ],
912               'sources': [
913                 'tools/shader_bench/window_linux.cc',
914               ],
915             }],
916             ['OS=="win"', {
917               'dependencies': [
918                 '../third_party/angle/src/build_angle.gyp:libEGL',
919                 '../third_party/angle/src/build_angle.gyp:libGLESv2',
920               ],
921               'sources': [
922                 'tools/shader_bench/window_win.cc',
923               ],
924             }],
925           ],
926         },
927       ],
928     }],
929     ['OS == "linux" and target_arch != "arm"', {
930       'targets': [
931         {
932           'target_name': 'tile_render_bench',
933           'type': 'executable',
934           'dependencies': [
935             '../base/base.gyp:base',
936             '../ui/gl/gl.gyp:gl',
937           ],
938           'libraries': [
939             '-lGL',
940             '-ldl',
941           ],
942           'sources': [
943             'tools/tile_render_bench/tile_render_bench.cc',
944           ],
945         },
946       ],
947     }],
948     ['os_posix == 1 and OS != "mac" and OS != "android"', {
949       'targets': [
950         {
951           'target_name': 'player_x11',
952           'type': 'executable',
953           'dependencies': [
954             'media',
955             'yuv_convert',
956             '../base/base.gyp:base',
957             '../ui/gl/gl.gyp:gl',
958           ],
959           'link_settings': {
960             'libraries': [
961               '-ldl',
962               '-lX11',
963               '-lXrender',
964               '-lXext',
965             ],
966           },
967           'sources': [
968             'tools/player_x11/data_source_logger.cc',
969             'tools/player_x11/data_source_logger.h',
970             'tools/player_x11/gl_video_renderer.cc',
971             'tools/player_x11/gl_video_renderer.h',
972             'tools/player_x11/player_x11.cc',
973             'tools/player_x11/x11_video_renderer.cc',
974             'tools/player_x11/x11_video_renderer.h',
975           ],
976         },
977       ],
978     }],
979     # Special target to wrap a gtest_target_type==shared_library
980     # media_unittests into an android apk for execution.
981     ['OS == "android" and gtest_target_type == "shared_library"', {
982       'targets': [
983         {
984           'target_name': 'media_unittests_apk',
985           'type': 'none',
986           'dependencies': [
987             '../base/base.gyp:base_java',
988             'media_java',
989             'media_unittests',
990           ],
991           'variables': {
992             'test_suite_name': 'media_unittests',
993             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
994             'input_jars_paths': [
995               '<(PRODUCT_DIR)/lib.java/chromium_base.jar',
996               '<(PRODUCT_DIR)/lib.java/chromium_media.jar',
997              ],
998           },
999           'includes': [ '../build/apk_test.gypi' ],
1000         },
1001       ],
1002     }],
1003     ['OS == "android"', {
1004       'targets': [
1005         {
1006           'target_name': 'player_android',
1007           'type': 'static_library',
1008           'sources': [
1009             'base/android/media_player_bridge.cc',
1010             'base/android/media_player_bridge.h',
1011           ],
1012           'dependencies': [
1013             '../base/base.gyp:base',
1014           ],
1015           'include_dirs': [
1016             '<(SHARED_INTERMEDIATE_DIR)/media',
1017           ],
1018           'actions': [
1019             {
1020               'action_name': 'generate-jni-headers',
1021               'inputs': [
1022                 '../base/android/jni_generator/jni_generator.py',
1023                 'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1024               ],
1025               'outputs': [
1026                 '<(SHARED_INTERMEDIATE_DIR)/media/jni/media_player_listener_jni.h',
1027               ],
1028               'action': [
1029                 'python',
1030                 '<(DEPTH)/base/android/jni_generator/jni_generator.py',
1031                 '-o',
1032                 '<@(_inputs)',
1033                 '<@(_outputs)',
1034               ],
1035             },
1036           ],
1037         },
1038         {
1039           'target_name': 'media_java',
1040           'type': 'none',
1041           'dependencies': [ '../base/base.gyp:base_java' ],
1042           'variables': {
1043             'package_name': 'media',
1044             'java_in_dir': 'base/android/java',
1045           },
1046           'includes': [ '../build/java.gypi' ],
1047         },
1049       ],
1050     }, { # OS != "android"'
1051       # Android does not use ffmpeg, so disable the targets which require it.
1052       'targets': [
1053         {
1054           'target_name': 'ffmpeg_unittests',
1055           'type': 'executable',
1056           'dependencies': [
1057             'media',
1058             'media_test_support',
1059             '../base/base.gyp:base',
1060             '../base/base.gyp:base_i18n',
1061             '../base/base.gyp:test_support_base',
1062             '../base/base.gyp:test_support_perf',
1063             '../testing/gtest.gyp:gtest',
1064             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1065           ],
1066           'sources': [
1067             'ffmpeg/ffmpeg_unittest.cc',
1068           ],
1069           'conditions': [
1070             ['toolkit_uses_gtk == 1', {
1071               'dependencies': [
1072                 # Needed for the following #include chain:
1073                 #   base/run_all_unittests.cc
1074                 #   ../base/test_suite.h
1075                 #   gtk/gtk.h
1076                 '../build/linux/system.gyp:gtk',
1077               ],
1078               'conditions': [
1079                 ['linux_use_tcmalloc==1', {
1080                   'dependencies': [
1081                     '../base/allocator/allocator.gyp:allocator',
1082                   ],
1083                 }],
1084               ],
1085             }],
1086           ],
1087         },
1088         {
1089           'target_name': 'ffmpeg_regression_tests',
1090           'type': 'executable',
1091           'dependencies': [
1092             'media',
1093             'media_test_support',
1094             '../base/base.gyp:test_support_base',
1095             '../testing/gmock.gyp:gmock',
1096             '../testing/gtest.gyp:gtest',
1097             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1098           ],
1099           'sources': [
1100             'base/test_data_util.cc',
1101             'base/run_all_unittests.cc',
1102             'ffmpeg/ffmpeg_regression_tests.cc',
1103             'filters/pipeline_integration_test_base.cc',
1104           ],
1105           'conditions': [
1106             ['os_posix==1 and OS!="mac"', {
1107               'conditions': [
1108                 ['linux_use_tcmalloc==1', {
1109                   'dependencies': [
1110                     '../base/allocator/allocator.gyp:allocator',
1111                   ],
1112                 }],
1113               ],
1114             }],
1115           ],
1116         },
1117         {
1118           'target_name': 'ffmpeg_tests',
1119           'type': 'executable',
1120           'dependencies': [
1121             'media',
1122             '../base/base.gyp:base',
1123             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1124           ],
1125           'sources': [
1126             'test/ffmpeg_tests/ffmpeg_tests.cc',
1127           ],
1128         },
1129         {
1130           'target_name': 'media_bench',
1131           'type': 'executable',
1132           'dependencies': [
1133             'media',
1134             '../base/base.gyp:base',
1135             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1136           ],
1137           'sources': [
1138             'tools/media_bench/media_bench.cc',
1139           ],
1140         },
1141       ],
1142     }]
1143   ],