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

Unified Diff: webrtc/media/engine/fakewebrtccall.cc

Issue 2348533002: Reland Replace interface VideoCapturerInput with VideoSinkInterface. (Closed)
Patch Set: Fix rtp timestamp in quality test. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/fakewebrtccall.cc
diff --git a/webrtc/media/engine/fakewebrtccall.cc b/webrtc/media/engine/fakewebrtccall.cc
index cb904df66fdcf1275bf722ddb6220968bd0bd8ab..9437fa0fbaec234ec1d81d6815e0da795a84240f 100644
--- a/webrtc/media/engine/fakewebrtccall.cc
+++ b/webrtc/media/engine/fakewebrtccall.cc
@@ -103,11 +103,17 @@ FakeVideoSendStream::FakeVideoSendStream(
: sending_(false),
config_(std::move(config)),
codec_settings_set_(false),
+ source_(nullptr),
num_swapped_frames_(0) {
RTC_DCHECK(config.encoder_settings.encoder != NULL);
ReconfigureVideoEncoder(std::move(encoder_config));
}
+FakeVideoSendStream::~FakeVideoSendStream() {
+ if (source_)
+ source_->RemoveSink(this);
+}
+
const webrtc::VideoSendStream::Config& FakeVideoSendStream::GetConfig() const {
return config_;
}
@@ -162,8 +168,7 @@ int64_t FakeVideoSendStream::GetLastTimestamp() const {
return last_frame_.render_time_ms();
}
-void FakeVideoSendStream::IncomingCapturedFrame(
- const webrtc::VideoFrame& frame) {
+void FakeVideoSendStream::OnFrame(const webrtc::VideoFrame& frame) {
++num_swapped_frames_;
last_frame_.ShallowCopy(frame);
}
@@ -204,10 +209,6 @@ void FakeVideoSendStream::ReconfigureVideoEncoder(
++num_encoder_reconfigurations_;
}
-webrtc::VideoCaptureInput* FakeVideoSendStream::Input() {
- return this;
-}
-
void FakeVideoSendStream::Start() {
sending_ = true;
}
@@ -216,6 +217,16 @@ void FakeVideoSendStream::Stop() {
sending_ = false;
}
+void FakeVideoSendStream::SetSource(
+ rtc::VideoSourceInterface<webrtc::VideoFrame>* source) {
+ RTC_DCHECK(source != source_);
+ if (source_)
+ source_->RemoveSink(this);
+ source_ = source;
+ if (source)
+ source->AddOrUpdateSink(this, rtc::VideoSinkWants());
+}
+
FakeVideoReceiveStream::FakeVideoReceiveStream(
webrtc::VideoReceiveStream::Config config)
: config_(std::move(config)), receiving_(false) {}
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698