| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 void SetEventLog(RtcEventLog* event_log) { | 188 void SetEventLog(RtcEventLog* event_log) { |
| 189 rtc::CritScope lock(&crit_); | 189 rtc::CritScope lock(&crit_); |
| 190 event_log_ = event_log; | 190 event_log_ = event_log; |
| 191 } | 191 } |
| 192 | 192 |
| 193 private: | 193 private: |
| 194 rtc::CriticalSection crit_; | 194 rtc::CriticalSection crit_; |
| 195 RtcEventLog* event_log_ GUARDED_BY(crit_); | 195 RtcEventLog* event_log_ RTC_GUARDED_BY(crit_); |
| 196 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); | 196 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 class RtcpRttStatsProxy final : public RtcpRttStats { | 199 class RtcpRttStatsProxy final : public RtcpRttStats { |
| 200 public: | 200 public: |
| 201 RtcpRttStatsProxy() : rtcp_rtt_stats_(nullptr) {} | 201 RtcpRttStatsProxy() : rtcp_rtt_stats_(nullptr) {} |
| 202 | 202 |
| 203 void OnRttUpdate(int64_t rtt) override { | 203 void OnRttUpdate(int64_t rtt) override { |
| 204 rtc::CritScope lock(&crit_); | 204 rtc::CritScope lock(&crit_); |
| 205 if (rtcp_rtt_stats_) | 205 if (rtcp_rtt_stats_) |
| 206 rtcp_rtt_stats_->OnRttUpdate(rtt); | 206 rtcp_rtt_stats_->OnRttUpdate(rtt); |
| 207 } | 207 } |
| 208 | 208 |
| 209 int64_t LastProcessedRtt() const override { | 209 int64_t LastProcessedRtt() const override { |
| 210 rtc::CritScope lock(&crit_); | 210 rtc::CritScope lock(&crit_); |
| 211 if (!rtcp_rtt_stats_) | 211 if (!rtcp_rtt_stats_) |
| 212 return 0; | 212 return 0; |
| 213 return rtcp_rtt_stats_->LastProcessedRtt(); | 213 return rtcp_rtt_stats_->LastProcessedRtt(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { | 216 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { |
| 217 rtc::CritScope lock(&crit_); | 217 rtc::CritScope lock(&crit_); |
| 218 rtcp_rtt_stats_ = rtcp_rtt_stats; | 218 rtcp_rtt_stats_ = rtcp_rtt_stats; |
| 219 } | 219 } |
| 220 | 220 |
| 221 private: | 221 private: |
| 222 rtc::CriticalSection crit_; | 222 rtc::CriticalSection crit_; |
| 223 RtcpRttStats* rtcp_rtt_stats_ GUARDED_BY(crit_); | 223 RtcpRttStats* rtcp_rtt_stats_ RTC_GUARDED_BY(crit_); |
| 224 RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy); | 224 RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy); |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 class TransportFeedbackProxy : public TransportFeedbackObserver { | 227 class TransportFeedbackProxy : public TransportFeedbackObserver { |
| 228 public: | 228 public: |
| 229 TransportFeedbackProxy() : feedback_observer_(nullptr) { | 229 TransportFeedbackProxy() : feedback_observer_(nullptr) { |
| 230 pacer_thread_.DetachFromThread(); | 230 pacer_thread_.DetachFromThread(); |
| 231 network_thread_.DetachFromThread(); | 231 network_thread_.DetachFromThread(); |
| 232 } | 232 } |
| 233 | 233 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 258 std::vector<PacketFeedback> GetTransportFeedbackVector() const override { | 258 std::vector<PacketFeedback> GetTransportFeedbackVector() const override { |
| 259 RTC_NOTREACHED(); | 259 RTC_NOTREACHED(); |
| 260 return std::vector<PacketFeedback>(); | 260 return std::vector<PacketFeedback>(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 private: | 263 private: |
| 264 rtc::CriticalSection crit_; | 264 rtc::CriticalSection crit_; |
| 265 rtc::ThreadChecker thread_checker_; | 265 rtc::ThreadChecker thread_checker_; |
| 266 rtc::ThreadChecker pacer_thread_; | 266 rtc::ThreadChecker pacer_thread_; |
| 267 rtc::ThreadChecker network_thread_; | 267 rtc::ThreadChecker network_thread_; |
| 268 TransportFeedbackObserver* feedback_observer_ GUARDED_BY(&crit_); | 268 TransportFeedbackObserver* feedback_observer_ RTC_GUARDED_BY(&crit_); |
| 269 }; | 269 }; |
| 270 | 270 |
| 271 class TransportSequenceNumberProxy : public TransportSequenceNumberAllocator { | 271 class TransportSequenceNumberProxy : public TransportSequenceNumberAllocator { |
| 272 public: | 272 public: |
| 273 TransportSequenceNumberProxy() : seq_num_allocator_(nullptr) { | 273 TransportSequenceNumberProxy() : seq_num_allocator_(nullptr) { |
| 274 pacer_thread_.DetachFromThread(); | 274 pacer_thread_.DetachFromThread(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void SetSequenceNumberAllocator( | 277 void SetSequenceNumberAllocator( |
| 278 TransportSequenceNumberAllocator* seq_num_allocator) { | 278 TransportSequenceNumberAllocator* seq_num_allocator) { |
| 279 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 279 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 280 rtc::CritScope lock(&crit_); | 280 rtc::CritScope lock(&crit_); |
| 281 seq_num_allocator_ = seq_num_allocator; | 281 seq_num_allocator_ = seq_num_allocator; |
| 282 } | 282 } |
| 283 | 283 |
| 284 // Implements TransportSequenceNumberAllocator. | 284 // Implements TransportSequenceNumberAllocator. |
| 285 uint16_t AllocateSequenceNumber() override { | 285 uint16_t AllocateSequenceNumber() override { |
| 286 RTC_DCHECK(pacer_thread_.CalledOnValidThread()); | 286 RTC_DCHECK(pacer_thread_.CalledOnValidThread()); |
| 287 rtc::CritScope lock(&crit_); | 287 rtc::CritScope lock(&crit_); |
| 288 if (!seq_num_allocator_) | 288 if (!seq_num_allocator_) |
| 289 return 0; | 289 return 0; |
| 290 return seq_num_allocator_->AllocateSequenceNumber(); | 290 return seq_num_allocator_->AllocateSequenceNumber(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 private: | 293 private: |
| 294 rtc::CriticalSection crit_; | 294 rtc::CriticalSection crit_; |
| 295 rtc::ThreadChecker thread_checker_; | 295 rtc::ThreadChecker thread_checker_; |
| 296 rtc::ThreadChecker pacer_thread_; | 296 rtc::ThreadChecker pacer_thread_; |
| 297 TransportSequenceNumberAllocator* seq_num_allocator_ GUARDED_BY(&crit_); | 297 TransportSequenceNumberAllocator* seq_num_allocator_ RTC_GUARDED_BY(&crit_); |
| 298 }; | 298 }; |
| 299 | 299 |
| 300 class RtpPacketSenderProxy : public RtpPacketSender { | 300 class RtpPacketSenderProxy : public RtpPacketSender { |
| 301 public: | 301 public: |
| 302 RtpPacketSenderProxy() : rtp_packet_sender_(nullptr) {} | 302 RtpPacketSenderProxy() : rtp_packet_sender_(nullptr) {} |
| 303 | 303 |
| 304 void SetPacketSender(RtpPacketSender* rtp_packet_sender) { | 304 void SetPacketSender(RtpPacketSender* rtp_packet_sender) { |
| 305 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 305 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 306 rtc::CritScope lock(&crit_); | 306 rtc::CritScope lock(&crit_); |
| 307 rtp_packet_sender_ = rtp_packet_sender; | 307 rtp_packet_sender_ = rtp_packet_sender; |
| 308 } | 308 } |
| 309 | 309 |
| 310 // Implements RtpPacketSender. | 310 // Implements RtpPacketSender. |
| 311 void InsertPacket(Priority priority, | 311 void InsertPacket(Priority priority, |
| 312 uint32_t ssrc, | 312 uint32_t ssrc, |
| 313 uint16_t sequence_number, | 313 uint16_t sequence_number, |
| 314 int64_t capture_time_ms, | 314 int64_t capture_time_ms, |
| 315 size_t bytes, | 315 size_t bytes, |
| 316 bool retransmission) override { | 316 bool retransmission) override { |
| 317 rtc::CritScope lock(&crit_); | 317 rtc::CritScope lock(&crit_); |
| 318 if (rtp_packet_sender_) { | 318 if (rtp_packet_sender_) { |
| 319 rtp_packet_sender_->InsertPacket(priority, ssrc, sequence_number, | 319 rtp_packet_sender_->InsertPacket(priority, ssrc, sequence_number, |
| 320 capture_time_ms, bytes, retransmission); | 320 capture_time_ms, bytes, retransmission); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 private: | 324 private: |
| 325 rtc::ThreadChecker thread_checker_; | 325 rtc::ThreadChecker thread_checker_; |
| 326 rtc::CriticalSection crit_; | 326 rtc::CriticalSection crit_; |
| 327 RtpPacketSender* rtp_packet_sender_ GUARDED_BY(&crit_); | 327 RtpPacketSender* rtp_packet_sender_ RTC_GUARDED_BY(&crit_); |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 class VoERtcpObserver : public RtcpBandwidthObserver { | 330 class VoERtcpObserver : public RtcpBandwidthObserver { |
| 331 public: | 331 public: |
| 332 explicit VoERtcpObserver(Channel* owner) | 332 explicit VoERtcpObserver(Channel* owner) |
| 333 : owner_(owner), bandwidth_observer_(nullptr) {} | 333 : owner_(owner), bandwidth_observer_(nullptr) {} |
| 334 virtual ~VoERtcpObserver() {} | 334 virtual ~VoERtcpObserver() {} |
| 335 | 335 |
| 336 void SetBandwidthObserver(RtcpBandwidthObserver* bandwidth_observer) { | 336 void SetBandwidthObserver(RtcpBandwidthObserver* bandwidth_observer) { |
| 337 rtc::CritScope lock(&crit_); | 337 rtc::CritScope lock(&crit_); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 total_number_of_packets; | 391 total_number_of_packets; |
| 392 } | 392 } |
| 393 owner_->OnUplinkPacketLossRate(weighted_fraction_lost / 255.0f); | 393 owner_->OnUplinkPacketLossRate(weighted_fraction_lost / 255.0f); |
| 394 } | 394 } |
| 395 | 395 |
| 396 private: | 396 private: |
| 397 Channel* owner_; | 397 Channel* owner_; |
| 398 // Maps remote side ssrc to extended highest sequence number received. | 398 // Maps remote side ssrc to extended highest sequence number received. |
| 399 std::map<uint32_t, uint32_t> extended_max_sequence_number_; | 399 std::map<uint32_t, uint32_t> extended_max_sequence_number_; |
| 400 rtc::CriticalSection crit_; | 400 rtc::CriticalSection crit_; |
| 401 RtcpBandwidthObserver* bandwidth_observer_ GUARDED_BY(crit_); | 401 RtcpBandwidthObserver* bandwidth_observer_ RTC_GUARDED_BY(crit_); |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 class Channel::ProcessAndEncodeAudioTask : public rtc::QueuedTask { | 404 class Channel::ProcessAndEncodeAudioTask : public rtc::QueuedTask { |
| 405 public: | 405 public: |
| 406 ProcessAndEncodeAudioTask(std::unique_ptr<AudioFrame> audio_frame, | 406 ProcessAndEncodeAudioTask(std::unique_ptr<AudioFrame> audio_frame, |
| 407 Channel* channel) | 407 Channel* channel) |
| 408 : audio_frame_(std::move(audio_frame)), channel_(channel) { | 408 : audio_frame_(std::move(audio_frame)), channel_(channel) { |
| 409 RTC_DCHECK(channel_); | 409 RTC_DCHECK(channel_); |
| 410 } | 410 } |
| 411 | 411 |
| (...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3132 int64_t min_rtt = 0; | 3132 int64_t min_rtt = 0; |
| 3133 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3133 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3134 0) { | 3134 0) { |
| 3135 return 0; | 3135 return 0; |
| 3136 } | 3136 } |
| 3137 return rtt; | 3137 return rtt; |
| 3138 } | 3138 } |
| 3139 | 3139 |
| 3140 } // namespace voe | 3140 } // namespace voe |
| 3141 } // namespace webrtc | 3141 } // namespace webrtc |
| OLD | NEW |