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