Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / media / BUILD.gn
blob4c8d52a6778766dcaa101f2a8d8ed15586137c0b
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   }
35   if (use_alsa) {
36     defines += [ "USE_ALSA" ]
37   }
40 config("media_implementation") {
41   defines = [ "MEDIA_IMPLEMENTATION" ]
44 config("media_dependent_config") {
45   defines = []
46   if (!media_use_libvpx) {
47     defines += [ "MEDIA_DISABLE_LIBVPX" ]
48   }
49   if (!media_use_ffmpeg) {
50     defines += [ "MEDIA_DISABLE_FFMPEG" ]
51   }
52   if (is_win) {
53     ldflags = [
54       "/DELAYLOAD:mf.dll",
55       "/DELAYLOAD:mfplat.dll",
56       "/DELAYLOAD:mfreadwrite.dll",
57     ]
58   }
61 if (use_ozone) {
62   action("generate_ozone_constructor_list") {
63     # Ozone platform objects are auto-generated using similar
64     # patterns for naming and classes constructors. Here we build the
65     # object MediaOzonePlatform.
66     script = "../ui/ozone/generate_constructor_list.py"
68     platform_list_txt_file = "$target_gen_dir/../ui/ozone/platform_list.txt"
69     constructor_list_cc_file =
70         "$target_gen_dir/../media/ozone/constructor_list.cc"
72     sources = [
73       platform_list_txt_file,
74     ]
75     outputs = [
76       constructor_list_cc_file,
77     ]
78     args = [
79       "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
80       "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
81       "--namespace=media",
82       "--typename=MediaOzonePlatform",
83       "--include=\"media/ozone/media_ozone_platform.h\"",
84     ]
85   }
88 component("media") {
89   sources = [
90     "blink/skcanvas_video_renderer.cc",
91     "blink/skcanvas_video_renderer.h",
92     "cdm/aes_decryptor.cc",
93     "cdm/aes_decryptor.h",
94     "cdm/cenc_utils.cc",
95     "cdm/cenc_utils.h",
96     "cdm/default_cdm_factory.cc",
97     "cdm/default_cdm_factory.h",
98     "cdm/json_web_key.cc",
99     "cdm/json_web_key.h",
100     "cdm/key_system_names.cc",
101     "cdm/key_system_names.h",
102     "cdm/player_tracker_impl.cc",
103     "cdm/player_tracker_impl.h",
104     "cdm/proxy_decryptor.cc",
105     "cdm/proxy_decyrptor.h",
106     "ffmpeg/ffmpeg_deleters.h",
107     "filters/audio_clock.cc",
108     "filters/audio_clock.h",
109     "filters/audio_renderer_algorithm.cc",
110     "filters/audio_renderer_algorithm.h",
111     "filters/chunk_demuxer.cc",
112     "filters/chunk_demuxer.h",
113     "filters/context_3d.h",
114     "filters/decoder_selector.cc",
115     "filters/decoder_selector.h",
116     "filters/decoder_stream.cc",
117     "filters/decoder_stream.h",
118     "filters/decoder_stream_traits.cc",
119     "filters/decoder_stream_traits.h",
120     "filters/decrypting_audio_decoder.cc",
121     "filters/decrypting_audio_decoder.h",
122     "filters/decrypting_demuxer_stream.cc",
123     "filters/decrypting_demuxer_stream.h",
124     "filters/decrypting_video_decoder.cc",
125     "filters/decrypting_video_decoder.h",
126     "filters/default_media_permission.cc",
127     "filters/default_media_permission.h",
128     "filters/file_data_source.cc",
129     "filters/file_data_source.h",
130     "filters/frame_processor.cc",
131     "filters/frame_processor.h",
132     "filters/gpu_video_decoder.cc",
133     "filters/gpu_video_decoder.h",
134     "filters/h264_bit_reader.cc",
135     "filters/h264_bit_reader.h",
136     "filters/h264_parser.cc",
137     "filters/h264_parser.h",
138     "filters/jpeg_parser.cc",
139     "filters/jpeg_parser.h",
140     "filters/source_buffer_platform.cc",
141     "filters/source_buffer_platform.h",
142     "filters/source_buffer_range.cc",
143     "filters/source_buffer_range.h",
144     "filters/source_buffer_stream.cc",
145     "filters/source_buffer_stream.h",
146     "filters/stream_parser_factory.cc",
147     "filters/stream_parser_factory.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/midi_scheduler.cc",
196     "midi/midi_scheduler.h",
197     "midi/usb_midi_descriptor_parser.cc",
198     "midi/usb_midi_descriptor_parser.h",
199     "midi/usb_midi_device.h",
200     "midi/usb_midi_input_stream.cc",
201     "midi/usb_midi_input_stream.h",
202     "midi/usb_midi_jack.h",
203     "midi/usb_midi_output_stream.cc",
204     "midi/usb_midi_output_stream.h",
205     "renderers/audio_renderer_impl.cc",
206     "renderers/audio_renderer_impl.h",
207     "renderers/gpu_video_accelerator_factories.h",
208     "renderers/renderer_impl.cc",
209     "renderers/renderer_impl.h",
210     "renderers/video_renderer_impl.cc",
211     "renderers/video_renderer_impl.h",
212     "video/capture/fake_video_capture_device.cc",
213     "video/capture/fake_video_capture_device.h",
214     "video/capture/fake_video_capture_device_factory.cc",
215     "video/capture/fake_video_capture_device_factory.h",
216     "video/capture/file_video_capture_device.cc",
217     "video/capture/file_video_capture_device.h",
218     "video/capture/file_video_capture_device_factory.cc",
219     "video/capture/file_video_capture_device_factory.h",
220     "video/capture/linux/v4l2_capture_delegate.cc",
221     "video/capture/linux/v4l2_capture_delegate.h",
222     "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
223     "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
224     "video/capture/linux/v4l2_capture_delegate_single_plane.cc",
225     "video/capture/linux/v4l2_capture_delegate_single_plane.h",
226     "video/capture/linux/video_capture_device_chromeos.cc",
227     "video/capture/linux/video_capture_device_chromeos.h",
228     "video/capture/linux/video_capture_device_factory_linux.cc",
229     "video/capture/linux/video_capture_device_factory_linux.h",
230     "video/capture/linux/video_capture_device_linux.cc",
231     "video/capture/linux/video_capture_device_linux.h",
232     "video/capture/mac/platform_video_capturing_mac.h",
233     "video/capture/mac/video_capture_device_avfoundation_mac.h",
234     "video/capture/mac/video_capture_device_avfoundation_mac.mm",
235     "video/capture/mac/video_capture_device_decklink_mac.h",
236     "video/capture/mac/video_capture_device_decklink_mac.mm",
237     "video/capture/mac/video_capture_device_factory_mac.h",
238     "video/capture/mac/video_capture_device_factory_mac.mm",
239     "video/capture/mac/video_capture_device_mac.h",
240     "video/capture/mac/video_capture_device_mac.mm",
241     "video/capture/mac/video_capture_device_qtkit_mac.h",
242     "video/capture/mac/video_capture_device_qtkit_mac.mm",
243     "video/capture/video_capture_device.cc",
244     "video/capture/video_capture_device.h",
245     "video/capture/video_capture_device_factory.cc",
246     "video/capture/video_capture_device_factory.h",
247     "video/capture/video_capture_device_info.cc",
248     "video/capture/video_capture_device_info.h",
249     "video/capture/win/capability_list_win.cc",
250     "video/capture/win/capability_list_win.h",
251     "video/capture/win/filter_base_win.cc",
252     "video/capture/win/filter_base_win.h",
253     "video/capture/win/pin_base_win.cc",
254     "video/capture/win/pin_base_win.h",
255     "video/capture/win/sink_filter_observer_win.h",
256     "video/capture/win/sink_filter_win.cc",
257     "video/capture/win/sink_filter_win.h",
258     "video/capture/win/sink_input_pin_win.cc",
259     "video/capture/win/sink_input_pin_win.h",
260     "video/capture/win/video_capture_device_factory_win.cc",
261     "video/capture/win/video_capture_device_factory_win.h",
262     "video/capture/win/video_capture_device_mf_win.cc",
263     "video/capture/win/video_capture_device_mf_win.h",
264     "video/capture/win/video_capture_device_win.cc",
265     "video/capture/win/video_capture_device_win.h",
266     "video/fake_video_encode_accelerator.cc",
267     "video/fake_video_encode_accelerator.h",
268     "video/h264_poc.cc",
269     "video/h264_poc.h",
270     "video/picture.cc",
271     "video/picture.h",
272     "video/video_decode_accelerator.cc",
273     "video/video_decode_accelerator.h",
274     "video/video_encode_accelerator.cc",
275     "video/video_encode_accelerator.h",
276   ]
278   configs += [
279     ":media_config",
280     ":media_implementation",
282     # TODO(wolenetz): Fix size_t to int trunctaion in win64.
283     # See http://crbug.com/171009
284     "//build/config/compiler:no_size_t_to_int_warning",
285   ]
286   all_dependent_configs = [ ":media_dependent_config" ]
288   allow_circular_includes_from = []
289   cflags = []
290   libs = []
291   defines = []
292   deps = []
294   include_dirs = [ "." ]
295   if (media_use_ffmpeg) {
296     deps += [ "//third_party/ffmpeg" ]
297     sources += [
298       "ffmpeg/ffmpeg_common.cc",
299       "ffmpeg/ffmpeg_common.h",
300       "filters/audio_file_reader.cc",
301       "filters/audio_file_reader.h",
302       "filters/blocking_url_protocol.cc",
303       "filters/blocking_url_protocol.h",
304       "filters/ffmpeg_audio_decoder.cc",
305       "filters/ffmpeg_audio_decoder.h",
306       "filters/ffmpeg_bitstream_converter.h",
307       "filters/ffmpeg_demuxer.cc",
308       "filters/ffmpeg_demuxer.h",
309       "filters/ffmpeg_glue.cc",
310       "filters/ffmpeg_glue.h",
311       "filters/ffmpeg_video_decoder.cc",
312       "filters/ffmpeg_video_decoder.h",
313       "filters/in_memory_url_protocol.cc",
314       "filters/in_memory_url_protocol.h",
315     ]
316     if (proprietary_codecs) {
317       sources += [
318         "filters/ffmpeg_aac_bitstream_converter.cc",
319         "filters/ffmpeg_aac_bitstream_converter.h",
320         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
321         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
322       ]
323     }
324   }
326   if (current_cpu == "arm" && arm_use_neon) {
327     defines += [ "USE_NEON" ]
328   }
330   if (media_use_libvpx) {
331     sources += [
332       "filters/vpx_video_decoder.cc",
333       "filters/vpx_video_decoder.h",
334     ]
335     deps += [ "//third_party/libvpx" ]
336   }
338   if (is_android) {
339     sources += [
340       "midi/midi_manager_android.cc",
341       "midi/usb_midi_device_android.cc",
342       "midi/usb_midi_device_android.h",
343       "midi/usb_midi_device_factory_android.cc",
344       "midi/usb_midi_device_factory_android.h",
345       "video/capture/android/video_capture_device_android.cc",
346       "video/capture/android/video_capture_device_android.h",
347       "video/capture/android/video_capture_device_factory_android.cc",
348       "video/capture/android/video_capture_device_factory_android.h",
349     ]
350     deps += [
351       "//media/base/android",
352       "//media/base/android:media_java",
353       "//media/base/android:media_jni_headers",
354       "//media/base/android:video_capture_jni_headers",
355     ]
356     allow_circular_includes_from = [ "//media/base/android" ]
357   } else {
358     sources += [
359       "filters/opus_audio_decoder.cc",
360       "filters/opus_audio_decoder.h",
361       "renderers/default_renderer_factory.cc",
362       "renderers/default_renderer_factory.h",
363     ]
364   }
366   if (current_cpu != "arm" && is_chromeos) {
367     sources += [
368       "filters/h264_bitstream_buffer.cc",
369       "filters/h264_bitstream_buffer.h",
370     ]
371   }
373   if (use_alsa && use_udev) {
374     libs += [ "asound" ]
375     sources += [
376       "midi/midi_manager_alsa.cc",
377       "midi/midi_manager_alsa.h",
378     ]
379     deps += [ "//device/udev_linux" ]
380   }
382   # A simple WebM encoder for animated avatars on ChromeOS.
384   if (use_ozone) {
385     # Used for the generated listing header (ui/ozone/platform_list.h)
386     include_dirs += [ target_gen_dir ]
388     sources += [
389                  "ozone/media_ozone_platform.cc",
390                  "ozone/media_ozone_platform.h",
391                ] + get_target_outputs(":generate_ozone_constructor_list")
393     deps += [
394       ":generate_ozone_constructor_list",
395       "//ui/ozone",
396     ]
397   }
399   if (is_mac) {
400     deps += [
401       "//media/base/mac",
402       "//third_party/decklink",
403     ]
404     libs += [
405       "CoreMIDI.framework",
406       "CoreVideo.framework",
407       "OpenGL.framework",
408       "QTKit.framework",
409     ]
410   }
412   if (is_openbsd) {
413     sources -= [
414       "video/capture/linux/v4l2_capture_delegate_multi_plane.cc",
415       "video/capture/linux/v4l2_capture_delegate_multi_plane.h",
416     ]
417   }
419   if (is_ios) {
420     deps += [ "//media/base/mac" ]
421   }
423   if (is_win) {
424     deps += [ "//device/usb" ]
426     libs += [
427       "mf.lib",
428       "mfplat.lib",
429       "mfreadwrite.lib",
430       "mfuuid.lib",
431     ]
432   }
434   if (proprietary_codecs) {
435     sources += [
436       "filters/h264_to_annex_b_bitstream_converter.cc",
437       "filters/h264_to_annex_b_bitstream_converter.h",
438       "formats/mp2t/es_adapter_video.cc",
439       "formats/mp2t/es_adapter_video.h",
440       "formats/mp2t/es_parser.cc",
441       "formats/mp2t/es_parser.h",
442       "formats/mp2t/es_parser_adts.cc",
443       "formats/mp2t/es_parser_adts.h",
444       "formats/mp2t/es_parser_h264.cc",
445       "formats/mp2t/es_parser_h264.h",
446       "formats/mp2t/es_parser_mpeg1audio.cc",
447       "formats/mp2t/es_parser_mpeg1audio.h",
448       "formats/mp2t/mp2t_common.h",
449       "formats/mp2t/mp2t_stream_parser.cc",
450       "formats/mp2t/mp2t_stream_parser.h",
451       "formats/mp2t/timestamp_unroller.cc",
452       "formats/mp2t/timestamp_unroller.h",
453       "formats/mp2t/ts_packet.cc",
454       "formats/mp2t/ts_packet.h",
455       "formats/mp2t/ts_section.h",
456       "formats/mp2t/ts_section_pat.cc",
457       "formats/mp2t/ts_section_pat.h",
458       "formats/mp2t/ts_section_pes.cc",
459       "formats/mp2t/ts_section_pes.h",
460       "formats/mp2t/ts_section_pmt.cc",
461       "formats/mp2t/ts_section_pmt.h",
462       "formats/mp2t/ts_section_psi.cc",
463       "formats/mp2t/ts_section_psi.h",
464       "formats/mp4/aac.cc",
465       "formats/mp4/aac.h",
466       "formats/mp4/avc.cc",
467       "formats/mp4/avc.h",
468       "formats/mp4/box_definitions.cc",
469       "formats/mp4/box_definitions.h",
470       "formats/mp4/box_reader.cc",
471       "formats/mp4/box_reader.h",
472       "formats/mp4/cenc.cc",
473       "formats/mp4/cenc.h",
474       "formats/mp4/es_descriptor.cc",
475       "formats/mp4/es_descriptor.h",
476       "formats/mp4/mp4_stream_parser.cc",
477       "formats/mp4/mp4_stream_parser.h",
478       "formats/mp4/sample_to_group_iterator.cc",
479       "formats/mp4/sample_to_group_iterator.h",
480       "formats/mp4/track_run_iterator.cc",
481       "formats/mp4/track_run_iterator.h",
482       "formats/mpeg/adts_constants.cc",
483       "formats/mpeg/adts_constants.h",
484       "formats/mpeg/adts_stream_parser.cc",
485       "formats/mpeg/adts_stream_parser.h",
486       "formats/mpeg/mpeg1_audio_stream_parser.cc",
487       "formats/mpeg/mpeg1_audio_stream_parser.h",
488       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
489       "formats/mpeg/mpeg_audio_stream_parser_base.h",
490     ]
491   }
493   public_deps = [
494     "//media/base",
495     "//media/audio",
496   ]
498   deps += [
499     ":shared_memory_support",
500     "//base",
501     "//base:i18n",
502     "//base/third_party/dynamic_annotations",
503     "//crypto",
504     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
505     "//gpu/command_buffer/common",
506     "//skia",
507     "//third_party/libyuv",
508     "//third_party/opus",
509     "//ui/events:events_base",
510     "//ui/gfx",
511     "//ui/gfx/geometry",
512     "//url",
513   ]
516 # Minimal media component for media/cast on iOS.
517 if (is_ios) {
518   component("media_for_cast_ios") {
519     configs += [
520       ":media_config",
521       ":media_implementation",
522     ]
523     all_dependent_configs = [ ":media_dependent_config" ]
524     include_dirs = [ "." ]
525     libs = [ "CoreVideo.framework" ]
527     deps = [
528       ":shared_memory_support",
529       "//base",
530       "//media/base:base_for_cast_ios",
531       "//media/base/mac",
532       "//ui/gfx/geometry",
533     ]
534   }
537 test("media_unittests") {
538   sources = [
539     "blink/skcanvas_video_renderer_unittest.cc",
540     "cdm/aes_decryptor_unittest.cc",
541     "cdm/cenc_utils_unittest.cc",
542     "cdm/json_web_key_unittest.cc",
543     "filters/audio_clock_unittest.cc",
544     "filters/audio_decoder_selector_unittest.cc",
545     "filters/audio_renderer_algorithm_unittest.cc",
546     "filters/chunk_demuxer_unittest.cc",
547     "filters/decrypting_audio_decoder_unittest.cc",
548     "filters/decrypting_demuxer_stream_unittest.cc",
549     "filters/decrypting_video_decoder_unittest.cc",
550     "filters/fake_demuxer_stream.cc",
551     "filters/fake_demuxer_stream.h",
552     "filters/fake_demuxer_stream_unittest.cc",
553     "filters/fake_video_decoder.cc",
554     "filters/fake_video_decoder.h",
555     "filters/fake_video_decoder_unittest.cc",
556     "filters/file_data_source_unittest.cc",
557     "filters/frame_processor_unittest.cc",
558     "filters/h264_bit_reader_unittest.cc",
559     "filters/h264_parser_unittest.cc",
560     "filters/jpeg_parser_unittest.cc",
561     "filters/source_buffer_stream_unittest.cc",
562     "filters/video_decoder_selector_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_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     libs = [
677       # Required by midi_manager_mac_unittest.cc.
678       "CoreMIDI.framework",
679     ]
680   }
682   if (use_alsa && use_udev) {
683     sources += [ "midi/midi_manager_alsa_unittest.cc" ]
684   }
686   #      include_dirs += [
687   #        # Needed by media_drm_bridge.cc.
688   #        target_gen_dir,
689   #      ],
691   configs += [ ":media_config" ]
693   if (media_use_ffmpeg) {
694     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
695   }
698 test("media_perftests") {
699   configs += [ ":media_config" ]
700   deps = [
701     ":media",
702     ":shared_memory_support",
703     ":test_support",
704     "//base/test:test_support",
705     "//media/audio:test_support",
706     "//media/base:perftests",
707     "//media/base:test_support",
708     "//media/test:pipeline_integration_perftests",
709     "//testing/gmock",
710     "//testing/gtest",
711     "//testing/perf",
712     "//third_party/widevine/cdm:version_h",
713     "//ui/gfx:test_support",
714   ]
715   if (is_android) {
716     deps += [ "//ui/gl" ]
717   }
718   if (media_use_ffmpeg) {
719     deps += [ "//third_party/ffmpeg" ]  # Direct dependency required to inherit config.
720   }
723 source_set("test_support") {
724   testonly = true
725   sources = [
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 += [
756     ":media_config",
757     ":media_implementation",
758   ]
759   deps = [
760     "//base",
761   ]
764 if (media_use_ffmpeg) {
765   test("ffmpeg_regression_tests") {
766     sources = [
767       "base/run_all_unittests.cc",
768       "ffmpeg/ffmpeg_regression_tests.cc",
769     ]
771     configs += [ "//media:media_config" ]
773     deps = [
774       "//base/test:test_support",
775       "//media",
776       "//media:test_support",
777       "//media/audio:test_support",
778       "//media/base:test_support",
779       "//media/test:pipeline_integration_tests",
780       "//testing/gmock",
781       "//testing/gtest",
782       "//third_party/ffmpeg",
783       "//ui/gfx/geometry",
784       "//ui/gfx:test_support",
785     ]
786   }