blob: 832311ba3264c76893d07f100a0f8d1b47a88123 [file]
# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build_overrides/build.gni")
import("../../gni/openscreen.gni")
import("../streaming/external_libraries.gni")
visibility = [ "./*" ]
# Define the executable target only when the build is configured to use the
# standalone platform implementation; since this is itself a standalone
# application.
if (!build_with_chromium) {
have_external_libs = have_ffmpeg && have_libopus && have_libvpx
config("standalone_external_libs") {
defines = []
include_dirs = []
if (have_external_libs) {
defines += [ "CAST_STANDALONE_SENDER_HAVE_EXTERNAL_LIBS" ]
include_dirs +=
ffmpeg_include_dirs + libopus_include_dirs + libvpx_include_dirs
}
if (have_libaom) {
defines += [ "CAST_STANDALONE_SENDER_HAVE_LIBAOM" ]
include_dirs += libaom_include_dirs
}
}
openscreen_source_set("cast_sender_core") {
testonly = true
visibility += [ "../*" ]
public_deps = [
"../../discovery:dnssd",
"../../discovery:public",
"../../platform",
"../../platform:standalone_impl",
"../../third_party/jsoncpp",
"../../util",
"../common:certificate_boringssl",
"../common:public",
"../common/channel/proto:channel_proto",
"../sender:channel",
"../streaming:common",
"../streaming:sender",
]
deps = []
sources = []
include_dirs = []
lib_dirs = []
libs = []
if (have_external_libs) {
sources += [
"connection_settings.h",
"looping_file_cast_agent.cc",
"looping_file_cast_agent.h",
"looping_file_sender.cc",
"looping_file_sender.h",
"receiver_chooser.cc",
"receiver_chooser.h",
"remoting_sender.cc",
"remoting_sender.h",
"simulated_capturer.cc",
"simulated_capturer.h",
"streaming_encoder_util.cc",
"streaming_encoder_util.h",
"streaming_opus_encoder.cc",
"streaming_opus_encoder.h",
"streaming_video_encoder.cc",
"streaming_video_encoder.h",
"streaming_vpx_encoder.cc",
"streaming_vpx_encoder.h",
]
public_deps += [ "../standalone_common:ffmpeg_glue" ]
include_dirs +=
ffmpeg_include_dirs + libopus_include_dirs + libvpx_include_dirs
lib_dirs += external_lib_dirs + ffmpeg_lib_dirs + libopus_lib_dirs +
libvpx_lib_dirs
libs += ffmpeg_libs + libopus_libs + libvpx_libs
if (have_libaom) {
sources += [
"streaming_av1_encoder.cc",
"streaming_av1_encoder.h",
]
include_dirs += libaom_include_dirs
lib_dirs += libaom_lib_dirs
libs += libaom_libs
}
}
configs = [ "../common:certificate_config" ]
public_configs = [ ":standalone_external_libs" ]
}
openscreen_executable("cast_sender") {
testonly = true
visibility += [ "../..:gn_all" ]
deps = [
":cast_sender_core",
"../../third_party/getopt",
]
sources = [ "main.cc" ]
configs = [ "../common:certificate_config" ]
public_configs = [ ":standalone_external_libs" ]
}
}