pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [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 | */ |
| 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.org | 16e03b7 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 16 | #include "webrtc/test/video_capturer.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | namespace test { |
| 20 | |
| 21 | class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback { |
| 22 | public: |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 23 | static VcmCapturer* Create(VideoSendStreamInput* input, size_t width, |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 24 | size_t height, size_t target_fps); |
| 25 | virtual ~VcmCapturer(); |
| 26 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 27 | void Start() override; |
| 28 | void Stop() override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 29 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 30 | void OnIncomingCapturedFrame(const int32_t id, |
Miguel Casas-Sanchez | 4765070 | 2015-05-29 17:21:40 -0700 | [diff] [blame] | 31 | const VideoFrame& frame) override; // NOLINT |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 32 | void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 33 | |
| 34 | private: |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 35 | explicit VcmCapturer(VideoSendStreamInput* input); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 36 | bool Init(size_t width, size_t height, size_t target_fps); |
| 37 | void Destroy(); |
| 38 | |
| 39 | bool started_; |
pbos@webrtc.org | 375deb4 | 2013-05-21 09:32:22 +0000 | [diff] [blame] | 40 | VideoCaptureModule* vcm_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 41 | VideoCaptureCapability capability_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 42 | }; |
| 43 | } // test |
| 44 | } // webrtc |
| 45 | |
| 46 | #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_VCM_CAPTURER_H_ |