xref: /aosp_15_r20/external/webrtc/call/adaptation/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS.  All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10
11rtc_library("resource_adaptation") {
12  sources = [
13    "adaptation_constraint.cc",
14    "adaptation_constraint.h",
15    "broadcast_resource_listener.cc",
16    "broadcast_resource_listener.h",
17    "degradation_preference_provider.cc",
18    "degradation_preference_provider.h",
19    "encoder_settings.cc",
20    "encoder_settings.h",
21    "resource_adaptation_processor.cc",
22    "resource_adaptation_processor.h",
23    "resource_adaptation_processor_interface.cc",
24    "resource_adaptation_processor_interface.h",
25    "video_source_restrictions.cc",
26    "video_source_restrictions.h",
27    "video_stream_adapter.cc",
28    "video_stream_adapter.h",
29    "video_stream_input_state.cc",
30    "video_stream_input_state.h",
31    "video_stream_input_state_provider.cc",
32    "video_stream_input_state_provider.h",
33  ]
34  deps = [
35    "../../api:field_trials_view",
36    "../../api:make_ref_counted",
37    "../../api:rtp_parameters",
38    "../../api:scoped_refptr",
39    "../../api:sequence_checker",
40    "../../api/adaptation:resource_adaptation_api",
41    "../../api/task_queue:task_queue",
42    "../../api/video:video_adaptation",
43    "../../api/video:video_frame",
44    "../../api/video:video_stream_encoder",
45    "../../api/video_codecs:video_codecs_api",
46    "../../modules/video_coding:video_coding_utility",
47    "../../rtc_base:checks",
48    "../../rtc_base:logging",
49    "../../rtc_base:macromagic",
50    "../../rtc_base:refcount",
51    "../../rtc_base:rtc_task_queue",
52    "../../rtc_base:safe_conversions",
53    "../../rtc_base:stringutils",
54    "../../rtc_base/experiments:balanced_degradation_settings",
55    "../../rtc_base/synchronization:mutex",
56    "../../rtc_base/system:no_unique_address",
57    "../../video:video_stream_encoder_interface",
58    "../../video/config:encoder_config",
59  ]
60  absl_deps = [
61    "//third_party/abseil-cpp/absl/algorithm:container",
62    "//third_party/abseil-cpp/absl/strings",
63    "//third_party/abseil-cpp/absl/types:optional",
64    "//third_party/abseil-cpp/absl/types:variant",
65  ]
66}
67
68if (rtc_include_tests) {
69  rtc_library("resource_adaptation_tests") {
70    testonly = true
71
72    sources = [
73      "broadcast_resource_listener_unittest.cc",
74      "resource_adaptation_processor_unittest.cc",
75      "resource_unittest.cc",
76      "video_source_restrictions_unittest.cc",
77      "video_stream_adapter_unittest.cc",
78      "video_stream_input_state_provider_unittest.cc",
79    ]
80    deps = [
81      ":resource_adaptation",
82      ":resource_adaptation_test_utilities",
83      "../../api:scoped_refptr",
84      "../../api/adaptation:resource_adaptation_api",
85      "../../api/task_queue:default_task_queue_factory",
86      "../../api/task_queue:task_queue",
87      "../../api/video:video_adaptation",
88      "../../api/video_codecs:video_codecs_api",
89      "../../rtc_base:checks",
90      "../../rtc_base:gunit_helpers",
91      "../../rtc_base:rtc_event",
92      "../../rtc_base:rtc_task_queue",
93      "../../rtc_base:stringutils",
94      "../../rtc_base:task_queue_for_test",
95      "../../rtc_base/synchronization:mutex",
96      "../../test:field_trial",
97      "../../test:rtc_expect_death",
98      "../../test:scoped_key_value_config",
99      "../../test:test_support",
100      "../../video/config:encoder_config",
101    ]
102    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
103  }
104
105  rtc_source_set("resource_adaptation_test_utilities") {
106    testonly = true
107
108    sources = [
109      "test/fake_adaptation_constraint.cc",
110      "test/fake_adaptation_constraint.h",
111      "test/fake_frame_rate_provider.cc",
112      "test/fake_frame_rate_provider.h",
113      "test/fake_resource.cc",
114      "test/fake_resource.h",
115      "test/fake_video_stream_input_state_provider.cc",
116      "test/fake_video_stream_input_state_provider.h",
117      "test/mock_resource_listener.h",
118    ]
119    deps = [
120      ":resource_adaptation",
121      "../../api:make_ref_counted",
122      "../../api:scoped_refptr",
123      "../../api:sequence_checker",
124      "../../api/adaptation:resource_adaptation_api",
125      "../../api/task_queue:task_queue",
126      "../../api/video:video_stream_encoder",
127      "../../test:test_support",
128      "../../video:video_stream_encoder_interface",
129      "../../video/config:encoder_config",
130    ]
131    absl_deps = [
132      "//third_party/abseil-cpp/absl/strings",
133      "//third_party/abseil-cpp/absl/types:optional",
134    ]
135  }
136}
137