aboutsummaryrefslogtreecommitdiff
path: root/cast/standalone_sender/BUILD.gn
blob: a65c8bbf2bb23d2453d1f57ff47ce2b1c8f1bf5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright 2020 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/external_libraries.gni")
import("//build_overrides/build.gni")

# 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) {
  declare_args() {
    have_external_libs = have_ffmpeg && have_libopus && have_libvpx
  }

  config("standalone_external_libs") {
    defines = []
    if (have_external_libs) {
      defines += [ "CAST_STANDALONE_SENDER_HAVE_EXTERNAL_LIBS" ]
    }
    if (have_libaom) {
      defines += [ "CAST_STANDALONE_SENDER_HAVE_LIBAOM" ]
    }
  }

  executable("cast_sender") {
    deps = [
      "../../discovery:dnssd",
      "../../discovery:public",
      "../../platform",
      "../../platform:standalone_impl",
      "../../third_party/aomedia",
      "../../third_party/jsoncpp",
      "../../util",
      "../common:public",
      "../common/channel/proto:channel_proto",
      "../sender:channel",
      "../streaming:common",
      "../streaming:sender",
    ]

    sources = [ "main.cc" ]
    include_dirs = []
    lib_dirs = []
    libs = []
    if (have_external_libs) {
      sources += [
        "connection_settings.h",
        "ffmpeg_glue.cc",
        "ffmpeg_glue.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",
      ]

      include_dirs +=
          ffmpeg_include_dirs + libopus_include_dirs + libvpx_include_dirs
      lib_dirs += ffmpeg_lib_dirs + libopus_lib_dirs + libvpx_lib_dirs
      libs += ffmpeg_libs + libopus_libs + libvpx_libs

      # LibAOM support currently recommends building from source, so is included
      # separately here.
      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 = [
      "../../build:openscreen_include_dirs",
      ":standalone_external_libs",
    ]
  }
}