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

Unified Diff: media/cast/sender/frame_sender.cc

Issue 1709863002: Add Cast PLI support on sender side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dcheng's comments. Created 4 years, 9 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/sender/frame_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/frame_sender.cc
diff --git a/media/cast/sender/frame_sender.cc b/media/cast/sender/frame_sender.cc
index 59e03def4ef9d7f37f670cd3157768edbc0c368b..26063589ff6371a2a10c070d8739205beae012d0 100644
--- a/media/cast/sender/frame_sender.cc
+++ b/media/cast/sender/frame_sender.cc
@@ -59,6 +59,7 @@ FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment,
latest_acked_frame_id_(0),
duplicate_ack_counter_(0),
congestion_control_(congestion_control),
+ picture_lost_at_receiver_(false),
rtp_timebase_(rtp_timebase),
is_audio_(is_audio),
weak_factory_(this) {
@@ -219,8 +220,20 @@ void FrameSender::SendEncodedFrame(
<< last_sent_frame_id_ << ", latest_acked=" << latest_acked_frame_id_;
const uint32_t frame_id = encoded_frame->frame_id;
-
const bool is_first_frame_to_be_sent = last_send_time_.is_null();
+
+ if (picture_lost_at_receiver_ &&
+ (encoded_frame->dependency == EncodedFrame::KEY)) {
+ picture_lost_at_receiver_ = false;
+ DCHECK(frame_id > latest_acked_frame_id_);
+ // Cancel sending remaining frames.
+ std::vector<uint32_t> cancel_sending_frames;
+ for (uint32_t id = latest_acked_frame_id_ + 1; id < frame_id; ++id) {
+ cancel_sending_frames.push_back(id);
+ }
+ transport_sender_->CancelSendingFrames(ssrc_, cancel_sending_frames);
+ }
+
last_send_time_ = cast_environment_->Clock()->NowTicks();
last_sent_frame_id_ = frame_id;
// If this is the first frame about to be sent, fake the value of
@@ -387,6 +400,10 @@ void FrameSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) {
}
}
+void FrameSender::OnReceivedPli() {
+ picture_lost_at_receiver_ = true;
+}
+
bool FrameSender::ShouldDropNextFrame(base::TimeDelta frame_duration) const {
// Check that accepting the next frame won't cause more frames to become
// in-flight than the system's design limit.
« no previous file with comments | « media/cast/sender/frame_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698