xref: /aosp_15_r20/external/webrtc/api/video/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Copyright (c) 2018 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")
10if (is_android) {
11  import("//build/config/android/config.gni")
12  import("//build/config/android/rules.gni")
13}
14
15rtc_library("video_rtp_headers") {
16  visibility = [ "*" ]
17  sources = [
18    "color_space.cc",
19    "color_space.h",
20    "hdr_metadata.cc",
21    "hdr_metadata.h",
22    "video_content_type.cc",
23    "video_content_type.h",
24    "video_rotation.h",
25    "video_timing.cc",
26    "video_timing.h",
27  ]
28
29  deps = [
30    "..:array_view",
31    "../../rtc_base:logging",
32    "../../rtc_base:safe_conversions",
33    "../../rtc_base:stringutils",
34    "../../rtc_base/system:rtc_export",
35    "../units:data_rate",
36    "../units:time_delta",
37  ]
38  absl_deps = [
39    "//third_party/abseil-cpp/absl/container:inlined_vector",
40    "//third_party/abseil-cpp/absl/types:optional",
41  ]
42}
43
44rtc_library("video_frame") {
45  visibility = [ "*" ]
46  sources = [
47    "i420_buffer.cc",
48    "i420_buffer.h",
49    "i422_buffer.cc",
50    "i422_buffer.h",
51    "i444_buffer.cc",
52    "i444_buffer.h",
53    "nv12_buffer.cc",
54    "nv12_buffer.h",
55    "video_codec_type.h",
56    "video_frame.cc",
57    "video_frame.h",
58    "video_frame_buffer.cc",
59    "video_frame_buffer.h",
60    "video_sink_interface.h",
61    "video_source_interface.cc",
62    "video_source_interface.h",
63  ]
64
65  deps = [
66    ":video_rtp_headers",
67    "..:array_view",
68    "..:make_ref_counted",
69    "..:rtp_packet_info",
70    "..:scoped_refptr",
71    "..:video_track_source_constraints",
72    "../../rtc_base:checks",
73    "../../rtc_base:refcount",
74    "../../rtc_base:timeutils",
75    "../../rtc_base/memory:aligned_malloc",
76    "../../rtc_base/system:rtc_export",
77    "//third_party/libyuv",
78  ]
79  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
80}
81
82if (is_android) {
83  java_cpp_enum("video_frame_enums") {
84    sources = [ "video_frame_buffer.h" ]
85  }
86}
87
88rtc_library("video_frame_i010") {
89  visibility = [ "*" ]
90  sources = [
91    "i010_buffer.cc",
92    "i010_buffer.h",
93    "i210_buffer.cc",
94    "i210_buffer.h",
95  ]
96  deps = [
97    ":video_frame",
98    ":video_rtp_headers",
99    "..:make_ref_counted",
100    "..:scoped_refptr",
101    "../../rtc_base",
102    "../../rtc_base:checks",
103    "../../rtc_base:refcount",
104    "../../rtc_base/memory:aligned_malloc",
105    "//third_party/libyuv",
106  ]
107}
108
109rtc_source_set("recordable_encoded_frame") {
110  visibility = [ "*" ]
111  sources = [ "recordable_encoded_frame.h" ]
112
113  deps = [
114    ":encoded_image",
115    ":video_frame",
116    ":video_rtp_headers",
117    "..:array_view",
118    "..:make_ref_counted",
119    "..:scoped_refptr",
120    "../units:timestamp",
121  ]
122}
123
124rtc_source_set("video_frame_type") {
125  visibility = [ "*" ]
126  sources = [ "video_frame_type.h" ]
127}
128
129rtc_source_set("render_resolution") {
130  visibility = [ "*" ]
131  public = [ "render_resolution.h" ]
132}
133
134rtc_source_set("resolution") {
135  visibility = [ "*" ]
136  public = [ "resolution.h" ]
137}
138
139rtc_library("encoded_image") {
140  visibility = [ "*" ]
141  sources = [
142    "encoded_image.cc",
143    "encoded_image.h",
144  ]
145  deps = [
146    ":video_codec_constants",
147    ":video_frame",
148    ":video_frame_type",
149    ":video_rtp_headers",
150    "..:refcountedbase",
151    "..:rtp_packet_info",
152    "..:scoped_refptr",
153    "../../rtc_base:checks",
154    "../../rtc_base:refcount",
155    "../../rtc_base/system:rtc_export",
156  ]
157  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
158}
159
160rtc_library("encoded_frame") {
161  visibility = [ "*" ]
162  sources = [
163    "encoded_frame.cc",
164    "encoded_frame.h",
165  ]
166
167  deps = [
168    "../../modules/video_coding:encoded_frame",
169    "../units:timestamp",
170  ]
171  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
172}
173
174rtc_library("rtp_video_frame_assembler") {
175  visibility = [ "*" ]
176  sources = [
177    "rtp_video_frame_assembler.cc",
178    "rtp_video_frame_assembler.h",
179  ]
180
181  deps = [
182    ":encoded_frame",
183    "../../modules/rtp_rtcp:rtp_rtcp",
184    "../../modules/rtp_rtcp:rtp_rtcp_format",
185    "../../modules/video_coding:packet_buffer",
186    "../../modules/video_coding:video_coding",
187    "../../rtc_base:logging",
188  ]
189
190  absl_deps = [
191    "//third_party/abseil-cpp/absl/container:inlined_vector",
192    "//third_party/abseil-cpp/absl/types:optional",
193  ]
194}
195
196rtc_library("rtp_video_frame_assembler_unittests") {
197  testonly = true
198  sources = [ "rtp_video_frame_assembler_unittests.cc" ]
199
200  deps = [
201    ":rtp_video_frame_assembler",
202    "..:array_view",
203    "../../modules/rtp_rtcp:rtp_packetizer_av1_test_helper",
204    "../../modules/rtp_rtcp:rtp_rtcp",
205    "../../modules/rtp_rtcp:rtp_rtcp_format",
206    "../../test:test_support",
207  ]
208}
209
210rtc_source_set("video_codec_constants") {
211  visibility = [ "*" ]
212  sources = [ "video_codec_constants.h" ]
213  deps = []
214}
215
216rtc_library("video_bitrate_allocation") {
217  visibility = [ "*" ]
218  sources = [
219    "video_bitrate_allocation.cc",
220    "video_bitrate_allocation.h",
221  ]
222  deps = [
223    ":video_codec_constants",
224    "../../rtc_base:checks",
225    "../../rtc_base:safe_conversions",
226    "../../rtc_base:stringutils",
227    "../../rtc_base/system:rtc_export",
228  ]
229  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
230}
231
232rtc_source_set("video_layers_allocation") {
233  visibility = [ "*" ]
234  sources = [ "video_layers_allocation.h" ]
235  deps = [ "../units:data_rate" ]
236  absl_deps = [ "//third_party/abseil-cpp/absl/container:inlined_vector" ]
237}
238
239rtc_library("video_bitrate_allocator") {
240  visibility = [ "*" ]
241  sources = [
242    "video_bitrate_allocator.cc",
243    "video_bitrate_allocator.h",
244  ]
245  deps = [
246    ":video_bitrate_allocation",
247    "../units:data_rate",
248  ]
249}
250
251rtc_source_set("video_bitrate_allocator_factory") {
252  visibility = [ "*" ]
253  sources = [ "video_bitrate_allocator_factory.h" ]
254  deps = [
255    ":video_bitrate_allocator",
256    "../video_codecs:video_codecs_api",
257  ]
258}
259
260rtc_source_set("video_stream_decoder") {
261  visibility = [ "*" ]
262  sources = [ "video_stream_decoder.h" ]
263
264  deps = [
265    ":encoded_frame",
266    ":video_frame",
267    ":video_rtp_headers",
268    "../task_queue",
269    "../units:time_delta",
270    "../video_codecs:video_codecs_api",
271  ]
272  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
273}
274
275rtc_library("video_stream_decoder_create") {
276  visibility = [ "*" ]
277  sources = [
278    "video_stream_decoder_create.cc",
279    "video_stream_decoder_create.h",
280  ]
281
282  deps = [
283    ":video_stream_decoder",
284    "../../api:field_trials_view",
285    "../../video:video_stream_decoder_impl",
286    "../task_queue",
287    "../video_codecs:video_codecs_api",
288  ]
289}
290
291rtc_library("video_adaptation") {
292  visibility = [ "*" ]
293  sources = [
294    "video_adaptation_counters.cc",
295    "video_adaptation_counters.h",
296    "video_adaptation_reason.h",
297  ]
298
299  deps = [
300    "../../rtc_base:checks",
301    "../../rtc_base:stringutils",
302  ]
303}
304
305rtc_source_set("video_stream_encoder") {
306  visibility = [ "*" ]
307  sources = [ "video_stream_encoder_settings.h" ]
308
309  deps = [
310    ":video_adaptation",
311    ":video_bitrate_allocation",
312    ":video_bitrate_allocator",
313    ":video_bitrate_allocator_factory",
314    ":video_codec_constants",
315    ":video_frame",
316    ":video_layers_allocation",
317    "..:rtp_parameters",
318    "..:scoped_refptr",
319    "../:fec_controller_api",
320    "../:rtp_parameters",
321    "../adaptation:resource_adaptation_api",
322    "../units:data_rate",
323    "../video_codecs:video_codecs_api",
324  ]
325  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
326}
327
328rtc_source_set("video_frame_metadata") {
329  visibility = [ "*" ]
330  sources = [
331    "video_frame_metadata.cc",
332    "video_frame_metadata.h",
333  ]
334  deps = [
335    ":video_frame",
336    ":video_frame_type",
337    ":video_rtp_headers",
338    "..:array_view",
339    "../../rtc_base/system:rtc_export",
340    "../transport/rtp:dependency_descriptor",
341  ]
342  absl_deps = [
343    "//third_party/abseil-cpp/absl/container:inlined_vector",
344    "//third_party/abseil-cpp/absl/types:optional",
345  ]
346}
347
348rtc_library("builtin_video_bitrate_allocator_factory") {
349  visibility = [ "*" ]
350  sources = [
351    "builtin_video_bitrate_allocator_factory.cc",
352    "builtin_video_bitrate_allocator_factory.h",
353  ]
354
355  deps = [
356    ":video_bitrate_allocation",
357    ":video_bitrate_allocator",
358    ":video_bitrate_allocator_factory",
359    "../../api:scoped_refptr",
360    "../../media:rtc_media_base",
361    "../../modules/video_coding:video_coding_utility",
362    "../../modules/video_coding/svc:svc_rate_allocator",
363    "../video_codecs:video_codecs_api",
364  ]
365  absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
366}
367
368rtc_library("frame_buffer") {
369  visibility = [ "*" ]
370  sources = [
371    "frame_buffer.cc",
372    "frame_buffer.h",
373  ]
374  deps = [
375    "../../api:field_trials_view",
376    "../../api/units:timestamp",
377    "../../api/video:encoded_frame",
378    "../../modules/video_coding:video_coding_utility",
379    "../../rtc_base:logging",
380    "../../rtc_base:rtc_numerics",
381  ]
382  absl_deps = [
383    "//third_party/abseil-cpp/absl/algorithm:container",
384    "//third_party/abseil-cpp/absl/container:inlined_vector",
385    "//third_party/abseil-cpp/absl/types:optional",
386  ]
387}
388
389rtc_library("frame_buffer_unittest") {
390  testonly = true
391  sources = [ "frame_buffer_unittest.cc" ]
392
393  deps = [
394    ":frame_buffer",
395    "../../api/video:encoded_frame",
396    "../../test:fake_encoded_frame",
397    "../../test:field_trial",
398    "../../test:scoped_key_value_config",
399    "../../test:test_support",
400  ]
401}
402
403if (rtc_include_tests) {
404  rtc_library("video_unittests") {
405    testonly = true
406    sources = [ "video_stream_decoder_create_unittest.cc" ]
407    deps = [
408      ":video_frame_metadata",
409      ":video_frame_type",
410      ":video_stream_decoder_create",
411      "../../modules/rtp_rtcp:rtp_video_header",
412      "../../test:test_support",
413      "../task_queue:default_task_queue_factory",
414      "../video_codecs:builtin_video_decoder_factory",
415    ]
416  }
417}
418