blob: 707258099d2341d52f0dcda545df52479fc112d4 [file] [log] [blame]
# Copyright 2015 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/buildflag_header.gni")
import("//build/config/chromecast_build.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")
declare_args() {
system_owns_volume =
use_alsa && !enable_assistant && chromecast_branding != "google"
}
cast_source_set("backend") {
sources = [
"audio_decoder_software_wrapper.cc",
"audio_decoder_software_wrapper.h",
"audio_decoder_wrapper.cc",
"audio_decoder_wrapper.h",
"cma_backend.h",
"cma_backend_factory.h",
"cma_backend_factory_impl.cc",
"cma_backend_factory_impl.h",
"media_pipeline_backend_manager.cc",
"media_pipeline_backend_manager.h",
"media_pipeline_backend_wrapper.cc",
"media_pipeline_backend_wrapper.h",
"video_decoder_wrapper.cc",
"video_decoder_wrapper.h",
]
public_deps = [
"//chromecast/public",
"//chromecast/public/media",
]
deps = [
"//base",
"//chromecast:chromecast_buildflags",
"//chromecast/base/metrics:metrics",
"//chromecast/media:libcast_media",
"//chromecast/media/cma/base",
"//chromecast/media/cma/decoder",
]
}
# Target for OEM partners to override media shared library, i.e.
# libcast_media_1.0.so. This target is only used to build executables
# with correct linkage information.
cast_shared_library("libcast_media_1.0") {
sources = [
"cast_media_dummy.cc",
]
deps = [
":audio_buildflags",
"//chromecast/public",
]
}
volume_control_in_media_shlib = !cast_volume_control_in_avsettings
buildflag_header("audio_buildflags") {
header = "audio_buildflags.h"
flags = [
"MEDIA_CLOCK_MONOTONIC_RAW=$media_clock_monotonic_raw",
"SYSTEM_OWNS_VOLUME=$system_owns_volume",
"VOLUME_CONTROL_IN_MEDIA_SHLIB=$volume_control_in_media_shlib",
]
}
# Implementation of video decoder that discards decoder buffers.
# Used on audio platforms for media streams containing video.
cast_source_set("null_video") {
sources = [
"video_decoder_null.cc",
"video_decoder_null.h",
]
deps = [
"//base",
"//chromecast/public/media",
]
}
cast_source_set("public") {
sources = [
"system_volume_control.h",
]
deps = [
"//base",
"//chromecast/public/media",
]
}
cast_source_set("audio_helpers") {
sources = [
"audio_fader.cc",
"audio_fader.h",
]
deps = [
"//base",
"//media",
]
public_deps = [
"//chromecast/public/media",
]
}
cast_source_set("av_sync_dummy") {
sources = [
"av_sync_dummy.cc",
]
deps = [
"//base",
"//chromecast/public",
]
}
cast_source_set("audio_codec_support") {
sources = [
"media_codec_support_cast_audio.cc",
]
deps = [
"//base",
"//chromecast/public",
"//chromecast/public/media:media",
]
}
cast_source_set("cast_audio_json") {
sources = [
"cast_audio_json.cc",
"cast_audio_json.h",
]
deps = [
"//base",
]
}
cast_source_set("audio_resampler") {
sources = [
"audio_resampler.cc",
"audio_resampler.h",
]
deps = [
"//base",
"//chromecast/media/cma/base",
"//media",
]
# Use fastest possible float math.
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_speed" ]
cflags = [ "-ffast-math" ]
}
cast_source_set("interleaved_channel_mixer") {
sources = [
"interleaved_channel_mixer.cc",
"interleaved_channel_mixer.h",
]
deps = [
"//base",
"//media",
]
# Use fastest possible float math.
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_speed" ]
cflags = [ "-ffast-math" ]
}
cast_source_set("volume_map") {
sources = [
"volume_map.cc",
"volume_map.h",
]
deps = [
":cast_audio_json",
"//base",
"//chromecast/public",
]
}
cast_source_set("for_mixer_audio") {
sources = [
"audio_decoder_for_mixer.cc",
"audio_decoder_for_mixer.h",
"cast_media_shlib_mixer_audio.cc",
"media_pipeline_backend_for_mixer.cc",
"media_pipeline_backend_for_mixer.h",
"volume_control.cc",
]
deps = [
":audio_buildflags",
":audio_helpers",
":cast_audio_json",
":public",
":volume_map",
"//base",
"//chromecast/base",
"//chromecast/media/base:monotonic_clock",
"//chromecast/media/cma/backend/mixer",
"//chromecast/media/cma/base",
"//chromecast/media/cma/decoder",
"//chromecast/public",
"//chromecast/public/media",
"//media",
"//media:shared_memory_support",
]
}
test("cast_audio_backend_unittests") {
testonly = true
sources = [
"audio_fader_unittest.cc",
"interleaved_channel_mixer_unittest.cc",
"volume_map_unittest.cc",
]
deps = [
":audio_helpers",
":cast_audio_json",
":interleaved_channel_mixer",
":volume_map",
"//base",
"//base/test:run_all_unittests",
"//chromecast/media/cma/backend/mixer:unittests",
"//media",
"//testing/gmock",
"//testing/gtest",
]
if (is_fuchsia) {
deps += [ "fuchsia:unit_tests" ]
}
}