blob: 3b5d9e366ddd07bdbfd7e699a4e846a501260568 [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:
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000023 static VcmCapturer* Create(VideoSendStreamInput* input, size_t width,
pbos@webrtc.org29d58392013-05-16 12:08:03 +000024 size_t height, size_t target_fps);
25 virtual ~VcmCapturer();
26
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000027 void Start() override;
28 void Stop() override;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000029
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000030 void OnIncomingCapturedFrame(const int32_t id,
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070031 const VideoFrame& frame) override; // NOLINT
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000032 void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000033
34 private:
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000035 explicit VcmCapturer(VideoSendStreamInput* input);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000036 bool Init(size_t width, size_t height, size_t target_fps);
37 void Destroy();
38
39 bool started_;
pbos@webrtc.org375deb42013-05-21 09:32:22 +000040 VideoCaptureModule* vcm_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000041 VideoCaptureCapability capability_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000042};
43} // test
44} // webrtc
45
46#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_