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

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

Issue 192843002: Cast:Adding signaling and infrastructure for adjustable delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 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/video_receiver/video_receiver.h ('k') | media/cast/video_receiver/video_receiver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_receiver/video_receiver.cc
diff --git a/media/cast/video_receiver/video_receiver.cc b/media/cast/video_receiver/video_receiver.cc
index a37b270c99a742609444416b9bd1a3912cc4ec27..81f22aae4db8279a46803a6ffb9daac263cf1865 100644
--- a/media/cast/video_receiver/video_receiver.cc
+++ b/media/cast/video_receiver/video_receiver.cc
@@ -90,7 +90,8 @@ class LocalRtpReceiverStatistics : public RtpReceiverStatistics {
VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment,
const VideoReceiverConfig& video_config,
- transport::PacedPacketSender* const packet_sender)
+ transport::PacedPacketSender* const packet_sender,
+ const SetTargetDelayCallback& target_delay_cb)
: cast_environment_(cast_environment),
event_subscriber_(kReceiverRtcpEventHistorySize,
ReceiverRtcpEventSubscriber::kVideoEventSubscriber),
@@ -111,6 +112,7 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment,
decryptor_(),
time_incoming_packet_updated_(false),
incoming_rtp_timestamp_(0),
+ target_delay_cb_(target_delay_cb),
weak_factory_(this) {
int max_unacked_frames =
video_config.rtp_max_delay_ms * video_config.max_frame_rate / 1000;
@@ -139,6 +141,8 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment,
video_config.feedback_ssrc,
video_config.incoming_ssrc,
video_config.rtcp_c_name));
+ // Set the target delay that will be conveyed to the sender.
+ rtcp_->SetTargetDelay(target_delay_delta_);
cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_);
memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_));
}
@@ -394,6 +398,7 @@ base::TimeTicks VideoReceiver::GetRenderTime(base::TimeTicks now,
// This can fail if we have not received any RTCP packets in a long time.
return now;
}
+
base::TimeTicks render_time =
rtp_timestamp_in_ticks + time_offset_ + target_delay_delta_;
if (last_render_time_ > render_time)
@@ -535,5 +540,11 @@ void VideoReceiver::SendNextRtcpReport() {
ScheduleNextRtcpReport();
}
+void VideoReceiver::UpdateTargetDelay() {
+ NOTIMPLEMENTED();
+ rtcp_->SetTargetDelay(target_delay_delta_);
+ target_delay_cb_.Run(target_delay_delta_);
+}
+
} // namespace cast
} // namespace media
« no previous file with comments | « media/cast/video_receiver/video_receiver.h ('k') | media/cast/video_receiver/video_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698