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