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.
13 config("media_config") {
14 defines = [ "MEDIA_IMPLEMENTATION" ]
15 if (cpu_arch == "arm" && arm_use_neon) {
16 defines += [ "USE_NEON" ]
18 if (!media_use_libvpx) {
19 defines += [ "MEDIA_DISABLE_LIBVPX" ]
22 defines += [ "USE_PULSEAUDIO" ]
23 if (linux_link_pulseaudio) {
24 defines += [ "DLOPEN_PULSEAUDIO" ]
28 defines = [ "USE_CRAS" ]
30 if (enable_mpeg2ts_stream_parser) {
31 defines += [ "ENABLE_MPEG2TS_STREAM_PARSER" ]
35 config("media_dependent_config") {
39 "/DELAYLOAD:mfplat.dll",
40 "/DELAYLOAD:mfreadwrite.dll",
46 action("generate_ozone_constructor_list") {
47 # Ozone platform objects are auto-generated using similar
48 # patterns for naming and classes constructors. Here we build the
49 # object MediaOzonePlatform.
50 script = "../ui/ozone/generate_constructor_list.py"
52 platform_list_txt_file = "$target_gen_dir/ui/ozone/platform_list.txt"
53 constructor_list_cc_file = "$target_gen_dir/media/ozone/constructor_list.cc"
55 sources = [ platform_list_txt_file ]
56 outputs = [ constructor_list_cc_file ]
58 "--platform_list=$platform_list_txt_file",
59 "--output_cc=$constructor_list_cc_file",
61 "--typename=MediaOzonePlatform",
62 "--include=\"media/ozone/media_ozone_platform.h\""
69 "base/audio_block_fifo.cc",
70 "base/audio_block_fifo.h",
71 "base/audio_buffer.cc",
72 "base/audio_buffer.h",
73 "base/audio_buffer_queue.cc",
74 "base/audio_buffer_queue.h",
75 "base/audio_capturer_source.h",
76 "base/audio_buffer_converter.cc",
77 "base/audio_buffer_converter.h",
78 "base/audio_converter.cc",
79 "base/audio_converter.h",
80 "base/audio_decoder.cc",
81 "base/audio_decoder.h",
82 "base/audio_decoder_config.cc",
83 "base/audio_decoder_config.h",
84 "base/audio_discard_helper.cc",
85 "base/audio_discard_helper.h",
88 "base/audio_hardware_config.cc",
89 "base/audio_hardware_config.h",
92 "base/audio_pull_fifo.cc",
93 "base/audio_pull_fifo.h",
94 "base/audio_renderer.cc",
95 "base/audio_renderer.h",
96 "base/audio_renderer_mixer.cc",
97 "base/audio_renderer_mixer.h",
98 "base/audio_renderer_mixer_input.cc",
99 "base/audio_renderer_mixer_input.h",
100 "base/audio_renderer_sink.h",
101 "base/audio_splicer.cc",
102 "base/audio_splicer.h",
103 "base/audio_timestamp_helper.cc",
104 "base/audio_timestamp_helper.h",
105 "base/bind_to_current_loop.h",
106 "base/bit_reader.cc",
108 "base/bit_reader_core.cc",
109 "base/bit_reader_core.h",
110 "base/bitstream_buffer.h",
111 "base/buffering_state.h",
113 "base/byte_queue.cc",
115 "base/cdm_promise.cc",
116 "base/cdm_promise.h",
117 "base/channel_mixer.cc",
118 "base/channel_mixer.h",
120 "base/data_buffer.cc",
121 "base/data_buffer.h",
122 "base/data_source.cc",
123 "base/data_source.h",
124 "base/decoder_buffer.cc",
125 "base/decoder_buffer.h",
126 "base/decoder_buffer_queue.cc",
127 "base/decoder_buffer_queue.h",
128 "base/decrypt_config.cc",
129 "base/decrypt_config.h",
134 "base/demuxer_stream.cc",
135 "base/demuxer_stream.h",
138 "base/filter_collection.cc",
139 "base/filter_collection.h",
142 "base/media_keys.cc",
146 "base/media_log_event.h",
147 "base/media_switches.cc",
148 "base/media_switches.h",
150 "base/multi_channel_resampler.cc",
151 "base/multi_channel_resampler.h",
154 "base/pipeline_status.h",
155 "base/player_tracker.cc",
156 "base/player_tracker.h",
159 "base/sample_format.cc",
160 "base/sample_format.h",
161 "base/scoped_histogram_timer.h",
162 "base/seekable_buffer.cc",
163 "base/seekable_buffer.h",
164 "base/serial_runner.cc",
165 "base/serial_runner.h",
166 "base/simd/convert_rgb_to_yuv.h",
167 "base/simd/convert_rgb_to_yuv_c.cc",
168 "base/simd/convert_yuv_to_rgb.h",
169 "base/simd/convert_yuv_to_rgb_c.cc",
170 "base/simd/filter_yuv.h",
171 "base/simd/filter_yuv_c.cc",
172 "base/simd/yuv_to_rgb_table.cc",
173 "base/simd/yuv_to_rgb_table.h",
174 "base/sinc_resampler.cc",
175 "base/sinc_resampler.h",
176 "base/stream_parser.cc",
177 "base/stream_parser.h",
178 "base/stream_parser_buffer.cc",
179 "base/stream_parser_buffer.h",
182 "base/text_ranges.cc",
183 "base/text_ranges.h",
184 "base/text_renderer.cc",
185 "base/text_renderer.h",
187 "base/text_track_config.cc",
188 "base/text_track_config.h",
189 "base/time_delta_interpolator.cc",
190 "base/time_delta_interpolator.h",
191 "base/time_source.h",
192 "base/user_input_monitor.cc",
193 "base/user_input_monitor.h",
194 "base/user_input_monitor_mac.cc",
195 "base/user_input_monitor_win.cc",
196 "base/video_decoder.cc",
197 "base/video_decoder.h",
198 "base/video_decoder_config.cc",
199 "base/video_decoder_config.h",
200 "base/video_frame.cc",
201 "base/video_frame.h",
202 "base/video_frame_pool.cc",
203 "base/video_frame_pool.h",
204 "base/video_renderer.cc",
205 "base/video_renderer.h",
206 "base/video_rotation.h",
207 "base/video_util.cc",
209 "base/wall_clock_time_source.cc",
210 "base/wall_clock_time_source.h",
211 "base/yuv_convert.cc",
212 "base/yuv_convert.h",
213 "cdm/aes_decryptor.cc",
214 "cdm/aes_decryptor.h",
215 "cdm/json_web_key.cc",
216 "cdm/json_web_key.h",
217 "cdm/key_system_names.cc",
218 "cdm/key_system_names.h",
219 "cdm/player_tracker_impl.cc",
220 "cdm/player_tracker_impl.h",
221 "ffmpeg/ffmpeg_deleters.h",
222 "filters/audio_clock.cc",
223 "filters/audio_clock.h",
224 "filters/audio_renderer_algorithm.cc",
225 "filters/audio_renderer_algorithm.h",
226 "filters/audio_renderer_impl.cc",
227 "filters/audio_renderer_impl.h",
228 "filters/chunk_demuxer.cc",
229 "filters/chunk_demuxer.h",
230 "filters/decoder_selector.cc",
231 "filters/decoder_selector.h",
232 "filters/decoder_stream.cc",
233 "filters/decoder_stream.h",
234 "filters/decoder_stream_traits.cc",
235 "filters/decoder_stream_traits.h",
236 "filters/decrypting_audio_decoder.cc",
237 "filters/decrypting_audio_decoder.h",
238 "filters/decrypting_demuxer_stream.cc",
239 "filters/decrypting_demuxer_stream.h",
240 "filters/decrypting_video_decoder.cc",
241 "filters/decrypting_video_decoder.h",
242 "filters/file_data_source.cc",
243 "filters/file_data_source.h",
244 "filters/frame_processor.cc",
245 "filters/frame_processor.h",
246 "filters/gpu_video_accelerator_factories.cc",
247 "filters/gpu_video_accelerator_factories.h",
248 "filters/gpu_video_decoder.cc",
249 "filters/gpu_video_decoder.h",
250 "filters/h264_bit_reader.cc",
251 "filters/h264_bit_reader.h",
252 "filters/h264_parser.cc",
253 "filters/h264_parser.h",
254 "filters/skcanvas_video_renderer.cc",
255 "filters/skcanvas_video_renderer.h",
256 "filters/source_buffer_platform.cc",
257 "filters/source_buffer_platform.h",
258 "filters/source_buffer_stream.cc",
259 "filters/source_buffer_stream.h",
260 "filters/stream_parser_factory.cc",
261 "filters/stream_parser_factory.h",
262 "filters/video_frame_scheduler.h",
263 "filters/video_frame_scheduler_impl.cc",
264 "filters/video_frame_scheduler_impl.h",
265 "filters/video_frame_scheduler_proxy.cc",
266 "filters/video_frame_scheduler_proxy.h",
267 "filters/video_renderer_impl.cc",
268 "filters/video_renderer_impl.h",
269 "filters/webvtt_util.h",
270 "filters/wsola_internals.cc",
271 "filters/wsola_internals.h",
272 "midi/midi_manager.cc",
273 "midi/midi_manager.h",
274 "midi/midi_manager_mac.cc",
275 "midi/midi_manager_mac.h",
276 "midi/midi_manager_usb.cc",
277 "midi/midi_manager_usb.h",
278 "midi/midi_manager_win.cc",
279 "midi/midi_manager_win.h",
280 "midi/midi_message_queue.cc",
281 "midi/midi_message_queue.h",
282 "midi/midi_message_util.cc",
283 "midi/midi_message_util.h",
284 "midi/midi_port_info.cc",
285 "midi/midi_port_info.h",
286 "midi/usb_midi_descriptor_parser.cc",
287 "midi/usb_midi_descriptor_parser.h",
288 "midi/usb_midi_device.h",
289 "midi/usb_midi_input_stream.cc",
290 "midi/usb_midi_input_stream.h",
291 "midi/usb_midi_jack.h",
292 "midi/usb_midi_output_stream.cc",
293 "midi/usb_midi_output_stream.h",
294 "video/capture/fake_video_capture_device.cc",
295 "video/capture/fake_video_capture_device.h",
296 "video/capture/fake_video_capture_device_factory.h",
297 "video/capture/fake_video_capture_device_factory.cc",
298 "video/capture/file_video_capture_device.cc",
299 "video/capture/file_video_capture_device.h",
300 "video/capture/file_video_capture_device_factory.h",
301 "video/capture/file_video_capture_device_factory.cc",
302 "video/capture/linux/video_capture_device_factory_linux.cc",
303 "video/capture/linux/video_capture_device_factory_linux.h",
304 "video/capture/linux/video_capture_device_linux.cc",
305 "video/capture/linux/video_capture_device_linux.h",
306 "video/capture/linux/video_capture_device_chromeos.cc",
307 "video/capture/linux/video_capture_device_chromeos.h",
308 "video/capture/mac/avfoundation_glue.h",
309 "video/capture/mac/avfoundation_glue.mm",
310 "video/capture/mac/coremedia_glue.h",
311 "video/capture/mac/coremedia_glue.mm",
312 "video/capture/mac/platform_video_capturing_mac.h",
313 "video/capture/mac/video_capture_device_avfoundation_mac.h",
314 "video/capture/mac/video_capture_device_avfoundation_mac.mm",
315 "video/capture/mac/video_capture_device_factory_mac.h",
316 "video/capture/mac/video_capture_device_factory_mac.mm",
317 "video/capture/mac/video_capture_device_mac.h",
318 "video/capture/mac/video_capture_device_mac.mm",
319 "video/capture/mac/video_capture_device_qtkit_mac.h",
320 "video/capture/mac/video_capture_device_qtkit_mac.mm",
321 "video/capture/video_capture_device.cc",
322 "video/capture/video_capture_device.h",
323 "video/capture/video_capture_device_factory.cc",
324 "video/capture/video_capture_device_factory.h",
325 "video/capture/video_capture_types.cc",
326 "video/capture/video_capture_types.h",
327 "video/capture/win/capability_list_win.cc",
328 "video/capture/win/capability_list_win.h",
329 "video/capture/win/filter_base_win.cc",
330 "video/capture/win/filter_base_win.h",
331 "video/capture/win/pin_base_win.cc",
332 "video/capture/win/pin_base_win.h",
333 "video/capture/win/sink_filter_observer_win.h",
334 "video/capture/win/sink_filter_win.cc",
335 "video/capture/win/sink_filter_win.h",
336 "video/capture/win/sink_input_pin_win.cc",
337 "video/capture/win/sink_input_pin_win.h",
338 "video/capture/win/video_capture_device_factory_win.cc",
339 "video/capture/win/video_capture_device_factory_win.h",
340 "video/capture/win/video_capture_device_mf_win.cc",
341 "video/capture/win/video_capture_device_mf_win.h",
342 "video/capture/win/video_capture_device_win.cc",
343 "video/capture/win/video_capture_device_win.h",
346 "video/video_decode_accelerator.cc",
347 "video/video_decode_accelerator.h",
348 "video/video_encode_accelerator.cc",
349 "video/video_encode_accelerator.h",
350 "formats/common/offset_byte_queue.cc",
351 "formats/common/offset_byte_queue.h",
352 "formats/webm/webm_audio_client.cc",
353 "formats/webm/webm_audio_client.h",
354 "formats/webm/webm_cluster_parser.cc",
355 "formats/webm/webm_cluster_parser.h",
356 "formats/webm/webm_constants.cc",
357 "formats/webm/webm_constants.h",
358 "formats/webm/webm_content_encodings.cc",
359 "formats/webm/webm_content_encodings.h",
360 "formats/webm/webm_content_encodings_client.cc",
361 "formats/webm/webm_content_encodings_client.h",
362 "formats/webm/webm_crypto_helpers.cc",
363 "formats/webm/webm_crypto_helpers.h",
364 "formats/webm/webm_info_parser.cc",
365 "formats/webm/webm_info_parser.h",
366 "formats/webm/webm_parser.cc",
367 "formats/webm/webm_parser.h",
368 "formats/webm/webm_stream_parser.cc",
369 "formats/webm/webm_stream_parser.h",
370 "formats/webm/webm_tracks_parser.cc",
371 "formats/webm/webm_tracks_parser.h",
372 "formats/webm/webm_video_client.cc",
373 "formats/webm/webm_video_client.h",
374 "formats/webm/webm_webvtt_parser.cc",
375 "formats/webm/webm_webvtt_parser.h",
378 configs += [ ":media_config", ]
379 all_dependent_configs = [ ":media_dependent_config" ]
386 include_dirs = [ "." ]
387 if (media_use_ffmpeg) {
388 deps += [ "//third_party/ffmpeg" ]
390 "base/audio_video_metadata_extractor.cc",
391 "base/audio_video_metadata_extractor.h",
392 "base/container_names.cc",
393 "base/container_names.h",
394 "base/media_file_checker.cc",
395 "base/media_file_checker.h",
396 "base/media_posix.cc",
397 "ffmpeg/ffmpeg_common.cc",
398 "ffmpeg/ffmpeg_common.h",
399 "filters/audio_file_reader.cc",
400 "filters/audio_file_reader.h",
401 "filters/blocking_url_protocol.cc",
402 "filters/blocking_url_protocol.h",
403 "filters/ffmpeg_audio_decoder.cc",
404 "filters/ffmpeg_audio_decoder.h",
405 "filters/ffmpeg_demuxer.cc",
406 "filters/ffmpeg_demuxer.h",
407 "filters/ffmpeg_glue.cc",
408 "filters/ffmpeg_glue.h",
409 "filters/ffmpeg_video_decoder.cc",
410 "filters/ffmpeg_video_decoder.h",
411 "filters/in_memory_url_protocol.cc",
412 "filters/in_memory_url_protocol.h",
414 if (proprietary_codecs) {
416 "filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc",
417 "filters/ffmpeg_h264_to_annex_b_bitstream_converter.h",
422 if (cpu_arch == "arm" && arm_use_neon) {
423 defines += [ "USE_NEON" ]
426 if (media_use_libvpx) {
428 "filters/vpx_video_decoder.cc",
429 "filters/vpx_video_decoder.h",
431 deps += [ "//third_party/libvpx" ]
434 if (enable_browser_cdms) {
436 "base/browser_cdm.cc",
437 "base/browser_cdm.h",
438 "base/browser_cdm_factory.h",
444 "filters/opus_audio_decoder.cc",
445 "filters/opus_audio_decoder.h",
449 "base/android/demuxer_android.h",
450 "base/android/demuxer_stream_player_params.cc",
451 "base/android/demuxer_stream_player_params.h",
452 "base/android/media_player_manager.h",
453 "base/android/media_resource_getter.cc",
454 "base/android/media_resource_getter.h",
455 "base/media_stub.cc",
456 "midi/midi_manager_android.cc",
457 "midi/usb_midi_device_android.cc",
458 "midi/usb_midi_device_android.h",
459 "midi/usb_midi_device_factory_android.cc",
460 "midi/usb_midi_device_factory_android.h",
461 "video/capture/android/video_capture_device_android.cc",
462 "video/capture/android/video_capture_device_android.h",
463 "video/capture/android/video_capture_device_factory_android.cc",
464 "video/capture/android/video_capture_device_factory_android.h",
466 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
468 ":media_android_jni_headers",
470 ":video_capture_android_jni_headers",
472 if (!is_android_webview_build) {
473 deps += [ ":media_java" ]
478 # A simple WebM encoder for animated avatars on ChromeOS.
480 "formats/webm/chromeos/ebml_writer.cc",
481 "formats/webm/chromeos/ebml_writer.h",
482 "formats/webm/chromeos/webm_encoder.cc",
483 "formats/webm/chromeos/webm_encoder.h",
486 "//third_party/libvpx",
487 "//third_party/libyuv"
489 # For VaapiVideoEncodeAccelerator.
490 if (cpu_arch != "arm" && use_x11) {
492 "filters/h264_bitstream_buffer.cc",
493 "filters/h264_bitstream_buffer.h",
499 deps += [ "//third_party/libyuv" ]
504 defines += [ "USE_ALSA" ]
506 "midi/midi_manager_alsa.cc",
507 "midi/midi_manager_alsa.h",
511 # A simple WebM encoder for animated avatars on ChromeOS.
515 "//build/config/linux:x11",
516 "//build/config/linux:xext",
517 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
518 # "//build/config/linux:xdamage",
519 # "//build/config/linux:xfixes",
520 # "//build/config/linux:xtst",
523 "base/user_input_monitor_linux.cc"
526 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
531 # Used for the generated listing header (ui/ozone/platform_list.h)
532 include_dirs += [ target_gen_dir ]
535 "ozone/media_ozone_platform.cc",
536 "ozone/media_ozone_platform.h",
537 ] + get_target_outputs(":generate_ozone_constructor_list")
540 ":generate_ozone_constructor_list",
547 "CoreMIDI.framework",
548 "CoreVideo.framework",
562 "/wd4267" # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
563 # http://crbug.com/171009
567 if (proprietary_codecs) {
569 "formats/mp2t/es_adapter_video.cc",
570 "formats/mp2t/es_adapter_video.h",
571 "formats/mp2t/es_parser.h",
572 "formats/mp2t/es_parser_adts.cc",
573 "formats/mp2t/es_parser_adts.h",
574 "formats/mp2t/es_parser_h264.cc",
575 "formats/mp2t/es_parser_h264.h",
576 "formats/mp2t/mp2t_common.h",
577 "formats/mp2t/mp2t_stream_parser.cc",
578 "formats/mp2t/mp2t_stream_parser.h",
579 "formats/mp2t/ts_packet.cc",
580 "formats/mp2t/ts_packet.h",
581 "formats/mp2t/ts_section.h",
582 "formats/mp2t/ts_section_pat.cc",
583 "formats/mp2t/ts_section_pat.h",
584 "formats/mp2t/ts_section_pes.cc",
585 "formats/mp2t/ts_section_pes.h",
586 "formats/mp2t/ts_section_pmt.cc",
587 "formats/mp2t/ts_section_pmt.h",
588 "formats/mp2t/ts_section_psi.cc",
589 "formats/mp2t/ts_section_psi.h",
590 "formats/mp4/aac.cc",
592 "formats/mp4/avc.cc",
594 "formats/mp4/box_definitions.cc",
595 "formats/mp4/box_definitions.h",
596 "formats/mp4/box_reader.cc",
597 "formats/mp4/box_reader.h",
598 "formats/mp4/cenc.cc",
599 "formats/mp4/cenc.h",
600 "formats/mp4/es_descriptor.cc",
601 "formats/mp4/es_descriptor.h",
602 "formats/mp4/mp4_stream_parser.cc",
603 "formats/mp4/mp4_stream_parser.h",
604 "formats/mp4/sample_to_group_iterator.cc",
605 "formats/mp4/sample_to_group_iterator.h",
606 "formats/mp4/track_run_iterator.cc",
607 "formats/mp4/track_run_iterator.h",
608 "formats/mpeg/adts_constants.cc",
609 "formats/mpeg/adts_constants.h",
610 "formats/mpeg/adts_stream_parser.cc",
611 "formats/mpeg/adts_stream_parser.h",
612 "formats/mpeg/mp3_stream_parser.cc",
613 "formats/mpeg/mp3_stream_parser.h",
614 "formats/mpeg/mpeg_audio_stream_parser_base.cc",
615 "formats/mpeg/mpeg_audio_stream_parser_base.h",
619 if (cpu_arch == "x86" || cpu_arch == "x64") {
620 sources += [ "base/simd/convert_yuv_to_rgb_x86.cc" ]
628 if (is_linux || is_win) {
630 "base/keyboard_event_counter.cc",
631 "base/keyboard_event_counter.h",
636 ":shared_memory_support",
639 "//base/third_party/dynamic_annotations",
641 "//crypto:platform", # TODO(ajwong): This used to be provided by crypto.gyp via export_dependent_settings
642 "//gpu/command_buffer/common",
645 "//third_party/opus",
646 "//ui/events:events_base",
653 test("media_unittests") {
655 "base/android/media_codec_bridge_unittest.cc",
656 "base/android/media_drm_bridge_unittest.cc",
657 "base/android/media_source_player_unittest.cc",
658 "base/audio_block_fifo_unittest.cc",
659 "base/audio_buffer_converter_unittest.cc",
660 "base/audio_buffer_unittest.cc",
661 "base/audio_buffer_queue_unittest.cc",
662 "base/audio_bus_unittest.cc",
663 "base/audio_converter_unittest.cc",
664 "base/audio_discard_helper_unittest.cc",
665 "base/audio_fifo_unittest.cc",
666 "base/audio_hardware_config_unittest.cc",
667 "base/audio_hash_unittest.cc",
668 "base/audio_pull_fifo_unittest.cc",
669 "base/audio_renderer_mixer_input_unittest.cc",
670 "base/audio_renderer_mixer_unittest.cc",
671 "base/audio_splicer_unittest.cc",
672 "base/audio_timestamp_helper_unittest.cc",
673 "base/bind_to_current_loop_unittest.cc",
674 "base/bit_reader_unittest.cc",
675 "base/callback_holder.h",
676 "base/callback_holder_unittest.cc",
677 "base/channel_mixer_unittest.cc",
678 "base/data_buffer_unittest.cc",
679 "base/decoder_buffer_queue_unittest.cc",
680 "base/decoder_buffer_unittest.cc",
681 "base/djb2_unittest.cc",
682 "base/gmock_callback_support_unittest.cc",
683 "base/multi_channel_resampler_unittest.cc",
684 "base/pipeline_unittest.cc",
685 "base/ranges_unittest.cc",
686 "base/run_all_unittests.cc",
687 "base/scoped_histogram_timer_unittest.cc",
688 "base/serial_runner_unittest.cc",
689 "base/seekable_buffer_unittest.cc",
690 "base/sinc_resampler_unittest.cc",
691 "base/stream_parser_unittest.cc",
692 "base/text_ranges_unittest.cc",
693 "base/text_renderer_unittest.cc",
694 "base/user_input_monitor_unittest.cc",
695 "base/vector_math_testing.h",
696 "base/vector_math_unittest.cc",
697 "base/video_frame_unittest.cc",
698 "base/video_frame_pool_unittest.cc",
699 "base/video_util_unittest.cc",
700 "base/wall_clock_time_source_unittest.cc",
701 "base/yuv_convert_unittest.cc",
702 "cdm/aes_decryptor_unittest.cc",
703 "cdm/json_web_key_unittest.cc",
704 "filters/audio_clock_unittest.cc",
705 "filters/audio_decoder_selector_unittest.cc",
706 "filters/audio_renderer_algorithm_unittest.cc",
707 "filters/audio_renderer_impl_unittest.cc",
708 "filters/chunk_demuxer_unittest.cc",
709 "filters/decrypting_audio_decoder_unittest.cc",
710 "filters/decrypting_demuxer_stream_unittest.cc",
711 "filters/decrypting_video_decoder_unittest.cc",
712 "filters/fake_demuxer_stream.cc",
713 "filters/fake_demuxer_stream.h",
714 "filters/fake_demuxer_stream_unittest.cc",
715 "filters/fake_video_decoder.cc",
716 "filters/fake_video_decoder.h",
717 "filters/fake_video_decoder_unittest.cc",
718 "filters/file_data_source_unittest.cc",
719 "filters/frame_processor_unittest.cc",
720 "filters/h264_bit_reader_unittest.cc",
721 "filters/h264_parser_unittest.cc",
722 "filters/skcanvas_video_renderer_unittest.cc",
723 "filters/source_buffer_stream_unittest.cc",
724 "filters/video_decoder_selector_unittest.cc",
725 "filters/video_frame_scheduler_impl_unittest.cc",
726 "filters/video_frame_scheduler_unittest.cc",
727 "filters/video_frame_stream_unittest.cc",
728 "filters/video_renderer_impl_unittest.cc",
729 "midi/midi_manager_unittest.cc",
730 "midi/midi_manager_usb_unittest.cc",
731 "midi/midi_message_queue_unittest.cc",
732 "midi/midi_message_util_unittest.cc",
733 "midi/usb_midi_descriptor_parser_unittest.cc",
734 "midi/usb_midi_input_stream_unittest.cc",
735 "midi/usb_midi_output_stream_unittest.cc",
736 "video/capture/fake_video_capture_device_unittest.cc",
737 "video/capture/video_capture_device_unittest.cc",
738 "formats/common/offset_byte_queue_unittest.cc",
739 "formats/webm/cluster_builder.cc",
740 "formats/webm/cluster_builder.h",
741 "formats/webm/tracks_builder.cc",
742 "formats/webm/tracks_builder.h",
743 "formats/webm/webm_cluster_parser_unittest.cc",
744 "formats/webm/webm_content_encodings_client_unittest.cc",
745 "formats/webm/webm_parser_unittest.cc",
746 "formats/webm/webm_tracks_parser_unittest.cc",
747 "formats/webm/webm_webvtt_parser_unittest.cc",
750 if (media_use_ffmpeg) {
752 "base/audio_video_metadata_extractor_unittest.cc",
753 "base/media_file_checker_unittest.cc",
760 "base/container_names_unittest.cc",
761 "ffmpeg/ffmpeg_common_unittest.cc",
762 "filters/audio_decoder_unittest.cc",
763 "filters/audio_file_reader_unittest.cc",
764 "filters/blocking_url_protocol_unittest.cc",
765 "filters/ffmpeg_demuxer_unittest.cc",
766 "filters/ffmpeg_glue_unittest.cc",
767 "filters/ffmpeg_video_decoder_unittest.cc",
768 "filters/in_memory_url_protocol_unittest.cc",
769 "filters/pipeline_integration_test.cc",
770 "filters/pipeline_integration_test_base.cc",
773 # TODO(ajwong): Blocked on android.
776 # "//testing/android:native_test_native_code"
780 if (cpu_arch != "arm" && is_chromeos && use_x11) {
781 sources += [ "filters/h264_bitstream_buffer_unittest.cc" ]
784 if (cpu_arch == "x86" || cpu_arch == "x64") {
785 sources += [ "base/simd/convert_rgb_to_yuv_unittest.cc" ]
788 if (proprietary_codecs) {
790 "filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
791 "filters/h264_to_annex_b_bitstream_converter_unittest.cc",
792 "formats/common/stream_parser_test_base.cc",
793 "formats/common/stream_parser_test_base.h",
794 "formats/mp2t/es_adapter_video_unittest.cc",
795 "formats/mp2t/es_parser_h264_unittest.cc",
796 "formats/mp2t/mp2t_stream_parser_unittest.cc",
797 "formats/mp4/aac_unittest.cc",
798 "formats/mp4/avc_unittest.cc",
799 "formats/mp4/box_reader_unittest.cc",
800 "formats/mp4/es_descriptor_unittest.cc",
801 "formats/mp4/mp4_stream_parser_unittest.cc",
802 "formats/mp4/sample_to_group_iterator_unittest.cc",
803 "formats/mp4/track_run_iterator_unittest.cc",
804 "formats/mpeg/adts_stream_parser_unittest.cc",
805 "formats/mpeg/mp3_stream_parser_unittest.cc",
809 if (is_win && cpu_arch == "x64") {
811 "/wd4267" # TODO(wolenetz): Fix size_t to int trunctaion in win64. See
812 # http://crbug.com/171009
818 "video/capture/mac/video_capture_device_factory_mac_unittest.mm"
823 # # Needed by media_drm_bridge.cc.
827 configs += [ ":media_config" ]
829 # TODO(ajwong): This was in the original gyp, but it seems silly.
830 # ['os_posix==1 and OS!="mac"', {
832 # ['use_allocator!="none"', {
834 # '../base/allocator/allocator.gyp:allocator',
842 "//base/test:test_support",
843 "//media/audio:unittests",
844 "//media/audio:test_support",
845 "//skia", # Direct dependency required to inherit config.
848 # TODO(dalecurtis): Port the rest of Widevine stuff.
849 "//third_party/widevine/cdm:version_h",
851 "//ui/gfx:test_support",
853 if (media_use_ffmpeg) {
855 "//third_party/ffmpeg", # Direct dependency required to inherit config.
860 test("media_perftests") {
862 "base/audio_bus_perftest.cc",
863 "base/audio_converter_perftest.cc",
864 "base/run_all_perftests.cc",
865 "base/sinc_resampler_perftest.cc",
866 "base/vector_math_perftest.cc",
867 "base/yuv_convert_perftest.cc",
869 if (media_use_ffmpeg) {
871 "base/demuxer_perftest.cc",
872 "filters/pipeline_integration_perftest.cc",
873 "filters/pipeline_integration_test_base.cc",
876 configs += [ ":media_config" ]
879 ":shared_memory_support",
881 "//base/test:test_support",
882 "//media/audio:test_support",
886 "//third_party/widevine/cdm:version_h",
888 "//ui/gfx:test_support",
890 if (media_use_ffmpeg) {
892 "//third_party/ffmpeg", # Direct dependency required to inherit config.
897 if (cpu_arch == "x86" || cpu_arch == "x64") {
898 source_set("media_mmx") {
899 sources = [ "base/simd/filter_yuv_mmx.cc" ]
900 configs += [ ":media_config" ]
904 source_set("media_sse2") {
906 "base/simd/convert_rgb_to_yuv_sse2.cc",
907 "base/simd/convert_rgb_to_yuv_ssse3.cc",
908 "base/simd/filter_yuv_sse2.cc",
910 configs += [ ":media_config" ]
911 cflags = [ "-msse2" ]
914 import("//third_party/yasm/yasm_assemble.gni")
915 yasm_assemble("media_yasm") {
917 "base/simd/convert_rgb_to_yuv_ssse3.asm",
918 "base/simd/convert_yuv_to_rgb_mmx.asm",
919 "base/simd/convert_yuv_to_rgb_sse.asm",
920 "base/simd/convert_yuva_to_argb_mmx.asm",
921 "base/simd/empty_register_state_mmx.asm",
922 "base/simd/linear_scale_yuv_to_rgb_mmx.asm",
923 "base/simd/linear_scale_yuv_to_rgb_sse.asm",
924 "base/simd/scale_yuv_to_rgb_mmx.asm",
925 "base/simd/scale_yuv_to_rgb_sse.asm",
928 # TODO(ajwong): Only export if shared_library build...
932 # In addition to the same path as source asm, let yasm %include
933 # search path be relative to src/ per Chromium policy.
934 "-I", rebase_path("..", root_build_dir),
938 "//third_party/x86inc/x86inc.asm",
939 "base/simd/convert_rgb_to_yuv_ssse3.inc",
940 "base/simd/convert_yuv_to_rgb_mmx.inc",
941 "base/simd/convert_yuva_to_argb_mmx.inc",
942 "base/simd/linear_scale_yuv_to_rgb_mmx.inc",
943 "base/simd/media_export.asm",
944 "base/simd/scale_yuv_to_rgb_mmx.inc",
947 if (cpu_arch == "x86") {
948 yasm_flags += [ "-DARCH_X86_32" ]
949 } else if (cpu_arch == "x64") {
950 yasm_flags += [ "-DARCH_X86_64" ]
952 "base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
953 "base/simd/scale_yuv_to_rgb_sse2_x64.asm",
964 yasm_flags += [ "-DELF" ]
965 if (cpu_arch == "x64") {
966 # TODO(ajwong): Why isn't this true in mac?
967 yasm_flags += [ "-DPIC" ]
974 source_set("test_support") {
976 "base/fake_audio_render_callback.cc",
977 "base/fake_audio_render_callback.h",
978 "base/fake_audio_renderer_sink.cc",
979 "base/fake_audio_renderer_sink.h",
980 "base/fake_text_track_stream.cc",
981 "base/fake_text_track_stream.h",
982 "base/gmock_callback_support.h",
983 "base/mock_audio_renderer_sink.cc",
984 "base/mock_audio_renderer_sink.h",
985 "base/mock_demuxer_host.cc",
986 "base/mock_demuxer_host.h",
987 "base/mock_filters.cc",
988 "base/mock_filters.h",
989 "base/test_data_util.cc",
990 "base/test_data_util.h",
991 "base/test_helpers.cc",
992 "base/test_helpers.h",
993 "filters/clockless_video_frame_scheduler.cc",
994 "filters/clockless_video_frame_scheduler.h",
995 "filters/mock_gpu_video_accelerator_factories.cc",
996 "filters/mock_gpu_video_accelerator_factories.h",
997 "filters/test_video_frame_scheduler.cc",
998 "filters/test_video_frame_scheduler.h",
999 "video/mock_video_decode_accelerator.cc",
1000 "video/mock_video_decode_accelerator.h",
1004 ":shared_memory_support",
1006 "//net:test_support",
1013 # TODO(dalecurtis): How to split this across audio/base directories??
1014 component("shared_memory_support") {
1016 "audio/audio_parameters.cc",
1017 "audio/audio_parameters.h",
1018 "base/audio_bus.cc",
1020 "base/channel_layout.cc",
1021 "base/channel_layout.h",
1023 "base/media_export.h",
1024 "base/vector_math.cc",
1025 "base/vector_math.h",
1027 configs += [ ":media_config" ]
1031 if (media_use_ffmpeg) {
1032 test("ffmpeg_unittests") {
1033 sources = [ "ffmpeg/ffmpeg_unittest.cc" ]
1040 "//base/test:test_support",
1042 "//third_party/ffmpeg",
1043 "//ui/gfx:test_support",
1047 test("ffmpeg_regression_tests") {
1049 "base/run_all_unittests.cc",
1050 "ffmpeg/ffmpeg_regression_tests.cc",
1051 "filters/pipeline_integration_test_base.cc",
1053 configs += [ ":media_config" ]
1057 "//base/test:test_support",
1058 "//media/audio:test_support",
1061 "//third_party/ffmpeg",
1062 "//ui/gfx/geometry",
1063 "//ui/gfx:test_support",
1065 # TODO(ajwong): This was in the original gyp, but it seems silly.
1066 # ['os_posix==1 and OS!="mac"', {
1068 # ['use_allocator!="none"', {
1070 # '../base/allocator/allocator.gyp:allocator',
1079 executable("player_x11") {
1081 "tools/player_x11/data_source_logger.cc",
1082 "tools/player_x11/data_source_logger.h",
1083 "tools/player_x11/gl_video_renderer.cc",
1084 "tools/player_x11/gl_video_renderer.h",
1085 "tools/player_x11/player_x11.cc",
1086 "tools/player_x11/x11_video_renderer.cc",
1087 "tools/player_x11/x11_video_renderer.h",
1091 "//build/config/linux:x11",
1092 "//build/config/linux:xext",
1093 # TODO(ajwong): Why does xext get a separate thing in //build/config/linux:BUILD.gn
1094 # "//build/config/linux:xrender",
1098 ":shared_memory_support",
1102 "//ui/gfx/geometry",
1108 import("//build/config/android/rules.gni")
1109 source_set("player_android") {
1110 configs += [ ":media_config" ]
1112 "base/android/audio_decoder_job.cc",
1113 "base/android/audio_decoder_job.h",
1114 "base/android/browser_cdm_factory_android.cc",
1115 "base/android/media_codec_bridge.cc",
1116 "base/android/media_codec_bridge.h",
1117 "base/android/media_decoder_job.cc",
1118 "base/android/media_decoder_job.h",
1119 "base/android/media_drm_bridge.cc",
1120 "base/android/media_drm_bridge.h",
1121 "base/android/media_jni_registrar.cc",
1122 "base/android/media_jni_registrar.h",
1123 "base/android/media_player_android.cc",
1124 "base/android/media_player_android.h",
1125 "base/android/media_player_bridge.cc",
1126 "base/android/media_player_bridge.h",
1127 "base/android/media_player_listener.cc",
1128 "base/android/media_player_listener.h",
1129 "base/android/media_source_player.cc",
1130 "base/android/media_source_player.h",
1131 "base/android/video_decoder_job.cc",
1132 "base/android/video_decoder_job.h",
1133 "base/android/webaudio_media_codec_bridge.cc",
1134 "base/android/webaudio_media_codec_bridge.h",
1135 "base/android/webaudio_media_codec_info.h",
1139 ":media_android_jni_headers",
1141 "//third_party/widevine/cdm:version_h",
1147 generate_jni("media_android_jni_headers") {
1149 "base/android/java/src/org/chromium/media/AudioManagerAndroid.java",
1150 "base/android/java/src/org/chromium/media/AudioRecordInput.java",
1151 "base/android/java/src/org/chromium/media/MediaCodecBridge.java",
1152 "base/android/java/src/org/chromium/media/MediaDrmBridge.java",
1153 "base/android/java/src/org/chromium/media/MediaPlayerBridge.java",
1154 "base/android/java/src/org/chromium/media/MediaPlayerListener.java",
1155 "base/android/java/src/org/chromium/media/UsbMidiDeviceAndroid.java",
1156 "base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java",
1157 "base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java",
1159 jni_package = "media"
1162 generate_jni("video_capture_android_jni_headers") {
1164 "base/android/java/src/org/chromium/media/VideoCapture.java",
1165 "base/android/java/src/org/chromium/media/VideoCaptureFactory.java",
1167 jni_package = "media"
1170 android_library("media_java") {
1172 ":media_android_imageformat_list",
1177 java_cpp_template("media_android_imageformat_list") {
1179 "base/android/java/src/org/chromium/media/ImageFormat.template",
1182 "video/capture/android/imageformat_list.h"
1184 package_name = "org/chromium/media"
1187 # TODO(dalecurtis): Finish media_unittests_apk and media_perftests_apk.