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

Side by Side Diff: media/cast/video_sender/video_sender.h

Issue 276783002: Cast: Reduce bitrate drastically when close to unacked frame limit (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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ 5 #ifndef MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_
6 #define MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ 6 #define MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 scoped_ptr<Rtcp> rtcp_; 117 scoped_ptr<Rtcp> rtcp_;
118 uint8 max_unacked_frames_; 118 uint8 max_unacked_frames_;
119 int last_acked_frame_id_; 119 int last_acked_frame_id_;
120 int last_sent_frame_id_; 120 int last_sent_frame_id_;
121 int frames_in_encoder_; 121 int frames_in_encoder_;
122 int duplicate_ack_; 122 int duplicate_ack_;
123 base::TimeTicks last_send_time_; 123 base::TimeTicks last_send_time_;
124 base::TimeTicks last_checked_skip_count_time_; 124 base::TimeTicks last_checked_skip_count_time_;
125 int last_skip_count_; 125 int last_skip_count_;
126 int current_requested_bitrate_; 126 int current_requested_bitrate_;
127 // When we get close to the max number of un-acked frames, we set lower
128 // the bitrate drastically to ensure that we catch up. Without this we
129 // risk getting stuck in a catch-up state forever.
130 int current_bitrate_divider_;
127 CongestionControl congestion_control_; 131 CongestionControl congestion_control_;
128 132
129 // This is a "good enough" mapping for finding the RTP timestamp associated 133 // This is a "good enough" mapping for finding the RTP timestamp associated
130 // with a video frame. The key is the lowest 8 bits of frame id (which is 134 // with a video frame. The key is the lowest 8 bits of frame id (which is
131 // what is sent via RTCP). This map is used for logging purposes. The only 135 // what is sent via RTCP). This map is used for logging purposes. The only
132 // time when this mapping will be incorrect is when it receives an ACK for a 136 // time when this mapping will be incorrect is when it receives an ACK for a
133 // old enough frame such that 8-bit wrap around has already occurred, which 137 // old enough frame such that 8-bit wrap around has already occurred, which
134 // should be pretty rare. 138 // should be pretty rare.
135 RtpTimestamp frame_id_to_rtp_timestamp_[256]; 139 RtpTimestamp frame_id_to_rtp_timestamp_[256];
136 140
137 bool initialized_; 141 bool initialized_;
138 // Indicator for receiver acknowledgments. 142 // Indicator for receiver acknowledgments.
139 bool active_session_; 143 bool active_session_;
140 144
141 // NOTE: Weak pointers must be invalidated before all other member variables. 145 // NOTE: Weak pointers must be invalidated before all other member variables.
142 base::WeakPtrFactory<VideoSender> weak_factory_; 146 base::WeakPtrFactory<VideoSender> weak_factory_;
143 147
144 DISALLOW_COPY_AND_ASSIGN(VideoSender); 148 DISALLOW_COPY_AND_ASSIGN(VideoSender);
145 }; 149 };
146 150
147 } // namespace cast 151 } // namespace cast
148 } // namespace media 152 } // namespace media
149 153
150 #endif // MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ 154 #endif // MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | media/cast/video_sender/video_sender.cc » ('j') | media/cast/video_sender/video_sender.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698