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

Side by Side Diff: webrtc/media/base/fakevideocapturer.h

Issue 2471783002: Revert of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 10
11 #ifndef WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ 11 #ifndef WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
12 #define WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ 12 #define WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
13 13
14 #include <string.h> 14 #include <string.h>
15 15
16 #include <memory> 16 #include <memory>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/base/timeutils.h" 19 #include "webrtc/base/timeutils.h"
20 #include "webrtc/media/base/videocapturer.h" 20 #include "webrtc/media/base/videocapturer.h"
21 #include "webrtc/media/base/videocommon.h" 21 #include "webrtc/media/base/videocommon.h"
22 #include "webrtc/video_frame.h" 22 #include "webrtc/media/base/videoframe.h"
23 23
24 namespace cricket { 24 namespace cricket {
25 25
26 // Fake video capturer that allows the test to manually pump in frames. 26 // Fake video capturer that allows the test to manually pump in frames.
27 class FakeVideoCapturer : public cricket::VideoCapturer { 27 class FakeVideoCapturer : public cricket::VideoCapturer {
28 public: 28 public:
29 explicit FakeVideoCapturer(bool is_screencast) 29 explicit FakeVideoCapturer(bool is_screencast)
30 : running_(false), 30 : running_(false),
31 initial_timestamp_(rtc::TimeNanos()), 31 initial_timestamp_(rtc::TimeNanos()),
32 next_timestamp_(rtc::kNumNanosecsPerMillisec), 32 next_timestamp_(rtc::kNumNanosecsPerMillisec),
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // class. Child classes of VideoCapturer are expected to call 90 // class. Child classes of VideoCapturer are expected to call
91 // AdaptFrame, and the test case 91 // AdaptFrame, and the test case
92 // VideoCapturerTest.SinkWantsMaxPixelAndMaxPixelCountStepUp 92 // VideoCapturerTest.SinkWantsMaxPixelAndMaxPixelCountStepUp
93 // depends on this. 93 // depends on this.
94 if (AdaptFrame(width, height, 0, 0, &adapted_width, &adapted_height, 94 if (AdaptFrame(width, height, 0, 0, &adapted_width, &adapted_height,
95 &crop_width, &crop_height, &crop_x, &crop_y, nullptr)) { 95 &crop_width, &crop_height, &crop_x, &crop_y, nullptr)) {
96 rtc::scoped_refptr<webrtc::I420Buffer> buffer( 96 rtc::scoped_refptr<webrtc::I420Buffer> buffer(
97 webrtc::I420Buffer::Create(adapted_width, adapted_height)); 97 webrtc::I420Buffer::Create(adapted_width, adapted_height));
98 buffer->InitializeData(); 98 buffer->InitializeData();
99 99
100 OnFrame(webrtc::VideoFrame( 100 OnFrame(WebRtcVideoFrame(buffer, rotation_,
101 buffer, rotation_, 101 next_timestamp_ / rtc::kNumNanosecsPerMicrosec),
102 next_timestamp_ / rtc::kNumNanosecsPerMicrosec),
103 width, height); 102 width, height);
104 } 103 }
105 next_timestamp_ += timestamp_interval; 104 next_timestamp_ += timestamp_interval;
106 105
107 return true; 106 return true;
108 } 107 }
109 108
110 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed; 109 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed;
111 110
112 cricket::CaptureState Start(const cricket::VideoFormat& format) override { 111 cricket::CaptureState Start(const cricket::VideoFormat& format) override {
(...skipping 25 matching lines...) Expand all
138 bool running_; 137 bool running_;
139 int64_t initial_timestamp_; 138 int64_t initial_timestamp_;
140 int64_t next_timestamp_; 139 int64_t next_timestamp_;
141 const bool is_screencast_; 140 const bool is_screencast_;
142 webrtc::VideoRotation rotation_; 141 webrtc::VideoRotation rotation_;
143 }; 142 };
144 143
145 } // namespace cricket 144 } // namespace cricket
146 145
147 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ 146 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698