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