| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #ifndef WEBRTC_TEST_VCM_CAPTURER_H_ | 10 #ifndef WEBRTC_TEST_VCM_CAPTURER_H_ |
| 11 #define WEBRTC_TEST_VCM_CAPTURER_H_ | 11 #define WEBRTC_TEST_VCM_CAPTURER_H_ |
| 12 | 12 |
| 13 #include "webrtc/base/criticalsection.h" | 13 #include "webrtc/base/criticalsection.h" |
| 14 #include "webrtc/base/scoped_ref_ptr.h" | 14 #include "webrtc/base/scoped_ref_ptr.h" |
| 15 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 17 #include "webrtc/modules/video_capture/video_capture.h" | 17 #include "webrtc/modules/video_capture/video_capture.h" |
| 18 #include "webrtc/test/video_capturer.h" | 18 #include "webrtc/test/video_capturer.h" |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 namespace test { | 21 namespace test { |
| 22 | 22 |
| 23 class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback { | 23 class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback { |
| 24 public: | 24 public: |
| 25 static VcmCapturer* Create(VideoCaptureInput* input, | 25 static VcmCapturer* Create(size_t width, size_t height, size_t target_fps); |
| 26 size_t width, | |
| 27 size_t height, | |
| 28 size_t target_fps); | |
| 29 virtual ~VcmCapturer(); | 26 virtual ~VcmCapturer(); |
| 30 | 27 |
| 31 void Start() override; | 28 void Start() override; |
| 32 void Stop() override; | 29 void Stop() override; |
| 30 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
| 31 const rtc::VideoSinkWants& wants) override; |
| 32 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; |
| 33 | 33 |
| 34 void OnIncomingCapturedFrame(const int32_t id, | 34 void OnIncomingCapturedFrame(const int32_t id, |
| 35 const VideoFrame& frame) override; // NOLINT | 35 const VideoFrame& frame) override; // NOLINT |
| 36 void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override; | 36 void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 explicit VcmCapturer(VideoCaptureInput* input); | 39 VcmCapturer(); |
| 40 bool Init(size_t width, size_t height, size_t target_fps); | 40 bool Init(size_t width, size_t height, size_t target_fps); |
| 41 void Destroy(); | 41 void Destroy(); |
| 42 | 42 |
| 43 rtc::CriticalSection crit_; | 43 rtc::CriticalSection crit_; |
| 44 bool started_ GUARDED_BY(crit_); | 44 bool started_ GUARDED_BY(crit_); |
| 45 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); |
| 45 rtc::scoped_refptr<VideoCaptureModule> vcm_; | 46 rtc::scoped_refptr<VideoCaptureModule> vcm_; |
| 46 VideoCaptureCapability capability_; | 47 VideoCaptureCapability capability_; |
| 47 }; | 48 }; |
| 49 |
| 48 } // test | 50 } // test |
| 49 } // webrtc | 51 } // webrtc |
| 50 | 52 |
| 51 #endif // WEBRTC_TEST_VCM_CAPTURER_H_ | 53 #endif // WEBRTC_TEST_VCM_CAPTURER_H_ |
| OLD | NEW |