blob: f551991b40e740a6fd6f37a77c5b134078f920a9 [file] [log] [blame]
# Copyright 2017 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/jumbo.gni")
import("//media/media_options.gni")
import("//third_party/libaom/options.gni")
jumbo_source_set("filters") {
# 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",
"//media/renderers",
]
sources = [
"audio_clock.cc",
"audio_clock.h",
"audio_renderer_algorithm.cc",
"audio_renderer_algorithm.h",
"audio_timestamp_validator.cc",
"audio_timestamp_validator.h",
"chunk_demuxer.cc",
"chunk_demuxer.h",
"context_3d.h",
"decoder_selector.cc",
"decoder_selector.h",
"decoder_stream.cc",
"decoder_stream.h",
"decoder_stream_traits.cc",
"decoder_stream_traits.h",
"decrypting_audio_decoder.cc",
"decrypting_audio_decoder.h",
"decrypting_demuxer_stream.cc",
"decrypting_demuxer_stream.h",
"decrypting_media_resource.cc",
"decrypting_media_resource.h",
"decrypting_video_decoder.cc",
"decrypting_video_decoder.h",
"file_data_source.cc",
"file_data_source.h",
"frame_buffer_pool.cc",
"frame_buffer_pool.h",
"frame_processor.cc",
"frame_processor.h",
"gpu_video_decoder.cc",
"gpu_video_decoder.h",
"jpeg_parser.cc",
"jpeg_parser.h",
"memory_data_source.cc",
"memory_data_source.h",
"offloading_video_decoder.cc",
"offloading_video_decoder.h",
"pipeline_controller.cc",
"pipeline_controller.h",
"source_buffer_parse_warnings.h",
"source_buffer_range.cc",
"source_buffer_range.h",
"source_buffer_range_by_dts.cc",
"source_buffer_range_by_dts.h",
"source_buffer_range_by_pts.cc",
"source_buffer_range_by_pts.h",
"source_buffer_state.cc",
"source_buffer_state.h",
"source_buffer_stream.cc",
"source_buffer_stream.h",
"stream_parser_factory.cc",
"stream_parser_factory.h",
"video_cadence_estimator.cc",
"video_cadence_estimator.h",
"video_renderer_algorithm.cc",
"video_renderer_algorithm.h",
"vp8_bool_decoder.cc",
"vp8_bool_decoder.h",
"vp8_parser.cc",
"vp8_parser.h",
"vp9_bool_decoder.cc",
"vp9_bool_decoder.h",
"vp9_compressed_header_parser.cc",
"vp9_compressed_header_parser.h",
"vp9_parser.cc",
"vp9_parser.h",
"vp9_raw_bits_reader.cc",
"vp9_raw_bits_reader.h",
"vp9_uncompressed_header_parser.cc",
"vp9_uncompressed_header_parser.h",
"wsola_internals.cc",
"wsola_internals.h",
]
configs += [
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//media:subcomponent_config",
]
deps = [
"//cc/base", # For MathUtil.
"//gpu/command_buffer/common",
"//media/base",
"//media/cdm",
"//media/formats",
"//media/video",
"//skia",
"//third_party/libaom:av1_buildflags",
"//third_party/libyuv",
]
libs = []
if (proprietary_codecs) {
sources += [
"h264_to_annex_b_bitstream_converter.cc",
"h264_to_annex_b_bitstream_converter.h",
]
}
if (media_use_ffmpeg) {
deps += [
"//media/ffmpeg",
"//third_party/ffmpeg",
"//third_party/ffmpeg:ffmpeg_features",
"//third_party/opus",
]
sources += [
"audio_file_reader.cc",
"audio_file_reader.h",
"audio_video_metadata_extractor.cc",
"audio_video_metadata_extractor.h",
"blocking_url_protocol.cc",
"blocking_url_protocol.h",
"ffmpeg_audio_decoder.cc",
"ffmpeg_audio_decoder.h",
"ffmpeg_bitstream_converter.h",
"ffmpeg_demuxer.cc",
"ffmpeg_demuxer.h",
"ffmpeg_glue.cc",
"ffmpeg_glue.h",
"in_memory_url_protocol.cc",
"in_memory_url_protocol.h",
"media_file_checker.cc",
"media_file_checker.h",
]
}
if (media_use_libvpx) {
sources += [
"vpx_video_decoder.cc",
"vpx_video_decoder.h",
]
deps += [ "//third_party/libvpx" ]
}
if (enable_av1_decoder) {
sources += [
"aom_video_decoder.cc",
"aom_video_decoder.h",
]
deps += [ "//third_party/libaom" ]
}
if (enable_dav1d_decoder) {
sources += [
"dav1d_video_decoder.cc",
"dav1d_video_decoder.h",
]
deps += [ "//third_party/dav1d" ]
}
if (media_use_ffmpeg) {
if (proprietary_codecs) {
sources += [
"ffmpeg_aac_bitstream_converter.cc",
"ffmpeg_aac_bitstream_converter.h",
"ffmpeg_h264_to_annex_b_bitstream_converter.cc",
"ffmpeg_h264_to_annex_b_bitstream_converter.h",
]
if (enable_hevc_demuxing) {
sources += [
"ffmpeg_h265_to_annex_b_bitstream_converter.cc",
"ffmpeg_h265_to_annex_b_bitstream_converter.h",
]
}
}
if (enable_ffmpeg_video_decoders) {
sources += [
"ffmpeg_video_decoder.cc",
"ffmpeg_video_decoder.h",
]
}
}
if (is_android) {
sources -= [
"decrypting_audio_decoder.cc",
"decrypting_audio_decoder.h",
"decrypting_video_decoder.cc",
"decrypting_video_decoder.h",
]
sources += [
"android/media_codec_audio_decoder.cc",
"android/media_codec_audio_decoder.h",
"android/video_frame_extractor.cc",
"android/video_frame_extractor.h",
]
deps += [ "//media/base/android" ]
}
if (current_cpu != "arm" && is_linux) {
sources += [
"h264_bitstream_buffer.cc",
"h264_bitstream_buffer.h",
]
}
if (is_fuchsia) {
sources += [
"fuchsia/fuchsia_video_decoder.cc",
"fuchsia/fuchsia_video_decoder.h",
]
deps += [
"//third_party/fuchsia-sdk/sdk:media",
"//third_party/fuchsia-sdk/sdk:mediacodec",
]
}
}
source_set("perftests") {
testonly = true
sources = []
if (media_use_ffmpeg) {
sources += [ "demuxer_perftest.cc" ]
}
configs += [ "//media:media_config" ]
deps = [
"//base",
"//base/test:test_support",
"//media:test_support",
"//testing/gmock",
"//testing/gtest",
"//testing/perf",
]
}
static_library("test_support") {
testonly = true
visibility = [ "//media:test_support" ]
sources = [
"ivf_parser.cc",
"ivf_parser.h",
]
configs += [
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
deps = [
"//base/test:test_support",
"//media/base:test_support",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"audio_clock_unittest.cc",
"audio_decoder_stream_unittest.cc",
"audio_renderer_algorithm_unittest.cc",
"audio_timestamp_validator_unittest.cc",
"chunk_demuxer_unittest.cc",
"decoder_selector_unittest.cc",
"decrypting_audio_decoder_unittest.cc",
"decrypting_demuxer_stream_unittest.cc",
"decrypting_media_resource_unittest.cc",
"decrypting_video_decoder_unittest.cc",
"fake_video_decoder.cc",
"fake_video_decoder.h",
"fake_video_decoder_unittest.cc",
"file_data_source_unittest.cc",
"frame_buffer_pool_unittest.cc",
"frame_processor_unittest.cc",
"ivf_parser_unittest.cc",
"jpeg_parser_unittest.cc",
"memory_data_source_unittest.cc",
"offloading_video_decoder_unittest.cc",
"pipeline_controller_unittest.cc",
"source_buffer_state_unittest.cc",
"source_buffer_stream_unittest.cc",
"video_cadence_estimator_unittest.cc",
"video_decoder_stream_unittest.cc",
"video_renderer_algorithm_unittest.cc",
"vp8_bool_decoder_unittest.cc",
"vp8_parser_unittest.cc",
"vp9_parser_unittest.cc",
"vp9_raw_bits_reader_unittest.cc",
]
deps = [
"//base/test:test_support",
"//media:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/gfx:test_support",
]
configs += [
# TODO(crbug.com/167187): Fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
if (is_android) {
sources += [ "android/video_frame_extractor_unittest.cc" ]
sources -= [
"decrypting_audio_decoder_unittest.cc",
"decrypting_video_decoder_unittest.cc",
]
deps += [ "//ui/gl" ]
}
if (is_fuchsia) {
sources += [ "fuchsia/fuchsia_video_decoder_unittest.cc" ]
}
# libvpx for running vpx test on chromecast doesn't support high bit depth.
# This may cause some unit tests failure.
if (is_chromecast) {
defines = [ "LIBVPX_NO_HIGH_BIT_DEPTH" ]
}
if (media_use_ffmpeg) {
sources += [
"audio_decoder_unittest.cc",
"audio_file_reader_unittest.cc",
"blocking_url_protocol_unittest.cc",
"ffmpeg_demuxer_unittest.cc",
"ffmpeg_glue_unittest.cc",
"in_memory_url_protocol_unittest.cc",
]
deps += [
# Direct dependency needed for the config
"//third_party/opus",
]
# Even if FFmpeg is enabled on Android we don't want these.
# TODO(watk): Refactor tests that could be made to run on Android.
if (!is_android) {
sources += [
"audio_video_metadata_extractor_unittest.cc",
"media_file_checker_unittest.cc",
]
}
if (enable_ffmpeg_video_decoders) {
sources += [ "ffmpeg_video_decoder_unittest.cc" ]
}
}
if (media_use_libvpx) {
sources += [ "vpx_video_decoder_unittest.cc" ]
}
if (enable_av1_decoder) {
sources += [ "aom_video_decoder_unittest.cc" ]
if (enable_dav1d_decoder) {
sources += [ "dav1d_video_decoder_unittest.cc" ]
}
}
if (current_cpu != "arm" && is_linux) {
sources += [ "h264_bitstream_buffer_unittest.cc" ]
}
if (proprietary_codecs) {
sources += [ "h264_to_annex_b_bitstream_converter_unittest.cc" ]
if (media_use_ffmpeg) {
sources += [
"ffmpeg_aac_bitstream_converter_unittest.cc",
"ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc",
]
}
}
if (media_use_ffmpeg) {
# Direct dependency required to inherit config.
deps += [ "//third_party/ffmpeg" ]
}
}