blob: 1c024122642b1aa5a7ee38167f2b464d898f2031 [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# Copyright (c) 2014 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000010
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000011# Note this target is missing an implementation for the video capture.
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000012# Targets must link with either 'video_capture' or
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000013# 'video_capture_internal_impl' depending on whether they want to
14# use the internal capturer.
Mirko Bonadei86d053c2019-10-17 21:32:04 +020015rtc_library("video_capture_module") {
Per Kjellandera0f5f602018-01-10 15:57:32 +000016 visibility = [ "*" ]
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000017 sources = [
18 "device_info_impl.cc",
19 "device_info_impl.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010020 "video_capture.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000021 "video_capture_config.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010022 "video_capture_defines.h",
guidou41bce132016-08-04 06:48:17 -070023 "video_capture_factory.cc",
sakal06bfe1f2016-08-04 07:54:04 -070024 "video_capture_factory.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000025 "video_capture_impl.cc",
26 "video_capture_impl.h",
27 ]
28
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000029 deps = [
mbonadei1140f972017-04-26 03:38:35 -070030 "..:module_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +010031 "../../api:scoped_refptr",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020032 "../../api/video:video_frame",
33 "../../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +020034 "../../api/video:video_rtp_headers",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000035 "../../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +010036 "../../media:rtc_media_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070037 "../../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +010038 "../../rtc_base:stringutils",
Karl Wiberg2b857922018-03-23 14:53:54 +010039 "../../rtc_base/synchronization:rw_lock_wrapper",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000040 "../../system_wrappers",
Niels Mölleraa3c1cc2018-11-02 10:54:56 +010041 "//third_party/abseil-cpp/absl/strings",
Mirko Bonadei401d0562017-12-14 11:24:00 +010042 "//third_party/libyuv",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000043 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000044}
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000045
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000046if (!build_with_chromium) {
mbonadei054b1082017-09-04 06:54:54 -070047 rtc_source_set("video_capture_internal_impl") {
Mirko Bonadei77d197f2019-09-04 08:38:39 +020048 visibility = [ "*" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000049 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000050 ":video_capture_module",
Mirko Bonadeid9708072019-01-25 20:26:48 +010051 "../../api:scoped_refptr",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010052 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070053 "../../rtc_base:rtc_base_approved",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000054 "../../system_wrappers",
55 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000056
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000057 if (is_linux) {
58 sources = [
59 "linux/device_info_linux.cc",
60 "linux/device_info_linux.h",
61 "linux/video_capture_linux.cc",
62 "linux/video_capture_linux.h",
63 ]
Niels Möller9d8eaac2019-03-29 10:39:41 +010064 deps += [ "../../media:rtc_media_base" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000065 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000066 if (is_win) {
67 sources = [
68 "windows/device_info_ds.cc",
69 "windows/device_info_ds.h",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000070 "windows/help_functions_ds.cc",
71 "windows/help_functions_ds.h",
72 "windows/sink_filter_ds.cc",
73 "windows/sink_filter_ds.h",
74 "windows/video_capture_ds.cc",
75 "windows/video_capture_ds.h",
76 "windows/video_capture_factory_windows.cc",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000077 ]
78
Mirko Bonadei903dc862018-03-27 20:30:52 +020079 libs = [ "strmiids.lib" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000080
Dan Minor9c686132018-01-15 10:20:00 -050081 if (build_with_mozilla) {
82 sources += [
83 "windows/BaseFilter.cpp",
84 "windows/BaseInputPin.cpp",
85 "windows/BasePin.cpp",
86 "windows/MediaType.cpp",
87 ]
Dan Minor9c686132018-01-15 10:20:00 -050088 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000089 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000090
Dan Minor9c686132018-01-15 10:20:00 -050091 if (build_with_mozilla && is_android) {
92 include_dirs = [
93 "/config/external/nspr",
94 "/nsprpub/lib/ds",
95 "/nsprpub/pr/include",
96 ]
97
98 sources = [
99 "android/device_info_android.cc",
100 "android/video_capture_android.cc",
101 ]
102 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000103 }
sakal06bfe1f2016-08-04 07:54:04 -0700104
kjellanderf96c51a2016-08-15 09:21:31 -0700105 if (!is_android && rtc_include_tests) {
ehmaldonado38a21322016-09-02 04:10:34 -0700106 rtc_test("video_capture_tests") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100107 sources = [ "test/video_capture_unittest.cc" ]
sakal06bfe1f2016-08-04 07:54:04 -0700108 ldflags = []
109 if (is_linux || is_mac) {
110 ldflags += [
111 "-lpthread",
112 "-lm",
113 ]
114 }
115 if (is_linux) {
116 ldflags += [
117 "-lrt",
118 "-lXext",
119 "-lX11",
120 ]
121 }
122
123 deps = [
124 ":video_capture_internal_impl",
125 ":video_capture_module",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100126 "../../api:scoped_refptr",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200127 "../../api/video:video_frame",
128 "../../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +0200129 "../../api/video:video_rtp_headers",
Artem Titov94b57c02019-03-21 13:35:10 +0100130 "../../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700131 "../../rtc_base:rtc_base_approved",
Artem Titov94b57c02019-03-21 13:35:10 +0100132 "../../system_wrappers",
Artem Titov33f9d2b2019-12-05 15:59:00 +0100133 "../../test:frame_utils",
Yves Gerey21cddff2018-10-30 21:12:42 +0100134 "../../test:test_support",
kjellanderf96c51a2016-08-15 09:21:31 -0700135 "../../test:video_test_common",
136 "../utility",
137 "//testing/gtest",
Artem Titov533a9fe2019-03-21 12:18:05 +0100138 "//third_party/abseil-cpp/absl/memory",
sakal06bfe1f2016-08-04 07:54:04 -0700139 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700140 deps += [ "../../test:test_main" ]
sakal06bfe1f2016-08-04 07:54:04 -0700141 }
142 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000143}