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 |
| 24 : public VideoCapturer, |
| 25 public rtc::VideoSinkInterface<VideoFrame> { |
24 public: | 26 public: |
25 static VcmCapturer* Create(size_t width, size_t height, size_t target_fps); | 27 static VcmCapturer* Create(size_t width, size_t height, size_t target_fps); |
26 virtual ~VcmCapturer(); | 28 virtual ~VcmCapturer(); |
27 | 29 |
28 void Start() override; | 30 void Start() override; |
29 void Stop() override; | 31 void Stop() override; |
30 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | 32 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
31 const rtc::VideoSinkWants& wants) override; | 33 const rtc::VideoSinkWants& wants) override; |
32 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; | 34 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; |
33 | 35 |
34 void OnIncomingCapturedFrame(const int32_t id, | 36 void OnFrame(const VideoFrame& frame) override; |
35 const VideoFrame& frame) override; // NOLINT | |
36 void OnCaptureDelayChanged(const int32_t id, const int32_t delay) override; | |
37 | 37 |
38 private: | 38 private: |
39 VcmCapturer(); | 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::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); |
46 rtc::scoped_refptr<VideoCaptureModule> vcm_; | 46 rtc::scoped_refptr<VideoCaptureModule> vcm_; |
47 VideoCaptureCapability capability_; | 47 VideoCaptureCapability capability_; |
48 }; | 48 }; |
49 | 49 |
50 } // test | 50 } // test |
51 } // webrtc | 51 } // webrtc |
52 | 52 |
53 #endif // WEBRTC_TEST_VCM_CAPTURER_H_ | 53 #endif // WEBRTC_TEST_VCM_CAPTURER_H_ |
OLD | NEW |