Index: webrtc/media/engine/fakewebrtccall.cc |
diff --git a/webrtc/media/engine/fakewebrtccall.cc b/webrtc/media/engine/fakewebrtccall.cc |
index a303db5e69e7fb4cd3b1ab8cd78ec588b109f4fa..69f450c50053d6406e7a1714c70cc479b5bfd157 100644 |
--- a/webrtc/media/engine/fakewebrtccall.cc |
+++ b/webrtc/media/engine/fakewebrtccall.cc |
@@ -161,27 +161,28 @@ int FakeVideoSendStream::GetNumberOfSwappedFrames() const { |
} |
int FakeVideoSendStream::GetLastWidth() const { |
- return last_frame_.width(); |
+ return last_frame_->width(); |
} |
int FakeVideoSendStream::GetLastHeight() const { |
- return last_frame_.height(); |
+ return last_frame_->height(); |
} |
int64_t FakeVideoSendStream::GetLastTimestamp() const { |
- RTC_DCHECK(last_frame_.ntp_time_ms() == 0); |
- return last_frame_.render_time_ms(); |
+ RTC_DCHECK(last_frame_->ntp_time_ms() == 0); |
+ return last_frame_->render_time_ms(); |
} |
void FakeVideoSendStream::OnFrame(const webrtc::VideoFrame& frame) { |
++num_swapped_frames_; |
- if (frame.width() != last_frame_.width() || |
- frame.height() != last_frame_.height() || |
- frame.rotation() != last_frame_.rotation()) { |
+ if (!last_frame_ || |
+ frame.width() != last_frame_->width() || |
+ frame.height() != last_frame_->height() || |
+ frame.rotation() != last_frame_->rotation()) { |
video_streams_ = encoder_config_.video_stream_factory->CreateEncoderStreams( |
frame.width(), frame.height(), encoder_config_); |
} |
- last_frame_ = frame; |
+ last_frame_ = rtc::Optional<webrtc::VideoFrame>(frame); |
} |
void FakeVideoSendStream::SetStats( |
@@ -203,7 +204,7 @@ void FakeVideoSendStream::EnableEncodedFrameRecording( |
void FakeVideoSendStream::ReconfigureVideoEncoder( |
webrtc::VideoEncoderConfig config) { |
video_streams_ = config.video_stream_factory->CreateEncoderStreams( |
- last_frame_.width(), last_frame_.height(), config); |
+ last_frame_->width(), last_frame_->height(), config); |
if (config.encoder_specific_settings != NULL) { |
if (config_.encoder_settings.payload_name == "VP8") { |
config.encoder_specific_settings->FillVideoCodecVp8(&vpx_settings_.vp8); |