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