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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Inputs: target bitrate - the encoder target bitrate in bits/s. | 52 // Inputs: target bitrate - the encoder target bitrate in bits/s. |
53 // fraction_lost - packet loss rate in % in the network. | 53 // fraction_lost - packet loss rate in % in the network. |
54 // round_trip_time_ms - round trip time in milliseconds. | 54 // round_trip_time_ms - round trip time in milliseconds. |
55 // min_bit_rate - the bit rate of the end-point with lowest rate. | 55 // min_bit_rate - the bit rate of the end-point with lowest rate. |
56 // max_bit_rate - the bit rate of the end-point with highest rate. | 56 // max_bit_rate - the bit rate of the end-point with highest rate. |
57 uint32_t SetTargetRates(uint32_t target_bitrate, | 57 uint32_t SetTargetRates(uint32_t target_bitrate, |
58 uint8_t fraction_lost, | 58 uint8_t fraction_lost, |
59 int64_t round_trip_time_ms); | 59 int64_t round_trip_time_ms); |
60 | 60 |
61 void EnableFrameDropper(bool enable); | 61 void EnableFrameDropper(bool enable); |
62 | |
63 // Lets the sender suspend video when the rate drops below | |
64 // |threshold_bps|, and turns back on when the rate goes back up above | |
65 // |threshold_bps| + |window_bps|. | |
66 void SuspendBelowMinBitrate(int threshold_bps, int window_bps); | |
67 bool IsVideoSuspended() const; | |
68 | |
69 bool DropFrame(); | 62 bool DropFrame(); |
70 | 63 |
71 // Informs Media Optimization of encoded output. | 64 // Informs Media Optimization of encoded output. |
72 // TODO(perkj): Deprecate SetEncodingData once its not used for stats in | 65 // TODO(perkj): Deprecate SetEncodingData once its not used for stats in |
73 // VieEncoder. | 66 // VieEncoder. |
74 int32_t UpdateWithEncodedData(const EncodedImage& encoded_image); | 67 int32_t UpdateWithEncodedData(const EncodedImage& encoded_image); |
75 | 68 |
76 // InputFrameRate 0 = no frame rate estimate available. | 69 // InputFrameRate 0 = no frame rate estimate available. |
77 uint32_t InputFrameRate(); | 70 uint32_t InputFrameRate(); |
78 uint32_t SentFrameRate(); | 71 uint32_t SentFrameRate(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 uint32_t send_statistics_[4] GUARDED_BY(crit_sect_); | 119 uint32_t send_statistics_[4] GUARDED_BY(crit_sect_); |
127 uint32_t send_statistics_zero_encode_ GUARDED_BY(crit_sect_); | 120 uint32_t send_statistics_zero_encode_ GUARDED_BY(crit_sect_); |
128 int32_t max_payload_size_ GUARDED_BY(crit_sect_); | 121 int32_t max_payload_size_ GUARDED_BY(crit_sect_); |
129 int video_target_bitrate_ GUARDED_BY(crit_sect_); | 122 int video_target_bitrate_ GUARDED_BY(crit_sect_); |
130 float incoming_frame_rate_ GUARDED_BY(crit_sect_); | 123 float incoming_frame_rate_ GUARDED_BY(crit_sect_); |
131 int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_); | 124 int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_); |
132 std::list<EncodedFrameSample> encoded_frame_samples_ GUARDED_BY(crit_sect_); | 125 std::list<EncodedFrameSample> encoded_frame_samples_ GUARDED_BY(crit_sect_); |
133 uint32_t avg_sent_bit_rate_bps_ GUARDED_BY(crit_sect_); | 126 uint32_t avg_sent_bit_rate_bps_ GUARDED_BY(crit_sect_); |
134 uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_); | 127 uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_); |
135 int num_layers_ GUARDED_BY(crit_sect_); | 128 int num_layers_ GUARDED_BY(crit_sect_); |
136 bool suspension_enabled_ GUARDED_BY(crit_sect_); | |
137 bool video_suspended_ GUARDED_BY(crit_sect_); | |
138 int suspension_threshold_bps_ GUARDED_BY(crit_sect_); | |
139 int suspension_window_bps_ GUARDED_BY(crit_sect_); | |
140 }; | 129 }; |
141 } // namespace media_optimization | 130 } // namespace media_optimization |
142 } // namespace webrtc | 131 } // namespace webrtc |
143 | 132 |
144 #endif // WEBRTC_MODULES_VIDEO_CODING_MEDIA_OPTIMIZATION_H_ | 133 #endif // WEBRTC_MODULES_VIDEO_CODING_MEDIA_OPTIMIZATION_H_ |
OLD | NEW |