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 | */ |
Peter Boström | 7623ce4 | 2015-12-09 12:13:30 +0100 | [diff] [blame] | 10 | #ifndef WEBRTC_TEST_VCM_CAPTURER_H_ |
| 11 | #define WEBRTC_TEST_VCM_CAPTURER_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 12 | |
Peter Boström | 1e737c6 | 2015-10-23 14:45:55 +0200 | [diff] [blame] | 13 | #include "webrtc/base/criticalsection.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 14 | #include "webrtc/common_types.h" |
| 15 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 16 | #include "webrtc/modules/video_capture/video_capture.h" |
pbos@webrtc.org | 16e03b7 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 17 | #include "webrtc/test/video_capturer.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | namespace test { |
| 21 | |
| 22 | class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback { |
| 23 | public: |
Peter Boström | 4b91bd0 | 2015-06-26 06:58:16 +0200 | [diff] [blame] | 24 | static VcmCapturer* Create(VideoCaptureInput* input, |
| 25 | size_t width, |
| 26 | size_t height, |
| 27 | size_t target_fps); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 28 | virtual ~VcmCapturer(); |
| 29 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 30 | void Start() override; |
| 31 | void Stop() override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 32 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 33 | void OnIncomingCapturedFrame(const int32_t id, |
Miguel Casas-Sanchez | 4765070 | 2015-05-29 17:21:40 -0700 | [diff] [blame] | 34 | const VideoFrame& frame) override; // NOLINT |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 35 | void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 36 | |
| 37 | private: |
Peter Boström | 4b91bd0 | 2015-06-26 06:58:16 +0200 | [diff] [blame] | 38 | explicit VcmCapturer(VideoCaptureInput* input); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 39 | bool Init(size_t width, size_t height, size_t target_fps); |
| 40 | void Destroy(); |
| 41 | |
Peter Boström | 1e737c6 | 2015-10-23 14:45:55 +0200 | [diff] [blame] | 42 | rtc::CriticalSection crit_; |
| 43 | bool started_ GUARDED_BY(crit_); |
pbos@webrtc.org | 375deb4 | 2013-05-21 09:32:22 +0000 | [diff] [blame] | 44 | VideoCaptureModule* vcm_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 45 | VideoCaptureCapability capability_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 46 | }; |
| 47 | } // test |
| 48 | } // webrtc |
| 49 | |
Peter Boström | 7623ce4 | 2015-12-09 12:13:30 +0100 | [diff] [blame] | 50 | #endif // WEBRTC_TEST_VCM_CAPTURER_H_ |