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

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

Issue 502333002: [Cast] In Audio/VideoSender, drop frames when too-long a duration is in-flight. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing brace (rebase oops). 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 09211da62fe7156c0c9193a9b56246d9c5b99557..6cf02f563be0925a380b2ec6ae1627261695b290 100644
--- a/media/cast/sender/frame_sender.h
+++ b/media/cast/sender/frame_sender.h
@@ -15,7 +15,6 @@
#include "base/time/time.h"
#include "media/cast/cast_environment.h"
#include "media/cast/net/rtcp/rtcp.h"
-#include "media/cast/sender/rtp_timestamp_helper.h"
namespace media {
namespace cast {
@@ -25,7 +24,7 @@ class FrameSender {
FrameSender(scoped_refptr<CastEnvironment> cast_environment,
CastTransportSender* const transport_sender,
base::TimeDelta rtcp_interval,
- int frequency,
+ int rtp_timebase,
uint32 ssrc,
double max_frame_rate,
base::TimeDelta playout_delay);
@@ -62,10 +61,6 @@ class FrameSender {
const uint32 ssrc_;
- // Records lip-sync (i.e., mapping of RTP <--> NTP timestamps), and
- // extrapolates this mapping to any other point in time.
- RtpTimestampHelper rtp_timestamp_helper_;
-
// RTT information from RTCP.
bool rtt_available_;
base::TimeDelta rtt_;
@@ -83,6 +78,16 @@ class FrameSender {
void ResendCheck();
void ResendForKickstart();
+ // Record or retrieve a recent history of each frame's timestamps.
+ // Warning: If a frame ID too far in the past is requested, the getters will
+ // silently succeed but return incorrect values. Be sure to respect
+ // media::cast::kMaxUnackedFrames.
+ void RecordLatestFrameTimestamps(uint32 frame_id,
+ base::TimeTicks reference_time,
+ RtpTimestamp rtp_timestamp);
+ base::TimeTicks GetRecordedReferenceTime(uint32 frame_id) const;
+ RtpTimestamp GetRecordedRtpTimestamp(uint32 frame_id) const;
+
const base::TimeDelta rtcp_interval_;
// The total amount of time between a frame's capture/recording on the sender
@@ -112,7 +117,7 @@ class FrameSender {
// 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
+ // The ID of the last frame sent. Logic throughout FrameSender assumes this
// can safely wrap-around. This member is invalid until
// |!last_send_time_.is_null()|.
uint32 last_sent_frame_id_;
@@ -132,12 +137,16 @@ class FrameSender {
// 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:
+ // RTP timestamp increment representing one second.
+ const int rtp_timebase_;
+
+ // Ring buffers to keep track of recent frame timestamps (both in terms of
+ // local reference time and RTP media time). These should only be accessed
+ // through the Record/GetXXX() methods.
+ base::TimeTicks frame_reference_times_[256];
+ RtpTimestamp frame_rtp_timestamps_[256];
+
// 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