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

Side by Side Diff: webrtc/video/vie_encoder.h

Issue 2887303003: Implement kBalanced degradation preference. (Closed)
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 class AdaptCounter final { 182 class AdaptCounter final {
183 public: 183 public:
184 AdaptCounter(); 184 AdaptCounter();
185 ~AdaptCounter(); 185 ~AdaptCounter();
186 186
187 // Get number of adaptation downscales for |reason|. 187 // Get number of adaptation downscales for |reason|.
188 AdaptCounts Counts(int reason) const; 188 AdaptCounts Counts(int reason) const;
189 189
190 std::string ToString() const; 190 std::string ToString() const;
191 191
192 void IncrementFramerate(int reason, int delta); 192 void IncrementFramerate(int reason);
193 void IncrementResolution(int reason, int delta); 193 void IncrementResolution(int reason);
194 void DecrementFramerate(int reason);
195 void DecrementResolution(int reason);
196 void DecrementFramerate(int reason, int cur_fps);
194 197
195 // Gets the total number of downgrades (for all adapt reasons). 198 // Gets the total number of downgrades (for all adapt reasons).
196 int FramerateCount() const; 199 int FramerateCount() const;
197 int ResolutionCount() const; 200 int ResolutionCount() const;
198 int TotalCount() const;
199 201
200 // Gets the total number of downgrades for |reason|. 202 // Gets the total number of downgrades for |reason|.
201 int FramerateCount(int reason) const; 203 int FramerateCount(int reason) const;
202 int ResolutionCount(int reason) const; 204 int ResolutionCount(int reason) const;
203 int TotalCount(int reason) const; 205 int TotalCount(int reason) const;
204 206
205 private: 207 private:
206 std::string ToString(const std::vector<int>& counters) const; 208 std::string ToString(const std::vector<int>& counters) const;
207 int Count(const std::vector<int>& counters) const; 209 int Count(const std::vector<int>& counters) const;
210 void MoveCount(std::vector<int>* counters, int from_reason);
208 211
209 // Degradation counters holding number of framerate/resolution reductions 212 // Degradation counters holding number of framerate/resolution reductions
210 // per adapt reason. 213 // per adapt reason.
211 std::vector<int> fps_counters_; 214 std::vector<int> fps_counters_;
212 std::vector<int> resolution_counters_; 215 std::vector<int> resolution_counters_;
213 }; 216 };
214 217
215 AdaptCounter& GetAdaptCounter() RUN_ON(&encoder_queue_); 218 AdaptCounter& GetAdaptCounter() RUN_ON(&encoder_queue_);
216 const AdaptCounter& GetConstAdaptCounter() RUN_ON(&encoder_queue_); 219 const AdaptCounter& GetConstAdaptCounter() RUN_ON(&encoder_queue_);
217 void UpdateAdaptationStats(AdaptReason reason) RUN_ON(&encoder_queue_); 220 void UpdateAdaptationStats(AdaptReason reason) RUN_ON(&encoder_queue_);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // All public methods are proxied to |encoder_queue_|. It must must be 299 // All public methods are proxied to |encoder_queue_|. It must must be
297 // destroyed first to make sure no tasks are run that use other members. 300 // destroyed first to make sure no tasks are run that use other members.
298 rtc::TaskQueue encoder_queue_; 301 rtc::TaskQueue encoder_queue_;
299 302
300 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); 303 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder);
301 }; 304 };
302 305
303 } // namespace webrtc 306 } // namespace webrtc
304 307
305 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ 308 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698