• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9import("../../webrtc.gni")
10
11# Note this target is missing an implementation for the video capture.
12# Targets must link with either 'video_capture' or
13# 'video_capture_internal_impl' depending on whether they want to
14# use the internal capturer.
15rtc_library("video_capture_module") {
16  visibility = [ "*" ]
17  sources = [
18    "device_info_impl.cc",
19    "device_info_impl.h",
20    "video_capture.h",
21    "video_capture_config.h",
22    "video_capture_defines.h",
23    "video_capture_factory.cc",
24    "video_capture_factory.h",
25    "video_capture_impl.cc",
26    "video_capture_impl.h",
27  ]
28
29  deps = [
30    "../../api:scoped_refptr",
31    "../../api/video:video_frame",
32    "../../api/video:video_rtp_headers",
33    "../../common_video",
34    "../../media:rtc_media_base",
35    "../../rtc_base:event_tracer",
36    "../../rtc_base:logging",
37    "../../rtc_base:macromagic",
38    "../../rtc_base:refcount",
39    "../../rtc_base:stringutils",
40    "../../rtc_base:timeutils",
41    "../../rtc_base/synchronization:mutex",
42    "../../system_wrappers",
43    "//third_party/libyuv",
44  ]
45  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
46}
47
48if (!build_with_chromium) {
49  rtc_source_set("video_capture_internal_impl") {
50    visibility = [ "*" ]
51    deps = [
52      ":video_capture_module",
53      "../../api:scoped_refptr",
54      "../../api:sequence_checker",
55      "../../rtc_base:checks",
56      "../../rtc_base:logging",
57      "../../rtc_base:macromagic",
58      "../../rtc_base:platform_thread",
59      "../../rtc_base:refcount",
60      "../../rtc_base:stringutils",
61      "../../rtc_base/synchronization:mutex",
62      "../../system_wrappers",
63    ]
64
65    if (is_linux || is_chromeos) {
66      sources = [
67        "linux/device_info_linux.cc",
68        "linux/device_info_v4l2.cc",
69        "linux/device_info_v4l2.h",
70        "linux/video_capture_linux.cc",
71        "linux/video_capture_v4l2.cc",
72        "linux/video_capture_v4l2.h",
73      ]
74      deps += [ "../../media:rtc_media_base" ]
75    }
76    if (is_win) {
77      sources = [
78        "windows/device_info_ds.cc",
79        "windows/device_info_ds.h",
80        "windows/help_functions_ds.cc",
81        "windows/help_functions_ds.h",
82        "windows/sink_filter_ds.cc",
83        "windows/sink_filter_ds.h",
84        "windows/video_capture_ds.cc",
85        "windows/video_capture_ds.h",
86        "windows/video_capture_factory_windows.cc",
87      ]
88
89      libs = [
90        "ole32.lib",
91        "oleaut32.lib",
92        "strmiids.lib",
93        "user32.lib",
94      ]
95
96      if (build_with_mozilla) {
97        sources += [
98          "windows/BaseFilter.cpp",
99          "windows/BaseInputPin.cpp",
100          "windows/BasePin.cpp",
101          "windows/MediaType.cpp",
102        ]
103      }
104    }
105    if (is_fuchsia) {
106      sources = [ "video_capture_factory_null.cc" ]
107    }
108
109    if (build_with_mozilla && is_android) {
110      include_dirs = [
111        "/config/external/nspr",
112        "/nsprpub/lib/ds",
113        "/nsprpub/pr/include",
114      ]
115
116      sources = [
117        "android/device_info_android.cc",
118        "android/video_capture_android.cc",
119      ]
120    }
121  }
122
123  if (!is_android && rtc_include_tests) {
124    rtc_test("video_capture_tests") {
125      sources = [ "test/video_capture_unittest.cc" ]
126      ldflags = []
127      if (is_linux || is_chromeos || is_mac) {
128        ldflags += [
129          "-lpthread",
130          "-lm",
131        ]
132      }
133      if (is_linux || is_chromeos) {
134        ldflags += [
135          "-lrt",
136          "-lXext",
137          "-lX11",
138        ]
139      }
140
141      deps = [
142        ":video_capture_internal_impl",
143        ":video_capture_module",
144        "../../api:scoped_refptr",
145        "../../api/video:video_frame",
146        "../../api/video:video_rtp_headers",
147        "../../common_video",
148        "../../rtc_base:timeutils",
149        "../../rtc_base/synchronization:mutex",
150        "../../system_wrappers",
151        "../../test:frame_utils",
152        "../../test:test_main",
153        "../../test:test_support",
154        "../../test:video_test_common",
155        "//testing/gtest",
156        "//third_party/abseil-cpp/absl/memory",
157      ]
158    }
159  }
160}
161