pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 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 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 10 | #ifndef TEST_VCM_CAPTURER_H_ |
| 11 | #define TEST_VCM_CAPTURER_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 12 | |
sprang | c5d62e2 | 2017-04-03 06:53:04 | [diff] [blame] | 13 | #include <memory> |
Niels Möller | 3793bb4 | 2018-12-20 12:46:06 | [diff] [blame] | 14 | #include <vector> |
sprang | c5d62e2 | 2017-04-03 06:53:04 | [diff] [blame] | 15 | |
Mirko Bonadei | d970807 | 2019-01-25 19:26:48 | [diff] [blame] | 16 | #include "api/scoped_refptr.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 17 | #include "modules/video_capture/video_capture.h" |
Sebastian Jansson | f1f363f | 2018-08-13 12:24:58 | [diff] [blame] | 18 | #include "test/test_video_capturer.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
Sebastian Jansson | f1f363f | 2018-08-13 12:24:58 | [diff] [blame] | 23 | class VcmCapturer : public TestVideoCapturer, |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 24 | public rtc::VideoSinkInterface<VideoFrame> { |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 25 | public: |
Tarun Chawla | 8e857d1 | 2017-05-31 13:50:57 | [diff] [blame] | 26 | static VcmCapturer* Create(size_t width, |
| 27 | size_t height, |
| 28 | size_t target_fps, |
| 29 | size_t capture_device_index); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 30 | virtual ~VcmCapturer(); |
| 31 | |
nisse | b29b9c8 | 2016-12-12 08:22:56 | [diff] [blame] | 32 | void OnFrame(const VideoFrame& frame) override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 33 | |
| 34 | private: |
perkj | a49cbd3 | 2016-09-16 14:53:41 | [diff] [blame] | 35 | VcmCapturer(); |
Tarun Chawla | 8e857d1 | 2017-05-31 13:50:57 | [diff] [blame] | 36 | bool Init(size_t width, |
| 37 | size_t height, |
| 38 | size_t target_fps, |
| 39 | size_t capture_device_index); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 40 | void Destroy(); |
| 41 | |
Peter Boström | 1d19441 | 2016-03-21 15:44:31 | [diff] [blame] | 42 | rtc::scoped_refptr<VideoCaptureModule> vcm_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 43 | VideoCaptureCapability capability_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 44 | }; |
perkj | a49cbd3 | 2016-09-16 14:53:41 | [diff] [blame] | 45 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 46 | } // namespace test |
| 47 | } // namespace webrtc |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 48 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 49 | #endif // TEST_VCM_CAPTURER_H_ |