| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |