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

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

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: 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 d189f918d59c63a3b34e9e200325aec5c7ddc903..9f65b9cb7422973b6c186024eb9eb1a133bef2e9 100644
--- a/webrtc/media/engine/fakewebrtccall.cc
+++ b/webrtc/media/engine/fakewebrtccall.cc
@@ -161,28 +161,27 @@
}
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 (!last_frame_ ||
- frame.width() != last_frame_->width() ||
- frame.height() != last_frame_->height() ||
- frame.rotation() != last_frame_->rotation()) {
+ if (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_ = rtc::Optional<webrtc::VideoFrame>(frame);
+ last_frame_ = frame;
}
void FakeVideoSendStream::SetStats(
@@ -203,15 +202,8 @@
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(
- width, 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);
« 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