OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 struct NackInfo { | 52 struct NackInfo { |
53 NackInfo(); | 53 NackInfo(); |
54 NackInfo(uint16_t seq_num, uint16_t send_at_seq_num); | 54 NackInfo(uint16_t seq_num, uint16_t send_at_seq_num); |
55 | 55 |
56 uint16_t seq_num; | 56 uint16_t seq_num; |
57 uint16_t send_at_seq_num; | 57 uint16_t send_at_seq_num; |
58 int64_t sent_at_time; | 58 int64_t sent_at_time; |
59 int retries; | 59 int retries; |
60 }; | 60 }; |
61 void AddPacketsToNack(uint16_t seq_num_start, uint16_t seq_num_end) | 61 void AddPacketsToNack(uint16_t seq_num_start, uint16_t seq_num_end) |
62 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 62 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
63 | 63 |
64 // Removes packets from the nack list until the next keyframe. Returns true | 64 // Removes packets from the nack list until the next keyframe. Returns true |
65 // if packets were removed. | 65 // if packets were removed. |
66 bool RemovePacketsUntilKeyFrame() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 66 bool RemovePacketsUntilKeyFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
67 std::vector<uint16_t> GetNackBatch(NackFilterOptions options) | 67 std::vector<uint16_t> GetNackBatch(NackFilterOptions options) |
68 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 68 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
69 | 69 |
70 // Update the reordering distribution. | 70 // Update the reordering distribution. |
71 void UpdateReorderingStatistics(uint16_t seq_num) | 71 void UpdateReorderingStatistics(uint16_t seq_num) |
72 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 72 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
73 | 73 |
74 // Returns how many packets we have to wait in order to receive the packet | 74 // Returns how many packets we have to wait in order to receive the packet |
75 // with probability |probabilty| or higher. | 75 // with probability |probabilty| or higher. |
76 int WaitNumberOfPackets(float probability) const | 76 int WaitNumberOfPackets(float probability) const |
77 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 77 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
78 | 78 |
79 rtc::CriticalSection crit_; | 79 rtc::CriticalSection crit_; |
80 Clock* const clock_; | 80 Clock* const clock_; |
81 NackSender* const nack_sender_; | 81 NackSender* const nack_sender_; |
82 KeyFrameRequestSender* const keyframe_request_sender_; | 82 KeyFrameRequestSender* const keyframe_request_sender_; |
83 | 83 |
84 // TODO(philipel): Some of the variables below are consistently used on a | 84 // TODO(philipel): Some of the variables below are consistently used on a |
85 // known thread (e.g. see |initialized_|). Those probably do not need | 85 // known thread (e.g. see |initialized_|). Those probably do not need |
86 // synchronized access. | 86 // synchronized access. |
87 std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_ | 87 std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_ |
88 GUARDED_BY(crit_); | 88 RTC_GUARDED_BY(crit_); |
89 std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_ | 89 std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_ |
90 GUARDED_BY(crit_); | 90 RTC_GUARDED_BY(crit_); |
91 video_coding::Histogram reordering_histogram_ GUARDED_BY(crit_); | 91 video_coding::Histogram reordering_histogram_ RTC_GUARDED_BY(crit_); |
92 bool initialized_ GUARDED_BY(crit_); | 92 bool initialized_ RTC_GUARDED_BY(crit_); |
93 int64_t rtt_ms_ GUARDED_BY(crit_); | 93 int64_t rtt_ms_ RTC_GUARDED_BY(crit_); |
94 uint16_t newest_seq_num_ GUARDED_BY(crit_); | 94 uint16_t newest_seq_num_ RTC_GUARDED_BY(crit_); |
95 | 95 |
96 // Only touched on the process thread. | 96 // Only touched on the process thread. |
97 int64_t next_process_time_ms_; | 97 int64_t next_process_time_ms_; |
98 }; | 98 }; |
99 | 99 |
100 } // namespace webrtc | 100 } // namespace webrtc |
101 | 101 |
102 #endif // WEBRTC_MODULES_VIDEO_CODING_NACK_MODULE_H_ | 102 #endif // WEBRTC_MODULES_VIDEO_CODING_NACK_MODULE_H_ |
OLD | NEW |