kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # 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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 10 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 11 | # Note this target is missing an implementation for the video capture. |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 12 | # Targets must link with either 'video_capture' or |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 13 | # 'video_capture_internal_impl' depending on whether they want to |
| 14 | # use the internal capturer. |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 15 | rtc_library("video_capture_module") { |
Per Kjellander | a0f5f60 | 2018-01-10 15:57:32 +0000 | [diff] [blame] | 16 | visibility = [ "*" ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 17 | sources = [ |
| 18 | "device_info_impl.cc", |
| 19 | "device_info_impl.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 20 | "video_capture.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 21 | "video_capture_config.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 22 | "video_capture_defines.h", |
guidou | 41bce13 | 2016-08-04 06:48:17 -0700 | [diff] [blame] | 23 | "video_capture_factory.cc", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 24 | "video_capture_factory.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 25 | "video_capture_impl.cc", |
| 26 | "video_capture_impl.h", |
| 27 | ] |
| 28 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 29 | deps = [ |
mbonadei | 1140f97 | 2017-04-26 03:38:35 -0700 | [diff] [blame] | 30 | "..:module_api", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 31 | "../../api:scoped_refptr", |
Niels Möller | c6ce9c5 | 2018-05-11 11:15:30 +0200 | [diff] [blame] | 32 | "../../api/video:video_frame", |
| 33 | "../../api/video:video_frame_i420", |
Chen Xing | 5d24b16 | 2019-06-10 12:59:38 +0200 | [diff] [blame] | 34 | "../../api/video:video_rtp_headers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 35 | "../../common_video", |
Mirko Bonadei | ad62792 | 2017-11-30 17:16:21 +0100 | [diff] [blame] | 36 | "../../media:rtc_media_base", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 37 | "../../rtc_base:rtc_base_approved", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 38 | "../../rtc_base:stringutils", |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 39 | "../../rtc_base/synchronization:rw_lock_wrapper", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 40 | "../../system_wrappers", |
Niels Möller | aa3c1cc | 2018-11-02 10:54:56 +0100 | [diff] [blame] | 41 | "//third_party/abseil-cpp/absl/strings", |
Mirko Bonadei | 401d056 | 2017-12-14 11:24:00 +0100 | [diff] [blame] | 42 | "//third_party/libyuv", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 43 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 44 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 45 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 46 | if (!build_with_chromium) { |
mbonadei | 054b108 | 2017-09-04 06:54:54 -0700 | [diff] [blame] | 47 | rtc_source_set("video_capture_internal_impl") { |
Mirko Bonadei | 77d197f | 2019-09-04 08:38:39 +0200 | [diff] [blame] | 48 | visibility = [ "*" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 49 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 50 | ":video_capture_module", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 51 | "../../api:scoped_refptr", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 52 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 53 | "../../rtc_base:rtc_base_approved", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 54 | "../../system_wrappers", |
| 55 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 56 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 57 | 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öller | 9d8eaac | 2019-03-29 10:39:41 +0100 | [diff] [blame] | 64 | deps += [ "../../media:rtc_media_base" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 65 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 66 | if (is_win) { |
| 67 | sources = [ |
| 68 | "windows/device_info_ds.cc", |
| 69 | "windows/device_info_ds.h", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 70 | "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.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 77 | ] |
| 78 | |
Mirko Bonadei | 903dc86 | 2018-03-27 20:30:52 +0200 | [diff] [blame] | 79 | libs = [ "strmiids.lib" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 80 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 81 | if (build_with_mozilla) { |
| 82 | sources += [ |
| 83 | "windows/BaseFilter.cpp", |
| 84 | "windows/BaseInputPin.cpp", |
| 85 | "windows/BasePin.cpp", |
| 86 | "windows/MediaType.cpp", |
| 87 | ] |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 88 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 89 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 90 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 91 | 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.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 103 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 104 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 105 | if (!is_android && rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 106 | rtc_test("video_capture_tests") { |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 107 | sources = [ "test/video_capture_unittest.cc" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 108 | 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 Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 126 | "../../api:scoped_refptr", |
Niels Möller | c6ce9c5 | 2018-05-11 11:15:30 +0200 | [diff] [blame] | 127 | "../../api/video:video_frame", |
| 128 | "../../api/video:video_frame_i420", |
Chen Xing | 5d24b16 | 2019-06-10 12:59:38 +0200 | [diff] [blame] | 129 | "../../api/video:video_rtp_headers", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 130 | "../../common_video", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 131 | "../../rtc_base:rtc_base_approved", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 132 | "../../system_wrappers", |
Artem Titov | 33f9d2b | 2019-12-05 15:59:00 +0100 | [diff] [blame] | 133 | "../../test:frame_utils", |
Yves Gerey | 21cddff | 2018-10-30 21:12:42 +0100 | [diff] [blame] | 134 | "../../test:test_support", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 135 | "../../test:video_test_common", |
| 136 | "../utility", |
| 137 | "//testing/gtest", |
Artem Titov | 533a9fe | 2019-03-21 12:18:05 +0100 | [diff] [blame] | 138 | "//third_party/abseil-cpp/absl/memory", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 139 | ] |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 140 | deps += [ "../../test:test_main" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 141 | } |
| 142 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 143 | } |