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

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

Issue 2541863002: Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Initialize pixel data in VideoBroadcasterTest.OnFrame test. Created 4 years 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/modules/video_coding/codecs/h264/h264_encoder_impl.cc » ('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 9f65b9cb7422973b6c186024eb9eb1a133bef2e9..d189f918d59c63a3b34e9e200325aec5c7ddc903 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(
@@ -202,8 +203,15 @@ void FakeVideoSendStream::EnableEncodedFrameRecording(
void FakeVideoSendStream::ReconfigureVideoEncoder(
webrtc::VideoEncoderConfig config) {
+ int width, height;
+ if (last_frame_) {
+ width = last_frame_->width();
+ height = last_frame_->height();
+ } else {
+ width = height = 0;
+ }
video_streams_ = config.video_stream_factory->CreateEncoderStreams(
- last_frame_.width(), last_frame_.height(), config);
+ width, height, config);
if (config.encoder_specific_settings != NULL) {
if (config_.encoder_settings.payload_name == "VP8") {
config.encoder_specific_settings->FillVideoCodecVp8(&vpx_settings_.vp8);
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698