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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 uint32_t SentBitRate(); | 61 uint32_t SentBitRate(); |
62 | 62 |
63 private: | 63 private: |
64 enum { kFrameCountHistorySize = 90 }; | 64 enum { kFrameCountHistorySize = 90 }; |
65 enum { kFrameHistoryWinMs = 2000 }; | 65 enum { kFrameHistoryWinMs = 2000 }; |
66 enum { kBitrateAverageWinMs = 1000 }; | 66 enum { kBitrateAverageWinMs = 1000 }; |
67 | 67 |
68 struct EncodedFrameSample; | 68 struct EncodedFrameSample; |
69 typedef std::list<EncodedFrameSample> FrameSampleList; | 69 typedef std::list<EncodedFrameSample> FrameSampleList; |
70 | 70 |
71 void UpdateIncomingFrameRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 71 void UpdateIncomingFrameRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
72 void PurgeOldFrameSamples(int64_t threshold_ms) | 72 void PurgeOldFrameSamples(int64_t threshold_ms) |
73 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 73 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
74 void UpdateSentFramerate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 74 void UpdateSentFramerate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
75 | 75 |
76 void ProcessIncomingFrameRate(int64_t now) | 76 void ProcessIncomingFrameRate(int64_t now) |
77 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 77 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
78 | 78 |
79 // Checks conditions for suspending the video. The method compares | 79 // Checks conditions for suspending the video. The method compares |
80 // |video_target_bitrate_| with the threshold values for suspension, and | 80 // |video_target_bitrate_| with the threshold values for suspension, and |
81 // changes the state of |video_suspended_| accordingly. | 81 // changes the state of |video_suspended_| accordingly. |
82 void CheckSuspendConditions() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 82 void CheckSuspendConditions() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
83 | 83 |
84 void SetEncodingDataInternal(int32_t max_bit_rate, | 84 void SetEncodingDataInternal(int32_t max_bit_rate, |
85 uint32_t frame_rate, | 85 uint32_t frame_rate, |
86 uint32_t bit_rate) | 86 uint32_t bit_rate) |
87 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 87 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
88 | 88 |
89 uint32_t InputFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 89 uint32_t InputFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
90 | 90 |
91 uint32_t SentFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 91 uint32_t SentFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
92 | 92 |
93 // Protect all members. | 93 // Protect all members. |
94 rtc::CriticalSection crit_sect_; | 94 rtc::CriticalSection crit_sect_; |
95 | 95 |
96 Clock* clock_ GUARDED_BY(crit_sect_); | 96 Clock* clock_ RTC_GUARDED_BY(crit_sect_); |
97 int32_t max_bit_rate_ GUARDED_BY(crit_sect_); | 97 int32_t max_bit_rate_ RTC_GUARDED_BY(crit_sect_); |
98 float user_frame_rate_ GUARDED_BY(crit_sect_); | 98 float user_frame_rate_ RTC_GUARDED_BY(crit_sect_); |
99 std::unique_ptr<FrameDropper> frame_dropper_ GUARDED_BY(crit_sect_); | 99 std::unique_ptr<FrameDropper> frame_dropper_ RTC_GUARDED_BY(crit_sect_); |
100 int video_target_bitrate_ GUARDED_BY(crit_sect_); | 100 int video_target_bitrate_ RTC_GUARDED_BY(crit_sect_); |
101 float incoming_frame_rate_ GUARDED_BY(crit_sect_); | 101 float incoming_frame_rate_ RTC_GUARDED_BY(crit_sect_); |
102 int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_); | 102 int64_t incoming_frame_times_[kFrameCountHistorySize] RTC_GUARDED_BY( |
103 std::list<EncodedFrameSample> encoded_frame_samples_ GUARDED_BY(crit_sect_); | 103 crit_sect_); |
104 uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_); | 104 std::list<EncodedFrameSample> encoded_frame_samples_ |
| 105 RTC_GUARDED_BY(crit_sect_); |
| 106 uint32_t avg_sent_framerate_ RTC_GUARDED_BY(crit_sect_); |
105 }; | 107 }; |
106 } // namespace media_optimization | 108 } // namespace media_optimization |
107 } // namespace webrtc | 109 } // namespace webrtc |
108 | 110 |
109 #endif // WEBRTC_MODULES_VIDEO_CODING_MEDIA_OPTIMIZATION_H_ | 111 #endif // WEBRTC_MODULES_VIDEO_CODING_MEDIA_OPTIMIZATION_H_ |
OLD | NEW |