tor-browser

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

window_capturer_null.cc (2037B)


      1 /*
      2 *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #include <memory>
     12 
     13 #include "modules/desktop_capture/desktop_capturer.h"
     14 #include "rtc_base/checks.h"
     15 #include "rtc_base/logging.h"
     16 
     17 namespace webrtc {
     18 
     19 namespace {
     20 
     21 class WindowCapturerNull : public DesktopCapturer {
     22 public:
     23  WindowCapturerNull();
     24  ~WindowCapturerNull() override;
     25 
     26  WindowCapturerNull(const WindowCapturerNull&) = delete;
     27  WindowCapturerNull& operator=(const WindowCapturerNull&) = delete;
     28 
     29  // DesktopCapturer interface.
     30  void Start(Callback* callback) override;
     31  void CaptureFrame() override;
     32  bool GetSourceList(SourceList* sources) override;
     33  bool SelectSource(SourceId id) override;
     34 
     35 private:
     36  Callback* callback_ = nullptr;
     37 };
     38 
     39 WindowCapturerNull::WindowCapturerNull() {}
     40 WindowCapturerNull::~WindowCapturerNull() {}
     41 
     42 bool WindowCapturerNull::GetSourceList(SourceList* sources) {
     43  // Not implemented yet.
     44  return false;
     45 }
     46 
     47 bool WindowCapturerNull::SelectSource(SourceId id) {
     48  // Not implemented yet.
     49  return false;
     50 }
     51 
     52 void WindowCapturerNull::Start(Callback* callback) {
     53  RTC_DCHECK(!callback_);
     54  RTC_DCHECK(callback);
     55 
     56  callback_ = callback;
     57 }
     58 
     59 void WindowCapturerNull::CaptureFrame() {
     60  // Not implemented yet.
     61  callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
     62 }
     63 
     64 }  // namespace
     65 
     66 // static
     67 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
     68    const DesktopCaptureOptions& options) {
     69  RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer "
     70                      "creates DesktopCapturer of type WindowCapturerNull";
     71  return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull());
     72 }
     73 
     74 }  // namespace webrtc