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