Make the timestamp unroll offset consistent accross PES pids.
[chromium-blink-merge.git] / media / BUILD.gn
blob1901a78afbf6f5f0be85b2cf8655b8f43b581a9d
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_stream.cc",
114     "filters/source_buffer_stream.h",
115     "filters/stream_parser_factory.cc",
116     "filters/stream_parser_factory.h",
117     "filters/video_frame_scheduler.h",
118     "filters/video_frame_scheduler_impl.cc",
119     "filters/video_frame_scheduler_impl.h",
120     "filters/video_frame_scheduler_proxy.cc",
121     "filters/video_frame_scheduler_proxy.h",
122     "filters/video_renderer_impl.cc",
123     "filters/video_renderer_impl.h",
124     "filters/webvtt_util.h",
125     "filters/wsola_internals.cc",
126     "filters/wsola_internals.h",
127     "midi/midi_manager.cc",
128     "midi/midi_manager.h",
129     "midi/midi_manager_mac.cc",
130     "midi/midi_manager_mac.h",
131     "midi/midi_manager_usb.cc",
132     "midi/midi_manager_usb.h",
133     "midi/midi_manager_win.cc",
134     "midi/midi_manager_win.h",
135     "midi/midi_message_queue.cc",
136     "midi/midi_message_queue.h",
137     "midi/midi_message_util.cc",
138     "midi/midi_message_util.h",
139     "midi/midi_port_info.cc",
140     "midi/midi_port_info.h",
141     "midi/usb_midi_descriptor_parser.cc",
142     "midi/usb_midi_descriptor_parser.h",
143     "midi/usb_midi_device.h",
144     "midi/usb_midi_input_stream.cc",
145     "midi/usb_midi_input_stream.h",
146     "midi/usb_midi_jack.h",
147     "midi/usb_midi_output_stream.cc",
148     "midi/usb_midi_output_stream.h",
149     "video/capture/fake_video_capture_device.cc",
150     "video/capture/fake_video_capture_device.h",
151     "video/capture/fake_video_capture_device_factory.h",
152     "video/capture/fake_video_capture_device_factory.cc",
153     "video/capture/file_video_capture_device.cc",
154     "video/capture/file_video_capture_device.h",
155     "video/capture/file_video_capture_device_factory.h",
156     "video/capture/file_video_capture_device_factory.cc",
157     "video/capture/linux/video_capture_device_factory_linux.cc",
158     "video/capture/linux/video_capture_device_factory_linux.h",
159     "video/capture/linux/video_capture_device_linux.cc",
160     "video/capture/linux/video_capture_device_linux.h",
161     "video/capture/linux/video_capture_device_chromeos.cc",
162     "video/capture/linux/video_capture_device_chromeos.h",
163     "video/capture/mac/platform_video_capturing_mac.h",
164     "video/capture/mac/video_capture_device_avfoundation_mac.h",
165     "video/capture/mac/video_capture_device_avfoundation_mac.mm",
166     "video/capture/mac/video_capture_device_factory_mac.h",
167     "video/capture/mac/video_capture_device_factory_mac.mm",
168     "video/capture/mac/video_capture_device_mac.h",
169     "video/capture/mac/video_capture_device_mac.mm",
170     "video/capture/mac/video_capture_device_qtkit_mac.h",
171     "video/capture/mac/video_capture_device_qtkit_mac.mm",
172     "video/capture/video_capture_device.cc",
173     "video/capture/video_capture_device.h",
174     "video/capture/video_capture_device_factory.cc",
175     "video/capture/video_capture_device_factory.h",
176     "video/capture/video_capture_types.cc",
177     "video/capture/video_capture_types.h",
178     "video/capture/win/capability_list_win.cc",
179     "video/capture/win/capability_list_win.h",
180     "video/capture/win/filter_base_win.cc",
181     "video/capture/win/filter_base_win.h",
182     "video/capture/win/pin_base_win.cc",
183     "video/capture/win/pin_base_win.h",
184     "video/capture/win/sink_filter_observer_win.h",
185     "video/capture/win/sink_filter_win.cc",
186     "video/capture/win/sink_filter_win.h",
187     "video/capture/win/sink_input_pin_win.cc",
188     "video/capture/win/sink_input_pin_win.h",
189     "video/capture/win/video_capture_device_factory_win.cc",
190     "video/capture/win/video_capture_device_factory_win.h",
191     "video/capture/win/video_capture_device_mf_win.cc",
192     "video/capture/win/video_capture_device_mf_win.h",
193     "video/capture/win/video_capture_device_win.cc",
194     "video/capture/win/video_capture_device_win.h",
195     "video/picture.cc",
196     "video/picture.h",
197     "video/video_decode_accelerator.cc",
198     "video/video_decode_accelerator.h",
199     "video/video_encode_accelerator.cc",
200     "video/video_encode_accelerator.h",
201     "formats/common/offset_byte_queue.cc",
202     "formats/common/offset_byte_queue.h",
203     "formats/webm/webm_audio_client.cc",
204     "formats/webm/webm_audio_client.h",
205     "formats/webm/webm_cluster_parser.cc",
206     "formats/webm/webm_cluster_parser.h",
207     "formats/webm/webm_constants.cc",
208     "formats/webm/webm_constants.h",
209     "formats/webm/webm_content_encodings.cc",
210     "formats/webm/webm_content_encodings.h",
211     "formats/webm/webm_content_encodings_client.cc",
212     "formats/webm/webm_content_encodings_client.h",
213     "formats/webm/webm_crypto_helpers.cc",
214     "formats/webm/webm_crypto_helpers.h",
215     "formats/webm/webm_info_parser.cc",
216     "formats/webm/webm_info_parser.h",
217     "formats/webm/webm_parser.cc",
218     "formats/webm/webm_parser.h",
219     "formats/webm/webm_stream_parser.cc",
220     "formats/webm/webm_stream_parser.h",
221     "formats/webm/webm_tracks_parser.cc",
222     "formats/webm/webm_tracks_parser.h",
223     "formats/webm/webm_video_client.cc",
224     "formats/webm/webm_video_client.h",
225     "formats/webm/webm_webvtt_parser.cc",
226     "formats/webm/webm_webvtt_parser.h",
227   ]
229   configs += [ ":media_config", ]
230   all_dependent_configs = [ ":media_dependent_config" ]
232   cflags = []
233   libs = []
234   defines = []
235   deps = []
237   include_dirs = [ "." ]
238   if (media_use_ffmpeg) {
239     deps += [ "//third_party/ffmpeg" ]
240     sources += [
241       "ffmpeg/ffmpeg_common.cc",
242       "ffmpeg/ffmpeg_common.h",
243       "filters/audio_file_reader.cc",
244       "filters/audio_file_reader.h",
245       "filters/blocking_url_protocol.cc",
246       "filters/blocking_url_protocol.h",
247       "filters/ffmpeg_audio_decoder.cc",
248       "filters/ffmpeg_audio_decoder.h",
249       "filters/ffmpeg_demuxer.cc",
250       "filters/ffmpeg_demuxer.h",
251       "filters/ffmpeg_glue.cc",
252       "filters/ffmpeg_glue.h",
253       "filters/ffmpeg_video_decoder.cc",
254       "filters/ffmpeg_video_decoder.h",
255       "filters/in_memory_url_protocol.cc",
256       "filters/in_memory_url_protocol.h",
257     ]
258     if (proprietary_codecs) {
259       sources += [
260         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
261         "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
262       ]
263     }
264   }
266   if (cpu_arch == "arm" && arm_use_neon) {
267     defines += [ "USE_NEON" ]
268   }
270   if (media_use_libvpx) {
271      sources += [
272        "filters/vpx_video_decoder.cc",
273        "filters/vpx_video_decoder.h",
274      ]
275      deps += [ "//third_party/libvpx" ]
276   }
278   if (!is_android) {
279     sources += [
280       "filters/opus_audio_decoder.cc",
281       "filters/opus_audio_decoder.h",
282     ]
283   } else {
284     sources += [
285       "midi/midi_manager_android.cc",
286       "midi/usb_midi_device_android.cc",
287       "midi/usb_midi_device_android.h",
288       "midi/usb_midi_device_factory_android.cc",
289       "midi/usb_midi_device_factory_android.h",
290       "video/capture/android/video_capture_device_android.cc",
291       "video/capture/android/video_capture_device_android.h",
292       "video/capture/android/video_capture_device_factory_android.cc",
293       "video/capture/android/video_capture_device_factory_android.h",
294     ]
295     deps += [
296       "//media/base/android",
297       "//media/base/android:media_jni_headers",
298       "//media/base/android:video_capture_jni_headers",
299     ]
300     if (!is_android_webview_build) {
301       deps += [ "//media/base/android:media_java" ]
302     }
303   }
305   if (use_alsa) {
306     libs += [ "asound" ]
307     defines += [ "USE_ALSA" ]
308     sources += [
309       "midi/midi_manager_alsa.cc",
310       "midi/midi_manager_alsa.h",
311     ]
312   }
314   # A simple WebM encoder for animated avatars on ChromeOS.
316   if (use_ozone) {
317     # Used for the generated listing header (ui/ozone/platform_list.h)
318     include_dirs += [ target_gen_dir ]
320     sources += [
321       "ozone/media_ozone_platform.cc",
322       "ozone/media_ozone_platform.h",
323     ] + get_target_outputs(":generate_ozone_constructor_list")
325     deps += [
326       ":generate_ozone_constructor_list",
327       "//ui/ozone",
328     ]
329   }
331   if (is_mac) {
332     deps += [
333       "//media/base/mac",
334     ]
335     libs += [
336       "CoreMIDI.framework",
337       "CoreVideo.framework",
338       "OpenGL.framework",
339       "QTKit.framework",
340     ]
341   }
343   if (is_ios) {
344     deps += [
345       "//media/base/mac",
346     ]
347   }
349   if (is_win) {
350     libs += [
351       "mf.lib",
352       "mfplat.lib",
353       "mfreadwrite.lib",
354       "mfuuid.lib",
355     ]
356     cflags += [
357       "/wd4267"  # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
358                  # http://crbug.com/171009
359     ]
360   }
362   if (proprietary_codecs) {
363     sources += [
364       "formats/mp2t/es_adapter_video.cc",
365       "formats/mp2t/es_adapter_video.h",
366       "formats/mp2t/es_parser.cc",
367       "formats/mp2t/es_parser.h",
368       "formats/mp2t/es_parser_adts.cc",
369       "formats/mp2t/es_parser_adts.h",
370       "formats/mp2t/es_parser_h264.cc",
371       "formats/mp2t/es_parser_h264.h",
372       "formats/mp2t/es_parser_mpeg1audio.cc",
373       "formats/mp2t/es_parser_mpeg1audio.h",
374       "formats/mp2t/mp2t_common.h",
375       "formats/mp2t/mp2t_stream_parser.cc",
376       "formats/mp2t/mp2t_stream_parser.h",
377       "formats/mp2t/timestamp_unroller.cc",
378       "formats/mp2t/timestamp_unroller.h",
379       "formats/mp2t/ts_packet.cc",
380       "formats/mp2t/ts_packet.h",
381       "formats/mp2t/ts_section.h",
382       "formats/mp2t/ts_section_pat.cc",
383       "formats/mp2t/ts_section_pat.h",
384       "formats/mp2t/ts_section_pes.cc",
385       "formats/mp2t/ts_section_pes.h",
386       "formats/mp2t/ts_section_pmt.cc",
387       "formats/mp2t/ts_section_pmt.h",
388       "formats/mp2t/ts_section_psi.cc",
389       "formats/mp2t/ts_section_psi.h",
390       "formats/mp4/aac.cc",
391       "formats/mp4/aac.h",
392       "formats/mp4/avc.cc",
393       "formats/mp4/avc.h",
394       "formats/mp4/box_definitions.cc",
395       "formats/mp4/box_definitions.h",
396       "formats/mp4/box_reader.cc",
397       "formats/mp4/box_reader.h",
398       "formats/mp4/cenc.cc",
399       "formats/mp4/cenc.h",
400       "formats/mp4/es_descriptor.cc",
401       "formats/mp4/es_descriptor.h",
402       "formats/mp4/mp4_stream_parser.cc",
403       "formats/mp4/mp4_stream_parser.h",
404       "formats/mp4/sample_to_group_iterator.cc",
405       "formats/mp4/sample_to_group_iterator.h",
406       "formats/mp4/track_run_iterator.cc",
407       "formats/mp4/track_run_iterator.h",
408       "formats/mpeg/adts_constants.cc",
409       "formats/mpeg/adts_constants.h",
410       "formats/mpeg/adts_stream_parser.cc",
411       "formats/mpeg/adts_stream_parser.h",
412       "formats/mpeg/mpeg_audio_stream_parser_base.cc",
413       "formats/mpeg/mpeg_audio_stream_parser_base.h",
414       "formats/mpeg/mpeg1_audio_stream_parser.cc",
415       "formats/mpeg/mpeg1_audio_stream_parser.h",
416     ]
417   }
419   deps += [
420     ":shared_memory_support",
421     "//base",
422     "//base:i18n",
423     "//base/third_party/dynamic_annotations",
424     "//crypto",
425     "//crypto:platform",  # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
426     "//gpu/command_buffer/common",
427     "//media/audio",
428     "//media/base",
429     "//skia",
430     "//third_party/libyuv",
431     "//third_party/opus",
432     "//ui/events:events_base",
433     "//ui/gfx",
434     "//ui/gfx/geometry",
435     "//url",
436   ]
439 test("media_unittests") {
440   sources = [
441     "cdm/aes_decryptor_unittest.cc",
442     "cdm/json_web_key_unittest.cc",
443     "filters/audio_clock_unittest.cc",
444     "filters/audio_decoder_selector_unittest.cc",
445     "filters/audio_renderer_algorithm_unittest.cc",
446     "filters/audio_renderer_impl_unittest.cc",
447     "filters/chunk_demuxer_unittest.cc",
448     "filters/decrypting_audio_decoder_unittest.cc",
449     "filters/decrypting_demuxer_stream_unittest.cc",
450     "filters/decrypting_video_decoder_unittest.cc",
451     "filters/fake_demuxer_stream.cc",
452     "filters/fake_demuxer_stream.h",
453     "filters/fake_demuxer_stream_unittest.cc",
454     "filters/fake_video_decoder.cc",
455     "filters/fake_video_decoder.h",
456     "filters/fake_video_decoder_unittest.cc",
457     "filters/file_data_source_unittest.cc",
458     "filters/frame_processor_unittest.cc",
459     "filters/h264_bit_reader_unittest.cc",
460     "filters/h264_parser_unittest.cc",
461     "filters/renderer_impl_unittest.cc",
462     "filters/skcanvas_video_renderer_unittest.cc",
463     "filters/source_buffer_stream_unittest.cc",
464     "filters/video_decoder_selector_unittest.cc",
465     "filters/video_frame_scheduler_impl_unittest.cc",
466     "filters/video_frame_scheduler_unittest.cc",
467     "filters/video_frame_stream_unittest.cc",
468     "filters/video_renderer_impl_unittest.cc",
469     "midi/midi_manager_unittest.cc",
470     "midi/midi_manager_usb_unittest.cc",
471     "midi/midi_message_queue_unittest.cc",
472     "midi/midi_message_util_unittest.cc",
473     "midi/usb_midi_descriptor_parser_unittest.cc",
474     "midi/usb_midi_input_stream_unittest.cc",
475     "midi/usb_midi_output_stream_unittest.cc",
476     "video/capture/fake_video_capture_device_unittest.cc",
477     "video/capture/video_capture_device_unittest.cc",
478     "formats/common/offset_byte_queue_unittest.cc",
479     "formats/webm/cluster_builder.cc",
480     "formats/webm/cluster_builder.h",
481     "formats/webm/tracks_builder.cc",
482     "formats/webm/tracks_builder.h",
483     "formats/webm/webm_cluster_parser_unittest.cc",
484     "formats/webm/webm_content_encodings_client_unittest.cc",
485     "formats/webm/webm_parser_unittest.cc",
486     "formats/webm/webm_tracks_parser_unittest.cc",
487     "formats/webm/webm_webvtt_parser_unittest.cc",
488   ]
490   deps = [
491     ":media",
492     ":test_support",
493     "//base/allocator",
494     "//base/test:test_support",
495     "//media/audio:unittests",
496     "//media/audio:test_support",
497     "//media/base:unittests",
498     "//media/base:test_support",
499     "//skia",  # Direct dependency required to inherit config.
500     "//testing/gmock",
501     "//testing/gtest",
502     "//third_party/widevine/cdm:version_h",
503     "//ui/gfx:test_support",
504     "//url",
505   ]
507   if (is_android) {
508     deps += [
509       "//media/base/android",
510       # TODO(GYP)
511       #"//testing/android:native_test_native_code"
512     ]
513   }
515   if (media_use_ffmpeg) {
516     sources += [
517       "ffmpeg/ffmpeg_common_unittest.cc",
518       "filters/audio_decoder_unittest.cc",
519       "filters/audio_file_reader_unittest.cc",
520       "filters/blocking_url_protocol_unittest.cc",
521       "filters/ffmpeg_demuxer_unittest.cc",
522       "filters/ffmpeg_glue_unittest.cc",
523       "filters/ffmpeg_video_decoder_unittest.cc",
524       "filters/in_memory_url_protocol_unittest.cc",
525       "filters/pipeline_integration_test.cc",
526       "filters/pipeline_integration_test_base.cc",
527     ]
528   }
530   if (cpu_arch != "arm" && is_chromeos && use_x11) {
531     sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
532   }
534   if (proprietary_codecs) {
535     sources += [
536       "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
537       "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
538       "formats/common/stream_parser_test_base.cc",
539       "formats/common/stream_parser_test_base.h",
540       "formats/mp2t/es_adapter_video_unittest.cc",
541       "formats/mp2t/es_parser_adts_unittest.cc",
542       "formats/mp2t/es_parser_h264_unittest.cc",
543       "formats/mp2t/es_parser_mpeg1audio_unittest.cc",
544       "formats/mp2t/es_parser_test_base.cc",
545       "formats/mp2t/es_parser_test_base.h",
546       "formats/mp2t/mp2t_stream_parser_unittest.cc",
547       "formats/mp2t/timestamp_unroller_unittest.cc",
548       "formats/mp4/aac_unittest.cc",
549       "formats/mp4/avc_unittest.cc",
550       "formats/mp4/box_reader_unittest.cc",
551       "formats/mp4/es_descriptor_unittest.cc",
552       "formats/mp4/mp4_stream_parser_unittest.cc",
553       "formats/mp4/sample_to_group_iterator_unittest.cc",
554       "formats/mp4/track_run_iterator_unittest.cc",
555       "formats/mpeg/adts_stream_parser_unittest.cc",
556       "formats/mpeg/mpeg1_audio_stream_parser_unittest.cc",
557     ]
558   }
560   if (is_win && cpu_arch == "x64") {
561     cflags += [
562       "/wd4267"  # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
563                  # http://crbug.com/171009
564     ]
565   }
567   if (is_mac) {
568     sources += [
569       "video/capture/mac/video_capture_device_factory_mac_unittest.mm"
570     ]
571   }
573 #      include_dirs += [
574 #        # Needed by media_drm_bridge.cc.
575 #        target_gen_dir,
576 #      ],
578   configs += [ ":media_config" ]
580   if (media_use_ffmpeg) {
581     deps += [
582       "//third_party/ffmpeg",  # Direct dependency required to inherit config.
583     ]
584   }
587 test("media_perftests") {
588   sources = []
589   if (media_use_ffmpeg) {
590     sources += [
591       "filters/pipeline_integration_perftest.cc",
592       "filters/pipeline_integration_test_base.cc",
593     ]
594   }
595   configs += [ ":media_config" ]
596   deps = [
597     ":media",
598     ":shared_memory_support",
599     ":test_support",
600     "//base/test:test_support",
601     "//media/audio:test_support",
602     "//media/base:perftests",
603     "//media/base:test_support",
604     "//testing/gmock",
605     "//testing/gtest",
606     "//testing/perf",
607     "//third_party/widevine/cdm:version_h",
608     "//ui/gfx:test_support",
609   ]
610   if (is_android) {
611     deps += [ "//ui/gl" ]
612   }
613   if (media_use_ffmpeg) {
614     deps += [
615       "//third_party/ffmpeg",  # Direct dependency required to inherit config.
616     ]
617   }
620 source_set("test_support") {
621   testonly = true
622   sources = [
623     "filters/clockless_video_frame_scheduler.cc",
624     "filters/clockless_video_frame_scheduler.h",
625     "filters/mock_gpu_video_accelerator_factories.cc",
626     "filters/mock_gpu_video_accelerator_factories.h",
627     "filters/test_video_frame_scheduler.cc",
628     "filters/test_video_frame_scheduler.h",
629     "video/mock_video_decode_accelerator.cc",
630     "video/mock_video_decode_accelerator.h",
631   ]
632   deps = [
633     ":media",
634     ":shared_memory_support",
635     "//base",
636     "//skia",
637     "//testing/gmock",
638     "//testing/gtest",
639   ]
642 # TODO(dalecurtis): How to split this across audio/base directories??
643 component("shared_memory_support") {
644   sources = [
645     "audio/audio_parameters.cc",
646     "audio/audio_parameters.h",
647     "base/audio_bus.cc",
648     "base/audio_bus.h",
649     "base/channel_layout.cc",
650     "base/channel_layout.h",
651     "base/limits.h",
652     "base/media_export.h",
653     "base/vector_math.cc",
654     "base/vector_math.h",
655   ]
656   configs += [ ":media_config" ]
657   defines = [ "MEDIA_IMPLEMENTATION" ]
658   deps = [ "//base" ]
661 if (media_use_ffmpeg) {
662   test("ffmpeg_unittests") {
663     sources = [ "ffmpeg/ffmpeg_unittest.cc" ]
665     deps = [
666        ":media",
667        ":test_support",
668        "//base",
669        "//base:i18n",
670        "//base/test:test_support",
671        "//testing/gtest",
672        "//third_party/ffmpeg",
673        "//ui/gfx:test_support",
674     ]
675   }
677   test("ffmpeg_regression_tests") {
678     sources = [
679       "base/run_all_unittests.cc",
680       "ffmpeg/ffmpeg_regression_tests.cc",
681       "filters/pipeline_integration_test_base.cc",
682     ]
683     configs += [ ":media_config" ]
684     deps = [
685       ":media",
686       ":test_support",
687       "//base/test:test_support",
688       "//media/audio:test_support",
689       "//media/base:test_support",
690       "//testing/gmock",
691       "//testing/gtest",
692       "//third_party/ffmpeg",
693       "//ui/gfx/geometry",
694       "//ui/gfx:test_support",
695     ]
696   # TODO(ajwong): This was in the original gyp, but it seems silly.
697   #        ['os_posix==1 and OS!="mac"', {
698   #          'conditions': [
699   #            ['use_allocator!="none"', {
700   #              'dependencies': [
701   #                '../base/allocator/allocator.gyp:allocator',
702   #              ],
703   #            }],
704   #          ],
705   #        }],
706   }
709 if (use_x11) {
710   executable("player_x11") {
711     sources = [
712       "tools/player_x11/data_source_logger.cc",
713       "tools/player_x11/data_source_logger.h",
714       "tools/player_x11/gl_video_renderer.cc",
715       "tools/player_x11/gl_video_renderer.h",
716       "tools/player_x11/player_x11.cc",
717       "tools/player_x11/x11_video_renderer.cc",
718       "tools/player_x11/x11_video_renderer.h",
719     ]
720     configs += [
721       ":media_config",
722       "//build/config/linux:x11",
723       "//build/config/linux:xext",
724 # TODO(ajwong): Why does xext get a separate thing in //build/config/linux:BUILD.gn
725     #  "//build/config/linux:xrender",
726     ]
727     deps = [
728       ":media",
729       ":shared_memory_support",
730       "//base",
731       "//ui/gl",
732       "//ui/gfx",
733       "//ui/gfx/geometry",
734     ]
735   }