Disable NavigateRemoteFrameToBlankAndDataURLs on Windows.
[chromium-blink-merge.git] / media / BUILD.gn
bloba19ec54949804258bbff67319cadc917ac39cab2
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 = [ "MEDIA_IMPLEMENTATION" ]
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   }
35   if (use_alsa) {
36     defines += [ "USE_ALSA" ]
37   }
40 config("media_dependent_config") {
41   defines = []
42   if (!media_use_libvpx) {
43     defines += [ "MEDIA_DISABLE_LIBVPX" ]
44   }
45   if (!media_use_ffmpeg) {
46     defines += [ "MEDIA_DISABLE_FFMPEG" ]
47   }
48   if (is_win) {
49     ldflags = [
50       "/DELAYLOAD:mf.dll",
51       "/DELAYLOAD:mfplat.dll",
52       "/DELAYLOAD:mfreadwrite.dll",
53     ]
54   }
57 if (use_ozone) {
58   action("generate_ozone_constructor_list") {
59     # Ozone platform objects are auto-generated using similar
60     # patterns for naming and classes constructors. Here we build the
61     # object MediaOzonePlatform.
62     script = "../ui/ozone/generate_constructor_list.py"
64     platform_list_txt_file = "$target_gen_dir/../ui/ozone/platform_list.txt"
65     constructor_list_cc_file =
66         "$target_gen_dir/../media/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   }
84 component("media") {
85   sources = [
86     "cdm/aes_decryptor.cc",
87     "cdm/aes_decryptor.h",
88     "cdm/cenc_utils.cc",
89     "cdm/cenc_utils.h",
90     "cdm/default_cdm_factory.cc",
91     "cdm/default_cdm_factory.h",
92     "cdm/json_web_key.cc",
93     "cdm/json_web_key.h",
94     "cdm/key_system_names.cc",
95     "cdm/key_system_names.h",
96     "cdm/player_tracker_impl.cc",
97     "cdm/player_tracker_impl.h",
98     "cdm/proxy_decryptor.cc",
99     "cdm/proxy_decyrptor.h",
100     "ffmpeg/ffmpeg_deleters.h",
101     "filters/audio_clock.cc",
102     "filters/audio_clock.h",
103     "filters/audio_renderer_algorithm.cc",
104     "filters/audio_renderer_algorithm.h",
105     "filters/chunk_demuxer.cc",
106     "filters/chunk_demuxer.h",
107     "filters/context_3d.h",
108     "filters/decoder_selector.cc",
109     "filters/decoder_selector.h",
110     "filters/decoder_stream.cc",
111     "filters/decoder_stream.h",
112     "filters/decoder_stream_traits.cc",
113     "filters/decoder_stream_traits.h",
114     "filters/decrypting_audio_decoder.cc",
115     "filters/decrypting_audio_decoder.h",
116     "filters/decrypting_demuxer_stream.cc",
117     "filters/decrypting_demuxer_stream.h",
118     "filters/decrypting_video_decoder.cc",
119     "filters/decrypting_video_decoder.h",
120     "filters/default_media_permission.cc",
121     "filters/default_media_permission.h",
122     "filters/file_data_source.cc",
123     "filters/file_data_source.h",
124     "filters/frame_processor.cc",
125     "filters/frame_processor.h",
126     "filters/h264_bit_reader.cc",
127     "filters/h264_bit_reader.h",
128     "filters/h264_parser.cc",
129     "filters/h264_parser.h",
130     "filters/jpeg_parser.cc",
131     "filters/jpeg_parser.h",
132     "filters/source_buffer_platform.cc",
133     "filters/source_buffer_platform.h",
134     "filters/source_buffer_range.cc",
135     "filters/source_buffer_range.h",
136     "filters/source_buffer_stream.cc",
137     "filters/source_buffer_stream.h",
138     "filters/stream_parser_factory.cc",
139     "filters/stream_parser_factory.h",
140     "filters/video_frame_scheduler.h",
141     "filters/video_frame_scheduler_impl.cc",
142     "filters/video_frame_scheduler_impl.h",
143     "filters/video_frame_scheduler_proxy.cc",
144     "filters/video_frame_scheduler_proxy.h",
145     "filters/vp8_bool_decoder.cc",
146     "filters/vp8_bool_decoder.h",
147     "filters/vp8_parser.cc",
148     "filters/vp8_parser.h",
149     "filters/webvtt_util.h",
150     "filters/wsola_internals.cc",
151     "filters/wsola_internals.h",
152     "formats/common/offset_byte_queue.cc",
153     "formats/common/offset_byte_queue.h",
154     "formats/webm/webm_audio_client.cc",
155     "formats/webm/webm_audio_client.h",
156     "formats/webm/webm_cluster_parser.cc",
157     "formats/webm/webm_cluster_parser.h",
158     "formats/webm/webm_constants.cc",
159     "formats/webm/webm_constants.h",
160     "formats/webm/webm_content_encodings.cc",
161     "formats/webm/webm_content_encodings.h",
162     "formats/webm/webm_content_encodings_client.cc",
163     "formats/webm/webm_content_encodings_client.h",
164     "formats/webm/webm_crypto_helpers.cc",
165     "formats/webm/webm_crypto_helpers.h",
166     "formats/webm/webm_info_parser.cc",
167     "formats/webm/webm_info_parser.h",
168     "formats/webm/webm_parser.cc",
169     "formats/webm/webm_parser.h",
170     "formats/webm/webm_stream_parser.cc",
171     "formats/webm/webm_stream_parser.h",
172     "formats/webm/webm_tracks_parser.cc",
173     "formats/webm/webm_tracks_parser.h",
174     "formats/webm/webm_video_client.cc",
175     "formats/webm/webm_video_client.h",
176     "formats/webm/webm_webvtt_parser.cc",
177     "formats/webm/webm_webvtt_parser.h",
178     "midi/midi_manager.cc",
179     "midi/midi_manager.h",
180     "midi/midi_manager_mac.cc",
181     "midi/midi_manager_mac.h",
182     "midi/midi_manager_usb.cc",
183     "midi/midi_manager_usb.h",
184     "midi/midi_manager_win.cc",
185     "midi/midi_manager_win.h",
186     "midi/midi_message_queue.cc",
187     "midi/midi_message_queue.h",
188     "midi/midi_message_util.cc",
189     "midi/midi_message_util.h",
190     "midi/midi_port_info.cc",
191     "midi/midi_port_info.h",
192     "midi/usb_midi_descriptor_parser.cc",
193     "midi/usb_midi_descriptor_parser.h",
194     "midi/usb_midi_device.h",
195     "midi/usb_midi_input_stream.cc",
196     "midi/usb_midi_input_stream.h",
197     "midi/usb_midi_jack.h",
198     "midi/usb_midi_output_stream.cc",
199     "midi/usb_midi_output_stream.h",
200     "renderers/audio_renderer_impl.cc",
201     "renderers/audio_renderer_impl.h",
202     "renderers/gpu_video_accelerator_factories.cc",
203     "renderers/gpu_video_accelerator_factories.h",
204     "renderers/renderer_impl.cc",
205     "renderers/renderer_impl.h",
206     "renderers/video_renderer_impl.cc",
207     "renderers/video_renderer_impl.h",
208     "video/capture/file_video_capture_device.cc",
209     "video/capture/file_video_capture_device.h",
210     "video/capture/linux/video_capture_device_chromeos.cc",
211     "video/capture/linux/video_capture_device_chromeos.h",
212     "video/capture/linux/video_capture_device_linux.cc",
213     "video/capture/linux/video_capture_device_linux.h",
214     "video/capture/mac/platform_video_capturing_mac.h",
215     "video/capture/mac/video_capture_device_avfoundation_mac.h",
216     "video/capture/mac/video_capture_device_avfoundation_mac.mm",
217     "video/capture/mac/video_capture_device_decklink_mac.h",
218     "video/capture/mac/video_capture_device_decklink_mac.mm",
219     "video/capture/mac/video_capture_device_factory_mac.h",
220     "video/capture/mac/video_capture_device_factory_mac.mm",
221     "video/capture/mac/video_capture_device_mac.h",
222     "video/capture/mac/video_capture_device_mac.mm",
223     "video/capture/mac/video_capture_device_qtkit_mac.h",
224     "video/capture/mac/video_capture_device_qtkit_mac.mm",
225     "video/capture/video_capture_device.cc",
226     "video/capture/video_capture_device.h",
227     "video/capture/video_capture_device_info.cc",
228     "video/capture/video_capture_device_info.h",
229     "video/capture/win/capability_list_win.cc",
230     "video/capture/win/capability_list_win.h",
231     "video/capture/win/filter_base_win.cc",
232     "video/capture/win/filter_base_win.h",
233     "video/capture/win/pin_base_win.cc",
234     "video/capture/win/pin_base_win.h",
235     "video/capture/win/sink_filter_observer_win.h",
236     "video/capture/win/sink_filter_win.cc",
237     "video/capture/win/sink_filter_win.h",
238     "video/capture/win/sink_input_pin_win.cc",
239     "video/capture/win/sink_input_pin_win.h",
240     "video/capture/win/video_capture_device_factory_win.cc",
241     "video/capture/win/video_capture_device_factory_win.h",
242     "video/capture/win/video_capture_device_mf_win.cc",
243     "video/capture/win/video_capture_device_mf_win.h",
244     "video/capture/win/video_capture_device_win.cc",
245     "video/capture/win/video_capture_device_win.h",
246     "video/fake_video_encode_accelerator.cc",
247     "video/fake_video_encode_accelerator.h",
248     "video/h264_poc.cc",
249     "video/h264_poc.h",
250     "video/picture.cc",
251     "video/picture.h",
252     "video/video_decode_accelerator.cc",
253     "video/video_decode_accelerator.h",
254     "video/video_encode_accelerator.cc",
255     "video/video_encode_accelerator.h",
256   ]
258   configs += [
259     ":media_config",
261     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
262     # See http://crbug.com/171009
263     "//build/config/compiler:no_size_t_to_int_warning",
264   ]
265   all_dependent_configs = [ ":media_dependent_config" ]
267   cflags = []
268   libs = []
269   defines = []
270   deps = []
272   include_dirs = [ "." ]
273   if (media_use_ffmpeg) {
274     deps += [ "//third_party/ffmpeg" ]
275     sources += [
276       "ffmpeg/ffmpeg_common.cc",
277       "ffmpeg/ffmpeg_common.h",
278       "filters/audio_file_reader.cc",
279       "filters/audio_file_reader.h",
280       "filters/blocking_url_protocol.cc",
281       "filters/blocking_url_protocol.h",
282       "filters/ffmpeg_audio_decoder.cc",
283       "filters/ffmpeg_audio_decoder.h",
284       "filters/ffmpeg_bitstream_converter.h",
285       "filters/ffmpeg_demuxer.cc",
286       "filters/ffmpeg_demuxer.h",
287       "filters/ffmpeg_glue.cc",
288       "filters/ffmpeg_glue.h",
289       "filters/ffmpeg_video_decoder.cc",
290       "filters/ffmpeg_video_decoder.h",
291       "filters/in_memory_url_protocol.cc",
292       "filters/in_memory_url_protocol.h",
293     ]
294     if (proprietary_codecs) {
295       sources += [
296         "filters/ffmpeg_aac_bitstream_converter.cc",
297         "filters/ffmpeg_aac_bitstream_converter.h",
298         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
299         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
300       ]
301     }
302   }
304   if (current_cpu == "arm" && arm_use_neon) {
305     defines += [ "USE_NEON" ]
306   }
308   if (media_use_libvpx) {
309     sources += [
310       "filters/vpx_video_decoder.cc",
311       "filters/vpx_video_decoder.h",
312     ]
313     deps += [ "//third_party/libvpx" ]
314   }
316   if (!is_android) {
317     sources += [
318       "filters/opus_audio_decoder.cc",
319       "filters/opus_audio_decoder.h",
320     ]
321     if (!is_ensemble) {
322       sources += [
323         "renderers/default_renderer_factory.cc",
324         "renderers/default_renderer_factory.h",
325       ]
326     }
327   } else {
328     sources += [
329       "midi/midi_manager_android.cc",
330       "midi/usb_midi_device_android.cc",
331       "midi/usb_midi_device_android.h",
332       "midi/usb_midi_device_factory_android.cc",
333       "midi/usb_midi_device_factory_android.h",
334       "video/capture/android/video_capture_device_android.cc",
335       "video/capture/android/video_capture_device_android.h",
336       "video/capture/android/video_capture_device_factory_android.cc",
337       "video/capture/android/video_capture_device_factory_android.h",
338     ]
339     deps += [
340       "//media/base/android",
341       "//media/base/android:media_jni_headers",
342       "//media/base/android:video_capture_jni_headers",
343     ]
344     if (!is_android_webview_build) {
345       deps += [ "//media/base/android:media_java" ]
346     }
347   }
349   if (current_cpu != "arm" && is_chromeos) {
350     sources += [
351       "filters/h264_bitstream_buffer.cc",
352       "filters/h264_bitstream_buffer.h",
353     ]
354   }
356   if (use_alsa) {
357     libs += [ "asound" ]
358     sources += [
359       "midi/midi_manager_alsa.cc",
360       "midi/midi_manager_alsa.h",
361     ]
362   }
364   if (use_udev) {
365     deps += [ "//device/udev_linux" ]
366   }
368   # A simple WebM encoder for animated avatars on ChromeOS.
370   if (use_ozone) {
371     # Used for the generated listing header (ui/ozone/platform_list.h)
372     include_dirs += [ target_gen_dir ]
374     sources += [
375                  "ozone/media_ozone_platform.cc",
376                  "ozone/media_ozone_platform.h",
377                ] + get_target_outputs(":generate_ozone_constructor_list")
379     deps += [
380       ":generate_ozone_constructor_list",
381       "//ui/ozone",
382     ]
383   }
385   if (is_mac) {
386     deps += [
387       "//media/base/mac",
388       "//third_party/decklink",
389     ]
390     libs += [
391       "CoreMIDI.framework",
392       "CoreVideo.framework",
393       "OpenGL.framework",
394       "QTKit.framework",
395     ]
396   }
398   if (is_ios) {
399     deps += [ "//media/base/mac" ]
400   }
402   if (is_win) {
403     libs += [
404       "mf.lib",
405       "mfplat.lib",
406       "mfreadwrite.lib",
407       "mfuuid.lib",
408     ]
409   }
411   if (proprietary_codecs) {
412     sources += [
413       "filters/h264_to_annex_b_bitstream_converter.cc",
414       "filters/h264_to_annex_b_bitstream_converter.h",
415       "formats/mp2t/es_adapter_video.cc",
416       "formats/mp2t/es_adapter_video.h",
417       "formats/mp2t/es_parser.cc",
418       "formats/mp2t/es_parser.h",
419       "formats/mp2t/es_parser_adts.cc",
420       "formats/mp2t/es_parser_adts.h",
421       "formats/mp2t/es_parser_h264.cc",
422       "formats/mp2t/es_parser_h264.h",
423       "formats/mp2t/es_parser_mpeg1audio.cc",
424       "formats/mp2t/es_parser_mpeg1audio.h",
425       "formats/mp2t/mp2t_common.h",
426       "formats/mp2t/mp2t_stream_parser.cc",
427       "formats/mp2t/mp2t_stream_parser.h",
428       "formats/mp2t/timestamp_unroller.cc",
429       "formats/mp2t/timestamp_unroller.h",
430       "formats/mp2t/ts_packet.cc",
431       "formats/mp2t/ts_packet.h",
432       "formats/mp2t/ts_section.h",
433       "formats/mp2t/ts_section_pat.cc",
434       "formats/mp2t/ts_section_pat.h",
435       "formats/mp2t/ts_section_pes.cc",
436       "formats/mp2t/ts_section_pes.h",
437       "formats/mp2t/ts_section_pmt.cc",
438       "formats/mp2t/ts_section_pmt.h",
439       "formats/mp2t/ts_section_psi.cc",
440       "formats/mp2t/ts_section_psi.h",
441       "formats/mp4/aac.cc",
442       "formats/mp4/aac.h",
443       "formats/mp4/avc.cc",
444       "formats/mp4/avc.h",
445       "formats/mp4/box_definitions.cc",
446       "formats/mp4/box_definitions.h",
447       "formats/mp4/box_reader.cc",
448       "formats/mp4/box_reader.h",
449       "formats/mp4/cenc.cc",
450       "formats/mp4/cenc.h",
451       "formats/mp4/es_descriptor.cc",
452       "formats/mp4/es_descriptor.h",
453       "formats/mp4/mp4_stream_parser.cc",
454       "formats/mp4/mp4_stream_parser.h",
455       "formats/mp4/sample_to_group_iterator.cc",
456       "formats/mp4/sample_to_group_iterator.h",
457       "formats/mp4/track_run_iterator.cc",
458       "formats/mp4/track_run_iterator.h",
459       "formats/mpeg/adts_constants.cc",
460       "formats/mpeg/adts_constants.h",
461       "formats/mpeg/adts_stream_parser.cc",
462       "formats/mpeg/adts_stream_parser.h",
463       "formats/mpeg/mpeg1_audio_stream_parser.cc",
464       "formats/mpeg/mpeg1_audio_stream_parser.h",
465       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
466       "formats/mpeg/mpeg_audio_stream_parser_base.h",
467     ]
468   }
470   public_deps = [
471     "//media/base",
472     "//media/audio",
473   ]
475   deps += [
476     ":shared_memory_support",
477     "//base",
478     "//base:i18n",
479     "//base/third_party/dynamic_annotations",
480     "//crypto",
481     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
482     "//gpu/command_buffer/common",
483     "//third_party/libyuv",
484     "//third_party/opus",
485     "//ui/gfx/geometry",
486     "//url",
487   ]
489   # Add the sources and dependencies that need X11, font, or graphics
490   # libraries.
491   if (!is_ensemble) {
492     sources += [
493       "blink/skcanvas_video_renderer.cc",
494       "blink/skcanvas_video_renderer.h",
495       "filters/gpu_video_decoder.cc",
496       "filters/gpu_video_decoder.h",
497       "video/capture/fake_video_capture_device.cc",
498       "video/capture/fake_video_capture_device.h",
499       "video/capture/fake_video_capture_device_factory.cc",
500       "video/capture/fake_video_capture_device_factory.h",
501       "video/capture/file_video_capture_device_factory.cc",
502       "video/capture/file_video_capture_device_factory.h",
503       "video/capture/linux/video_capture_device_factory_linux.cc",
504       "video/capture/linux/video_capture_device_factory_linux.h",
505       "video/capture/video_capture_device_factory.cc",
506       "video/capture/video_capture_device_factory.h",
507     ]
509     deps += [
510       "//skia",
511       "//ui/events:events_base",
512       "//ui/gfx",
513     ]
514   }
517 # Minimal media component for media/cast on iOS.
518 if (is_ios) {
519   component("media_for_cast_ios") {
520     configs += [ ":media_config" ]
521     all_dependent_configs = [ ":media_dependent_config" ]
522     include_dirs = [ "." ]
523     libs = [ "CoreVideo.framework" ]
525     deps = [
526       ":shared_memory_support",
527       "//base",
528       "//media/base:base_for_cast_ios",
529       "//media/base/mac",
530       "//ui/gfx/geometry",
531     ]
532   }
535 test("media_unittests") {
536   sources = [
537     "blink/skcanvas_video_renderer_unittest.cc",
538     "cdm/aes_decryptor_unittest.cc",
539     "cdm/cenc_utils_unittest.cc",
540     "cdm/json_web_key_unittest.cc",
541     "filters/audio_clock_unittest.cc",
542     "filters/audio_decoder_selector_unittest.cc",
543     "filters/audio_renderer_algorithm_unittest.cc",
544     "filters/chunk_demuxer_unittest.cc",
545     "filters/decrypting_audio_decoder_unittest.cc",
546     "filters/decrypting_demuxer_stream_unittest.cc",
547     "filters/decrypting_video_decoder_unittest.cc",
548     "filters/fake_demuxer_stream.cc",
549     "filters/fake_demuxer_stream.h",
550     "filters/fake_demuxer_stream_unittest.cc",
551     "filters/fake_video_decoder.cc",
552     "filters/fake_video_decoder.h",
553     "filters/fake_video_decoder_unittest.cc",
554     "filters/file_data_source_unittest.cc",
555     "filters/frame_processor_unittest.cc",
556     "filters/h264_bit_reader_unittest.cc",
557     "filters/h264_parser_unittest.cc",
558     "filters/jpeg_parser_unittest.cc",
559     "filters/source_buffer_stream_unittest.cc",
560     "filters/video_decoder_selector_unittest.cc",
561     "filters/video_frame_scheduler_impl_unittest.cc",
562     "filters/video_frame_scheduler_unittest.cc",
563     "filters/video_frame_stream_unittest.cc",
564     "filters/vp8_bool_decoder_unittest.cc",
565     "filters/vp8_parser_unittest.cc",
566     "formats/common/offset_byte_queue_unittest.cc",
567     "formats/webm/cluster_builder.cc",
568     "formats/webm/cluster_builder.h",
569     "formats/webm/opus_packet_builder.cc",
570     "formats/webm/opus_packet_builder.h",
571     "formats/webm/tracks_builder.cc",
572     "formats/webm/tracks_builder.h",
573     "formats/webm/webm_cluster_parser_unittest.cc",
574     "formats/webm/webm_content_encodings_client_unittest.cc",
575     "formats/webm/webm_parser_unittest.cc",
576     "formats/webm/webm_tracks_parser_unittest.cc",
577     "formats/webm/webm_webvtt_parser_unittest.cc",
578     "midi/midi_manager_unittest.cc",
579     "midi/midi_manager_usb_unittest.cc",
580     "midi/midi_message_queue_unittest.cc",
581     "midi/midi_message_util_unittest.cc",
582     "midi/usb_midi_descriptor_parser_unittest.cc",
583     "midi/usb_midi_input_stream_unittest.cc",
584     "midi/usb_midi_output_stream_unittest.cc",
585     "renderers/audio_renderer_impl_unittest.cc",
586     "renderers/renderer_impl_unittest.cc",
587     "renderers/video_renderer_impl_unittest.cc",
588     "video/capture/fake_video_capture_device_unittest.cc",
589     "video/capture/video_capture_device_unittest.cc",
590     "video/h264_poc_unittest.cc",
591   ]
593   # TODO(wolenetz): Fix size_t to int trunctaion in win64.
594   # See http://crbug.com/171009
595   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
597   deps = [
598     ":media",
599     ":test_support",
600     "//base/allocator",
601     "//base/test:test_support",
602     "//media/audio:unittests",
603     "//media/audio:test_support",
604     "//media/base:unittests",
605     "//media/base:test_support",
606     "//media/test:pipeline_integration_tests",
607     "//skia",  # Direct dependency required to inherit config.
608     "//testing/gmock",
609     "//testing/gtest",
610     "//third_party/widevine/cdm:version_h",
611     "//ui/gfx:test_support",
612     "//url",
613   ]
615   if (is_android) {
616     deps += [
617       "//media/base/android",
618       # TODO(GYP)
619       #"//testing/android:native_test_native_code"
620     ]
621   }
623   if (media_use_ffmpeg) {
624     sources += [
625       "ffmpeg/ffmpeg_common_unittest.cc",
626       "filters/audio_decoder_unittest.cc",
627       "filters/audio_file_reader_unittest.cc",
628       "filters/blocking_url_protocol_unittest.cc",
629       "filters/ffmpeg_demuxer_unittest.cc",
630       "filters/ffmpeg_glue_unittest.cc",
631       "filters/ffmpeg_video_decoder_unittest.cc",
632       "filters/in_memory_url_protocol_unittest.cc",
633     ]
634   }
636   if (current_cpu != "arm" && is_chromeos) {
637     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
638   }
640   if (proprietary_codecs) {
641     sources += [
642       "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
643       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
644       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
645       "formats/common/stream_parser_test_base.cc",
646       "formats/common/stream_parser_test_base.h",
647       "formats/mp2t/es_adapter_video_unittest.cc",
648       "formats/mp2t/es_parser_adts_unittest.cc",
649       "formats/mp2t/es_parser_h264_unittest.cc",
650       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
651       "formats/mp2t/es_parser_test_base.cc",
652       "formats/mp2t/es_parser_test_base.h",
653       "formats/mp2t/mp2t_stream_parser_unittest.cc",
654       "formats/mp2t/timestamp_unroller_unittest.cc",
655       "formats/mp4/aac_unittest.cc",
656       "formats/mp4/avc_unittest.cc",
657       "formats/mp4/box_reader_unittest.cc",
658       "formats/mp4/es_descriptor_unittest.cc",
659       "formats/mp4/mp4_stream_parser_unittest.cc",
660       "formats/mp4/sample_to_group_iterator_unittest.cc",
661       "formats/mp4/track_run_iterator_unittest.cc",
662       "formats/mpeg/adts_stream_parser_unittest.cc",
663       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
664     ]
665   }
667   if (is_mac || is_ios) {
668     deps += [ "//media/base/mac" ]
669   }
671   if (is_mac) {
672     sources += [
673       "midi/midi_manager_mac_unittest.cc",
674       "video/capture/mac/video_capture_device_factory_mac_unittest.mm",
675     ]
676   }
678   if (use_alsa) {
679     sources += [ "midi/midi_manager_alsa_unittest.cc" ]
680   }
682   #      include_dirs += [
683   #        # Needed by media_drm_bridge.cc.
684   #        target_gen_dir,
685   #      ],
687   configs += [ ":media_config" ]
689   if (media_use_ffmpeg) {
690     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
691   }
694 test("media_perftests") {
695   configs += [ ":media_config" ]
696   deps = [
697     ":media",
698     ":shared_memory_support",
699     ":test_support",
700     "//base/test:test_support",
701     "//media/audio:test_support",
702     "//media/base:perftests",
703     "//media/base:test_support",
704     "//media/test:pipeline_integration_perftests",
705     "//testing/gmock",
706     "//testing/gtest",
707     "//testing/perf",
708     "//third_party/widevine/cdm:version_h",
709     "//ui/gfx:test_support",
710   ]
711   if (is_android) {
712     deps += [ "//ui/gl" ]
713   }
714   if (media_use_ffmpeg) {
715     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
716   }
719 source_set("test_support") {
720   testonly = true
721   sources = [
722     "filters/clockless_video_frame_scheduler.cc",
723     "filters/clockless_video_frame_scheduler.h",
724     "filters/test_video_frame_scheduler.cc",
725     "filters/test_video_frame_scheduler.h",
726     "renderers/mock_gpu_video_accelerator_factories.cc",
727     "renderers/mock_gpu_video_accelerator_factories.h",
728     "video/mock_video_decode_accelerator.cc",
729     "video/mock_video_decode_accelerator.h",
730   ]
731   deps = [
732     ":media",
733     ":shared_memory_support",
734     "//base",
735     "//skia",
736     "//testing/gmock",
737     "//testing/gtest",
738   ]
741 # TODO(dalecurtis): How to split this across audio/base directories??
742 component("shared_memory_support") {
743   sources = [
744     "audio/audio_parameters.cc",
745     "audio/audio_parameters.h",
746     "base/audio_bus.cc",
747     "base/audio_bus.h",
748     "base/channel_layout.cc",
749     "base/channel_layout.h",
750     "base/limits.h",
751     "base/media_export.h",
752     "base/vector_math.cc",
753     "base/vector_math.h",
754   ]
755   configs += [ ":media_config" ]
756   defines = [ "MEDIA_IMPLEMENTATION" ]
757   deps = [
758     "//base",
759   ]
762 if (media_use_ffmpeg) {
763   test("ffmpeg_regression_tests") {
764     sources = [
765       "base/run_all_unittests.cc",
766       "ffmpeg/ffmpeg_regression_tests.cc",
767     ]
769     configs += [ "//media:media_config" ]
771     deps = [
772       "//base/test:test_support",
773       "//media",
774       "//media:test_support",
775       "//media/audio:test_support",
776       "//media/base:test_support",
777       "//media/test:pipeline_integration_tests",
778       "//testing/gmock",
779       "//testing/gtest",
780       "//third_party/ffmpeg",
781       "//ui/gfx/geometry",
782       "//ui/gfx:test_support",
783     ]
784   }
787 if (use_x11) {
788   executable("player_x11") {
789     sources = [
790       "tools/player_x11/data_source_logger.cc",
791       "tools/player_x11/data_source_logger.h",
792       "tools/player_x11/gl_video_renderer.cc",
793       "tools/player_x11/gl_video_renderer.h",
794       "tools/player_x11/player_x11.cc",
795       "tools/player_x11/x11_video_renderer.cc",
796       "tools/player_x11/x11_video_renderer.h",
797     ]
798     configs += [
799       ":media_config",
800       "//build/config/linux:x11",
801       "//build/config/linux:xext",
803       # TODO(ajwong): Why does xext get a separate thing in //build/config/linux:BUILD.gn
804       #  "//build/config/linux:xrender",
805     ]
806     deps = [
807       ":media",
808       ":shared_memory_support",
809       "//base",
810       "//ui/gl",
811       "//ui/gfx",
812       "//ui/gfx/geometry",
813     ]
814   }