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