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

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

Issue 514263002: Move common code and variables from audio/video sender to frame sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/audio_sender.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/frame_sender.h
diff --git a/media/cast/sender/frame_sender.h b/media/cast/sender/frame_sender.h
index 5da3927961f7262aca2774ffd60254610c4b17b6..09211da62fe7156c0c9193a9b56246d9c5b99557 100644
--- a/media/cast/sender/frame_sender.h
+++ b/media/cast/sender/frame_sender.h
@@ -74,6 +74,15 @@ class FrameSender {
base::TimeDelta max_rtt_;
protected:
+ // Schedule and execute periodic checks for re-sending packets. If no
+ // acknowledgements have been received for "too long," AudioSender will
+ // speculatively re-send certain packets of an unacked frame to kick-start
+ // re-transmission. This is a last resort tactic to prevent the session from
+ // getting stuck after a long outage.
+ void ScheduleNextResendCheck();
+ void ResendCheck();
+ void ResendForKickstart();
+
const base::TimeDelta rtcp_interval_;
// The total amount of time between a frame's capture/recording on the sender
@@ -94,6 +103,40 @@ class FrameSender {
// new frames shall halt.
int max_unacked_frames_;
+ // Counts how many RTCP reports are being "aggressively" sent (i.e., one per
+ // frame) at the start of the session. Once a threshold is reached, RTCP
+ // reports are instead sent at the configured interval + random drift.
+ int num_aggressive_rtcp_reports_sent_;
+
+ // This is "null" until the first frame is sent. Thereafter, this tracks the
+ // last time any frame was sent or re-sent.
+ base::TimeTicks last_send_time_;
+
+ // The ID of the last frame sent. Logic throughout AudioSender assumes this
+ // can safely wrap-around. This member is invalid until
+ // |!last_send_time_.is_null()|.
+ uint32 last_sent_frame_id_;
+
+ // The ID of the latest (not necessarily the last) frame that has been
+ // acknowledged. Logic throughout AudioSender assumes this can safely
+ // wrap-around. This member is invalid until |!last_send_time_.is_null()|.
+ uint32 latest_acked_frame_id_;
+
+ // Counts the number of duplicate ACK that are being received. When this
+ // number reaches a threshold, the sender will take this as a sign that the
+ // receiver hasn't yet received the first packet of the next frame. In this
+ // case, VideoSender will trigger a re-send of the next frame.
+ int duplicate_ack_counter_;
+
+ // If this sender is ready for use, this is STATUS_AUDIO_INITIALIZED or
+ // STATUS_VIDEO_INITIALIZED.
+ CastInitializationStatus cast_initialization_status_;
+
+ // This is a "good enough" mapping for finding the RTP timestamp associated
+ // with a video frame. The key is the lowest 8 bits of frame id (which is
+ // what is sent via RTCP). This map is used for logging purposes.
+ RtpTimestamp frame_id_to_rtp_timestamp_[256];
+
private:
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<FrameSender> weak_factory_;
« no previous file with comments | « media/cast/sender/audio_sender.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698