summaryrefslogtreecommitdiff
path: root/chromium/remoting/codec/BUILD.gn
blob: 15c181d5fc30fb57719343cef1f98ebf59b16455 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# 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.

source_set("encoder") {
  sources = [
    "audio_encoder.h",
    "encoder_bitrate_filter.cc",
    "encoder_bitrate_filter.h",
    "frame_processing_time_estimator.cc",
    "frame_processing_time_estimator.h",
    "video_encoder.cc",
    "video_encoder.h",
    "video_encoder_helper.cc",
    "video_encoder_helper.h",
    "video_encoder_verbatim.cc",
    "video_encoder_verbatim.h",
    "video_encoder_vpx.cc",
    "video_encoder_vpx.h",
    "webrtc_video_encoder_proxy.cc",
    "webrtc_video_encoder_proxy.h",
    "webrtc_video_encoder_selector.cc",
    "webrtc_video_encoder_selector.h",
    "webrtc_video_encoder_vpx.cc",
    "webrtc_video_encoder_vpx.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    ":vpx_codec",
    "//base/third_party/dynamic_annotations",
    "//remoting/proto",
    "//third_party/libvpx",
    "//third_party/libyuv",
    "//third_party/opus",
    "//third_party/webrtc/modules/desktop_capture:primitives",
    "//ui/gfx:color_space",
    "//ui/gfx/geometry",
  ]

  # Currently, building WebrtcVideoEncoderGpu is only supported on Windows and
  # Linux, and encoding with WebrtcVideoEncoderGpu is only supported on Windows.
  if (is_win || is_linux) {
    public_configs = [
      "//skia:skia_config",
    ]
    sources += [
      "webrtc_video_encoder_gpu.cc",
      "webrtc_video_encoder_gpu.h",
    ]
    deps += [
      "//gpu/command_buffer/service",
      "//media/gpu",
    ]
  }

  # Opus depends on //media, which is not a supported include for iOS.
  # Also disabled it on Android, to avoid dependency on //media.
  # TODO(sergeyu): Cleanup host-only deps in client targets.
  if (!is_ios && !is_android) {
    sources += [
      "audio_encoder_opus.cc",
      "audio_encoder_opus.h",
      "cast_software_video_encoder_adapter.cc",
      "cast_software_video_encoder_adapter.h",
    ]
    deps += [
      "//media",
      "//media:shared_memory_support",
      "//media/cast:sender",
    ]
  }
}

source_set("decoder") {
  sources = [
    "audio_decoder.cc",
    "audio_decoder.h",
    "audio_decoder_opus.cc",
    "audio_decoder_opus.h",
    "video_decoder.h",
    "video_decoder_verbatim.cc",
    "video_decoder_verbatim.h",
    "video_decoder_vpx.cc",
    "video_decoder_vpx.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    ":vpx_codec",
    "//base/third_party/dynamic_annotations",
    "//remoting/proto",
    "//third_party/libvpx",
    "//third_party/libyuv",
    "//third_party/opus",
    "//third_party/webrtc/modules/desktop_capture:primitives",
  ]
}

source_set("vpx_codec") {
  sources = [
    "scoped_vpx_codec.cc",
    "scoped_vpx_codec.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  public_deps = [
    "//third_party/libvpx",
  ]

  deps = [
    "//base/third_party/dynamic_annotations",
    "//remoting/proto",
    "//third_party/libyuv",
    "//third_party/webrtc/modules/desktop_capture:primitives",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "audio_encoder_opus_unittest.cc",
    "codec_test.cc",
    "codec_test.h",
    "encoder_bitrate_filter_unittest.cc",
    "frame_processing_time_estimator_unittest.cc",
    "video_decoder_vpx_unittest.cc",
    "video_encoder_helper_unittest.cc",
    "video_encoder_verbatim_unittest.cc",
    "video_encoder_vpx_unittest.cc",
    "webrtc_video_encoder_selector_unittest.cc",
  ]

  deps = [
    ":decoder",
    ":encoder",
    "//base",
    "//remoting/proto",
    "//testing/gtest",
    "//third_party/webrtc/modules/desktop_capture",
    "//ui/gfx:color_space",
  ]

  if (is_ios || is_android) {
    sources -= [ "audio_encoder_opus_unittest.cc" ]
  }
}