naiveproxy/media/base/BUILD.gn
2018-08-14 22:19:20 +00:00

596 lines
15 KiB
Plaintext

# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/arm.gni")
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//build/config/linux/pkg_config.gni")
import("//media/media_options.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
jumbo_source_set("base") {
# Do not expand the visibility here without double-checking with OWNERS, this
# is a roll-up target which is part of the //media component. Most other DEPs
# should be using //media and not directly DEP this roll-up target.
visibility = media_subcomponent_deps
visibility += [ "//media" ]
# TODO(dalecurtis): Replace this with empty targets on non-mac so
# we can just include //media/base/mac in media_subcomponent_deps.
if (is_ios || is_mac) {
visibility += [ "//media/base/mac" ]
}
sources = [
"android_overlay_config.cc",
"android_overlay_config.h",
"android_overlay_mojo_factory.h",
"audio_block_fifo.cc",
"audio_block_fifo.h",
"audio_buffer.cc",
"audio_buffer.h",
"audio_buffer_converter.cc",
"audio_buffer_converter.h",
"audio_buffer_queue.cc",
"audio_buffer_queue.h",
"audio_capturer_source.h",
"audio_codecs.cc",
"audio_codecs.h",
"audio_converter.cc",
"audio_converter.h",
"audio_decoder.cc",
"audio_decoder.h",
"audio_decoder_config.cc",
"audio_decoder_config.h",
"audio_discard_helper.cc",
"audio_discard_helper.h",
"audio_fifo.cc",
"audio_fifo.h",
"audio_hash.cc",
"audio_hash.h",
"audio_pull_fifo.cc",
"audio_pull_fifo.h",
"audio_push_fifo.cc",
"audio_push_fifo.h",
"audio_renderer.cc",
"audio_renderer.h",
"audio_renderer_mixer.cc",
"audio_renderer_mixer.h",
"audio_renderer_mixer_input.cc",
"audio_renderer_mixer_input.h",
"audio_renderer_mixer_pool.h",
"audio_renderer_sink.h",
"audio_shifter.cc",
"audio_shifter.h",
"audio_timestamp_helper.cc",
"audio_timestamp_helper.h",
"bind_to_current_loop.h",
"bit_reader.cc",
"bit_reader.h",
"bit_reader_core.cc",
"bit_reader_core.h",
"bitstream_buffer.cc",
"bitstream_buffer.h",
"buffering_state.h",
"byte_queue.cc",
"byte_queue.h",
"callback_holder.h",
"callback_registry.h",
"cdm_callback_promise.cc",
"cdm_callback_promise.h",
"cdm_config.h",
"cdm_context.cc",
"cdm_context.h",
"cdm_factory.cc",
"cdm_factory.h",
"cdm_initialized_promise.cc",
"cdm_initialized_promise.h",
"cdm_key_information.cc",
"cdm_key_information.h",
"cdm_promise.cc",
"cdm_promise.h",
"cdm_promise_adapter.cc",
"cdm_promise_adapter.h",
"cdm_proxy_context.cc",
"cdm_proxy_context.h",
"cdm_session_tracker.cc",
"cdm_session_tracker.h",
"channel_mixer.cc",
"channel_mixer.h",
"channel_mixing_matrix.cc",
"channel_mixing_matrix.h",
"container_names.cc",
"container_names.h",
"content_decryption_module.cc",
"content_decryption_module.h",
"data_buffer.cc",
"data_buffer.h",
"data_source.cc",
"data_source.h",
"decode_capabilities.cc",
"decode_capabilities.h",
"decode_status.cc",
"decode_status.h",
"decoder_buffer.cc",
"decoder_buffer.h",
"decoder_buffer_queue.cc",
"decoder_buffer_queue.h",
"decoder_factory.cc",
"decoder_factory.h",
"decrypt_config.cc",
"decrypt_config.h",
"decryptor.cc",
"decryptor.h",
"demuxer.cc",
"demuxer.h",
"demuxer_memory_limit.h",
"demuxer_stream.cc",
"demuxer_stream.h",
"djb2.cc",
"djb2.h",
"eme_constants.h",
"encryption_pattern.cc",
"encryption_pattern.h",
"encryption_scheme.cc",
"encryption_scheme.h",
"fake_audio_worker.cc",
"fake_audio_worker.h",
"fallback_video_decoder.cc",
"fallback_video_decoder.h",
"feedback_signal_accumulator.h",
"flinging_controller.h",
"hdr_metadata.cc",
"hdr_metadata.h",
"key_system_names.cc",
"key_system_names.h",
"key_system_properties.cc",
"key_system_properties.h",
"key_systems.cc",
"key_systems.h",
"localized_strings.cc",
"localized_strings.h",
"loopback_audio_converter.cc",
"loopback_audio_converter.h",
"media.cc",
"media.h",
"media_client.cc",
"media_client.h",
"media_content_type.cc",
"media_content_type.h",
"media_controller.h",
"media_export.h",
"media_log.cc",
"media_log.h",
"media_log_event.h",
"media_observer.cc",
"media_observer.h",
"media_permission.cc",
"media_permission.h",
"media_resource.cc",
"media_resource.h",
"media_status.cc",
"media_status.h",
"media_status_observer.h",
"media_switches.cc",
"media_switches.h",
"media_track.cc",
"media_track.h",
"media_tracks.cc",
"media_tracks.h",
"media_url_demuxer.cc",
"media_url_demuxer.h",
"media_url_params.h",
"media_util.cc",
"media_util.h",
"mime_util.cc",
"mime_util.h",
"mime_util_internal.cc",
"mime_util_internal.h",
"moving_average.cc",
"moving_average.h",
"multi_channel_resampler.cc",
"multi_channel_resampler.h",
"null_video_sink.cc",
"null_video_sink.h",
"output_device_info.cc",
"output_device_info.h",
"overlay_info.cc",
"overlay_info.h",
"pipeline.h",
"pipeline_impl.cc",
"pipeline_impl.h",
"pipeline_metadata.cc",
"pipeline_metadata.h",
"pipeline_status.cc",
"pipeline_status.h",
"player_tracker.cc",
"player_tracker.h",
"provision_fetcher.h",
"ranges.cc",
"ranges.h",
"renderer.cc",
"renderer.h",
"renderer_client.h",
"renderer_factory.cc",
"renderer_factory.h",
"renderer_factory_selector.cc",
"renderer_factory_selector.h",
"routing_token_callback.h",
"sample_rates.cc",
"sample_rates.h",
"seekable_buffer.cc",
"seekable_buffer.h",
"serial_runner.cc",
"serial_runner.h",
"silent_sink_suspender.cc",
"silent_sink_suspender.h",
"sinc_resampler.cc",
"sinc_resampler.h",
"stream_parser.cc",
"stream_parser.h",
"stream_parser_buffer.cc",
"stream_parser_buffer.h",
"subsample_entry.cc",
"subsample_entry.h",
"text_cue.cc",
"text_cue.h",
"text_ranges.cc",
"text_ranges.h",
"text_renderer.cc",
"text_renderer.h",
"text_track.h",
"text_track_config.cc",
"text_track_config.h",
"time_delta_interpolator.cc",
"time_delta_interpolator.h",
"time_source.h",
"timestamp_constants.h",
"unaligned_shared_memory.cc",
"unaligned_shared_memory.h",
"user_input_monitor.cc",
"user_input_monitor.h",
"video_bitrate_allocation.cc",
"video_bitrate_allocation.h",
"video_codecs.cc",
"video_codecs.h",
"video_color_space.cc",
"video_color_space.h",
"video_decoder.cc",
"video_decoder.h",
"video_decoder_config.cc",
"video_decoder_config.h",
"video_frame.cc",
"video_frame.h",
"video_frame_layout.cc",
"video_frame_layout.h",
"video_frame_metadata.cc",
"video_frame_metadata.h",
"video_frame_pool.cc",
"video_frame_pool.h",
"video_renderer.cc",
"video_renderer.h",
"video_rotation.cc",
"video_rotation.h",
"video_types.cc",
"video_types.h",
"video_util.cc",
"video_util.h",
"wall_clock_time_source.cc",
"wall_clock_time_source.h",
"watch_time_keys.cc",
"watch_time_keys.h",
"webvtt_util.h",
]
defines = []
public_deps = [
":video_facing",
"//media:media_buildflags",
"//media:shared_memory_support",
"//third_party/libaom:av1_buildflags",
"//ui/gfx:color_space",
]
deps = [
"//base/allocator:buildflags",
"//gpu/command_buffer/common",
"//skia",
"//third_party/libyuv",
"//third_party/widevine/cdm:headers",
"//ui/display:display",
"//ui/events:events_base",
"//url:url",
]
libs = []
configs += [
"//build/config:precompiled_headers",
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//media:subcomponent_config",
]
if (media_use_ffmpeg) {
deps += [
"//third_party/ffmpeg",
"//third_party/ffmpeg:ffmpeg_features",
]
}
if (media_use_libvpx) {
deps += [ "//third_party/libvpx" ]
}
if (use_x11) {
configs += [
"//build/config/linux:x11",
"//build/config/linux:xext",
]
sources += [ "user_input_monitor_linux.cc" ]
deps += [
"//ui/events:events_base",
"//ui/gfx/x",
]
} else if (is_mac) {
sources += [ "user_input_monitor_mac.cc" ]
libs = [
"CoreVideo.framework",
"CoreFoundation.framework",
"CoreGraphics.framework",
]
} else if (is_win) {
sources += [ "user_input_monitor_win.cc" ]
} else {
defines += [ "DISABLE_USER_INPUT_MONITOR" ]
}
if (is_linux || is_win) {
sources += [
"keyboard_event_counter.cc",
"keyboard_event_counter.h",
]
}
# Note: should also work on is_posix || is_fuchsia
if (is_linux) {
sources += [
"scopedfd_helper.cc",
"scopedfd_helper.h",
]
}
if (is_win) {
deps += [ "//media/base/win" ]
}
if (is_chromecast) {
sources += [ "demuxer_memory_limit_low.cc" ]
} else if (is_android) {
sources += [ "demuxer_memory_limit_android.cc" ]
} else {
sources += [ "demuxer_memory_limit_default.cc" ]
}
}
source_set("video_facing") {
sources = [
"video_facing.h",
]
}
if (is_android) {
java_cpp_enum("java_enums") {
sources = [
"encryption_scheme.h",
"video_codecs.h",
]
}
}
# Note: Only specific internal targets that roll up into the //media component
# should depend on this, external targets should use //media:test_support.
static_library("test_support") {
visibility = [
"//media:test_support",
"//media/audio:test_support",
"//media/base/android:test_support",
"//media/filters:test_support",
"//media/formats:test_support",
"//media/video:test_support",
]
testonly = true
sources = [
"fake_audio_render_callback.cc",
"fake_audio_render_callback.h",
"fake_audio_renderer_sink.cc",
"fake_audio_renderer_sink.h",
"fake_demuxer_stream.cc",
"fake_demuxer_stream.h",
"fake_localized_strings.cc",
"fake_localized_strings.h",
"fake_single_thread_task_runner.cc",
"fake_single_thread_task_runner.h",
"fake_text_track_stream.cc",
"fake_text_track_stream.h",
"gmock_callback_support.h",
"mock_audio_renderer_sink.cc",
"mock_audio_renderer_sink.h",
"mock_demuxer_host.cc",
"mock_demuxer_host.h",
"mock_filters.cc",
"mock_filters.h",
"mock_media_log.cc",
"mock_media_log.h",
"test_data_util.cc",
"test_data_util.h",
"test_helpers.cc",
"test_helpers.h",
"test_random.h",
]
configs += [ "//media:media_config" ]
# Do not add any other //media deps except this; this ensures other
# test_support targets all use the same //media component to avoid duplicate
# and undefined symbol issues on Windows.
public_deps = [
"//media",
]
deps = [
"//base",
"//base/test:test_support",
"//testing/gmock",
"//ui/gfx:test_support",
"//url",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"audio_block_fifo_unittest.cc",
"audio_buffer_converter_unittest.cc",
"audio_buffer_queue_unittest.cc",
"audio_buffer_unittest.cc",
"audio_bus_unittest.cc",
"audio_converter_unittest.cc",
"audio_discard_helper_unittest.cc",
"audio_fifo_unittest.cc",
"audio_hash_unittest.cc",
"audio_latency_unittest.cc",
"audio_parameters_unittest.cc",
"audio_point_unittest.cc",
"audio_pull_fifo_unittest.cc",
"audio_push_fifo_unittest.cc",
"audio_renderer_mixer_input_unittest.cc",
"audio_renderer_mixer_unittest.cc",
"audio_sample_types_unittest.cc",
"audio_shifter_unittest.cc",
"audio_timestamp_helper_unittest.cc",
"bind_to_current_loop_unittest.cc",
"bit_reader_unittest.cc",
"callback_holder_unittest.cc",
"callback_registry_unittest.cc",
"channel_mixer_unittest.cc",
"channel_mixing_matrix_unittest.cc",
"container_names_unittest.cc",
"data_buffer_unittest.cc",
"decode_capabilities_unittest.cc",
"decoder_buffer_queue_unittest.cc",
"decoder_buffer_unittest.cc",
"decrypt_config_unittest.cc",
"djb2_unittest.cc",
"fake_audio_worker_unittest.cc",
"fake_demuxer_stream_unittest.cc",
"fallback_video_decoder_unittest.cc",
"feedback_signal_accumulator_unittest.cc",
"gmock_callback_support_unittest.cc",
"key_systems_unittest.cc",
"media_log_unittest.cc",
"media_url_demuxer_unittest.cc",
"mime_util_unittest.cc",
"moving_average_unittest.cc",
"multi_channel_resampler_unittest.cc",
"null_video_sink_unittest.cc",
"pipeline_impl_unittest.cc",
"ranges_unittest.cc",
"renderer_factory_selector_unittest.cc",
"seekable_buffer_unittest.cc",
"serial_runner_unittest.cc",
"silent_sink_suspender_unittest.cc",
"sinc_resampler_unittest.cc",
"stream_parser_unittest.cc",
"subsample_entry_unittest.cc",
"text_ranges_unittest.cc",
"text_renderer_unittest.cc",
"time_delta_interpolator_unittest.cc",
"unaligned_shared_memory_unittest.cc",
"user_input_monitor_unittest.cc",
"vector_math_unittest.cc",
"video_bitrate_allocation_unittest.cc",
"video_codecs_unittest.cc",
"video_color_space_unittest.cc",
"video_decoder_config_unittest.cc",
"video_frame_layout_unittest.cc",
"video_frame_pool_unittest.cc",
"video_frame_unittest.cc",
"video_util_unittest.cc",
"wall_clock_time_source_unittest.cc",
]
configs += [
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//media:media_config",
]
deps = [
"//base/test:test_support",
"//gpu/command_buffer/common",
"//media:test_support",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//third_party/libyuv",
"//third_party/widevine/cdm:headers",
"//ui/gfx",
]
if (is_mac || is_ios) {
deps += [ "//media/base/mac:unit_tests" ]
}
if (is_linux || is_win) {
sources += [ "keyboard_event_counter_unittest.cc" ]
}
}
source_set("perftests") {
testonly = true
sources = [
"audio_bus_perftest.cc",
"audio_converter_perftest.cc",
"run_all_perftests.cc",
"sinc_resampler_perftest.cc",
"vector_math_perftest.cc",
]
configs += [
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//media:media_config",
]
deps = [
"//base",
"//base/test:test_support",
"//media:test_support",
"//testing/gmock",
"//testing/gtest",
"//testing/perf",
]
}
fuzzer_test("media_bit_reader_fuzzer") {
sources = [
"bit_reader_fuzzertest.cc",
]
deps = [
"//base",
"//media:test_support",
]
}
fuzzer_test("media_container_names_fuzzer") {
sources = [
"container_names_fuzzertest.cc",
]
deps = [
"//base",
"//media:test_support",
]
}