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

Unified Diff: media/cast/video_sender/video_sender.cc

Issue 268983002: Revert of Cast: Fix two video freezing problems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months 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 | « media/cast/video_sender/video_sender.h ('k') | media/cast/video_sender/video_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_sender/video_sender.cc
diff --git a/media/cast/video_sender/video_sender.cc b/media/cast/video_sender/video_sender.cc
index 8fae0804702c5d110bc213c949f001d495a762c9..ee0e3d14ff1635733db753fa429a8fb713778195 100644
--- a/media/cast/video_sender/video_sender.cc
+++ b/media/cast/video_sender/video_sender.cc
@@ -61,7 +61,6 @@
rtcp_feedback_(new LocalRtcpVideoSenderFeedback(this)),
last_acked_frame_id_(-1),
last_sent_frame_id_(-1),
- frames_in_encoder_(0),
duplicate_ack_(0),
last_skip_count_(0),
current_requested_bitrate_(video_config.start_bitrate),
@@ -89,13 +88,6 @@
cast_environment, video_config, max_unacked_frames_));
}
-
- media::cast::transport::CastTransportVideoConfig transport_config;
- transport_config.codec = video_config.codec;
- transport_config.rtp.config = video_config.rtp_config;
- transport_config.rtp.max_outstanding_frames = max_unacked_frames_ + 1;
- transport_sender_->InitializeVideo(transport_config);
-
rtcp_.reset(
new Rtcp(cast_environment_,
rtcp_feedback_.get(),
@@ -104,7 +96,7 @@
NULL,
video_config.rtcp_mode,
base::TimeDelta::FromMilliseconds(video_config.rtcp_interval),
- video_config.rtp_config.ssrc,
+ video_config.sender_ssrc,
video_config.incoming_feedback_ssrc,
video_config.rtcp_c_name));
rtcp_->SetCastReceiverEventHistorySize(kReceiverRtcpEventHistorySize);
@@ -158,13 +150,11 @@
"timestamp", capture_time.ToInternalValue(),
"rtp_timestamp", GetVideoRtpTimestamp(capture_time));
- if (video_encoder_->EncodeVideoFrame(
+ if (!video_encoder_->EncodeVideoFrame(
video_frame,
capture_time,
base::Bind(&VideoSender::SendEncodedVideoFrameMainThread,
weak_factory_.GetWeakPtr()))) {
- frames_in_encoder_++;
- UpdateFramesInFlight();
}
}
@@ -178,8 +168,6 @@
<< static_cast<int>(encoded_frame->frame_id);
}
- DCHECK_GT(frames_in_encoder_, 0);
- frames_in_encoder_--;
uint32 frame_id = encoded_frame->frame_id;
cast_environment_->Logging()->InsertEncodedFrameEvent(
last_send_time_, kVideoFrameEncoded, encoded_frame->rtp_timestamp,
@@ -308,14 +296,10 @@
VLOG(1) << "ACK timeout resend first key frame";
ResendFrame(0);
} else {
- if (last_acked_frame_id_ == last_sent_frame_id_) {
- // Last frame acked, no point in doing anything
- } else {
- DCHECK_LE(0, last_acked_frame_id_);
- uint32 frame_id = static_cast<uint32>(last_acked_frame_id_ + 1);
- VLOG(1) << "ACK timeout resend frame:" << static_cast<int>(frame_id);
- ResendFrame(frame_id);
- }
+ DCHECK_LE(0, last_acked_frame_id_);
+ uint32 frame_id = static_cast<uint32>(last_acked_frame_id_ + 1);
+ VLOG(1) << "ACK timeout resend frame:" << static_cast<int>(frame_id);
+ ResendFrame(frame_id);
}
}
}
@@ -459,11 +443,9 @@
} else {
frames_in_flight = static_cast<uint32>(last_sent_frame_id_) + 1;
}
- frames_in_flight += frames_in_encoder_;
VLOG(2) << frames_in_flight
<< " Frames in flight; last sent: " << last_sent_frame_id_
- << " last acked:" << last_acked_frame_id_
- << " frames in encoder: " << frames_in_encoder_;
+ << " last acked:" << last_acked_frame_id_;
if (frames_in_flight >= max_unacked_frames_) {
video_encoder_->SkipNextFrame(true);
return;
« no previous file with comments | « media/cast/video_sender/video_sender.h ('k') | media/cast/video_sender/video_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698