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