Add missing mandoline dependencies.
[chromium-blink-merge.git] / media / BUILD.gn
blobfc7953ae43fbbe09aaa4e815affa649eec92fd43
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   }
37 config("media_implementation") {
38   defines = [ "MEDIA_IMPLEMENTATION" ]
41 config("media_dependent_config") {
42   defines = []
43   if (!media_use_libvpx) {
44     defines += [ "MEDIA_DISABLE_LIBVPX" ]
45   }
46   if (!media_use_ffmpeg) {
47     defines += [ "MEDIA_DISABLE_FFMPEG" ]
48   }
49   if (is_win) {
50     ldflags = [
51       "/DELAYLOAD:mf.dll",
52       "/DELAYLOAD:mfplat.dll",
53       "/DELAYLOAD:mfreadwrite.dll",
54     ]
55   }
58 if (use_ozone) {
59   action("generate_ozone_constructor_list") {
60     # Ozone platform objects are auto-generated using similar
61     # patterns for naming and classes constructors. Here we build the
62     # object MediaOzonePlatform.
63     script = "../ui/ozone/generate_constructor_list.py"
65     platform_list_txt_file = "$target_gen_dir/../ui/ozone/platform_list.txt"
66     constructor_list_cc_file =
67         "$target_gen_dir/../media/ozone/constructor_list.cc"
69     sources = [
70       platform_list_txt_file,
71     ]
72     outputs = [
73       constructor_list_cc_file,
74     ]
75     args = [
76       "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
77       "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
78       "--namespace=media",
79       "--typename=MediaOzonePlatform",
80       "--include=\"media/ozone/media_ozone_platform.h\"",
81     ]
82   }
85 component("media") {
86   sources = [
87     "blink/skcanvas_video_renderer.cc",
88     "blink/skcanvas_video_renderer.h",
89     "cdm/aes_decryptor.cc",
90     "cdm/aes_decryptor.h",
91     "cdm/default_cdm_factory.cc",
92     "cdm/default_cdm_factory.h",
93     "cdm/json_web_key.cc",
94     "cdm/json_web_key.h",
95     "cdm/key_system_names.cc",
96     "cdm/key_system_names.h",
97     "cdm/player_tracker_impl.cc",
98     "cdm/player_tracker_impl.h",
99     "cdm/proxy_decryptor.cc",
100     "cdm/proxy_decyrptor.h",
101     "ffmpeg/ffmpeg_deleters.h",
102     "filters/audio_clock.cc",
103     "filters/audio_clock.h",
104     "filters/audio_renderer_algorithm.cc",
105     "filters/audio_renderer_algorithm.h",
106     "filters/chunk_demuxer.cc",
107     "filters/chunk_demuxer.h",
108     "filters/context_3d.h",
109     "filters/decoder_selector.cc",
110     "filters/decoder_selector.h",
111     "filters/decoder_stream.cc",
112     "filters/decoder_stream.h",
113     "filters/decoder_stream_traits.cc",
114     "filters/decoder_stream_traits.h",
115     "filters/decrypting_audio_decoder.cc",
116     "filters/decrypting_audio_decoder.h",
117     "filters/decrypting_demuxer_stream.cc",
118     "filters/decrypting_demuxer_stream.h",
119     "filters/decrypting_video_decoder.cc",
120     "filters/decrypting_video_decoder.h",
121     "filters/default_media_permission.cc",
122     "filters/default_media_permission.h",
123     "filters/file_data_source.cc",
124     "filters/file_data_source.h",
125     "filters/frame_processor.cc",
126     "filters/frame_processor.h",
127     "filters/gpu_video_decoder.cc",
128     "filters/gpu_video_decoder.h",
129     "filters/h264_bit_reader.cc",
130     "filters/h264_bit_reader.h",
131     "filters/h264_parser.cc",
132     "filters/h264_parser.h",
133     "filters/jpeg_parser.cc",
134     "filters/jpeg_parser.h",
135     "filters/source_buffer_platform.cc",
136     "filters/source_buffer_platform.h",
137     "filters/source_buffer_range.cc",
138     "filters/source_buffer_range.h",
139     "filters/source_buffer_stream.cc",
140     "filters/source_buffer_stream.h",
141     "filters/stream_parser_factory.cc",
142     "filters/stream_parser_factory.h",
143     "filters/video_cadence_estimator.cc",
144     "filters/video_cadence_estimator.h",
145     "filters/video_renderer_algorithm.cc",
146     "filters/video_renderer_algorithm.h",
147     "filters/vp8_bool_decoder.cc",
148     "filters/vp8_bool_decoder.h",
149     "filters/vp8_parser.cc",
150     "filters/vp8_parser.h",
151     "filters/webvtt_util.h",
152     "filters/wsola_internals.cc",
153     "filters/wsola_internals.h",
154     "formats/common/offset_byte_queue.cc",
155     "formats/common/offset_byte_queue.h",
156     "formats/webm/webm_audio_client.cc",
157     "formats/webm/webm_audio_client.h",
158     "formats/webm/webm_cluster_parser.cc",
159     "formats/webm/webm_cluster_parser.h",
160     "formats/webm/webm_constants.cc",
161     "formats/webm/webm_constants.h",
162     "formats/webm/webm_content_encodings.cc",
163     "formats/webm/webm_content_encodings.h",
164     "formats/webm/webm_content_encodings_client.cc",
165     "formats/webm/webm_content_encodings_client.h",
166     "formats/webm/webm_crypto_helpers.cc",
167     "formats/webm/webm_crypto_helpers.h",
168     "formats/webm/webm_info_parser.cc",
169     "formats/webm/webm_info_parser.h",
170     "formats/webm/webm_parser.cc",
171     "formats/webm/webm_parser.h",
172     "formats/webm/webm_stream_parser.cc",
173     "formats/webm/webm_stream_parser.h",
174     "formats/webm/webm_tracks_parser.cc",
175     "formats/webm/webm_tracks_parser.h",
176     "formats/webm/webm_video_client.cc",
177     "formats/webm/webm_video_client.h",
178     "formats/webm/webm_webvtt_parser.cc",
179     "formats/webm/webm_webvtt_parser.h",
180     "renderers/audio_renderer_impl.cc",
181     "renderers/audio_renderer_impl.h",
182     "renderers/gpu_video_accelerator_factories.h",
183     "renderers/renderer_impl.cc",
184     "renderers/renderer_impl.h",
185     "renderers/video_renderer_impl.cc",
186     "renderers/video_renderer_impl.h",
187     "video/capture/fake_video_capture_device.cc",
188     "video/capture/fake_video_capture_device.h",
189     "video/capture/fake_video_capture_device_factory.cc",
190     "video/capture/fake_video_capture_device_factory.h",
191     "video/capture/file_video_capture_device.cc",
192     "video/capture/file_video_capture_device.h",
193     "video/capture/file_video_capture_device_factory.cc",
194     "video/capture/file_video_capture_device_factory.h",
195     "video/capture/linux/v4l2_capture_delegate.cc",
196     "video/capture/linux/v4l2_capture_delegate.h",
197     "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
198     "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
199     "video/capture/linux/v4l2_capture_delegate_single_plane.cc",
200     "video/capture/linux/v4l2_capture_delegate_single_plane.h",
201     "video/capture/linux/video_capture_device_chromeos.cc",
202     "video/capture/linux/video_capture_device_chromeos.h",
203     "video/capture/linux/video_capture_device_factory_linux.cc",
204     "video/capture/linux/video_capture_device_factory_linux.h",
205     "video/capture/linux/video_capture_device_linux.cc",
206     "video/capture/linux/video_capture_device_linux.h",
207     "video/capture/mac/platform_video_capturing_mac.h",
208     "video/capture/mac/video_capture_device_avfoundation_mac.h",
209     "video/capture/mac/video_capture_device_avfoundation_mac.mm",
210     "video/capture/mac/video_capture_device_decklink_mac.h",
211     "video/capture/mac/video_capture_device_decklink_mac.mm",
212     "video/capture/mac/video_capture_device_factory_mac.h",
213     "video/capture/mac/video_capture_device_factory_mac.mm",
214     "video/capture/mac/video_capture_device_mac.h",
215     "video/capture/mac/video_capture_device_mac.mm",
216     "video/capture/mac/video_capture_device_qtkit_mac.h",
217     "video/capture/mac/video_capture_device_qtkit_mac.mm",
218     "video/capture/video_capture_device.cc",
219     "video/capture/video_capture_device.h",
220     "video/capture/video_capture_device_factory.cc",
221     "video/capture/video_capture_device_factory.h",
222     "video/capture/video_capture_device_info.cc",
223     "video/capture/video_capture_device_info.h",
224     "video/capture/win/capability_list_win.cc",
225     "video/capture/win/capability_list_win.h",
226     "video/capture/win/filter_base_win.cc",
227     "video/capture/win/filter_base_win.h",
228     "video/capture/win/pin_base_win.cc",
229     "video/capture/win/pin_base_win.h",
230     "video/capture/win/sink_filter_observer_win.h",
231     "video/capture/win/sink_filter_win.cc",
232     "video/capture/win/sink_filter_win.h",
233     "video/capture/win/sink_input_pin_win.cc",
234     "video/capture/win/sink_input_pin_win.h",
235     "video/capture/win/video_capture_device_factory_win.cc",
236     "video/capture/win/video_capture_device_factory_win.h",
237     "video/capture/win/video_capture_device_mf_win.cc",
238     "video/capture/win/video_capture_device_mf_win.h",
239     "video/capture/win/video_capture_device_win.cc",
240     "video/capture/win/video_capture_device_win.h",
241     "video/fake_video_encode_accelerator.cc",
242     "video/fake_video_encode_accelerator.h",
243     "video/gpu_memory_buffer_video_frame_pool.cc",
244     "video/gpu_memory_buffer_video_frame_pool.h",
245     "video/h264_poc.cc",
246     "video/h264_poc.h",
247     "video/picture.cc",
248     "video/picture.h",
249     "video/video_decode_accelerator.cc",
250     "video/video_decode_accelerator.h",
251     "video/video_encode_accelerator.cc",
252     "video/video_encode_accelerator.h",
253   ]
255   configs += [
256     ":media_config",
257     ":media_implementation",
259     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
260     # See http://crbug.com/171009
261     "//build/config/compiler:no_size_t_to_int_warning",
262   ]
263   all_dependent_configs = [ ":media_dependent_config" ]
265   allow_circular_includes_from = []
266   cflags = []
267   libs = []
268   defines = []
269   deps = []
271   include_dirs = [ "." ]
272   if (media_use_ffmpeg) {
273     deps += [ "//third_party/ffmpeg" ]
274     sources += [
275       "ffmpeg/ffmpeg_common.cc",
276       "ffmpeg/ffmpeg_common.h",
277       "filters/audio_file_reader.cc",
278       "filters/audio_file_reader.h",
279       "filters/blocking_url_protocol.cc",
280       "filters/blocking_url_protocol.h",
281       "filters/ffmpeg_audio_decoder.cc",
282       "filters/ffmpeg_audio_decoder.h",
283       "filters/ffmpeg_bitstream_converter.h",
284       "filters/ffmpeg_demuxer.cc",
285       "filters/ffmpeg_demuxer.h",
286       "filters/ffmpeg_glue.cc",
287       "filters/ffmpeg_glue.h",
288       "filters/ffmpeg_video_decoder.cc",
289       "filters/ffmpeg_video_decoder.h",
290       "filters/in_memory_url_protocol.cc",
291       "filters/in_memory_url_protocol.h",
292     ]
293     if (proprietary_codecs) {
294       sources += [
295         "filters/ffmpeg_aac_bitstream_converter.cc",
296         "filters/ffmpeg_aac_bitstream_converter.h",
297         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
298         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
299       ]
300     }
301   }
303   if (current_cpu == "arm" && arm_use_neon) {
304     defines += [ "USE_NEON" ]
305   }
307   if (media_use_libvpx) {
308     sources += [
309       "filters/vpx_video_decoder.cc",
310       "filters/vpx_video_decoder.h",
311     ]
312     deps += [ "//third_party/libvpx" ]
313   }
315   if (is_android) {
316     sources += [
317       "video/capture/android/video_capture_device_android.cc",
318       "video/capture/android/video_capture_device_android.h",
319       "video/capture/android/video_capture_device_factory_android.cc",
320       "video/capture/android/video_capture_device_factory_android.h",
321     ]
322     deps += [
323       "//media/base/android",
324       "//media/base/android:media_jni_headers",
325       "//media/base/android:video_capture_jni_headers",
326     ]
327     allow_circular_includes_from = [ "//media/base/android" ]
328   } else {
329     sources += [
330       "filters/opus_audio_decoder.cc",
331       "filters/opus_audio_decoder.h",
332       "renderers/default_renderer_factory.cc",
333       "renderers/default_renderer_factory.h",
334     ]
335   }
337   if (current_cpu != "arm" && is_chromeos) {
338     sources += [
339       "filters/h264_bitstream_buffer.cc",
340       "filters/h264_bitstream_buffer.h",
341     ]
342   }
344   # A simple WebM encoder for animated avatars on ChromeOS.
346   if (use_ozone) {
347     # Used for the generated listing header (ui/ozone/platform_list.h)
348     include_dirs += [ target_gen_dir ]
350     sources += [
351                  "ozone/media_ozone_platform.cc",
352                  "ozone/media_ozone_platform.h",
353                ] + get_target_outputs(":generate_ozone_constructor_list")
355     deps += [
356       ":generate_ozone_constructor_list",
357       "//ui/ozone",
358     ]
359   }
361   if (is_mac) {
362     deps += [
363       "//media/base/mac",
364       "//third_party/decklink",
365     ]
366     libs += [
367       "CoreVideo.framework",
368       "OpenGL.framework",
369       "QTKit.framework",
370     ]
371   }
373   if (is_openbsd) {
374     sources -= [
375       "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
376       "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
377     ]
378   }
380   if (is_ios) {
381     deps += [ "//media/base/mac" ]
382   }
384   if (is_win) {
385     deps += [ "//media/base/win" ]
386     libs += [
387       "mf.lib",
388       "mfplat.lib",
389       "mfreadwrite.lib",
390       "mfuuid.lib",
391     ]
392   }
394   if (proprietary_codecs) {
395     sources += [
396       "cdm/cenc_utils.cc",
397       "cdm/cenc_utils.h",
398       "filters/h264_to_annex_b_bitstream_converter.cc",
399       "filters/h264_to_annex_b_bitstream_converter.h",
400       "formats/mp2t/es_adapter_video.cc",
401       "formats/mp2t/es_adapter_video.h",
402       "formats/mp2t/es_parser.cc",
403       "formats/mp2t/es_parser.h",
404       "formats/mp2t/es_parser_adts.cc",
405       "formats/mp2t/es_parser_adts.h",
406       "formats/mp2t/es_parser_h264.cc",
407       "formats/mp2t/es_parser_h264.h",
408       "formats/mp2t/es_parser_mpeg1audio.cc",
409       "formats/mp2t/es_parser_mpeg1audio.h",
410       "formats/mp2t/mp2t_common.h",
411       "formats/mp2t/mp2t_stream_parser.cc",
412       "formats/mp2t/mp2t_stream_parser.h",
413       "formats/mp2t/timestamp_unroller.cc",
414       "formats/mp2t/timestamp_unroller.h",
415       "formats/mp2t/ts_packet.cc",
416       "formats/mp2t/ts_packet.h",
417       "formats/mp2t/ts_section.h",
418       "formats/mp2t/ts_section_pat.cc",
419       "formats/mp2t/ts_section_pat.h",
420       "formats/mp2t/ts_section_pes.cc",
421       "formats/mp2t/ts_section_pes.h",
422       "formats/mp2t/ts_section_pmt.cc",
423       "formats/mp2t/ts_section_pmt.h",
424       "formats/mp2t/ts_section_psi.cc",
425       "formats/mp2t/ts_section_psi.h",
426       "formats/mp4/aac.cc",
427       "formats/mp4/aac.h",
428       "formats/mp4/avc.cc",
429       "formats/mp4/avc.h",
430       "formats/mp4/box_definitions.cc",
431       "formats/mp4/box_definitions.h",
432       "formats/mp4/box_reader.cc",
433       "formats/mp4/box_reader.h",
434       "formats/mp4/cenc.cc",
435       "formats/mp4/cenc.h",
436       "formats/mp4/es_descriptor.cc",
437       "formats/mp4/es_descriptor.h",
438       "formats/mp4/mp4_stream_parser.cc",
439       "formats/mp4/mp4_stream_parser.h",
440       "formats/mp4/sample_to_group_iterator.cc",
441       "formats/mp4/sample_to_group_iterator.h",
442       "formats/mp4/track_run_iterator.cc",
443       "formats/mp4/track_run_iterator.h",
444       "formats/mpeg/adts_constants.cc",
445       "formats/mpeg/adts_constants.h",
446       "formats/mpeg/adts_stream_parser.cc",
447       "formats/mpeg/adts_stream_parser.h",
448       "formats/mpeg/mpeg1_audio_stream_parser.cc",
449       "formats/mpeg/mpeg1_audio_stream_parser.h",
450       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
451       "formats/mpeg/mpeg_audio_stream_parser_base.h",
452     ]
453   }
455   public_deps = [
456     "//media/base",
457     "//media/audio",
458   ]
460   deps += [
461     ":shared_memory_support",
462     "//base",
463     "//base:i18n",
464     "//base/third_party/dynamic_annotations",
465     "//crypto",
466     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
467     "//gpu/command_buffer/common",
468     "//skia",
469     "//third_party/libyuv",
470     "//third_party/opus",
471     "//ui/events:events_base",
472     "//ui/gfx",
473     "//ui/gfx/geometry",
474     "//url",
475   ]
478 # Minimal media component for media/cast on iOS.
479 if (is_ios) {
480   component("media_for_cast_ios") {
481     configs += [
482       ":media_config",
483       ":media_implementation",
484     ]
485     all_dependent_configs = [ ":media_dependent_config" ]
486     include_dirs = [ "." ]
487     libs = [ "CoreVideo.framework" ]
489     deps = [
490       ":shared_memory_support",
491       "//base",
492       "//gpu/command_buffer/common",
493       "//media/base:base_for_cast_ios",
494       "//media/base/mac",
495       "//ui/gfx/geometry",
496     ]
497   }
500 test("media_unittests") {
501   sources = [
502     "blink/skcanvas_video_renderer_unittest.cc",
503     "cdm/aes_decryptor_unittest.cc",
504     "cdm/json_web_key_unittest.cc",
505     "filters/audio_clock_unittest.cc",
506     "filters/audio_decoder_selector_unittest.cc",
507     "filters/audio_renderer_algorithm_unittest.cc",
508     "filters/chunk_demuxer_unittest.cc",
509     "filters/decrypting_audio_decoder_unittest.cc",
510     "filters/decrypting_demuxer_stream_unittest.cc",
511     "filters/decrypting_video_decoder_unittest.cc",
512     "filters/fake_video_decoder.cc",
513     "filters/fake_video_decoder.h",
514     "filters/fake_video_decoder_unittest.cc",
515     "filters/file_data_source_unittest.cc",
516     "filters/frame_processor_unittest.cc",
517     "filters/h264_bit_reader_unittest.cc",
518     "filters/h264_parser_unittest.cc",
519     "filters/jpeg_parser_unittest.cc",
520     "filters/source_buffer_stream_unittest.cc",
521     "filters/video_cadence_estimator_unittest.cc",
522     "filters/video_decoder_selector_unittest.cc",
523     "filters/video_frame_stream_unittest.cc",
524     "filters/video_renderer_algorithm_unittest.cc",
525     "filters/vp8_bool_decoder_unittest.cc",
526     "filters/vp8_parser_unittest.cc",
527     "formats/common/offset_byte_queue_unittest.cc",
528     "formats/webm/cluster_builder.cc",
529     "formats/webm/cluster_builder.h",
530     "formats/webm/opus_packet_builder.cc",
531     "formats/webm/opus_packet_builder.h",
532     "formats/webm/tracks_builder.cc",
533     "formats/webm/tracks_builder.h",
534     "formats/webm/webm_cluster_parser_unittest.cc",
535     "formats/webm/webm_content_encodings_client_unittest.cc",
536     "formats/webm/webm_parser_unittest.cc",
537     "formats/webm/webm_tracks_parser_unittest.cc",
538     "formats/webm/webm_webvtt_parser_unittest.cc",
539     "renderers/audio_renderer_impl_unittest.cc",
540     "renderers/renderer_impl_unittest.cc",
541     "renderers/video_renderer_impl_unittest.cc",
542     "video/capture/fake_video_capture_device_unittest.cc",
543     "video/capture/video_capture_device_unittest.cc",
544     "video/h264_poc_unittest.cc",
545   ]
547   # TODO(wolenetz): Fix size_t to int trunctaion in win64.
548   # See http://crbug.com/171009
549   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
551   deps = [
552     ":media",
553     ":test_support",
554     "//base/allocator",
555     "//base/test:test_support",
556     "//media/audio:unittests",
557     "//media/audio:test_support",
558     "//media/base:unittests",
559     "//media/base:test_support",
560     "//media/test:pipeline_integration_tests",
561     "//skia",  # Direct dependency required to inherit config.
562     "//testing/gmock",
563     "//testing/gtest",
564     "//third_party/widevine/cdm:version_h",
565     "//ui/gfx:test_support",
566     "//url",
567   ]
569   if (is_android) {
570     isolate_file = "media_unittests.isolate"
571     deps += [
572       "//media/base/android",
573       # TODO(GYP)
574       #"//testing/android/native_test:native_test_native_code"
575     ]
576   }
578   if (media_use_ffmpeg) {
579     sources += [
580       "ffmpeg/ffmpeg_common_unittest.cc",
581       "filters/audio_decoder_unittest.cc",
582       "filters/audio_file_reader_unittest.cc",
583       "filters/blocking_url_protocol_unittest.cc",
584       "filters/ffmpeg_demuxer_unittest.cc",
585       "filters/ffmpeg_glue_unittest.cc",
586       "filters/ffmpeg_video_decoder_unittest.cc",
587       "filters/in_memory_url_protocol_unittest.cc",
588     ]
589   }
591   if (current_cpu != "arm" && is_chromeos) {
592     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
593   }
595   if (proprietary_codecs) {
596     sources += [
597       "cdm/cenc_utils_unittest.cc",
598       "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
599       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
600       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
601       "formats/common/stream_parser_test_base.cc",
602       "formats/common/stream_parser_test_base.h",
603       "formats/mp2t/es_adapter_video_unittest.cc",
604       "formats/mp2t/es_parser_adts_unittest.cc",
605       "formats/mp2t/es_parser_h264_unittest.cc",
606       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
607       "formats/mp2t/es_parser_test_base.cc",
608       "formats/mp2t/es_parser_test_base.h",
609       "formats/mp2t/mp2t_stream_parser_unittest.cc",
610       "formats/mp2t/timestamp_unroller_unittest.cc",
611       "formats/mp4/aac_unittest.cc",
612       "formats/mp4/avc_unittest.cc",
613       "formats/mp4/box_reader_unittest.cc",
614       "formats/mp4/es_descriptor_unittest.cc",
615       "formats/mp4/mp4_stream_parser_unittest.cc",
616       "formats/mp4/sample_to_group_iterator_unittest.cc",
617       "formats/mp4/track_run_iterator_unittest.cc",
618       "formats/mpeg/adts_stream_parser_unittest.cc",
619       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
620     ]
621   }
623   if (is_mac || is_ios) {
624     deps += [ "//media/base/mac" ]
625   }
627   if (is_mac) {
628     sources +=
629         [ "video/capture/mac/video_capture_device_factory_mac_unittest.mm" ]
630   }
632   #      include_dirs += [
633   #        # Needed by media_drm_bridge.cc.
634   #        target_gen_dir,
635   #      ],
637   configs += [ ":media_config" ]
639   if (media_use_ffmpeg) {
640     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
641   }
644 test("media_perftests") {
645   configs += [ ":media_config" ]
646   deps = [
647     ":media",
648     ":shared_memory_support",
649     ":test_support",
650     "//base/test:test_support",
651     "//media/audio:test_support",
652     "//media/base:perftests",
653     "//media/base:test_support",
654     "//media/test:pipeline_integration_perftests",
655     "//testing/gmock",
656     "//testing/gtest",
657     "//testing/perf",
658     "//third_party/widevine/cdm:version_h",
659     "//ui/gfx:test_support",
660   ]
661   if (is_android) {
662     deps += [ "//ui/gl" ]
663     isolate_file = "media_perftests.isolate"
664   }
665   if (media_use_ffmpeg) {
666     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
667   }
670 # For running the subset of media_unittests that might require audio hardware
671 # separately on GPU bots. media_unittests includes these too.
672 test("audio_unittests") {
673   sources = [
674     "base/run_all_unittests.cc",
675   ]
676   deps = [
677     ":test_support",
678     "//base/test:test_support",
679     "//media/audio:unittests",
680     "//ui/gfx:test_support",
681   ]
684 source_set("test_support") {
685   testonly = true
686   sources = [
687     "renderers/mock_gpu_video_accelerator_factories.cc",
688     "renderers/mock_gpu_video_accelerator_factories.h",
689     "video/mock_video_decode_accelerator.cc",
690     "video/mock_video_decode_accelerator.h",
691   ]
692   deps = [
693     ":media",
694     ":shared_memory_support",
695     "//base",
696     "//skia",
697     "//testing/gmock",
698     "//testing/gtest",
699   ]
702 # TODO(dalecurtis): How to split this across audio/base directories??
703 component("shared_memory_support") {
704   sources = [
705     "audio/audio_parameters.cc",
706     "audio/audio_parameters.h",
707     "base/audio_bus.cc",
708     "base/audio_bus.h",
709     "base/channel_layout.cc",
710     "base/channel_layout.h",
711     "base/limits.h",
712     "base/media_export.h",
713     "base/vector_math.cc",
714     "base/vector_math.h",
715   ]
716   configs += [
717     ":media_config",
718     ":media_implementation",
719   ]
720   deps = [
721     "//base",
722   ]
725 if (media_use_ffmpeg) {
726   test("ffmpeg_regression_tests") {
727     sources = [
728       "base/run_all_unittests.cc",
729       "ffmpeg/ffmpeg_regression_tests.cc",
730     ]
732     configs += [ "//media:media_config" ]
734     deps = [
735       "//base/test:test_support",
736       "//media",
737       "//media:test_support",
738       "//media/audio:test_support",
739       "//media/base:test_support",
740       "//media/test:pipeline_integration_tests",
741       "//testing/gmock",
742       "//testing/gtest",
743       "//third_party/ffmpeg",
744       "//ui/gfx/geometry",
745       "//ui/gfx:test_support",
746     ]
747   }