Mojo UDP socket API definition.
[chromium-blink-merge.git] / media / BUILD.gn
blob8deb6b9df317145e6c6d5eb0dff5ea755bc917aa
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 (!linux_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_types.cc",
181     "video/capture/video_capture_types.h",
182     "video/capture/win/capability_list_win.cc",
183     "video/capture/win/capability_list_win.h",
184     "video/capture/win/filter_base_win.cc",
185     "video/capture/win/filter_base_win.h",
186     "video/capture/win/pin_base_win.cc",
187     "video/capture/win/pin_base_win.h",
188     "video/capture/win/sink_filter_observer_win.h",
189     "video/capture/win/sink_filter_win.cc",
190     "video/capture/win/sink_filter_win.h",
191     "video/capture/win/sink_input_pin_win.cc",
192     "video/capture/win/sink_input_pin_win.h",
193     "video/capture/win/video_capture_device_factory_win.cc",
194     "video/capture/win/video_capture_device_factory_win.h",
195     "video/capture/win/video_capture_device_mf_win.cc",
196     "video/capture/win/video_capture_device_mf_win.h",
197     "video/capture/win/video_capture_device_win.cc",
198     "video/capture/win/video_capture_device_win.h",
199     "video/picture.cc",
200     "video/picture.h",
201     "video/video_decode_accelerator.cc",
202     "video/video_decode_accelerator.h",
203     "video/video_encode_accelerator.cc",
204     "video/video_encode_accelerator.h",
205     "formats/common/offset_byte_queue.cc",
206     "formats/common/offset_byte_queue.h",
207     "formats/webm/webm_audio_client.cc",
208     "formats/webm/webm_audio_client.h",
209     "formats/webm/webm_cluster_parser.cc",
210     "formats/webm/webm_cluster_parser.h",
211     "formats/webm/webm_constants.cc",
212     "formats/webm/webm_constants.h",
213     "formats/webm/webm_content_encodings.cc",
214     "formats/webm/webm_content_encodings.h",
215     "formats/webm/webm_content_encodings_client.cc",
216     "formats/webm/webm_content_encodings_client.h",
217     "formats/webm/webm_crypto_helpers.cc",
218     "formats/webm/webm_crypto_helpers.h",
219     "formats/webm/webm_info_parser.cc",
220     "formats/webm/webm_info_parser.h",
221     "formats/webm/webm_parser.cc",
222     "formats/webm/webm_parser.h",
223     "formats/webm/webm_stream_parser.cc",
224     "formats/webm/webm_stream_parser.h",
225     "formats/webm/webm_tracks_parser.cc",
226     "formats/webm/webm_tracks_parser.h",
227     "formats/webm/webm_video_client.cc",
228     "formats/webm/webm_video_client.h",
229     "formats/webm/webm_webvtt_parser.cc",
230     "formats/webm/webm_webvtt_parser.h",
231   ]
233   configs += [ ":media_config", ]
234   all_dependent_configs = [ ":media_dependent_config" ]
236   cflags = []
237   libs = []
238   defines = []
239   deps = []
241   include_dirs = [ "." ]
242   if (media_use_ffmpeg) {
243     deps += [ "//third_party/ffmpeg" ]
244     sources += [
245       "ffmpeg/ffmpeg_common.cc",
246       "ffmpeg/ffmpeg_common.h",
247       "filters/audio_file_reader.cc",
248       "filters/audio_file_reader.h",
249       "filters/blocking_url_protocol.cc",
250       "filters/blocking_url_protocol.h",
251       "filters/ffmpeg_audio_decoder.cc",
252       "filters/ffmpeg_audio_decoder.h",
253       "filters/ffmpeg_demuxer.cc",
254       "filters/ffmpeg_demuxer.h",
255       "filters/ffmpeg_glue.cc",
256       "filters/ffmpeg_glue.h",
257       "filters/ffmpeg_video_decoder.cc",
258       "filters/ffmpeg_video_decoder.h",
259       "filters/in_memory_url_protocol.cc",
260       "filters/in_memory_url_protocol.h",
261     ]
262     if (proprietary_codecs) {
263       sources += [
264         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
265         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
266       ]
267     }
268   }
270   if (cpu_arch == "arm" && arm_use_neon) {
271     defines += [ "USE_NEON" ]
272   }
274   if (media_use_libvpx) {
275      sources += [
276        "filters/vpx_video_decoder.cc",
277        "filters/vpx_video_decoder.h",
278      ]
279      deps += [ "//third_party/libvpx" ]
280   }
282   if (!is_android) {
283     sources += [
284       "filters/opus_audio_decoder.cc",
285       "filters/opus_audio_decoder.h",
286     ]
287   } else {
288     sources += [
289       "midi/midi_manager_android.cc",
290       "midi/usb_midi_device_android.cc",
291       "midi/usb_midi_device_android.h",
292       "midi/usb_midi_device_factory_android.cc",
293       "midi/usb_midi_device_factory_android.h",
294       "video/capture/android/video_capture_device_android.cc",
295       "video/capture/android/video_capture_device_android.h",
296       "video/capture/android/video_capture_device_factory_android.cc",
297       "video/capture/android/video_capture_device_factory_android.h",
298     ]
299     deps += [
300       "//media/base/android",
301       "//media/base/android:media_jni_headers",
302       "//media/base/android:video_capture_jni_headers",
303     ]
304     if (!is_android_webview_build) {
305       deps += [ "//media/base/android:media_java" ]
306     }
307   }
309   if (use_alsa) {
310     libs += [ "asound" ]
311     defines += [ "USE_ALSA" ]
312     sources += [
313       "midi/midi_manager_alsa.cc",
314       "midi/midi_manager_alsa.h",
315     ]
316   }
318   # A simple WebM encoder for animated avatars on ChromeOS.
320   if (use_ozone) {
321     # Used for the generated listing header (ui/ozone/platform_list.h)
322     include_dirs += [ target_gen_dir ]
324     sources += [
325       "ozone/media_ozone_platform.cc",
326       "ozone/media_ozone_platform.h",
327     ] + get_target_outputs(":generate_ozone_constructor_list")
329     deps += [
330       ":generate_ozone_constructor_list",
331       "//ui/ozone",
332     ]
333   }
335   if (is_mac) {
336     deps += [
337       "//media/base/mac",
338       "//third_party/decklink",
339     ]
340     libs += [
341       "CoreMIDI.framework",
342       "CoreVideo.framework",
343       "OpenGL.framework",
344       "QTKit.framework",
345     ]
346   }
348   if (is_ios) {
349     deps += [
350       "//media/base/mac",
351     ]
352   }
354   if (is_win) {
355     libs += [
356       "mf.lib",
357       "mfplat.lib",
358       "mfreadwrite.lib",
359       "mfuuid.lib",
360     ]
361     cflags += [
362       "/wd4267"  # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
363                  # http://crbug.com/171009
364     ]
365   }
367   if (proprietary_codecs) {
368     sources += [
369       "formats/mp2t/es_adapter_video.cc",
370       "formats/mp2t/es_adapter_video.h",
371       "formats/mp2t/es_parser.cc",
372       "formats/mp2t/es_parser.h",
373       "formats/mp2t/es_parser_adts.cc",
374       "formats/mp2t/es_parser_adts.h",
375       "formats/mp2t/es_parser_h264.cc",
376       "formats/mp2t/es_parser_h264.h",
377       "formats/mp2t/es_parser_mpeg1audio.cc",
378       "formats/mp2t/es_parser_mpeg1audio.h",
379       "formats/mp2t/mp2t_common.h",
380       "formats/mp2t/mp2t_stream_parser.cc",
381       "formats/mp2t/mp2t_stream_parser.h",
382       "formats/mp2t/timestamp_unroller.cc",
383       "formats/mp2t/timestamp_unroller.h",
384       "formats/mp2t/ts_packet.cc",
385       "formats/mp2t/ts_packet.h",
386       "formats/mp2t/ts_section.h",
387       "formats/mp2t/ts_section_pat.cc",
388       "formats/mp2t/ts_section_pat.h",
389       "formats/mp2t/ts_section_pes.cc",
390       "formats/mp2t/ts_section_pes.h",
391       "formats/mp2t/ts_section_pmt.cc",
392       "formats/mp2t/ts_section_pmt.h",
393       "formats/mp2t/ts_section_psi.cc",
394       "formats/mp2t/ts_section_psi.h",
395       "formats/mp4/aac.cc",
396       "formats/mp4/aac.h",
397       "formats/mp4/avc.cc",
398       "formats/mp4/avc.h",
399       "formats/mp4/box_definitions.cc",
400       "formats/mp4/box_definitions.h",
401       "formats/mp4/box_reader.cc",
402       "formats/mp4/box_reader.h",
403       "formats/mp4/cenc.cc",
404       "formats/mp4/cenc.h",
405       "formats/mp4/es_descriptor.cc",
406       "formats/mp4/es_descriptor.h",
407       "formats/mp4/mp4_stream_parser.cc",
408       "formats/mp4/mp4_stream_parser.h",
409       "formats/mp4/sample_to_group_iterator.cc",
410       "formats/mp4/sample_to_group_iterator.h",
411       "formats/mp4/track_run_iterator.cc",
412       "formats/mp4/track_run_iterator.h",
413       "formats/mpeg/adts_constants.cc",
414       "formats/mpeg/adts_constants.h",
415       "formats/mpeg/adts_stream_parser.cc",
416       "formats/mpeg/adts_stream_parser.h",
417       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
418       "formats/mpeg/mpeg_audio_stream_parser_base.h",
419       "formats/mpeg/mpeg1_audio_stream_parser.cc",
420       "formats/mpeg/mpeg1_audio_stream_parser.h",
421     ]
422   }
424   public_deps = [
425     "//media/base",
426     "//media/audio",
427   ]
429   deps += [
430     ":shared_memory_support",
431     "//base",
432     "//base:i18n",
433     "//base/third_party/dynamic_annotations",
434     "//crypto",
435     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
436     "//gpu/command_buffer/common",
437     "//skia",
438     "//third_party/libyuv",
439     "//third_party/opus",
440     "//ui/events:events_base",
441     "//ui/gfx",
442     "//ui/gfx/geometry",
443     "//url",
444   ]
447 # Minimal media component for media/cast on iOS.
448 if (is_ios) {
449   component("media_for_cast_ios") {
450     configs += [ ":media_config" ]
451     all_dependent_configs = [ ":media_dependent_config" ]
452     include_dirs = [ "." ]
453     libs = [ "CoreVideo.framework" ]
455     deps = [
456       ":shared_memory_support",
457       "//base",
458       "//media/base:base_for_cast_ios",
459       "//media/base/mac",
460       "//ui/gfx/geometry",
461     ]
462   }
465 test("media_unittests") {
466   sources = [
467     "cdm/aes_decryptor_unittest.cc",
468     "cdm/json_web_key_unittest.cc",
469     "filters/audio_clock_unittest.cc",
470     "filters/audio_decoder_selector_unittest.cc",
471     "filters/audio_renderer_algorithm_unittest.cc",
472     "filters/audio_renderer_impl_unittest.cc",
473     "filters/chunk_demuxer_unittest.cc",
474     "filters/decrypting_audio_decoder_unittest.cc",
475     "filters/decrypting_demuxer_stream_unittest.cc",
476     "filters/decrypting_video_decoder_unittest.cc",
477     "filters/fake_demuxer_stream.cc",
478     "filters/fake_demuxer_stream.h",
479     "filters/fake_demuxer_stream_unittest.cc",
480     "filters/fake_video_decoder.cc",
481     "filters/fake_video_decoder.h",
482     "filters/fake_video_decoder_unittest.cc",
483     "filters/file_data_source_unittest.cc",
484     "filters/frame_processor_unittest.cc",
485     "filters/h264_bit_reader_unittest.cc",
486     "filters/h264_parser_unittest.cc",
487     "filters/renderer_impl_unittest.cc",
488     "filters/skcanvas_video_renderer_unittest.cc",
489     "filters/source_buffer_stream_unittest.cc",
490     "filters/video_decoder_selector_unittest.cc",
491     "filters/video_frame_scheduler_impl_unittest.cc",
492     "filters/video_frame_scheduler_unittest.cc",
493     "filters/video_frame_stream_unittest.cc",
494     "filters/video_renderer_impl_unittest.cc",
495     "midi/midi_manager_unittest.cc",
496     "midi/midi_manager_usb_unittest.cc",
497     "midi/midi_message_queue_unittest.cc",
498     "midi/midi_message_util_unittest.cc",
499     "midi/usb_midi_descriptor_parser_unittest.cc",
500     "midi/usb_midi_input_stream_unittest.cc",
501     "midi/usb_midi_output_stream_unittest.cc",
502     "video/capture/fake_video_capture_device_unittest.cc",
503     "video/capture/video_capture_device_unittest.cc",
504     "formats/common/offset_byte_queue_unittest.cc",
505     "formats/webm/cluster_builder.cc",
506     "formats/webm/cluster_builder.h",
507     "formats/webm/tracks_builder.cc",
508     "formats/webm/tracks_builder.h",
509     "formats/webm/webm_cluster_parser_unittest.cc",
510     "formats/webm/webm_content_encodings_client_unittest.cc",
511     "formats/webm/webm_parser_unittest.cc",
512     "formats/webm/webm_tracks_parser_unittest.cc",
513     "formats/webm/webm_webvtt_parser_unittest.cc",
514   ]
516   deps = [
517     ":media",
518     ":test_support",
519     "//base/allocator",
520     "//base/test:test_support",
521     "//media/audio:unittests",
522     "//media/audio:test_support",
523     "//media/base:unittests",
524     "//media/base:test_support",
525     "//skia",  # Direct dependency required to inherit config.
526     "//testing/gmock",
527     "//testing/gtest",
528     "//third_party/widevine/cdm:version_h",
529     "//ui/gfx:test_support",
530     "//url",
531   ]
533   if (is_android) {
534     deps += [
535       "//media/base/android",
536       # TODO(GYP)
537       #"//testing/android:native_test_native_code"
538     ]
539   }
541   if (media_use_ffmpeg) {
542     sources += [
543       "ffmpeg/ffmpeg_common_unittest.cc",
544       "filters/audio_decoder_unittest.cc",
545       "filters/audio_file_reader_unittest.cc",
546       "filters/blocking_url_protocol_unittest.cc",
547       "filters/ffmpeg_demuxer_unittest.cc",
548       "filters/ffmpeg_glue_unittest.cc",
549       "filters/ffmpeg_video_decoder_unittest.cc",
550       "filters/in_memory_url_protocol_unittest.cc",
551       "filters/pipeline_integration_test.cc",
552       "filters/pipeline_integration_test_base.cc",
553     ]
554   }
556   if (cpu_arch != "arm" && is_chromeos && use_x11) {
557     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
558   }
560   if (proprietary_codecs) {
561     sources += [
562       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
563       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
564       "formats/common/stream_parser_test_base.cc",
565       "formats/common/stream_parser_test_base.h",
566       "formats/mp2t/es_adapter_video_unittest.cc",
567       "formats/mp2t/es_parser_adts_unittest.cc",
568       "formats/mp2t/es_parser_h264_unittest.cc",
569       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
570       "formats/mp2t/es_parser_test_base.cc",
571       "formats/mp2t/es_parser_test_base.h",
572       "formats/mp2t/mp2t_stream_parser_unittest.cc",
573       "formats/mp2t/timestamp_unroller_unittest.cc",
574       "formats/mp4/aac_unittest.cc",
575       "formats/mp4/avc_unittest.cc",
576       "formats/mp4/box_reader_unittest.cc",
577       "formats/mp4/es_descriptor_unittest.cc",
578       "formats/mp4/mp4_stream_parser_unittest.cc",
579       "formats/mp4/sample_to_group_iterator_unittest.cc",
580       "formats/mp4/track_run_iterator_unittest.cc",
581       "formats/mpeg/adts_stream_parser_unittest.cc",
582       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
583     ]
584   }
586   if (is_win && cpu_arch == "x64") {
587     cflags += [
588       "/wd4267"  # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
589                  # http://crbug.com/171009
590     ]
591   }
593   if (is_mac) {
594     sources += [
595       "video/capture/mac/video_capture_device_factory_mac_unittest.mm"
596     ]
597   }
599 #      include_dirs += [
600 #        # Needed by media_drm_bridge.cc.
601 #        target_gen_dir,
602 #      ],
604   configs += [ ":media_config" ]
606   if (media_use_ffmpeg) {
607     deps += [
608       "//third_party/ffmpeg",  # Direct dependency required to inherit config.
609     ]
610   }
613 test("media_perftests") {
614   sources = []
615   if (media_use_ffmpeg) {
616     sources += [
617       "filters/pipeline_integration_perftest.cc",
618       "filters/pipeline_integration_test_base.cc",
619     ]
620   }
621   configs += [ ":media_config" ]
622   deps = [
623     ":media",
624     ":shared_memory_support",
625     ":test_support",
626     "//base/test:test_support",
627     "//media/audio:test_support",
628     "//media/base:perftests",
629     "//media/base:test_support",
630     "//testing/gmock",
631     "//testing/gtest",
632     "//testing/perf",
633     "//third_party/widevine/cdm:version_h",
634     "//ui/gfx:test_support",
635   ]
636   if (is_android) {
637     deps += [ "//ui/gl" ]
638   }
639   if (media_use_ffmpeg) {
640     deps += [
641       "//third_party/ffmpeg",  # Direct dependency required to inherit config.
642     ]
643   }
646 source_set("test_support") {
647   testonly = true
648   sources = [
649     "filters/clockless_video_frame_scheduler.cc",
650     "filters/clockless_video_frame_scheduler.h",
651     "filters/mock_gpu_video_accelerator_factories.cc",
652     "filters/mock_gpu_video_accelerator_factories.h",
653     "filters/test_video_frame_scheduler.cc",
654     "filters/test_video_frame_scheduler.h",
655     "video/mock_video_decode_accelerator.cc",
656     "video/mock_video_decode_accelerator.h",
657   ]
658   deps = [
659     ":media",
660     ":shared_memory_support",
661     "//base",
662     "//skia",
663     "//testing/gmock",
664     "//testing/gtest",
665   ]
668 # TODO(dalecurtis): How to split this across audio/base directories??
669 component("shared_memory_support") {
670   sources = [
671     "audio/audio_parameters.cc",
672     "audio/audio_parameters.h",
673     "base/audio_bus.cc",
674     "base/audio_bus.h",
675     "base/channel_layout.cc",
676     "base/channel_layout.h",
677     "base/limits.h",
678     "base/media_export.h",
679     "base/vector_math.cc",
680     "base/vector_math.h",
681   ]
682   configs += [ ":media_config" ]
683   defines = [ "MEDIA_IMPLEMENTATION" ]
684   deps = [ "//base" ]
687 if (media_use_ffmpeg) {
688   test("ffmpeg_unittests") {
689     sources = [ "ffmpeg/ffmpeg_unittest.cc" ]
691     deps = [
692        ":media",
693        ":test_support",
694        "//base",
695        "//base:i18n",
696        "//base/test:test_support",
697        "//testing/gtest",
698        "//third_party/ffmpeg",
699        "//ui/gfx:test_support",
700     ]
701   }
703   test("ffmpeg_regression_tests") {
704     sources = [
705       "base/run_all_unittests.cc",
706       "ffmpeg/ffmpeg_regression_tests.cc",
707       "filters/pipeline_integration_test_base.cc",
708     ]
709     configs += [ ":media_config" ]
710     deps = [
711       ":media",
712       ":test_support",
713       "//base/test:test_support",
714       "//media/audio:test_support",
715       "//media/base:test_support",
716       "//testing/gmock",
717       "//testing/gtest",
718       "//third_party/ffmpeg",
719       "//ui/gfx/geometry",
720       "//ui/gfx:test_support",
721     ]
722   # TODO(ajwong): This was in the original gyp, but it seems silly.
723   #        ['os_posix==1 and OS!="mac"', {
724   #          'conditions': [
725   #            ['use_allocator!="none"', {
726   #              'dependencies': [
727   #                '../base/allocator/allocator.gyp:allocator',
728   #              ],
729   #            }],
730   #          ],
731   #        }],
732   }
735 if (use_x11) {
736   executable("player_x11") {
737     sources = [
738       "tools/player_x11/data_source_logger.cc",
739       "tools/player_x11/data_source_logger.h",
740       "tools/player_x11/gl_video_renderer.cc",
741       "tools/player_x11/gl_video_renderer.h",
742       "tools/player_x11/player_x11.cc",
743       "tools/player_x11/x11_video_renderer.cc",
744       "tools/player_x11/x11_video_renderer.h",
745     ]
746     configs += [
747       ":media_config",
748       "//build/config/linux:x11",
749       "//build/config/linux:xext",
750 # TODO(ajwong): Why does xext get a separate thing in //build/config/linux:BUILD.gn
751     #  "//build/config/linux:xrender",
752     ]
753     deps = [
754       ":media",
755       ":shared_memory_support",
756       "//base",
757       "//ui/gl",
758       "//ui/gfx",
759       "//ui/gfx/geometry",
760     ]
761   }