tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

BUILD.gn (5944B)


      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 
      9 import("../../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.
     15 rtc_library("video_capture_module") {
     16   visibility = [ "*" ]
     17   sources = [
     18     "device_info_impl.cc",
     19     "device_info_impl.h",
     20     "raw_video_sink_interface.h",
     21     "video_capture.h",
     22     "video_capture_config.h",
     23     "video_capture_defines.h",
     24     "video_capture_factory.cc",
     25     "video_capture_factory.h",
     26     "video_capture_impl.cc",
     27     "video_capture_impl.h",
     28   ]
     29 
     30   deps = [
     31     "../../api:ref_count",
     32     "../../api:scoped_refptr",
     33     "../../api:sequence_checker",
     34     "../../api/video:video_frame",
     35     "../../api/video:video_rtp_headers",
     36     "../../common_video",
     37     "../../rtc_base:checks",
     38     "../../rtc_base:event_tracer",
     39     "../../rtc_base:logging",
     40     "../../rtc_base:macromagic",
     41     "../../rtc_base:race_checker",
     42     "../../rtc_base:refcount",
     43     "../../rtc_base:stringutils",
     44     "../../rtc_base:timeutils",
     45     "../../rtc_base/synchronization:mutex",
     46     "../../rtc_base/system:rtc_export",
     47     "../../system_wrappers",
     48     "//third_party/abseil-cpp/absl/strings",
     49     "//third_party/abseil-cpp/absl/strings:string_view",
     50     "//third_party/libyuv",
     51   ]
     52 }
     53 
     54 if (!build_with_chromium || is_linux || is_chromeos) {
     55   rtc_library("video_capture_internal_impl") {
     56     visibility = [ "*" ]
     57     deps = [
     58       ":video_capture_module",
     59       "../../api:make_ref_counted",
     60       "../../api:scoped_refptr",
     61       "../../api:sequence_checker",
     62       "../../api/video:video_rtp_headers",
     63       "../../common_video",
     64       "../../media:video_common",
     65       "../../rtc_base:checks",
     66       "../../rtc_base:logging",
     67       "../../rtc_base:macromagic",
     68       "../../rtc_base:platform_thread",
     69       "../../rtc_base:platform_thread_types",
     70       "../../rtc_base:race_checker",
     71       "../../rtc_base:refcount",
     72       "../../rtc_base:stringutils",
     73       "../../rtc_base/synchronization:mutex",
     74       "../../rtc_base/system:rtc_export",
     75       "../../system_wrappers",
     76       "//third_party/abseil-cpp/absl/strings",
     77     ]
     78     sources = [
     79       "video_capture_options.cc",
     80       "video_capture_options.h",
     81     ]
     82 
     83     if (is_linux || is_bsd || is_chromeos) {
     84       sources += [
     85         "linux/device_info_linux.cc",
     86         "linux/device_info_v4l2.cc",
     87         "linux/device_info_v4l2.h",
     88         "linux/video_capture_linux.cc",
     89         "linux/video_capture_v4l2.cc",
     90         "linux/video_capture_v4l2.h",
     91       ]
     92       deps += [
     93         "../../media:rtc_media_base",
     94         "../../rtc_base:sanitizer",
     95       ]
     96 
     97       if (rtc_use_pipewire) {
     98         sources += [
     99           "linux/camera_portal.cc",
    100           "linux/camera_portal.h",
    101           "linux/device_info_pipewire.cc",
    102           "linux/device_info_pipewire.h",
    103           "linux/pipewire_session.cc",
    104           "linux/pipewire_session.h",
    105           "linux/video_capture_pipewire.cc",
    106           "linux/video_capture_pipewire.h",
    107         ]
    108 
    109         configs += [ "../portal:pipewire_base" ]
    110 
    111         public_configs = [ "../portal:pipewire_config" ]
    112 
    113         deps += [
    114           "../../api:refcountedbase",
    115           "../../common_video",
    116           "../../media:rtc_media_base",
    117           "../portal",
    118         ]
    119         if (build_with_mozilla) {
    120           configs -= [ "../portal:pipewire_base" ]
    121           defines = [ "WEBRTC_USE_PIPEWIRE" ]
    122         }
    123       }
    124     }
    125     if (is_win) {
    126       sources += [
    127         "windows/device_info_ds.cc",
    128         "windows/device_info_ds.h",
    129         "windows/help_functions_ds.cc",
    130         "windows/help_functions_ds.h",
    131         "windows/sink_filter_ds.cc",
    132         "windows/sink_filter_ds.h",
    133         "windows/video_capture_ds.cc",
    134         "windows/video_capture_ds.h",
    135         "windows/video_capture_factory_windows.cc",
    136       ]
    137 
    138       libs = [
    139         "ole32.lib",
    140         "oleaut32.lib",
    141         "strmiids.lib",
    142         "user32.lib",
    143       ]
    144     }
    145     if (is_fuchsia) {
    146       sources += [ "video_capture_factory_null.cc" ]
    147     }
    148 
    149     if (!build_with_mozilla && is_android) {
    150       include_dirs = [
    151         "/config/external/nspr",
    152         "/nsprpub/lib/ds",
    153         "/nsprpub/pr/include",
    154       ]
    155 
    156       sources += [
    157         "android/device_info_android.cc",
    158         "android/video_capture_android.cc",
    159       ]
    160     }
    161   }
    162 
    163   if (!is_android && rtc_include_tests) {
    164     rtc_test("video_capture_tests") {
    165       sources = [ "test/video_capture_unittest.cc" ]
    166       ldflags = []
    167       if (is_linux || is_chromeos || is_mac) {
    168         ldflags += [
    169           "-lpthread",
    170           "-lm",
    171         ]
    172       }
    173       if (is_linux || is_chromeos) {
    174         ldflags += [
    175           "-lrt",
    176           "-lXext",
    177           "-lX11",
    178         ]
    179       }
    180 
    181       deps = [
    182         ":video_capture_internal_impl",
    183         ":video_capture_module",
    184         "../../api:rtc_error_matchers",
    185         "../../api:scoped_refptr",
    186         "../../api/units:time_delta",
    187         "../../api/video:video_frame",
    188         "../../api/video:video_rtp_headers",
    189         "../../common_video",
    190         "../../rtc_base:checks",
    191         "../../rtc_base:gunit_helpers",
    192         "../../rtc_base:timeutils",
    193         "../../rtc_base/synchronization:mutex",
    194         "../../system_wrappers",
    195         "../../test:frame_utils",
    196         "../../test:test_main",
    197         "../../test:test_support",
    198         "../../test:video_test_common",
    199         "../../test:wait_until",
    200         "//testing/gtest",
    201         "//third_party/abseil-cpp/absl/memory",
    202       ]
    203     }
    204   }
    205 }