Material PDF: Add required Polymer 0.8 elements.
[chromium-blink-merge.git] / media / BUILD.gn
blobb01ad89b1c8e1182b659d49d5d982fe95200eb1a
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/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     libs += [
386       "mf.lib",
387       "mfplat.lib",
388       "mfreadwrite.lib",
389       "mfuuid.lib",
390     ]
391   }
393   if (proprietary_codecs) {
394     sources += [
395       "filters/h264_to_annex_b_bitstream_converter.cc",
396       "filters/h264_to_annex_b_bitstream_converter.h",
397       "formats/mp2t/es_adapter_video.cc",
398       "formats/mp2t/es_adapter_video.h",
399       "formats/mp2t/es_parser.cc",
400       "formats/mp2t/es_parser.h",
401       "formats/mp2t/es_parser_adts.cc",
402       "formats/mp2t/es_parser_adts.h",
403       "formats/mp2t/es_parser_h264.cc",
404       "formats/mp2t/es_parser_h264.h",
405       "formats/mp2t/es_parser_mpeg1audio.cc",
406       "formats/mp2t/es_parser_mpeg1audio.h",
407       "formats/mp2t/mp2t_common.h",
408       "formats/mp2t/mp2t_stream_parser.cc",
409       "formats/mp2t/mp2t_stream_parser.h",
410       "formats/mp2t/timestamp_unroller.cc",
411       "formats/mp2t/timestamp_unroller.h",
412       "formats/mp2t/ts_packet.cc",
413       "formats/mp2t/ts_packet.h",
414       "formats/mp2t/ts_section.h",
415       "formats/mp2t/ts_section_pat.cc",
416       "formats/mp2t/ts_section_pat.h",
417       "formats/mp2t/ts_section_pes.cc",
418       "formats/mp2t/ts_section_pes.h",
419       "formats/mp2t/ts_section_pmt.cc",
420       "formats/mp2t/ts_section_pmt.h",
421       "formats/mp2t/ts_section_psi.cc",
422       "formats/mp2t/ts_section_psi.h",
423       "formats/mp4/aac.cc",
424       "formats/mp4/aac.h",
425       "formats/mp4/avc.cc",
426       "formats/mp4/avc.h",
427       "formats/mp4/box_definitions.cc",
428       "formats/mp4/box_definitions.h",
429       "formats/mp4/box_reader.cc",
430       "formats/mp4/box_reader.h",
431       "formats/mp4/cenc.cc",
432       "formats/mp4/cenc.h",
433       "formats/mp4/es_descriptor.cc",
434       "formats/mp4/es_descriptor.h",
435       "formats/mp4/mp4_stream_parser.cc",
436       "formats/mp4/mp4_stream_parser.h",
437       "formats/mp4/sample_to_group_iterator.cc",
438       "formats/mp4/sample_to_group_iterator.h",
439       "formats/mp4/track_run_iterator.cc",
440       "formats/mp4/track_run_iterator.h",
441       "formats/mpeg/adts_constants.cc",
442       "formats/mpeg/adts_constants.h",
443       "formats/mpeg/adts_stream_parser.cc",
444       "formats/mpeg/adts_stream_parser.h",
445       "formats/mpeg/mpeg1_audio_stream_parser.cc",
446       "formats/mpeg/mpeg1_audio_stream_parser.h",
447       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
448       "formats/mpeg/mpeg_audio_stream_parser_base.h",
449     ]
450   }
452   public_deps = [
453     "//media/base",
454     "//media/audio",
455   ]
457   deps += [
458     ":shared_memory_support",
459     "//base",
460     "//base:i18n",
461     "//base/third_party/dynamic_annotations",
462     "//crypto",
463     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
464     "//gpu/command_buffer/common",
465     "//skia",
466     "//third_party/libyuv",
467     "//third_party/opus",
468     "//ui/events:events_base",
469     "//ui/gfx",
470     "//ui/gfx/geometry",
471     "//url",
472   ]
475 # Minimal media component for media/cast on iOS.
476 if (is_ios) {
477   component("media_for_cast_ios") {
478     configs += [
479       ":media_config",
480       ":media_implementation",
481     ]
482     all_dependent_configs = [ ":media_dependent_config" ]
483     include_dirs = [ "." ]
484     libs = [ "CoreVideo.framework" ]
486     deps = [
487       ":shared_memory_support",
488       "//base",
489       "//media/base:base_for_cast_ios",
490       "//media/base/mac",
491       "//ui/gfx/geometry",
492     ]
493   }
496 test("media_unittests") {
497   sources = [
498     "blink/skcanvas_video_renderer_unittest.cc",
499     "cdm/aes_decryptor_unittest.cc",
500     "cdm/cenc_utils_unittest.cc",
501     "cdm/json_web_key_unittest.cc",
502     "filters/audio_clock_unittest.cc",
503     "filters/audio_decoder_selector_unittest.cc",
504     "filters/audio_renderer_algorithm_unittest.cc",
505     "filters/chunk_demuxer_unittest.cc",
506     "filters/decrypting_audio_decoder_unittest.cc",
507     "filters/decrypting_demuxer_stream_unittest.cc",
508     "filters/decrypting_video_decoder_unittest.cc",
509     "filters/fake_demuxer_stream.cc",
510     "filters/fake_demuxer_stream.h",
511     "filters/fake_demuxer_stream_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     deps += [
571       "//media/base/android",
572       # TODO(GYP)
573       #"//testing/android/native_test:native_test_native_code"
574     ]
575   }
577   if (media_use_ffmpeg) {
578     sources += [
579       "ffmpeg/ffmpeg_common_unittest.cc",
580       "filters/audio_decoder_unittest.cc",
581       "filters/audio_file_reader_unittest.cc",
582       "filters/blocking_url_protocol_unittest.cc",
583       "filters/ffmpeg_demuxer_unittest.cc",
584       "filters/ffmpeg_glue_unittest.cc",
585       "filters/ffmpeg_video_decoder_unittest.cc",
586       "filters/in_memory_url_protocol_unittest.cc",
587     ]
588   }
590   if (current_cpu != "arm" && is_chromeos) {
591     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
592   }
594   if (proprietary_codecs) {
595     sources += [
596       "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
597       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
598       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
599       "formats/common/stream_parser_test_base.cc",
600       "formats/common/stream_parser_test_base.h",
601       "formats/mp2t/es_adapter_video_unittest.cc",
602       "formats/mp2t/es_parser_adts_unittest.cc",
603       "formats/mp2t/es_parser_h264_unittest.cc",
604       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
605       "formats/mp2t/es_parser_test_base.cc",
606       "formats/mp2t/es_parser_test_base.h",
607       "formats/mp2t/mp2t_stream_parser_unittest.cc",
608       "formats/mp2t/timestamp_unroller_unittest.cc",
609       "formats/mp4/aac_unittest.cc",
610       "formats/mp4/avc_unittest.cc",
611       "formats/mp4/box_reader_unittest.cc",
612       "formats/mp4/es_descriptor_unittest.cc",
613       "formats/mp4/mp4_stream_parser_unittest.cc",
614       "formats/mp4/sample_to_group_iterator_unittest.cc",
615       "formats/mp4/track_run_iterator_unittest.cc",
616       "formats/mpeg/adts_stream_parser_unittest.cc",
617       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
618     ]
619   }
621   if (is_mac || is_ios) {
622     deps += [ "//media/base/mac" ]
623   }
625   if (is_mac) {
626     sources +=
627         [ "video/capture/mac/video_capture_device_factory_mac_unittest.mm" ]
628   }
630   #      include_dirs += [
631   #        # Needed by media_drm_bridge.cc.
632   #        target_gen_dir,
633   #      ],
635   configs += [ ":media_config" ]
637   if (media_use_ffmpeg) {
638     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
639   }
642 test("media_perftests") {
643   configs += [ ":media_config" ]
644   deps = [
645     ":media",
646     ":shared_memory_support",
647     ":test_support",
648     "//base/test:test_support",
649     "//media/audio:test_support",
650     "//media/base:perftests",
651     "//media/base:test_support",
652     "//media/test:pipeline_integration_perftests",
653     "//testing/gmock",
654     "//testing/gtest",
655     "//testing/perf",
656     "//third_party/widevine/cdm:version_h",
657     "//ui/gfx:test_support",
658   ]
659   if (is_android) {
660     deps += [ "//ui/gl" ]
661   }
662   if (media_use_ffmpeg) {
663     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
664   }
667 # For running the subset of media_unittests that might require audio hardware
668 # separately on GPU bots. media_unittests includes these too.
669 test("audio_unittests") {
670   sources = [
671     "base/run_all_unittests.cc",
672   ]
673   deps = [
674     ":test_support",
675     "//base/test:test_support",
676     "//media/audio:unittests",
677     "//ui/gfx:test_support",
678   ]
681 source_set("test_support") {
682   testonly = true
683   sources = [
684     "renderers/mock_gpu_video_accelerator_factories.cc",
685     "renderers/mock_gpu_video_accelerator_factories.h",
686     "video/mock_video_decode_accelerator.cc",
687     "video/mock_video_decode_accelerator.h",
688   ]
689   deps = [
690     ":media",
691     ":shared_memory_support",
692     "//base",
693     "//skia",
694     "//testing/gmock",
695     "//testing/gtest",
696   ]
699 # TODO(dalecurtis): How to split this across audio/base directories??
700 component("shared_memory_support") {
701   sources = [
702     "audio/audio_parameters.cc",
703     "audio/audio_parameters.h",
704     "base/audio_bus.cc",
705     "base/audio_bus.h",
706     "base/channel_layout.cc",
707     "base/channel_layout.h",
708     "base/limits.h",
709     "base/media_export.h",
710     "base/vector_math.cc",
711     "base/vector_math.h",
712   ]
713   configs += [
714     ":media_config",
715     ":media_implementation",
716   ]
717   deps = [
718     "//base",
719   ]
722 if (media_use_ffmpeg) {
723   test("ffmpeg_regression_tests") {
724     sources = [
725       "base/run_all_unittests.cc",
726       "ffmpeg/ffmpeg_regression_tests.cc",
727     ]
729     configs += [ "//media:media_config" ]
731     deps = [
732       "//base/test:test_support",
733       "//media",
734       "//media:test_support",
735       "//media/audio:test_support",
736       "//media/base:test_support",
737       "//media/test:pipeline_integration_tests",
738       "//testing/gmock",
739       "//testing/gtest",
740       "//third_party/ffmpeg",
741       "//ui/gfx/geometry",
742       "//ui/gfx:test_support",
743     ]
744   }