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