blob: dde3edc2f7ccf48d49b0165fcafb2838fbfc9baa [file] [log] [blame]
pbos@webrtc.orgdc8c8832013-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.orgb581c902013-10-28 16:32:01 +000016#include "webrtc/test/video_capturer.h"
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000017
18namespace webrtc {
19namespace test {
20
21class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback {
22 public:
pbos@webrtc.orgd8e92c92013-08-23 09:19:30 +000023 static VcmCapturer* Create(VideoSendStreamInput* input, size_t width,
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000024 size_t height, size_t target_fps);
25 virtual ~VcmCapturer();
26
27 virtual void Start() OVERRIDE;
28 virtual void Stop() OVERRIDE;
29
mflodman@webrtc.org9bacbf42013-05-27 15:52:38 +000030 virtual void OnIncomingCapturedFrame(
31 const int32_t id, I420VideoFrame& frame) OVERRIDE; // NOLINT
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000032 virtual void OnCaptureDelayChanged(const int32_t id, const int32_t delay)
33 OVERRIDE;
34
35 private:
pbos@webrtc.orgd8e92c92013-08-23 09:19:30 +000036 explicit VcmCapturer(VideoSendStreamInput* input);
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000037 bool Init(size_t width, size_t height, size_t target_fps);
38 void Destroy();
39
40 bool started_;
pbos@webrtc.org9a15fc32013-05-21 09:32:22 +000041 VideoCaptureModule* vcm_;
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000042 VideoCaptureCapability capability_;
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000043};
44} // test
45} // webrtc
46
47#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_