Remove last_width_/last_height_ from WebRtcVideoReceiveStream. Used in GetStats. Get dimensions from VideoReceiveStream::Stats instead.

BUG=webrtc:6274

Review-Url: https://codereview.webrtc.org/2280903002
Cr-Commit-Position: refs/heads/master@{#13967}
This commit is contained in:
asapersson 2016-08-30 00:45:45 -07:00 committed by Commit bot
parent 68343a8f67
commit 26dd92b2ff
3 changed files with 6 additions and 9 deletions

View File

@ -2281,8 +2281,6 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream(
red_disabled_by_remote_side_(red_disabled_by_remote_side),
external_decoder_factory_(external_decoder_factory),
sink_(NULL),
last_width_(-1),
last_height_(-1),
first_frame_timestamp_(-1),
estimated_remote_start_ntp_time_ms_(0) {
config_.renderer = this;
@ -2524,9 +2522,6 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::OnFrame(
return;
}
last_width_ = frame.width();
last_height_ = frame.height();
WebRtcVideoFrame render_frame(
frame.video_frame_buffer(), frame.rotation(),
frame.render_time_ms() * rtc::kNumNanosecsPerMicrosec, frame.timestamp());
@ -2573,11 +2568,11 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo(
info.framerate_rcvd = stats.network_frame_rate;
info.framerate_decoded = stats.decode_frame_rate;
info.framerate_output = stats.render_frame_rate;
info.frame_width = stats.width;
info.frame_height = stats.height;
{
rtc::CritScope frame_cs(&sink_lock_);
info.frame_width = last_width_;
info.frame_height = last_height_;
info.capture_start_ntp_time_ms = estimated_remote_start_ntp_time_ms_;
}

View File

@ -494,8 +494,6 @@ class WebRtcVideoChannel2 : public VideoMediaChannel, public webrtc::Transport {
rtc::CriticalSection sink_lock_;
rtc::VideoSinkInterface<cricket::VideoFrame>* sink_ GUARDED_BY(sink_lock_);
int last_width_ GUARDED_BY(sink_lock_);
int last_height_ GUARDED_BY(sink_lock_);
// Expands remote RTP timestamps to int64_t to be able to estimate how long
// the stream has been running.
rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_

View File

@ -3168,6 +3168,8 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesDecodeStatsCorrectly) {
stats.jitter_buffer_ms = 6;
stats.min_playout_delay_ms = 7;
stats.render_delay_ms = 8;
stats.width = 9;
stats.height = 10;
stream->SetStats(stats);
cricket::VideoMediaInfo info;
@ -3181,6 +3183,8 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesDecodeStatsCorrectly) {
EXPECT_EQ(stats.jitter_buffer_ms, info.receivers[0].jitter_buffer_ms);
EXPECT_EQ(stats.min_playout_delay_ms, info.receivers[0].min_playout_delay_ms);
EXPECT_EQ(stats.render_delay_ms, info.receivers[0].render_delay_ms);
EXPECT_EQ(stats.width, info.receivers[0].frame_width);
EXPECT_EQ(stats.height, info.receivers[0].frame_height);
}
TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesReceivePacketStatsCorrectly) {