xref: /aosp_15_r20/external/webrtc/test/mac_capturer.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2019 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 #ifndef TEST_MAC_CAPTURER_H_
11 #define TEST_MAC_CAPTURER_H_
12 
13 #include <memory>
14 #include <vector>
15 
16 #include "api/media_stream_interface.h"
17 #include "api/scoped_refptr.h"
18 #include "modules/video_capture/video_capture.h"
19 #include "rtc_base/thread.h"
20 #include "test/test_video_capturer.h"
21 
22 namespace webrtc {
23 namespace test {
24 
25 class MacCapturer : public TestVideoCapturer,
26                     public rtc::VideoSinkInterface<VideoFrame> {
27  public:
28   static MacCapturer* Create(size_t width,
29                              size_t height,
30                              size_t target_fps,
31                              size_t capture_device_index);
32   ~MacCapturer() override;
33 
34   void OnFrame(const VideoFrame& frame) override;
35 
36  private:
37   MacCapturer(size_t width,
38               size_t height,
39               size_t target_fps,
40               size_t capture_device_index);
41   void Destroy();
42 
43   void* capturer_;
44   void* adapter_;
45 };
46 
47 }  // namespace test
48 }  // namespace webrtc
49 
50 #endif  // TEST_MAC_CAPTURER_H_
51