Web MIDI API: reject sysex permissions on non-secure schemes
[chromium-blink-merge.git] / media / BUILD.gn
blobdfe9b7d1de451a82e385a51107f9da38c39f31b5
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     "blink/skcanvas_video_renderer.cc",
87     "blink/skcanvas_video_renderer.h",
88     "cdm/aes_decryptor.cc",
89     "cdm/aes_decryptor.h",
90     "cdm/cenc_utils.cc",
91     "cdm/cenc_utils.h",
92     "cdm/default_cdm_factory.cc",
93     "cdm/default_cdm_factory.h",
94     "cdm/json_web_key.cc",
95     "cdm/json_web_key.h",
96     "cdm/key_system_names.cc",
97     "cdm/key_system_names.h",
98     "cdm/player_tracker_impl.cc",
99     "cdm/player_tracker_impl.h",
100     "cdm/proxy_decryptor.cc",
101     "cdm/proxy_decyrptor.h",
102     "ffmpeg/ffmpeg_deleters.h",
103     "filters/audio_clock.cc",
104     "filters/audio_clock.h",
105     "filters/audio_renderer_algorithm.cc",
106     "filters/audio_renderer_algorithm.h",
107     "filters/chunk_demuxer.cc",
108     "filters/chunk_demuxer.h",
109     "filters/context_3d.h",
110     "filters/decoder_selector.cc",
111     "filters/decoder_selector.h",
112     "filters/decoder_stream.cc",
113     "filters/decoder_stream.h",
114     "filters/decoder_stream_traits.cc",
115     "filters/decoder_stream_traits.h",
116     "filters/decrypting_audio_decoder.cc",
117     "filters/decrypting_audio_decoder.h",
118     "filters/decrypting_demuxer_stream.cc",
119     "filters/decrypting_demuxer_stream.h",
120     "filters/decrypting_video_decoder.cc",
121     "filters/decrypting_video_decoder.h",
122     "filters/default_media_permission.cc",
123     "filters/default_media_permission.h",
124     "filters/file_data_source.cc",
125     "filters/file_data_source.h",
126     "filters/frame_processor.cc",
127     "filters/frame_processor.h",
128     "filters/gpu_video_decoder.cc",
129     "filters/gpu_video_decoder.h",
130     "filters/h264_bit_reader.cc",
131     "filters/h264_bit_reader.h",
132     "filters/h264_parser.cc",
133     "filters/h264_parser.h",
134     "filters/jpeg_parser.cc",
135     "filters/jpeg_parser.h",
136     "filters/source_buffer_platform.cc",
137     "filters/source_buffer_platform.h",
138     "filters/source_buffer_range.cc",
139     "filters/source_buffer_range.h",
140     "filters/source_buffer_stream.cc",
141     "filters/source_buffer_stream.h",
142     "filters/stream_parser_factory.cc",
143     "filters/stream_parser_factory.h",
144     "filters/video_frame_scheduler.h",
145     "filters/video_frame_scheduler_impl.cc",
146     "filters/video_frame_scheduler_impl.h",
147     "filters/video_frame_scheduler_proxy.cc",
148     "filters/video_frame_scheduler_proxy.h",
149     "filters/vp8_bool_decoder.cc",
150     "filters/vp8_bool_decoder.h",
151     "filters/vp8_parser.cc",
152     "filters/vp8_parser.h",
153     "filters/webvtt_util.h",
154     "filters/wsola_internals.cc",
155     "filters/wsola_internals.h",
156     "formats/common/offset_byte_queue.cc",
157     "formats/common/offset_byte_queue.h",
158     "formats/webm/webm_audio_client.cc",
159     "formats/webm/webm_audio_client.h",
160     "formats/webm/webm_cluster_parser.cc",
161     "formats/webm/webm_cluster_parser.h",
162     "formats/webm/webm_constants.cc",
163     "formats/webm/webm_constants.h",
164     "formats/webm/webm_content_encodings.cc",
165     "formats/webm/webm_content_encodings.h",
166     "formats/webm/webm_content_encodings_client.cc",
167     "formats/webm/webm_content_encodings_client.h",
168     "formats/webm/webm_crypto_helpers.cc",
169     "formats/webm/webm_crypto_helpers.h",
170     "formats/webm/webm_info_parser.cc",
171     "formats/webm/webm_info_parser.h",
172     "formats/webm/webm_parser.cc",
173     "formats/webm/webm_parser.h",
174     "formats/webm/webm_stream_parser.cc",
175     "formats/webm/webm_stream_parser.h",
176     "formats/webm/webm_tracks_parser.cc",
177     "formats/webm/webm_tracks_parser.h",
178     "formats/webm/webm_video_client.cc",
179     "formats/webm/webm_video_client.h",
180     "formats/webm/webm_webvtt_parser.cc",
181     "formats/webm/webm_webvtt_parser.h",
182     "midi/midi_manager.cc",
183     "midi/midi_manager.h",
184     "midi/midi_manager_mac.cc",
185     "midi/midi_manager_mac.h",
186     "midi/midi_manager_usb.cc",
187     "midi/midi_manager_usb.h",
188     "midi/midi_manager_win.cc",
189     "midi/midi_manager_win.h",
190     "midi/midi_message_queue.cc",
191     "midi/midi_message_queue.h",
192     "midi/midi_message_util.cc",
193     "midi/midi_message_util.h",
194     "midi/midi_port_info.cc",
195     "midi/midi_port_info.h",
196     "midi/usb_midi_descriptor_parser.cc",
197     "midi/usb_midi_descriptor_parser.h",
198     "midi/usb_midi_device.h",
199     "midi/usb_midi_input_stream.cc",
200     "midi/usb_midi_input_stream.h",
201     "midi/usb_midi_jack.h",
202     "midi/usb_midi_output_stream.cc",
203     "midi/usb_midi_output_stream.h",
204     "renderers/audio_renderer_impl.cc",
205     "renderers/audio_renderer_impl.h",
206     "renderers/gpu_video_accelerator_factories.h",
207     "renderers/renderer_impl.cc",
208     "renderers/renderer_impl.h",
209     "renderers/video_renderer_impl.cc",
210     "renderers/video_renderer_impl.h",
211     "video/capture/file_video_capture_device.cc",
212     "video/capture/file_video_capture_device.h",
213     "video/capture/linux/v4l2_capture_delegate.cc",
214     "video/capture/linux/v4l2_capture_delegate.h",
215     "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
216     "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
217     "video/capture/linux/v4l2_capture_delegate_single_plane.cc",
218     "video/capture/linux/v4l2_capture_delegate_single_plane.h",
219     "video/capture/linux/video_capture_device_chromeos.cc",
220     "video/capture/linux/video_capture_device_chromeos.h",
221     "video/capture/linux/video_capture_device_linux.cc",
222     "video/capture/linux/video_capture_device_linux.h",
223     "video/capture/mac/platform_video_capturing_mac.h",
224     "video/capture/mac/video_capture_device_avfoundation_mac.h",
225     "video/capture/mac/video_capture_device_avfoundation_mac.mm",
226     "video/capture/mac/video_capture_device_decklink_mac.h",
227     "video/capture/mac/video_capture_device_decklink_mac.mm",
228     "video/capture/mac/video_capture_device_factory_mac.h",
229     "video/capture/mac/video_capture_device_factory_mac.mm",
230     "video/capture/mac/video_capture_device_mac.h",
231     "video/capture/mac/video_capture_device_mac.mm",
232     "video/capture/mac/video_capture_device_qtkit_mac.h",
233     "video/capture/mac/video_capture_device_qtkit_mac.mm",
234     "video/capture/video_capture_device.cc",
235     "video/capture/video_capture_device.h",
236     "video/capture/video_capture_device_info.cc",
237     "video/capture/video_capture_device_info.h",
238     "video/capture/win/capability_list_win.cc",
239     "video/capture/win/capability_list_win.h",
240     "video/capture/win/filter_base_win.cc",
241     "video/capture/win/filter_base_win.h",
242     "video/capture/win/pin_base_win.cc",
243     "video/capture/win/pin_base_win.h",
244     "video/capture/win/sink_filter_observer_win.h",
245     "video/capture/win/sink_filter_win.cc",
246     "video/capture/win/sink_filter_win.h",
247     "video/capture/win/sink_input_pin_win.cc",
248     "video/capture/win/sink_input_pin_win.h",
249     "video/capture/win/video_capture_device_factory_win.cc",
250     "video/capture/win/video_capture_device_factory_win.h",
251     "video/capture/win/video_capture_device_mf_win.cc",
252     "video/capture/win/video_capture_device_mf_win.h",
253     "video/capture/win/video_capture_device_win.cc",
254     "video/capture/win/video_capture_device_win.h",
255     "video/fake_video_encode_accelerator.cc",
256     "video/fake_video_encode_accelerator.h",
257     "video/h264_poc.cc",
258     "video/h264_poc.h",
259     "video/picture.cc",
260     "video/picture.h",
261     "video/video_decode_accelerator.cc",
262     "video/video_decode_accelerator.h",
263     "video/video_encode_accelerator.cc",
264     "video/video_encode_accelerator.h",
265   ]
267   configs += [
268     ":media_config",
270     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
271     # See http://crbug.com/171009
272     "//build/config/compiler:no_size_t_to_int_warning",
273   ]
274   all_dependent_configs = [ ":media_dependent_config" ]
276   cflags = []
277   libs = []
278   defines = []
279   deps = []
281   include_dirs = [ "." ]
282   if (media_use_ffmpeg) {
283     deps += [ "//third_party/ffmpeg" ]
284     sources += [
285       "ffmpeg/ffmpeg_common.cc",
286       "ffmpeg/ffmpeg_common.h",
287       "filters/audio_file_reader.cc",
288       "filters/audio_file_reader.h",
289       "filters/blocking_url_protocol.cc",
290       "filters/blocking_url_protocol.h",
291       "filters/ffmpeg_audio_decoder.cc",
292       "filters/ffmpeg_audio_decoder.h",
293       "filters/ffmpeg_bitstream_converter.h",
294       "filters/ffmpeg_demuxer.cc",
295       "filters/ffmpeg_demuxer.h",
296       "filters/ffmpeg_glue.cc",
297       "filters/ffmpeg_glue.h",
298       "filters/ffmpeg_video_decoder.cc",
299       "filters/ffmpeg_video_decoder.h",
300       "filters/in_memory_url_protocol.cc",
301       "filters/in_memory_url_protocol.h",
302     ]
303     if (proprietary_codecs) {
304       sources += [
305         "filters/ffmpeg_aac_bitstream_converter.cc",
306         "filters/ffmpeg_aac_bitstream_converter.h",
307         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
308         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
309       ]
310     }
311   }
313   if (current_cpu == "arm" && arm_use_neon) {
314     defines += [ "USE_NEON" ]
315   }
317   if (media_use_libvpx) {
318     sources += [
319       "filters/vpx_video_decoder.cc",
320       "filters/vpx_video_decoder.h",
321     ]
322     deps += [ "//third_party/libvpx" ]
323   }
325   if (!is_android) {
326     sources += [
327       "filters/opus_audio_decoder.cc",
328       "filters/opus_audio_decoder.h",
329       "renderers/default_renderer_factory.cc",
330       "renderers/default_renderer_factory.h",
331     ]
332   } else {
333     sources += [
334       "midi/midi_manager_android.cc",
335       "midi/usb_midi_device_android.cc",
336       "midi/usb_midi_device_android.h",
337       "midi/usb_midi_device_factory_android.cc",
338       "midi/usb_midi_device_factory_android.h",
339       "video/capture/android/video_capture_device_android.cc",
340       "video/capture/android/video_capture_device_android.h",
341       "video/capture/android/video_capture_device_factory_android.cc",
342       "video/capture/android/video_capture_device_factory_android.h",
343     ]
344     deps += [
345       "//media/base/android",
346       "//media/base/android:media_jni_headers",
347       "//media/base/android:video_capture_jni_headers",
348     ]
349     if (!is_android_webview_build) {
350       deps += [ "//media/base/android:media_java" ]
351     }
352   }
354   if (current_cpu != "arm" && is_chromeos) {
355     sources += [
356       "filters/h264_bitstream_buffer.cc",
357       "filters/h264_bitstream_buffer.h",
358     ]
359   }
361   if (use_alsa) {
362     libs += [ "asound" ]
363     sources += [
364       "midi/midi_manager_alsa.cc",
365       "midi/midi_manager_alsa.h",
366     ]
367   }
369   if (use_udev) {
370     deps += [ "//device/udev_linux" ]
371   }
373   # A simple WebM encoder for animated avatars on ChromeOS.
375   if (use_ozone) {
376     # Used for the generated listing header (ui/ozone/platform_list.h)
377     include_dirs += [ target_gen_dir ]
379     sources += [
380                  "ozone/media_ozone_platform.cc",
381                  "ozone/media_ozone_platform.h",
382                ] + get_target_outputs(":generate_ozone_constructor_list")
384     deps += [
385       ":generate_ozone_constructor_list",
386       "//ui/ozone",
387     ]
388   }
390   if (is_mac) {
391     deps += [
392       "//media/base/mac",
393       "//third_party/decklink",
394     ]
395     libs += [
396       "CoreMIDI.framework",
397       "CoreVideo.framework",
398       "OpenGL.framework",
399       "QTKit.framework",
400     ]
401   }
403   if (is_openbsd) {
404     sources -= [
405       "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
406       "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
407     ]
408   }
410   if (is_ios) {
411     deps += [ "//media/base/mac" ]
412   }
414   if (is_win) {
415     libs += [
416       "mf.lib",
417       "mfplat.lib",
418       "mfreadwrite.lib",
419       "mfuuid.lib",
420     ]
421   }
423   if (proprietary_codecs) {
424     sources += [
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/gfx/geometry",
499     "//url",
500   ]
502   # Add the sources and dependencies that need the X11 or fontconfig libraries.
503   if (!is_ensemble) {
504     sources += [
505       "video/capture/fake_video_capture_device.cc",
506       "video/capture/fake_video_capture_device.h",
507       "video/capture/fake_video_capture_device_factory.cc",
508       "video/capture/fake_video_capture_device_factory.h",
509       "video/capture/file_video_capture_device_factory.cc",
510       "video/capture/file_video_capture_device_factory.h",
511       "video/capture/linux/video_capture_device_factory_linux.cc",
512       "video/capture/linux/video_capture_device_factory_linux.h",
513       "video/capture/video_capture_device_factory.cc",
514       "video/capture/video_capture_device_factory.h",
515     ]
517     deps += [
518       "//ui/events:events_base",
519       "//ui/gfx",
520     ]
521   }
524 # Minimal media component for media/cast on iOS.
525 if (is_ios) {
526   component("media_for_cast_ios") {
527     configs += [ ":media_config" ]
528     all_dependent_configs = [ ":media_dependent_config" ]
529     include_dirs = [ "." ]
530     libs = [ "CoreVideo.framework" ]
532     deps = [
533       ":shared_memory_support",
534       "//base",
535       "//media/base:base_for_cast_ios",
536       "//media/base/mac",
537       "//ui/gfx/geometry",
538     ]
539   }
542 test("media_unittests") {
543   sources = [
544     "blink/skcanvas_video_renderer_unittest.cc",
545     "cdm/aes_decryptor_unittest.cc",
546     "cdm/cenc_utils_unittest.cc",
547     "cdm/json_web_key_unittest.cc",
548     "filters/audio_clock_unittest.cc",
549     "filters/audio_decoder_selector_unittest.cc",
550     "filters/audio_renderer_algorithm_unittest.cc",
551     "filters/chunk_demuxer_unittest.cc",
552     "filters/decrypting_audio_decoder_unittest.cc",
553     "filters/decrypting_demuxer_stream_unittest.cc",
554     "filters/decrypting_video_decoder_unittest.cc",
555     "filters/fake_demuxer_stream.cc",
556     "filters/fake_demuxer_stream.h",
557     "filters/fake_demuxer_stream_unittest.cc",
558     "filters/fake_video_decoder.cc",
559     "filters/fake_video_decoder.h",
560     "filters/fake_video_decoder_unittest.cc",
561     "filters/file_data_source_unittest.cc",
562     "filters/frame_processor_unittest.cc",
563     "filters/h264_bit_reader_unittest.cc",
564     "filters/h264_parser_unittest.cc",
565     "filters/jpeg_parser_unittest.cc",
566     "filters/source_buffer_stream_unittest.cc",
567     "filters/video_decoder_selector_unittest.cc",
568     "filters/video_frame_scheduler_impl_unittest.cc",
569     "filters/video_frame_scheduler_unittest.cc",
570     "filters/video_frame_stream_unittest.cc",
571     "filters/vp8_bool_decoder_unittest.cc",
572     "filters/vp8_parser_unittest.cc",
573     "formats/common/offset_byte_queue_unittest.cc",
574     "formats/webm/cluster_builder.cc",
575     "formats/webm/cluster_builder.h",
576     "formats/webm/opus_packet_builder.cc",
577     "formats/webm/opus_packet_builder.h",
578     "formats/webm/tracks_builder.cc",
579     "formats/webm/tracks_builder.h",
580     "formats/webm/webm_cluster_parser_unittest.cc",
581     "formats/webm/webm_content_encodings_client_unittest.cc",
582     "formats/webm/webm_parser_unittest.cc",
583     "formats/webm/webm_tracks_parser_unittest.cc",
584     "formats/webm/webm_webvtt_parser_unittest.cc",
585     "midi/midi_manager_unittest.cc",
586     "midi/midi_manager_usb_unittest.cc",
587     "midi/midi_message_queue_unittest.cc",
588     "midi/midi_message_util_unittest.cc",
589     "midi/usb_midi_descriptor_parser_unittest.cc",
590     "midi/usb_midi_input_stream_unittest.cc",
591     "midi/usb_midi_output_stream_unittest.cc",
592     "renderers/audio_renderer_impl_unittest.cc",
593     "renderers/renderer_impl_unittest.cc",
594     "renderers/video_renderer_impl_unittest.cc",
595     "video/capture/fake_video_capture_device_unittest.cc",
596     "video/capture/video_capture_device_unittest.cc",
597     "video/h264_poc_unittest.cc",
598   ]
600   # TODO(wolenetz): Fix size_t to int trunctaion in win64.
601   # See http://crbug.com/171009
602   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
604   deps = [
605     ":media",
606     ":test_support",
607     "//base/allocator",
608     "//base/test:test_support",
609     "//media/audio:unittests",
610     "//media/audio:test_support",
611     "//media/base:unittests",
612     "//media/base:test_support",
613     "//media/test:pipeline_integration_tests",
614     "//skia",  # Direct dependency required to inherit config.
615     "//testing/gmock",
616     "//testing/gtest",
617     "//third_party/widevine/cdm:version_h",
618     "//ui/gfx:test_support",
619     "//url",
620   ]
622   if (is_android) {
623     deps += [
624       "//media/base/android",
625       # TODO(GYP)
626       #"//testing/android:native_test_native_code"
627     ]
628   }
630   if (media_use_ffmpeg) {
631     sources += [
632       "ffmpeg/ffmpeg_common_unittest.cc",
633       "filters/audio_decoder_unittest.cc",
634       "filters/audio_file_reader_unittest.cc",
635       "filters/blocking_url_protocol_unittest.cc",
636       "filters/ffmpeg_demuxer_unittest.cc",
637       "filters/ffmpeg_glue_unittest.cc",
638       "filters/ffmpeg_video_decoder_unittest.cc",
639       "filters/in_memory_url_protocol_unittest.cc",
640     ]
641   }
643   if (current_cpu != "arm" && is_chromeos) {
644     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
645   }
647   if (proprietary_codecs) {
648     sources += [
649       "filters/ffmpeg_aac_bitstream_converter_unittest.cc",
650       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
651       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
652       "formats/common/stream_parser_test_base.cc",
653       "formats/common/stream_parser_test_base.h",
654       "formats/mp2t/es_adapter_video_unittest.cc",
655       "formats/mp2t/es_parser_adts_unittest.cc",
656       "formats/mp2t/es_parser_h264_unittest.cc",
657       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
658       "formats/mp2t/es_parser_test_base.cc",
659       "formats/mp2t/es_parser_test_base.h",
660       "formats/mp2t/mp2t_stream_parser_unittest.cc",
661       "formats/mp2t/timestamp_unroller_unittest.cc",
662       "formats/mp4/aac_unittest.cc",
663       "formats/mp4/avc_unittest.cc",
664       "formats/mp4/box_reader_unittest.cc",
665       "formats/mp4/es_descriptor_unittest.cc",
666       "formats/mp4/mp4_stream_parser_unittest.cc",
667       "formats/mp4/sample_to_group_iterator_unittest.cc",
668       "formats/mp4/track_run_iterator_unittest.cc",
669       "formats/mpeg/adts_stream_parser_unittest.cc",
670       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
671     ]
672   }
674   if (is_mac || is_ios) {
675     deps += [ "//media/base/mac" ]
676   }
678   if (is_mac) {
679     sources += [
680       "midi/midi_manager_mac_unittest.cc",
681       "video/capture/mac/video_capture_device_factory_mac_unittest.mm",
682     ]
683   }
685   if (use_alsa) {
686     sources += [ "midi/midi_manager_alsa_unittest.cc" ]
687   }
689   #      include_dirs += [
690   #        # Needed by media_drm_bridge.cc.
691   #        target_gen_dir,
692   #      ],
694   configs += [ ":media_config" ]
696   if (media_use_ffmpeg) {
697     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
698   }
701 test("media_perftests") {
702   configs += [ ":media_config" ]
703   deps = [
704     ":media",
705     ":shared_memory_support",
706     ":test_support",
707     "//base/test:test_support",
708     "//media/audio:test_support",
709     "//media/base:perftests",
710     "//media/base:test_support",
711     "//media/test:pipeline_integration_perftests",
712     "//testing/gmock",
713     "//testing/gtest",
714     "//testing/perf",
715     "//third_party/widevine/cdm:version_h",
716     "//ui/gfx:test_support",
717   ]
718   if (is_android) {
719     deps += [ "//ui/gl" ]
720   }
721   if (media_use_ffmpeg) {
722     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
723   }
726 source_set("test_support") {
727   testonly = true
728   sources = [
729     "filters/clockless_video_frame_scheduler.cc",
730     "filters/clockless_video_frame_scheduler.h",
731     "filters/test_video_frame_scheduler.cc",
732     "filters/test_video_frame_scheduler.h",
733     "renderers/mock_gpu_video_accelerator_factories.cc",
734     "renderers/mock_gpu_video_accelerator_factories.h",
735     "video/mock_video_decode_accelerator.cc",
736     "video/mock_video_decode_accelerator.h",
737   ]
738   deps = [
739     ":media",
740     ":shared_memory_support",
741     "//base",
742     "//skia",
743     "//testing/gmock",
744     "//testing/gtest",
745   ]
748 # TODO(dalecurtis): How to split this across audio/base directories??
749 component("shared_memory_support") {
750   sources = [
751     "audio/audio_parameters.cc",
752     "audio/audio_parameters.h",
753     "base/audio_bus.cc",
754     "base/audio_bus.h",
755     "base/channel_layout.cc",
756     "base/channel_layout.h",
757     "base/limits.h",
758     "base/media_export.h",
759     "base/vector_math.cc",
760     "base/vector_math.h",
761   ]
762   configs += [ ":media_config" ]
763   defines = [ "MEDIA_IMPLEMENTATION" ]
764   deps = [
765     "//base",
766   ]
769 if (media_use_ffmpeg) {
770   test("ffmpeg_regression_tests") {
771     sources = [
772       "base/run_all_unittests.cc",
773       "ffmpeg/ffmpeg_regression_tests.cc",
774     ]
776     configs += [ "//media:media_config" ]
778     deps = [
779       "//base/test:test_support",
780       "//media",
781       "//media:test_support",
782       "//media/audio:test_support",
783       "//media/base:test_support",
784       "//media/test:pipeline_integration_tests",
785       "//testing/gmock",
786       "//testing/gtest",
787       "//third_party/ffmpeg",
788       "//ui/gfx/geometry",
789       "//ui/gfx:test_support",
790     ]
791   }
794 if (use_x11) {
795   executable("player_x11") {
796     sources = [
797       "tools/player_x11/data_source_logger.cc",
798       "tools/player_x11/data_source_logger.h",
799       "tools/player_x11/gl_video_renderer.cc",
800       "tools/player_x11/gl_video_renderer.h",
801       "tools/player_x11/player_x11.cc",
802       "tools/player_x11/x11_video_renderer.cc",
803       "tools/player_x11/x11_video_renderer.h",
804     ]
805     configs += [
806       ":media_config",
807       "//build/config/linux:x11",
808       "//build/config/linux:xext",
810       # TODO(ajwong): Why does xext get a separate thing in //build/config/linux:BUILD.gn
811       #  "//build/config/linux:xrender",
812     ]
813     deps = [
814       ":media",
815       ":shared_memory_support",
816       "//base",
817       "//tools/xdisplaycheck",
818       "//ui/gl",
819       "//ui/gfx",
820       "//ui/gfx/geometry",
821     ]
822   }