Check for a valid native pointer in AppBannerManager::onAppDetailsRetrieved.
[chromium-blink-merge.git] / media / BUILD.gn
blobaf3028d9bad7920fced4d36b003255b08dc18b61
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_decryptor.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/ivf_parser.cc",
204     "filters/ivf_parser.h",
205     "filters/jpeg_parser.cc",
206     "filters/jpeg_parser.h",
207     "filters/source_buffer_platform.cc",
208     "filters/source_buffer_platform.h",
209     "filters/source_buffer_range.cc",
210     "filters/source_buffer_range.h",
211     "filters/source_buffer_stream.cc",
212     "filters/source_buffer_stream.h",
213     "filters/stream_parser_factory.cc",
214     "filters/stream_parser_factory.h",
215     "filters/video_cadence_estimator.cc",
216     "filters/video_cadence_estimator.h",
217     "filters/video_renderer_algorithm.cc",
218     "filters/video_renderer_algorithm.h",
219     "filters/vp8_bool_decoder.cc",
220     "filters/vp8_bool_decoder.h",
221     "filters/vp8_parser.cc",
222     "filters/vp8_parser.h",
223     "filters/vp9_parser.cc",
224     "filters/vp9_parser.h",
225     "filters/vp9_raw_bits_reader.cc",
226     "filters/vp9_raw_bits_reader.h",
227     "filters/webvtt_util.h",
228     "filters/wsola_internals.cc",
229     "filters/wsola_internals.h",
230     "formats/common/offset_byte_queue.cc",
231     "formats/common/offset_byte_queue.h",
232     "formats/webm/webm_audio_client.cc",
233     "formats/webm/webm_audio_client.h",
234     "formats/webm/webm_cluster_parser.cc",
235     "formats/webm/webm_cluster_parser.h",
236     "formats/webm/webm_constants.cc",
237     "formats/webm/webm_constants.h",
238     "formats/webm/webm_content_encodings.cc",
239     "formats/webm/webm_content_encodings.h",
240     "formats/webm/webm_content_encodings_client.cc",
241     "formats/webm/webm_content_encodings_client.h",
242     "formats/webm/webm_crypto_helpers.cc",
243     "formats/webm/webm_crypto_helpers.h",
244     "formats/webm/webm_info_parser.cc",
245     "formats/webm/webm_info_parser.h",
246     "formats/webm/webm_parser.cc",
247     "formats/webm/webm_parser.h",
248     "formats/webm/webm_stream_parser.cc",
249     "formats/webm/webm_stream_parser.h",
250     "formats/webm/webm_tracks_parser.cc",
251     "formats/webm/webm_tracks_parser.h",
252     "formats/webm/webm_video_client.cc",
253     "formats/webm/webm_video_client.h",
254     "formats/webm/webm_webvtt_parser.cc",
255     "formats/webm/webm_webvtt_parser.h",
256     "renderers/audio_renderer_impl.cc",
257     "renderers/audio_renderer_impl.h",
258     "renderers/default_renderer_factory.cc",
259     "renderers/default_renderer_factory.h",
260     "renderers/gpu_video_accelerator_factories.h",
261     "renderers/renderer_impl.cc",
262     "renderers/renderer_impl.h",
263     "renderers/video_renderer_impl.cc",
264     "renderers/video_renderer_impl.h",
265     "video/fake_video_encode_accelerator.cc",
266     "video/fake_video_encode_accelerator.h",
267     "video/gpu_memory_buffer_video_frame_pool.cc",
268     "video/gpu_memory_buffer_video_frame_pool.h",
269     "video/h264_poc.cc",
270     "video/h264_poc.h",
271     "video/jpeg_decode_accelerator.cc",
272     "video/jpeg_decode_accelerator.h",
273     "video/picture.cc",
274     "video/picture.h",
275     "video/video_decode_accelerator.cc",
276     "video/video_decode_accelerator.h",
277     "video/video_encode_accelerator.cc",
278     "video/video_encode_accelerator.h",
279   ]
281   configs += [
282     ":media_config",
283     ":media_implementation",
284     "//build/config:precompiled_headers",
286     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
287     # See http://crbug.com/171009
288     "//build/config/compiler:no_size_t_to_int_warning",
289   ]
290   all_dependent_configs = [ ":media_dependent_config" ]
292   allow_circular_includes_from = []
293   cflags = []
294   libs = []
295   defines = []
296   deps = []
298   include_dirs = [ "." ]
299   if (media_use_ffmpeg) {
300     deps += [ "//third_party/ffmpeg" ]
301     sources += [
302       "ffmpeg/ffmpeg_common.cc",
303       "ffmpeg/ffmpeg_common.h",
304       "filters/audio_file_reader.cc",
305       "filters/audio_file_reader.h",
306       "filters/blocking_url_protocol.cc",
307       "filters/blocking_url_protocol.h",
308       "filters/ffmpeg_audio_decoder.cc",
309       "filters/ffmpeg_audio_decoder.h",
310       "filters/ffmpeg_bitstream_converter.h",
311       "filters/ffmpeg_demuxer.cc",
312       "filters/ffmpeg_demuxer.h",
313       "filters/ffmpeg_glue.cc",
314       "filters/ffmpeg_glue.h",
315       "filters/ffmpeg_video_decoder.cc",
316       "filters/ffmpeg_video_decoder.h",
317       "filters/in_memory_url_protocol.cc",
318       "filters/in_memory_url_protocol.h",
319     ]
320     if (proprietary_codecs) {
321       sources += [
322         "filters/ffmpeg_aac_bitstream_converter.cc",
323         "filters/ffmpeg_aac_bitstream_converter.h",
324         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
325         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
326       ]
327     }
328   }
330   if (current_cpu == "arm" && arm_use_neon) {
331     defines += [ "USE_NEON" ]
332   }
334   if (media_use_libvpx) {
335     sources += [
336       "filters/vpx_video_decoder.cc",
337       "filters/vpx_video_decoder.h",
338     ]
339     deps += [ "//third_party/libvpx" ]
340   }
342   if (media_use_libwebm) {
343     sources += [
344       "capture/webm_muxer.cc",
345       "capture/webm_muxer.h",
346     ]
347     deps += [ "//third_party/libwebm" ]
348   }
350   if (is_android) {
351     sources += [
352       "capture/video/android/video_capture_device_android.cc",
353       "capture/video/android/video_capture_device_android.h",
354       "capture/video/android/video_capture_device_factory_android.cc",
355       "capture/video/android/video_capture_device_factory_android.h",
356     ]
357     deps += [
358       "//media/base/android",
359       "//media/base/android:media_jni_headers",
360       "//media/base/android:video_capture_jni_headers",
361     ]
362     allow_circular_includes_from = [ "//media/base/android" ]
363   } else {
364     sources += [
365       "filters/opus_audio_decoder.cc",
366       "filters/opus_audio_decoder.h",
367     ]
368   }
370   if (current_cpu != "arm" && is_chromeos) {
371     sources += [
372       "filters/h264_bitstream_buffer.cc",
373       "filters/h264_bitstream_buffer.h",
374     ]
375   }
377   # A simple WebM encoder for animated avatars on ChromeOS.
379   if (use_ozone) {
380     # Used for the generated listing header (ui/ozone/platform_list.h)
381     include_dirs += [ target_gen_dir ]
383     sources += [
384                  "ozone/media_ozone_platform.cc",
385                  "ozone/media_ozone_platform.h",
386                ] + get_target_outputs(":generate_ozone_constructor_list")
388     deps += [
389       ":generate_ozone_constructor_list",
390       "//ui/ozone",
391     ]
392   }
394   if (is_mac) {
395     deps += [
396       "//media/base/mac",
397       "//third_party/decklink",
398     ]
399     libs += [
400       "CoreVideo.framework",
401       "OpenGL.framework",
402       "QTKit.framework",
403     ]
404   }
406   if (is_openbsd) {
407     sources -= [
408       "capture/video/linux/v4l2_capture_delegate_multi_plane.cc",
409       "capture/video/linux/v4l2_capture_delegate_multi_plane.h",
410     ]
411   }
413   if (is_ios) {
414     deps += [ "//media/base/mac" ]
415   }
417   if (is_win) {
418     deps += [ "//media/base/win" ]
419     libs += [
420       "mf.lib",
421       "mfplat.lib",
422       "mfreadwrite.lib",
423       "mfuuid.lib",
424     ]
425   }
427   if (proprietary_codecs) {
428     sources += [
429       "cdm/cenc_utils.cc",
430       "cdm/cenc_utils.h",
431       "filters/h264_to_annex_b_bitstream_converter.cc",
432       "filters/h264_to_annex_b_bitstream_converter.h",
433       "formats/mp2t/es_adapter_video.cc",
434       "formats/mp2t/es_adapter_video.h",
435       "formats/mp2t/es_parser.cc",
436       "formats/mp2t/es_parser.h",
437       "formats/mp2t/es_parser_adts.cc",
438       "formats/mp2t/es_parser_adts.h",
439       "formats/mp2t/es_parser_h264.cc",
440       "formats/mp2t/es_parser_h264.h",
441       "formats/mp2t/es_parser_mpeg1audio.cc",
442       "formats/mp2t/es_parser_mpeg1audio.h",
443       "formats/mp2t/mp2t_common.h",
444       "formats/mp2t/mp2t_stream_parser.cc",
445       "formats/mp2t/mp2t_stream_parser.h",
446       "formats/mp2t/timestamp_unroller.cc",
447       "formats/mp2t/timestamp_unroller.h",
448       "formats/mp2t/ts_packet.cc",
449       "formats/mp2t/ts_packet.h",
450       "formats/mp2t/ts_section.h",
451       "formats/mp2t/ts_section_pat.cc",
452       "formats/mp2t/ts_section_pat.h",
453       "formats/mp2t/ts_section_pes.cc",
454       "formats/mp2t/ts_section_pes.h",
455       "formats/mp2t/ts_section_pmt.cc",
456       "formats/mp2t/ts_section_pmt.h",
457       "formats/mp2t/ts_section_psi.cc",
458       "formats/mp2t/ts_section_psi.h",
459       "formats/mp4/aac.cc",
460       "formats/mp4/aac.h",
461       "formats/mp4/avc.cc",
462       "formats/mp4/avc.h",
463       "formats/mp4/box_definitions.cc",
464       "formats/mp4/box_definitions.h",
465       "formats/mp4/box_reader.cc",
466       "formats/mp4/box_reader.h",
467       "formats/mp4/cenc.cc",
468       "formats/mp4/cenc.h",
469       "formats/mp4/es_descriptor.cc",
470       "formats/mp4/es_descriptor.h",
471       "formats/mp4/mp4_stream_parser.cc",
472       "formats/mp4/mp4_stream_parser.h",
473       "formats/mp4/sample_to_group_iterator.cc",
474       "formats/mp4/sample_to_group_iterator.h",
475       "formats/mp4/track_run_iterator.cc",
476       "formats/mp4/track_run_iterator.h",
477       "formats/mpeg/adts_constants.cc",
478       "formats/mpeg/adts_constants.h",
479       "formats/mpeg/adts_stream_parser.cc",
480       "formats/mpeg/adts_stream_parser.h",
481       "formats/mpeg/mpeg1_audio_stream_parser.cc",
482       "formats/mpeg/mpeg1_audio_stream_parser.h",
483       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
484       "formats/mpeg/mpeg_audio_stream_parser_base.h",
485     ]
486   }
488   public_deps = [
489     "//media/base",
490     "//media/audio",
491   ]
493   deps += [
494     ":shared_memory_support",
495     "//base",
496     "//base:i18n",
497     "//base/third_party/dynamic_annotations",
498     "//crypto",
499     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
500     "//gpu/command_buffer/common",
501     "//skia",
502     "//third_party/libyuv",
503     "//third_party/opus",
504     "//ui/events:events_base",
505     "//ui/gfx",
506     "//ui/gfx/geometry",
507     "//url",
508   ]
511 # Minimal media component for media/cast on iOS.
512 if (is_ios) {
513   component("media_for_cast_ios") {
514     configs += [
515       ":media_config",
516       ":media_implementation",
517     ]
518     all_dependent_configs = [ ":media_dependent_config" ]
519     include_dirs = [ "." ]
520     libs = [ "CoreVideo.framework" ]
522     deps = [
523       ":shared_memory_support",
524       "//base",
525       "//gpu/command_buffer/common",
526       "//media/base:base_for_cast_ios",
527       "//media/base/mac",
528       "//ui/gfx/geometry",
529     ]
530   }
533 # TODO(GYP): Delete this after we've converted everything to GN.
534 # The _run targets exist only for compatibility w/ GYP.
535 group("media_unittests_run") {
536   testonly = true
537   deps = [
538     ":media_unittests",
539   ]
542 test("media_unittests") {
543   sources = [
544     "blink/skcanvas_video_renderer_unittest.cc",
545     "capture/content/animated_content_sampler_unittest.cc",
546     "capture/content/capture_resolution_chooser_unittest.cc",
547     "capture/content/feedback_signal_accumulator_unittest.cc",
548     "capture/content/smooth_event_sampler_unittest.cc",
549     "capture/content/video_capture_oracle_unittest.cc",
550     "capture/video/fake_video_capture_device_unittest.cc",
551     "capture/video/video_capture_device_unittest.cc",
552     "cdm/aes_decryptor_unittest.cc",
553     "cdm/json_web_key_unittest.cc",
554     "filters/audio_clock_unittest.cc",
555     "filters/audio_decoder_selector_unittest.cc",
556     "filters/audio_renderer_algorithm_unittest.cc",
557     "filters/chunk_demuxer_unittest.cc",
558     "filters/decrypting_audio_decoder_unittest.cc",
559     "filters/decrypting_demuxer_stream_unittest.cc",
560     "filters/decrypting_video_decoder_unittest.cc",
561     "filters/fake_video_decoder.cc",
562     "filters/fake_video_decoder.h",
563     "filters/fake_video_decoder_unittest.cc",
564     "filters/file_data_source_unittest.cc",
565     "filters/frame_processor_unittest.cc",
566     "filters/h264_bit_reader_unittest.cc",
567     "filters/h264_parser_unittest.cc",
568     "filters/ivf_parser_unittest.cc",
569     "filters/jpeg_parser_unittest.cc",
570     "filters/source_buffer_stream_unittest.cc",
571     "filters/video_cadence_estimator_unittest.cc",
572     "filters/video_decoder_selector_unittest.cc",
573     "filters/video_frame_stream_unittest.cc",
574     "filters/video_renderer_algorithm_unittest.cc",
575     "filters/vp8_bool_decoder_unittest.cc",
576     "filters/vp8_parser_unittest.cc",
577     "filters/vp9_parser_unittest.cc",
578     "filters/vp9_raw_bits_reader_unittest.cc",
579     "formats/common/offset_byte_queue_unittest.cc",
580     "formats/webm/cluster_builder.cc",
581     "formats/webm/cluster_builder.h",
582     "formats/webm/opus_packet_builder.cc",
583     "formats/webm/opus_packet_builder.h",
584     "formats/webm/tracks_builder.cc",
585     "formats/webm/tracks_builder.h",
586     "formats/webm/webm_cluster_parser_unittest.cc",
587     "formats/webm/webm_content_encodings_client_unittest.cc",
588     "formats/webm/webm_parser_unittest.cc",
589     "formats/webm/webm_tracks_parser_unittest.cc",
590     "formats/webm/webm_webvtt_parser_unittest.cc",
591     "renderers/audio_renderer_impl_unittest.cc",
592     "renderers/renderer_impl_unittest.cc",
593     "renderers/video_renderer_impl_unittest.cc",
594     "video/h264_poc_unittest.cc",
595   ]
597   data = [
598     "test/data/",
599   ]
601   # TODO(wolenetz): Fix size_t to int trunctaion in win64.
602   # See http://crbug.com/171009
603   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
605   deps = [
606     ":media",
607     ":test_support",
608     "//base/allocator",
609     "//base/test:test_support",
610     "//media/audio:unittests",
611     "//media/audio:test_support",
612     "//media/base:unittests",
613     "//media/base:test_support",
614     "//media/test:pipeline_integration_tests",
615     "//skia",  # Direct dependency required to inherit config.
616     "//testing/gmock",
617     "//testing/gtest",
618     "//third_party/widevine/cdm:version_h",
619     "//ui/gfx:test_support",
620     "//url",
621   ]
623   if (is_android) {
624     isolate_file = "media_unittests.isolate"
625     deps += [
626       "//media/base/android",
627       # TODO(GYP)
628       #"//testing/android/native_test:native_test_native_code"
629     ]
630   }
632   if (media_use_ffmpeg) {
633     sources += [
634       "ffmpeg/ffmpeg_common_unittest.cc",
635       "filters/audio_decoder_unittest.cc",
636       "filters/audio_file_reader_unittest.cc",
637       "filters/blocking_url_protocol_unittest.cc",
638       "filters/ffmpeg_demuxer_unittest.cc",
639       "filters/ffmpeg_glue_unittest.cc",
640       "filters/ffmpeg_video_decoder_unittest.cc",
641       "filters/in_memory_url_protocol_unittest.cc",
642     ]
643   }
645   if (current_cpu != "arm" && is_chromeos) {
646     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
647   }
649   if (proprietary_codecs) {
650     sources += [
651       "cdm/cenc_utils_unittest.cc",
652       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
653       "formats/common/stream_parser_test_base.cc",
654       "formats/common/stream_parser_test_base.h",
655       "formats/mp2t/es_adapter_video_unittest.cc",
656       "formats/mp2t/es_parser_adts_unittest.cc",
657       "formats/mp2t/es_parser_h264_unittest.cc",
658       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
659       "formats/mp2t/es_parser_test_base.cc",
660       "formats/mp2t/es_parser_test_base.h",
661       "formats/mp2t/mp2t_stream_parser_unittest.cc",
662       "formats/mp2t/timestamp_unroller_unittest.cc",
663       "formats/mp4/aac_unittest.cc",
664       "formats/mp4/avc_unittest.cc",
665       "formats/mp4/box_reader_unittest.cc",
666       "formats/mp4/es_descriptor_unittest.cc",
667       "formats/mp4/mp4_stream_parser_unittest.cc",
668       "formats/mp4/sample_to_group_iterator_unittest.cc",
669       "formats/mp4/track_run_iterator_unittest.cc",
670       "formats/mpeg/adts_stream_parser_unittest.cc",
671       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
672     ]
673     if (media_use_ffmpeg) {
674       sources += [
675         "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
676         "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
677       ]
678     }
679   }
681   if (is_mac || is_ios) {
682     deps += [ "//media/base/mac" ]
683   }
685   if (is_mac) {
686     sources +=
687         [ "capture/video/mac/video_capture_device_factory_mac_unittest.mm" ]
688   }
690   #      include_dirs += [
691   #        # Needed by media_drm_bridge.cc.
692   #        target_gen_dir,
693   #      ],
695   configs += [ ":media_config" ]
697   if (media_use_ffmpeg) {
698     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
699   }
702 test("media_perftests") {
703   configs += [ ":media_config" ]
704   deps = [
705     ":media",
706     ":shared_memory_support",
707     ":test_support",
708     "//base/test:test_support",
709     "//media/audio:test_support",
710     "//media/base:perftests",
711     "//media/base:test_support",
712     "//media/test:pipeline_integration_perftests",
713     "//testing/gmock",
714     "//testing/gtest",
715     "//testing/perf",
716     "//third_party/widevine/cdm:version_h",
717     "//ui/gfx:test_support",
718   ]
719   if (is_android) {
720     deps += [ "//ui/gl" ]
721     isolate_file = "media_perftests.isolate"
722   }
723   if (media_use_ffmpeg) {
724     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
725   }
728 # For running the subset of media_unittests that might require audio hardware
729 # separately on GPU bots. media_unittests includes these too.
730 test("audio_unittests") {
731   sources = [
732     "base/run_all_unittests.cc",
733   ]
734   deps = [
735     ":test_support",
736     "//base/test:test_support",
737     "//media/audio:unittests",
738     "//ui/gfx:test_support",
739   ]
742 source_set("test_support") {
743   testonly = true
744   sources = [
745     "renderers/mock_gpu_video_accelerator_factories.cc",
746     "renderers/mock_gpu_video_accelerator_factories.h",
747     "video/mock_video_decode_accelerator.cc",
748     "video/mock_video_decode_accelerator.h",
749   ]
750   deps = [
751     ":media",
752     ":shared_memory_support",
753     "//base",
754     "//skia",
755     "//testing/gmock",
756     "//testing/gtest",
757   ]
760 # TODO(dalecurtis): How to split this across audio/base directories??
761 component("shared_memory_support") {
762   sources = [
763     "audio/audio_parameters.cc",
764     "audio/audio_parameters.h",
765     "base/audio_bus.cc",
766     "base/audio_bus.h",
767     "base/channel_layout.cc",
768     "base/channel_layout.h",
769     "base/limits.h",
770     "base/media_export.h",
771     "base/vector_math.cc",
772     "base/vector_math.h",
773   ]
774   configs += [
775     ":media_config",
776     ":media_implementation",
777   ]
778   deps = [
779     "//base",
780   ]
783 if (media_use_ffmpeg) {
784   test("ffmpeg_regression_tests") {
785     sources = [
786       "base/run_all_unittests.cc",
787       "ffmpeg/ffmpeg_regression_tests.cc",
788     ]
790     configs += [ "//media:media_config" ]
792     deps = [
793       "//base/test:test_support",
794       "//media",
795       "//media:test_support",
796       "//media/audio:test_support",
797       "//media/base:test_support",
798       "//media/test:pipeline_integration_tests",
799       "//testing/gmock",
800       "//testing/gtest",
801       "//third_party/ffmpeg",
802       "//ui/gfx/geometry",
803       "//ui/gfx:test_support",
804     ]
805   }