Bug 1864652 - Expose settings for Global Privacy Control. r=geckoview-reviewers,ohall...
[gecko.git] / third_party / libwebrtc / test / mac_capturer.h
blob58ccfc0675e2524222ad2578be7146d399cd6dea
1 /*
2 * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
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 #ifndef TEST_MAC_CAPTURER_H_
11 #define TEST_MAC_CAPTURER_H_
13 #include <cstddef>
14 #include <memory>
15 #include <vector>
17 #include "api/media_stream_interface.h"
18 #include "api/scoped_refptr.h"
19 #include "modules/video_capture/video_capture.h"
20 #include "rtc_base/logging.h"
21 #include "rtc_base/thread.h"
22 #include "test/test_video_capturer.h"
24 namespace webrtc {
25 namespace test {
27 class MacCapturer : public TestVideoCapturer,
28 public rtc::VideoSinkInterface<VideoFrame> {
29 public:
30 static MacCapturer* Create(size_t width,
31 size_t height,
32 size_t target_fps,
33 size_t capture_device_index);
34 ~MacCapturer() override;
36 void Start() override {
37 RTC_LOG(LS_WARNING) << "Capturer doesn't support resume/pause and always "
38 "produces the video";
40 void Stop() override {
41 RTC_LOG(LS_WARNING) << "Capturer doesn't support resume/pause and always "
42 "produces the video";
45 void OnFrame(const VideoFrame& frame) override;
47 int GetFrameWidth() const override { return static_cast<int>(width_); }
48 int GetFrameHeight() const override { return static_cast<int>(height_); }
50 private:
51 MacCapturer(size_t width,
52 size_t height,
53 size_t target_fps,
54 size_t capture_device_index);
55 void Destroy();
57 size_t width_;
58 size_t height_;
59 void* capturer_;
60 void* adapter_;
63 } // namespace test
64 } // namespace webrtc
66 #endif // TEST_MAC_CAPTURER_H_