blob: 93321f0ff1465b5b2a2c1f8281fc1f15be4f639a [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 */
10#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_
11#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_
12
13#include "webrtc/common_types.h"
14#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
15#include "webrtc/modules/video_capture/include/video_capture.h"
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000016#include "webrtc/test/video_capturer.h"
pbos@webrtc.org29d58392013-05-16 12:08:03 +000017
18namespace webrtc {
19namespace test {
20
21class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback {
22 public:
Peter Boström4b91bd02015-06-26 06:58:16 +020023 static VcmCapturer* Create(VideoCaptureInput* input,
24 size_t width,
25 size_t height,
26 size_t target_fps);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000027 virtual ~VcmCapturer();
28
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000029 void Start() override;
30 void Stop() override;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000031
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000032 void OnIncomingCapturedFrame(const int32_t id,
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070033 const VideoFrame& frame) override; // NOLINT
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000034 void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000035
36 private:
Peter Boström4b91bd02015-06-26 06:58:16 +020037 explicit VcmCapturer(VideoCaptureInput* input);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000038 bool Init(size_t width, size_t height, size_t target_fps);
39 void Destroy();
40
41 bool started_;
pbos@webrtc.org375deb42013-05-21 09:32:22 +000042 VideoCaptureModule* vcm_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000043 VideoCaptureCapability capability_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000044};
45} // test
46} // webrtc
47
48#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_