blob: 5418dc9596261f4dcfd1f1f025034ff4b6118be0 [file] [log] [blame]
pbos@webrtc.org29d58392013-05-16 12:08:03 +00001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef TEST_VCM_CAPTURER_H_
11#define TEST_VCM_CAPTURER_H_
pbos@webrtc.org29d58392013-05-16 12:08:03 +000012
sprangc5d62e22017-04-02 23:53:04 -070013#include <memory>
Niels Möller3793bb42018-12-20 13:46:06 +010014#include <vector>
sprangc5d62e22017-04-02 23:53:04 -070015
Mirko Bonadeid9708072019-01-25 20:26:48 +010016#include "api/scoped_refptr.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "modules/video_capture/video_capture.h"
Sebastian Janssonf1f363f2018-08-13 14:24:58 +020018#include "test/test_video_capturer.h"
pbos@webrtc.org29d58392013-05-16 12:08:03 +000019
20namespace webrtc {
21namespace test {
22
Sebastian Janssonf1f363f2018-08-13 14:24:58 +020023class VcmCapturer : public TestVideoCapturer,
Yves Gerey665174f2018-06-19 15:03:05 +020024 public rtc::VideoSinkInterface<VideoFrame> {
pbos@webrtc.org29d58392013-05-16 12:08:03 +000025 public:
Tarun Chawla8e857d12017-05-31 19:20:57 +053026 static VcmCapturer* Create(size_t width,
27 size_t height,
28 size_t target_fps,
29 size_t capture_device_index);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000030 virtual ~VcmCapturer();
31
nisseb29b9c82016-12-12 00:22:56 -080032 void OnFrame(const VideoFrame& frame) override;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000033
34 private:
perkja49cbd32016-09-16 07:53:41 -070035 VcmCapturer();
Tarun Chawla8e857d12017-05-31 19:20:57 +053036 bool Init(size_t width,
37 size_t height,
38 size_t target_fps,
39 size_t capture_device_index);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000040 void Destroy();
41
Peter Boström1d194412016-03-21 16:44:31 +010042 rtc::scoped_refptr<VideoCaptureModule> vcm_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000043 VideoCaptureCapability capability_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000044};
perkja49cbd32016-09-16 07:53:41 -070045
Yves Gerey665174f2018-06-19 15:03:05 +020046} // namespace test
47} // namespace webrtc
pbos@webrtc.org29d58392013-05-16 12:08:03 +000048
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#endif // TEST_VCM_CAPTURER_H_