Add a virtual beamforming audio device on ChromeOS.
[chromium-blink-merge.git] / media / BUILD.gn
blob78c53102b2c2c6255390614d58d44c9cb988881e
1 # Copyright 2014 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.
5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni")
7 import("//build/config/features.gni")
8 import("//build/config/linux/pkg_config.gni")
9 import("//build/config/ui.gni")
10 import("//media/media_options.gni")
11 import("//testing/test.gni")
13 # Common configuration for targets in the media directory.
14 # NOT for exporting.
15 config("media_config") {
16   defines = []
17   if (!media_use_libvpx) {
18     defines += [ "MEDIA_DISABLE_LIBVPX" ]
19   }
20   if (!media_use_ffmpeg) {
21     defines += [ "MEDIA_DISABLE_FFMPEG" ]
22   }
23   if (current_cpu == "arm" && arm_use_neon) {
24     defines += [ "USE_NEON" ]
25   }
26   if (use_pulseaudio) {
27     defines += [ "USE_PULSEAUDIO" ]
28     if (!link_pulseaudio) {
29       defines += [ "DLOPEN_PULSEAUDIO" ]
30     }
31   }
32   if (use_cras) {
33     defines += [ "USE_CRAS" ]
34   }
35   if (proprietary_codecs && enable_hevc_demuxing) {
36     defines += [ "ENABLE_HEVC_DEMUXING" ]
37   }
40 config("media_implementation") {
41   defines = [ "MEDIA_IMPLEMENTATION" ]
44 config("media_dependent_config") {
45   defines = []
46   if (!media_use_libvpx) {
47     defines += [ "MEDIA_DISABLE_LIBVPX" ]
48   }
49   if (!media_use_ffmpeg) {
50     defines += [ "MEDIA_DISABLE_FFMPEG" ]
51   }
52   if (is_win) {
53     ldflags = [
54       "/DELAYLOAD:mf.dll",
55       "/DELAYLOAD:mfplat.dll",
56       "/DELAYLOAD:mfreadwrite.dll",
57     ]
58   }
61 if (use_ozone) {
62   action("generate_ozone_constructor_list") {
63     # Ozone platform objects are auto-generated using similar
64     # patterns for naming and classes constructors. Here we build the
65     # object MediaOzonePlatform.
66     script = "../ui/ozone/generate_constructor_list.py"
68     platform_list_txt_file = "$target_gen_dir/../ui/ozone/platform_list.txt"
69     constructor_list_cc_file = "$target_gen_dir/ozone/constructor_list.cc"
71     sources = [
72       platform_list_txt_file,
73     ]
74     outputs = [
75       constructor_list_cc_file,
76     ]
77     args = [
78       "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
79       "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
80       "--namespace=media",
81       "--typename=MediaOzonePlatform",
82       "--include=\"media/ozone/media_ozone_platform.h\"",
83     ]
84     deps = [
85       "//ui/ozone:generate_ozone_platform_list",
86     ]
87   }
90 component("media") {
91   sources = [
92     "blink/skcanvas_video_renderer.cc",
93     "blink/skcanvas_video_renderer.h",
94     "capture/content/animated_content_sampler.cc",
95     "capture/content/animated_content_sampler.h",
96     "capture/content/capture_resolution_chooser.cc",
97     "capture/content/capture_resolution_chooser.h",
98     "capture/content/feedback_signal_accumulator.cc",
99     "capture/content/feedback_signal_accumulator.h",
100     "capture/content/screen_capture_device_core.cc",
101     "capture/content/screen_capture_device_core.h",
102     "capture/content/smooth_event_sampler.cc",
103     "capture/content/smooth_event_sampler.h",
104     "capture/content/thread_safe_capture_oracle.cc",
105     "capture/content/thread_safe_capture_oracle.h",
106     "capture/content/video_capture_oracle.cc",
107     "capture/content/video_capture_oracle.h",
108     "capture/video/fake_video_capture_device.cc",
109     "capture/video/fake_video_capture_device.h",
110     "capture/video/fake_video_capture_device_factory.cc",
111     "capture/video/fake_video_capture_device_factory.h",
112     "capture/video/file_video_capture_device.cc",
113     "capture/video/file_video_capture_device.h",
114     "capture/video/file_video_capture_device_factory.cc",
115     "capture/video/file_video_capture_device_factory.h",
116     "capture/video/linux/v4l2_capture_delegate.cc",
117     "capture/video/linux/v4l2_capture_delegate.h",
118     "capture/video/linux/v4l2_capture_delegate_multi_plane.cc",
119     "capture/video/linux/v4l2_capture_delegate_multi_plane.h",
120     "capture/video/linux/v4l2_capture_delegate_single_plane.cc",
121     "capture/video/linux/v4l2_capture_delegate_single_plane.h",
122     "capture/video/linux/video_capture_device_chromeos.cc",
123     "capture/video/linux/video_capture_device_chromeos.h",
124     "capture/video/linux/video_capture_device_factory_linux.cc",
125     "capture/video/linux/video_capture_device_factory_linux.h",
126     "capture/video/linux/video_capture_device_linux.cc",
127     "capture/video/linux/video_capture_device_linux.h",
128     "capture/video/mac/platform_video_capturing_mac.h",
129     "capture/video/mac/video_capture_device_avfoundation_mac.h",
130     "capture/video/mac/video_capture_device_avfoundation_mac.mm",
131     "capture/video/mac/video_capture_device_decklink_mac.h",
132     "capture/video/mac/video_capture_device_decklink_mac.mm",
133     "capture/video/mac/video_capture_device_factory_mac.h",
134     "capture/video/mac/video_capture_device_factory_mac.mm",
135     "capture/video/mac/video_capture_device_mac.h",
136     "capture/video/mac/video_capture_device_mac.mm",
137     "capture/video/mac/video_capture_device_qtkit_mac.h",
138     "capture/video/mac/video_capture_device_qtkit_mac.mm",
139     "capture/video/video_capture_device.cc",
140     "capture/video/video_capture_device.h",
141     "capture/video/video_capture_device_factory.cc",
142     "capture/video/video_capture_device_factory.h",
143     "capture/video/video_capture_device_info.cc",
144     "capture/video/video_capture_device_info.h",
145     "capture/video/win/capability_list_win.cc",
146     "capture/video/win/capability_list_win.h",
147     "capture/video/win/filter_base_win.cc",
148     "capture/video/win/filter_base_win.h",
149     "capture/video/win/pin_base_win.cc",
150     "capture/video/win/pin_base_win.h",
151     "capture/video/win/sink_filter_observer_win.h",
152     "capture/video/win/sink_filter_win.cc",
153     "capture/video/win/sink_filter_win.h",
154     "capture/video/win/sink_input_pin_win.cc",
155     "capture/video/win/sink_input_pin_win.h",
156     "capture/video/win/video_capture_device_factory_win.cc",
157     "capture/video/win/video_capture_device_factory_win.h",
158     "capture/video/win/video_capture_device_mf_win.cc",
159     "capture/video/win/video_capture_device_mf_win.h",
160     "capture/video/win/video_capture_device_win.cc",
161     "capture/video/win/video_capture_device_win.h",
162     "cdm/aes_decryptor.cc",
163     "cdm/aes_decryptor.h",
164     "cdm/default_cdm_factory.cc",
165     "cdm/default_cdm_factory.h",
166     "cdm/json_web_key.cc",
167     "cdm/json_web_key.h",
168     "cdm/key_system_names.cc",
169     "cdm/key_system_names.h",
170     "cdm/player_tracker_impl.cc",
171     "cdm/player_tracker_impl.h",
172     "cdm/proxy_decryptor.cc",
173     "cdm/proxy_decryptor.h",
174     "ffmpeg/ffmpeg_deleters.h",
175     "filters/audio_clock.cc",
176     "filters/audio_clock.h",
177     "filters/audio_renderer_algorithm.cc",
178     "filters/audio_renderer_algorithm.h",
179     "filters/chunk_demuxer.cc",
180     "filters/chunk_demuxer.h",
181     "filters/context_3d.h",
182     "filters/decoder_selector.cc",
183     "filters/decoder_selector.h",
184     "filters/decoder_stream.cc",
185     "filters/decoder_stream.h",
186     "filters/decoder_stream_traits.cc",
187     "filters/decoder_stream_traits.h",
188     "filters/decrypting_audio_decoder.cc",
189     "filters/decrypting_audio_decoder.h",
190     "filters/decrypting_demuxer_stream.cc",
191     "filters/decrypting_demuxer_stream.h",
192     "filters/decrypting_video_decoder.cc",
193     "filters/decrypting_video_decoder.h",
194     "filters/default_media_permission.cc",
195     "filters/default_media_permission.h",
196     "filters/file_data_source.cc",
197     "filters/file_data_source.h",
198     "filters/frame_processor.cc",
199     "filters/frame_processor.h",
200     "filters/gpu_video_decoder.cc",
201     "filters/gpu_video_decoder.h",
202     "filters/h264_bit_reader.cc",
203     "filters/h264_bit_reader.h",
204     "filters/h264_parser.cc",
205     "filters/h264_parser.h",
206     "filters/ivf_parser.cc",
207     "filters/ivf_parser.h",
208     "filters/jpeg_parser.cc",
209     "filters/jpeg_parser.h",
210     "filters/source_buffer_platform.cc",
211     "filters/source_buffer_platform.h",
212     "filters/source_buffer_range.cc",
213     "filters/source_buffer_range.h",
214     "filters/source_buffer_stream.cc",
215     "filters/source_buffer_stream.h",
216     "filters/stream_parser_factory.cc",
217     "filters/stream_parser_factory.h",
218     "filters/video_cadence_estimator.cc",
219     "filters/video_cadence_estimator.h",
220     "filters/video_renderer_algorithm.cc",
221     "filters/video_renderer_algorithm.h",
222     "filters/vp8_bool_decoder.cc",
223     "filters/vp8_bool_decoder.h",
224     "filters/vp8_parser.cc",
225     "filters/vp8_parser.h",
226     "filters/vp9_parser.cc",
227     "filters/vp9_parser.h",
228     "filters/vp9_raw_bits_reader.cc",
229     "filters/vp9_raw_bits_reader.h",
230     "filters/webvtt_util.h",
231     "filters/wsola_internals.cc",
232     "filters/wsola_internals.h",
233     "formats/common/offset_byte_queue.cc",
234     "formats/common/offset_byte_queue.h",
235     "formats/webm/webm_audio_client.cc",
236     "formats/webm/webm_audio_client.h",
237     "formats/webm/webm_cluster_parser.cc",
238     "formats/webm/webm_cluster_parser.h",
239     "formats/webm/webm_constants.cc",
240     "formats/webm/webm_constants.h",
241     "formats/webm/webm_content_encodings.cc",
242     "formats/webm/webm_content_encodings.h",
243     "formats/webm/webm_content_encodings_client.cc",
244     "formats/webm/webm_content_encodings_client.h",
245     "formats/webm/webm_crypto_helpers.cc",
246     "formats/webm/webm_crypto_helpers.h",
247     "formats/webm/webm_info_parser.cc",
248     "formats/webm/webm_info_parser.h",
249     "formats/webm/webm_parser.cc",
250     "formats/webm/webm_parser.h",
251     "formats/webm/webm_stream_parser.cc",
252     "formats/webm/webm_stream_parser.h",
253     "formats/webm/webm_tracks_parser.cc",
254     "formats/webm/webm_tracks_parser.h",
255     "formats/webm/webm_video_client.cc",
256     "formats/webm/webm_video_client.h",
257     "formats/webm/webm_webvtt_parser.cc",
258     "formats/webm/webm_webvtt_parser.h",
259     "renderers/audio_renderer_impl.cc",
260     "renderers/audio_renderer_impl.h",
261     "renderers/default_renderer_factory.cc",
262     "renderers/default_renderer_factory.h",
263     "renderers/gpu_video_accelerator_factories.h",
264     "renderers/renderer_impl.cc",
265     "renderers/renderer_impl.h",
266     "renderers/video_renderer_impl.cc",
267     "renderers/video_renderer_impl.h",
268     "video/fake_video_encode_accelerator.cc",
269     "video/fake_video_encode_accelerator.h",
270     "video/gpu_memory_buffer_video_frame_pool.cc",
271     "video/gpu_memory_buffer_video_frame_pool.h",
272     "video/h264_poc.cc",
273     "video/h264_poc.h",
274     "video/jpeg_decode_accelerator.cc",
275     "video/jpeg_decode_accelerator.h",
276     "video/picture.cc",
277     "video/picture.h",
278     "video/video_decode_accelerator.cc",
279     "video/video_decode_accelerator.h",
280     "video/video_encode_accelerator.cc",
281     "video/video_encode_accelerator.h",
282   ]
284   configs += [
285     ":media_config",
286     ":media_implementation",
287     "//build/config:precompiled_headers",
289     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
290     # See http://crbug.com/171009
291     "//build/config/compiler:no_size_t_to_int_warning",
292   ]
293   all_dependent_configs = [ ":media_dependent_config" ]
295   allow_circular_includes_from = []
296   cflags = []
297   libs = []
298   defines = []
299   deps = []
301   include_dirs = [ "." ]
302   if (media_use_ffmpeg) {
303     deps += [ "//third_party/ffmpeg" ]
304     sources += [
305       "ffmpeg/ffmpeg_common.cc",
306       "ffmpeg/ffmpeg_common.h",
307       "filters/audio_file_reader.cc",
308       "filters/audio_file_reader.h",
309       "filters/blocking_url_protocol.cc",
310       "filters/blocking_url_protocol.h",
311       "filters/ffmpeg_audio_decoder.cc",
312       "filters/ffmpeg_audio_decoder.h",
313       "filters/ffmpeg_bitstream_converter.h",
314       "filters/ffmpeg_demuxer.cc",
315       "filters/ffmpeg_demuxer.h",
316       "filters/ffmpeg_glue.cc",
317       "filters/ffmpeg_glue.h",
318       "filters/ffmpeg_video_decoder.cc",
319       "filters/ffmpeg_video_decoder.h",
320       "filters/in_memory_url_protocol.cc",
321       "filters/in_memory_url_protocol.h",
322     ]
323     if (proprietary_codecs) {
324       sources += [
325         "filters/ffmpeg_aac_bitstream_converter.cc",
326         "filters/ffmpeg_aac_bitstream_converter.h",
327         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
328         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
329       ]
330     }
331   }
333   if (proprietary_codecs && enable_hevc_demuxing) {
334     sources += [
335       "filters/h265_parser.cc",
336       "filters/h265_parser.h",
337       "formats/mp4/hevc.cc",
338       "formats/mp4/hevc.h",
339     ]
340     if (media_use_ffmpeg) {
341       sources += [
342         "filters/ffmpeg_h265_to_annex_b_bitstream_converter.cc",
343         "filters/ffmpeg_h265_to_annex_b_bitstream_converter.h",
344       ]
345     }
346   }
348   if (current_cpu == "arm" && arm_use_neon) {
349     defines += [ "USE_NEON" ]
350   }
352   if (media_use_libvpx) {
353     sources += [
354       "filters/vpx_video_decoder.cc",
355       "filters/vpx_video_decoder.h",
356     ]
357     deps += [ "//third_party/libvpx" ]
358   }
360   if (media_use_libwebm) {
361     sources += [
362       "capture/webm_muxer.cc",
363       "capture/webm_muxer.h",
364     ]
365     deps += [ "//third_party/libwebm" ]
366   }
368   if (is_android) {
369     sources += [
370       "capture/video/android/video_capture_device_android.cc",
371       "capture/video/android/video_capture_device_android.h",
372       "capture/video/android/video_capture_device_factory_android.cc",
373       "capture/video/android/video_capture_device_factory_android.h",
374     ]
375     deps += [
376       "//media/base/android",
377       "//media/base/android:media_jni_headers",
378       "//media/base/android:video_capture_jni_headers",
379     ]
380     allow_circular_includes_from = [ "//media/base/android" ]
381   } else {
382     sources += [
383       "filters/opus_audio_decoder.cc",
384       "filters/opus_audio_decoder.h",
385     ]
386   }
388   if (current_cpu != "arm" && is_chromeos) {
389     sources += [
390       "filters/h264_bitstream_buffer.cc",
391       "filters/h264_bitstream_buffer.h",
392     ]
393   }
395   # A simple WebM encoder for animated avatars on ChromeOS.
397   if (use_ozone) {
398     # Used for the generated listing header (ui/ozone/platform_list.h)
399     include_dirs += [ target_gen_dir ]
401     sources += [
402                  "ozone/media_ozone_platform.cc",
403                  "ozone/media_ozone_platform.h",
404                ] + get_target_outputs(":generate_ozone_constructor_list")
406     deps += [
407       ":generate_ozone_constructor_list",
408       "//ui/ozone",
409     ]
410   }
412   if (is_mac) {
413     deps += [
414       "//media/base/mac",
415       "//third_party/decklink",
416     ]
417     libs += [
418       "CoreVideo.framework",
419       "OpenGL.framework",
420       "QTKit.framework",
421     ]
422   }
424   if (is_openbsd) {
425     sources -= [
426       "capture/video/linux/v4l2_capture_delegate_multi_plane.cc",
427       "capture/video/linux/v4l2_capture_delegate_multi_plane.h",
428     ]
429   }
431   if (is_ios) {
432     deps += [ "//media/base/mac" ]
433   }
435   if (is_win) {
436     deps += [ "//media/base/win" ]
437     libs += [
438       "mf.lib",
439       "mfplat.lib",
440       "mfreadwrite.lib",
441       "mfuuid.lib",
442     ]
443   }
445   if (proprietary_codecs) {
446     sources += [
447       "cdm/cenc_utils.cc",
448       "cdm/cenc_utils.h",
449       "filters/h264_to_annex_b_bitstream_converter.cc",
450       "filters/h264_to_annex_b_bitstream_converter.h",
451       "formats/mp2t/es_adapter_video.cc",
452       "formats/mp2t/es_adapter_video.h",
453       "formats/mp2t/es_parser.cc",
454       "formats/mp2t/es_parser.h",
455       "formats/mp2t/es_parser_adts.cc",
456       "formats/mp2t/es_parser_adts.h",
457       "formats/mp2t/es_parser_h264.cc",
458       "formats/mp2t/es_parser_h264.h",
459       "formats/mp2t/es_parser_mpeg1audio.cc",
460       "formats/mp2t/es_parser_mpeg1audio.h",
461       "formats/mp2t/mp2t_common.h",
462       "formats/mp2t/mp2t_stream_parser.cc",
463       "formats/mp2t/mp2t_stream_parser.h",
464       "formats/mp2t/timestamp_unroller.cc",
465       "formats/mp2t/timestamp_unroller.h",
466       "formats/mp2t/ts_packet.cc",
467       "formats/mp2t/ts_packet.h",
468       "formats/mp2t/ts_section.h",
469       "formats/mp2t/ts_section_pat.cc",
470       "formats/mp2t/ts_section_pat.h",
471       "formats/mp2t/ts_section_pes.cc",
472       "formats/mp2t/ts_section_pes.h",
473       "formats/mp2t/ts_section_pmt.cc",
474       "formats/mp2t/ts_section_pmt.h",
475       "formats/mp2t/ts_section_psi.cc",
476       "formats/mp2t/ts_section_psi.h",
477       "formats/mp4/aac.cc",
478       "formats/mp4/aac.h",
479       "formats/mp4/avc.cc",
480       "formats/mp4/avc.h",
481       "formats/mp4/bitstream_converter.cc",
482       "formats/mp4/bitstream_converter.h",
483       "formats/mp4/box_definitions.cc",
484       "formats/mp4/box_definitions.h",
485       "formats/mp4/box_reader.cc",
486       "formats/mp4/box_reader.h",
487       "formats/mp4/cenc.cc",
488       "formats/mp4/cenc.h",
489       "formats/mp4/es_descriptor.cc",
490       "formats/mp4/es_descriptor.h",
491       "formats/mp4/mp4_stream_parser.cc",
492       "formats/mp4/mp4_stream_parser.h",
493       "formats/mp4/sample_to_group_iterator.cc",
494       "formats/mp4/sample_to_group_iterator.h",
495       "formats/mp4/track_run_iterator.cc",
496       "formats/mp4/track_run_iterator.h",
497       "formats/mpeg/adts_constants.cc",
498       "formats/mpeg/adts_constants.h",
499       "formats/mpeg/adts_stream_parser.cc",
500       "formats/mpeg/adts_stream_parser.h",
501       "formats/mpeg/mpeg1_audio_stream_parser.cc",
502       "formats/mpeg/mpeg1_audio_stream_parser.h",
503       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
504       "formats/mpeg/mpeg_audio_stream_parser_base.h",
505     ]
506   }
508   public_deps = [
509     "//media/base",
510     "//media/audio",
511   ]
513   deps += [
514     ":shared_memory_support",
515     "//base",
516     "//base:i18n",
517     "//base/third_party/dynamic_annotations",
518     "//crypto",
519     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
520     "//gpu/command_buffer/common",
521     "//skia",
522     "//third_party/libyuv",
523     "//third_party/opus",
524     "//ui/events:events_base",
525     "//ui/gfx",
526     "//ui/gfx/geometry",
527     "//url",
528   ]
531 # Minimal media component for media/cast on iOS.
532 if (is_ios) {
533   component("media_for_cast_ios") {
534     configs += [
535       ":media_config",
536       ":media_implementation",
537     ]
538     all_dependent_configs = [ ":media_dependent_config" ]
539     include_dirs = [ "." ]
540     libs = [ "CoreVideo.framework" ]
542     deps = [
543       ":shared_memory_support",
544       "//base",
545       "//gpu/command_buffer/common",
546       "//media/base:base_for_cast_ios",
547       "//media/base/mac",
548       "//ui/gfx/geometry",
549     ]
550   }
553 # TODO(GYP): Delete this after we've converted everything to GN.
554 # The _run targets exist only for compatibility w/ GYP.
555 group("media_unittests_run") {
556   testonly = true
557   deps = [
558     ":media_unittests",
559   ]
562 test("media_unittests") {
563   sources = [
564     "blink/skcanvas_video_renderer_unittest.cc",
565     "capture/content/animated_content_sampler_unittest.cc",
566     "capture/content/capture_resolution_chooser_unittest.cc",
567     "capture/content/feedback_signal_accumulator_unittest.cc",
568     "capture/content/smooth_event_sampler_unittest.cc",
569     "capture/content/video_capture_oracle_unittest.cc",
570     "capture/video/fake_video_capture_device_unittest.cc",
571     "capture/video/video_capture_device_unittest.cc",
572     "cdm/aes_decryptor_unittest.cc",
573     "cdm/json_web_key_unittest.cc",
574     "filters/audio_clock_unittest.cc",
575     "filters/audio_decoder_selector_unittest.cc",
576     "filters/audio_renderer_algorithm_unittest.cc",
577     "filters/chunk_demuxer_unittest.cc",
578     "filters/decrypting_audio_decoder_unittest.cc",
579     "filters/decrypting_demuxer_stream_unittest.cc",
580     "filters/decrypting_video_decoder_unittest.cc",
581     "filters/fake_video_decoder.cc",
582     "filters/fake_video_decoder.h",
583     "filters/fake_video_decoder_unittest.cc",
584     "filters/file_data_source_unittest.cc",
585     "filters/frame_processor_unittest.cc",
586     "filters/h264_bit_reader_unittest.cc",
587     "filters/h264_parser_unittest.cc",
588     "filters/ivf_parser_unittest.cc",
589     "filters/jpeg_parser_unittest.cc",
590     "filters/source_buffer_stream_unittest.cc",
591     "filters/video_cadence_estimator_unittest.cc",
592     "filters/video_decoder_selector_unittest.cc",
593     "filters/video_frame_stream_unittest.cc",
594     "filters/video_renderer_algorithm_unittest.cc",
595     "filters/vp8_bool_decoder_unittest.cc",
596     "filters/vp8_parser_unittest.cc",
597     "filters/vp9_parser_unittest.cc",
598     "filters/vp9_raw_bits_reader_unittest.cc",
599     "formats/common/offset_byte_queue_unittest.cc",
600     "formats/webm/cluster_builder.cc",
601     "formats/webm/cluster_builder.h",
602     "formats/webm/opus_packet_builder.cc",
603     "formats/webm/opus_packet_builder.h",
604     "formats/webm/tracks_builder.cc",
605     "formats/webm/tracks_builder.h",
606     "formats/webm/webm_cluster_parser_unittest.cc",
607     "formats/webm/webm_content_encodings_client_unittest.cc",
608     "formats/webm/webm_parser_unittest.cc",
609     "formats/webm/webm_tracks_parser_unittest.cc",
610     "formats/webm/webm_webvtt_parser_unittest.cc",
611     "renderers/audio_renderer_impl_unittest.cc",
612     "renderers/renderer_impl_unittest.cc",
613     "renderers/video_renderer_impl_unittest.cc",
614     "video/gpu_memory_buffer_video_frame_pool_unittest.cc",
615     "video/h264_poc_unittest.cc",
616   ]
618   data = [
619     "test/data/",
620   ]
622   # TODO(wolenetz): Fix size_t to int trunctaion in win64.
623   # See http://crbug.com/171009
624   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
626   deps = [
627     ":media",
628     ":test_support",
629     "//base/allocator",
630     "//base/test:test_support",
631     "//gpu/command_buffer/common",
632     "//gpu:test_support",
633     "//media/audio:unittests",
634     "//media/audio:test_support",
635     "//media/base:unittests",
636     "//media/base:test_support",
637     "//media/test:pipeline_integration_tests",
638     "//skia",  # Direct dependency required to inherit config.
639     "//testing/gmock",
640     "//testing/gtest",
641     "//third_party/widevine/cdm:version_h",
642     "//ui/gfx:test_support",
643     "//url",
644   ]
646   if (is_android) {
647     isolate_file = "media_unittests.isolate"
648     deps += [
649       "//media/base/android",
650       # TODO(GYP)
651       #"//testing/android/native_test:native_test_native_code"
652     ]
653   }
655   if (media_use_ffmpeg) {
656     sources += [
657       "ffmpeg/ffmpeg_common_unittest.cc",
658       "filters/audio_decoder_unittest.cc",
659       "filters/audio_file_reader_unittest.cc",
660       "filters/blocking_url_protocol_unittest.cc",
661       "filters/ffmpeg_demuxer_unittest.cc",
662       "filters/ffmpeg_glue_unittest.cc",
663       "filters/ffmpeg_video_decoder_unittest.cc",
664       "filters/in_memory_url_protocol_unittest.cc",
665     ]
666   }
668   if (media_use_libwebm) {
669     sources += [ "capture/webm_muxer_unittest.cc" ]
670     deps += [ "//third_party/libwebm" ]
671   }
673   if (current_cpu != "arm" && is_chromeos) {
674     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
675   }
677   if (proprietary_codecs) {
678     sources += [
679       "cdm/cenc_utils_unittest.cc",
680       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
681       "formats/common/stream_parser_test_base.cc",
682       "formats/common/stream_parser_test_base.h",
683       "formats/mp2t/es_adapter_video_unittest.cc",
684       "formats/mp2t/es_parser_adts_unittest.cc",
685       "formats/mp2t/es_parser_h264_unittest.cc",
686       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
687       "formats/mp2t/es_parser_test_base.cc",
688       "formats/mp2t/es_parser_test_base.h",
689       "formats/mp2t/mp2t_stream_parser_unittest.cc",
690       "formats/mp2t/timestamp_unroller_unittest.cc",
691       "formats/mp4/aac_unittest.cc",
692       "formats/mp4/avc_unittest.cc",
693       "formats/mp4/box_reader_unittest.cc",
694       "formats/mp4/es_descriptor_unittest.cc",
695       "formats/mp4/mp4_stream_parser_unittest.cc",
696       "formats/mp4/sample_to_group_iterator_unittest.cc",
697       "formats/mp4/track_run_iterator_unittest.cc",
698       "formats/mpeg/adts_stream_parser_unittest.cc",
699       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
700     ]
701     if (media_use_ffmpeg) {
702       sources += [
703         "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
704         "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
705       ]
706     }
707     if (enable_hevc_demuxing) {
708       sources += [ "filters/h265_parser_unittest.cc" ]
709     }
710   }
712   if (is_mac || is_ios) {
713     deps += [ "//media/base/mac" ]
714   }
716   if (is_mac) {
717     sources +=
718         [ "capture/video/mac/video_capture_device_factory_mac_unittest.mm" ]
719   }
721   #      include_dirs += [
722   #        # Needed by media_drm_bridge.cc.
723   #        target_gen_dir,
724   #      ],
726   configs += [ ":media_config" ]
728   if (media_use_ffmpeg) {
729     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
730   }
733 test("media_perftests") {
734   configs += [ ":media_config" ]
735   deps = [
736     ":media",
737     ":shared_memory_support",
738     ":test_support",
739     "//base/test:test_support",
740     "//media/audio:test_support",
741     "//media/base:perftests",
742     "//media/base:test_support",
743     "//media/test:pipeline_integration_perftests",
744     "//testing/gmock",
745     "//testing/gtest",
746     "//testing/perf",
747     "//third_party/widevine/cdm:version_h",
748     "//ui/gfx:test_support",
749   ]
750   if (is_android) {
751     deps += [ "//ui/gl" ]
752     isolate_file = "media_perftests.isolate"
753   }
754   if (media_use_ffmpeg) {
755     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
756   }
759 # For running the subset of media_unittests that might require audio hardware
760 # separately on GPU bots. media_unittests includes these too.
761 test("audio_unittests") {
762   sources = [
763     "base/run_all_unittests.cc",
764   ]
765   deps = [
766     ":test_support",
767     "//base/test:test_support",
768     "//media/audio:unittests",
769     "//ui/gfx:test_support",
770   ]
773 source_set("test_support") {
774   testonly = true
775   sources = [
776     "renderers/mock_gpu_video_accelerator_factories.cc",
777     "renderers/mock_gpu_video_accelerator_factories.h",
778     "video/mock_video_decode_accelerator.cc",
779     "video/mock_video_decode_accelerator.h",
780   ]
781   deps = [
782     ":media",
783     ":shared_memory_support",
784     "//base",
785     "//skia",
786     "//testing/gmock",
787     "//testing/gtest",
788   ]
791 # TODO(dalecurtis): How to split this across audio/base directories??
792 component("shared_memory_support") {
793   sources = [
794     "audio/audio_parameters.cc",
795     "audio/audio_parameters.h",
796     "audio/point.cc",
797     "audio/point.h",
798     "base/audio_bus.cc",
799     "base/audio_bus.h",
800     "base/channel_layout.cc",
801     "base/channel_layout.h",
802     "base/limits.h",
803     "base/media_export.h",
804     "base/vector_math.cc",
805     "base/vector_math.h",
806   ]
807   configs += [
808     ":media_config",
809     ":media_implementation",
810   ]
811   deps = [
812     "//base",
813     "//ui/gfx/geometry",
814   ]
817 if (media_use_ffmpeg) {
818   test("ffmpeg_regression_tests") {
819     sources = [
820       "base/run_all_unittests.cc",
821       "ffmpeg/ffmpeg_regression_tests.cc",
822     ]
824     configs += [ "//media:media_config" ]
826     deps = [
827       "//base/test:test_support",
828       "//media",
829       "//media:test_support",
830       "//media/audio:test_support",
831       "//media/base:test_support",
832       "//media/test:pipeline_integration_tests",
833       "//testing/gmock",
834       "//testing/gtest",
835       "//third_party/ffmpeg",
836       "//ui/gfx/geometry",
837       "//ui/gfx:test_support",
838     ]
839   }