Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: webrtc/test/vcm_capturer.h

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Changed AdaptUp behavior, respect SinkWants in test capturers, manual testing facilitated Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
14
13 #include "webrtc/base/criticalsection.h" 15 #include "webrtc/base/criticalsection.h"
14 #include "webrtc/base/scoped_ref_ptr.h" 16 #include "webrtc/base/scoped_ref_ptr.h"
15 #include "webrtc/common_types.h" 17 #include "webrtc/common_types.h"
16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 18 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
17 #include "webrtc/modules/video_capture/video_capture.h" 19 #include "webrtc/modules/video_capture/video_capture.h"
18 #include "webrtc/test/video_capturer.h" 20 #include "webrtc/test/video_capturer.h"
19 21
22 namespace cricket {
23 class VideoAdapter;
24 } // namespace cricket
25
20 namespace webrtc { 26 namespace webrtc {
21 namespace test { 27 namespace test {
22 28
23 class VcmCapturer 29 class VcmCapturer
24 : public VideoCapturer, 30 : public VideoCapturer,
25 public rtc::VideoSinkInterface<VideoFrame> { 31 public rtc::VideoSinkInterface<VideoFrame> {
26 public: 32 public:
27 static VcmCapturer* Create(size_t width, size_t height, size_t target_fps); 33 static VcmCapturer* Create(size_t width, size_t height, size_t target_fps);
28 virtual ~VcmCapturer(); 34 virtual ~VcmCapturer();
29 35
30 void Start() override; 36 void Start() override;
31 void Stop() override; 37 void Stop() override;
32 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 38 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
33 const rtc::VideoSinkWants& wants) override; 39 const rtc::VideoSinkWants& wants) override;
34 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; 40 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override;
35 41
36 void OnFrame(const VideoFrame& frame) override; 42 void OnFrame(const VideoFrame& frame) override;
37 43
38 private: 44 private:
39 VcmCapturer(); 45 VcmCapturer();
40 bool Init(size_t width, size_t height, size_t target_fps); 46 bool Init(size_t width, size_t height, size_t target_fps);
41 void Destroy(); 47 void Destroy();
42 48
43 rtc::CriticalSection crit_; 49 rtc::CriticalSection crit_;
44 bool started_ GUARDED_BY(crit_); 50 bool started_ GUARDED_BY(crit_);
45 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); 51 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_);
46 rtc::scoped_refptr<VideoCaptureModule> vcm_; 52 rtc::scoped_refptr<VideoCaptureModule> vcm_;
47 VideoCaptureCapability capability_; 53 VideoCaptureCapability capability_;
54 std::unique_ptr<cricket::VideoAdapter> video_adpter_;
48 }; 55 };
49 56
50 } // test 57 } // test
51 } // webrtc 58 } // webrtc
52 59
53 #endif // WEBRTC_TEST_VCM_CAPTURER_H_ 60 #endif // WEBRTC_TEST_VCM_CAPTURER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698