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