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) {} |