Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 void OnSentPacket(const rtc::SentPacket& sent_packet) override; | 102 void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
| 103 | 103 |
| 104 // Implements BitrateObserver. | 104 // Implements BitrateObserver. |
| 105 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, | 105 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, |
| 106 int64_t rtt_ms) override; | 106 int64_t rtt_ms) override; |
| 107 | 107 |
| 108 // Implements BitrateAllocator::LimitObserver. | 108 // Implements BitrateAllocator::LimitObserver. |
| 109 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, | 109 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, |
| 110 uint32_t max_padding_bitrate_bps) override; | 110 uint32_t max_padding_bitrate_bps) override; |
| 111 | 111 |
| 112 bool StartEventLog(rtc::PlatformFile log_file, | |
| 113 int64_t max_size_bytes) override { | |
| 114 return event_log_->StartLogging(log_file, max_size_bytes); | |
| 115 } | |
| 116 | |
| 117 void StopEventLog() override { event_log_->StopLogging(); } | |
| 118 | |
| 119 private: | 112 private: |
| 120 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, | 113 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, |
| 121 size_t length); | 114 size_t length); |
| 122 DeliveryStatus DeliverRtp(MediaType media_type, | 115 DeliveryStatus DeliverRtp(MediaType media_type, |
| 123 const uint8_t* packet, | 116 const uint8_t* packet, |
| 124 size_t length, | 117 size_t length, |
| 125 const PacketTime& packet_time); | 118 const PacketTime& packet_time); |
| 126 void ConfigureSync(const std::string& sync_group) | 119 void ConfigureSync(const std::string& sync_group) |
| 127 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); | 120 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); |
| 128 | 121 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ | 157 std::map<std::string, AudioReceiveStream*> sync_stream_mapping_ |
| 165 GUARDED_BY(receive_crit_); | 158 GUARDED_BY(receive_crit_); |
| 166 | 159 |
| 167 std::unique_ptr<RWLockWrapper> send_crit_; | 160 std::unique_ptr<RWLockWrapper> send_crit_; |
| 168 // Audio and Video send streams are owned by the client that creates them. | 161 // Audio and Video send streams are owned by the client that creates them. |
| 169 std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_ GUARDED_BY(send_crit_); | 162 std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_ GUARDED_BY(send_crit_); |
| 170 std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_); | 163 std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_); |
| 171 std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_); | 164 std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_); |
| 172 | 165 |
| 173 VideoSendStream::RtpStateMap suspended_video_send_ssrcs_; | 166 VideoSendStream::RtpStateMap suspended_video_send_ssrcs_; |
| 174 | 167 webrtc::RtcEventLog* event_log_; |
| 175 std::unique_ptr<webrtc::RtcEventLog> event_log_; | |
| 176 | 168 |
| 177 // The following members are only accessed (exclusively) from one thread and | 169 // The following members are only accessed (exclusively) from one thread and |
| 178 // from the destructor, and therefore doesn't need any explicit | 170 // from the destructor, and therefore doesn't need any explicit |
| 179 // synchronization. | 171 // synchronization. |
| 180 int64_t first_packet_sent_ms_; | 172 int64_t first_packet_sent_ms_; |
| 181 RateCounter received_bytes_per_second_counter_; | 173 RateCounter received_bytes_per_second_counter_; |
| 182 RateCounter received_audio_bytes_per_second_counter_; | 174 RateCounter received_audio_bytes_per_second_counter_; |
| 183 RateCounter received_video_bytes_per_second_counter_; | 175 RateCounter received_video_bytes_per_second_counter_; |
| 184 RateCounter received_rtcp_bytes_per_second_counter_; | 176 RateCounter received_rtcp_bytes_per_second_counter_; |
| 185 | 177 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 num_cpu_cores_(CpuInfo::DetectNumberOfCores()), | 222 num_cpu_cores_(CpuInfo::DetectNumberOfCores()), |
| 231 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), | 223 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), |
| 232 pacer_thread_(ProcessThread::Create("PacerThread")), | 224 pacer_thread_(ProcessThread::Create("PacerThread")), |
| 233 call_stats_(new CallStats(clock_)), | 225 call_stats_(new CallStats(clock_)), |
| 234 bitrate_allocator_(new BitrateAllocator(this)), | 226 bitrate_allocator_(new BitrateAllocator(this)), |
| 235 config_(config), | 227 config_(config), |
| 236 audio_network_state_(kNetworkUp), | 228 audio_network_state_(kNetworkUp), |
| 237 video_network_state_(kNetworkUp), | 229 video_network_state_(kNetworkUp), |
| 238 receive_crit_(RWLockWrapper::CreateRWLock()), | 230 receive_crit_(RWLockWrapper::CreateRWLock()), |
| 239 send_crit_(RWLockWrapper::CreateRWLock()), | 231 send_crit_(RWLockWrapper::CreateRWLock()), |
| 240 event_log_(RtcEventLog::Create(webrtc::Clock::GetRealTimeClock())), | 232 event_log_(config.event_log), |
| 241 first_packet_sent_ms_(-1), | 233 first_packet_sent_ms_(-1), |
| 242 received_bytes_per_second_counter_(clock_, nullptr, true), | 234 received_bytes_per_second_counter_(clock_, nullptr, true), |
| 243 received_audio_bytes_per_second_counter_(clock_, nullptr, true), | 235 received_audio_bytes_per_second_counter_(clock_, nullptr, true), |
| 244 received_video_bytes_per_second_counter_(clock_, nullptr, true), | 236 received_video_bytes_per_second_counter_(clock_, nullptr, true), |
| 245 received_rtcp_bytes_per_second_counter_(clock_, nullptr, true), | 237 received_rtcp_bytes_per_second_counter_(clock_, nullptr, true), |
| 246 min_allocated_send_bitrate_bps_(0), | 238 min_allocated_send_bitrate_bps_(0), |
| 247 configured_max_padding_bitrate_bps_(0), | 239 configured_max_padding_bitrate_bps_(0), |
| 248 estimated_send_bitrate_kbps_counter_(clock_, nullptr, true), | 240 estimated_send_bitrate_kbps_counter_(clock_, nullptr, true), |
| 249 pacer_bitrate_kbps_counter_(clock_, nullptr, true), | 241 pacer_bitrate_kbps_counter_(clock_, nullptr, true), |
| 250 remb_(clock_), | 242 remb_(clock_), |
| 251 congestion_controller_( | 243 congestion_controller_( |
| 252 new CongestionController(clock_, this, &remb_, event_log_.get())), | 244 new CongestionController(clock_, this, &remb_, event_log_)), |
| 253 video_send_delay_stats_(new SendDelayStats(clock_)), | 245 video_send_delay_stats_(new SendDelayStats(clock_)), |
| 254 start_ms_(clock_->TimeInMilliseconds()), | 246 start_ms_(clock_->TimeInMilliseconds()), |
| 255 worker_queue_("call_worker_queue") { | 247 worker_queue_("call_worker_queue") { |
| 256 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 248 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 257 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); | 249 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
| 258 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, | 250 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, |
| 259 config.bitrate_config.min_bitrate_bps); | 251 config.bitrate_config.min_bitrate_bps); |
| 260 if (config.bitrate_config.max_bitrate_bps != -1) { | 252 if (config.bitrate_config.max_bitrate_bps != -1) { |
| 261 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, | 253 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
| 262 config.bitrate_config.start_bitrate_bps); | 254 config.bitrate_config.start_bitrate_bps); |
| 263 } | 255 } |
| 264 | |
| 265 Trace::CreateTrace(); | 256 Trace::CreateTrace(); |
| 266 call_stats_->RegisterStatsObserver(congestion_controller_.get()); | 257 call_stats_->RegisterStatsObserver(congestion_controller_.get()); |
| 267 | 258 |
| 268 congestion_controller_->SetBweBitrates( | 259 congestion_controller_->SetBweBitrates( |
| 269 config_.bitrate_config.min_bitrate_bps, | 260 config_.bitrate_config.min_bitrate_bps, |
| 270 config_.bitrate_config.start_bitrate_bps, | 261 config_.bitrate_config.start_bitrate_bps, |
| 271 config_.bitrate_config.max_bitrate_bps); | 262 config_.bitrate_config.max_bitrate_bps); |
| 272 | 263 |
| 273 module_process_thread_->Start(); | 264 module_process_thread_->Start(); |
| 274 module_process_thread_->RegisterModule(call_stats_.get()); | 265 module_process_thread_->RegisterModule(call_stats_.get()); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 364 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 374 return this; | 365 return this; |
| 375 } | 366 } |
| 376 | 367 |
| 377 webrtc::AudioSendStream* Call::CreateAudioSendStream( | 368 webrtc::AudioSendStream* Call::CreateAudioSendStream( |
| 378 const webrtc::AudioSendStream::Config& config) { | 369 const webrtc::AudioSendStream::Config& config) { |
| 379 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); | 370 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); |
| 380 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 371 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 381 AudioSendStream* send_stream = new AudioSendStream( | 372 AudioSendStream* send_stream = new AudioSendStream( |
| 382 config, config_.audio_state, &worker_queue_, congestion_controller_.get(), | 373 config, config_.audio_state, &worker_queue_, congestion_controller_.get(), |
| 383 bitrate_allocator_.get(), event_log_.get()); | 374 bitrate_allocator_.get(), event_log_); |
| 384 { | 375 { |
| 385 WriteLockScoped write_lock(*send_crit_); | 376 WriteLockScoped write_lock(*send_crit_); |
| 386 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == | 377 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == |
| 387 audio_send_ssrcs_.end()); | 378 audio_send_ssrcs_.end()); |
| 388 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; | 379 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; |
| 389 } | 380 } |
| 390 send_stream->SignalNetworkState(audio_network_state_); | 381 send_stream->SignalNetworkState(audio_network_state_); |
| 391 UpdateAggregateNetworkState(); | 382 UpdateAggregateNetworkState(); |
| 392 return send_stream; | 383 return send_stream; |
| 393 } | 384 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 408 RTC_DCHECK(num_deleted == 1); | 399 RTC_DCHECK(num_deleted == 1); |
| 409 } | 400 } |
| 410 UpdateAggregateNetworkState(); | 401 UpdateAggregateNetworkState(); |
| 411 delete audio_send_stream; | 402 delete audio_send_stream; |
| 412 } | 403 } |
| 413 | 404 |
| 414 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( | 405 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
| 415 const webrtc::AudioReceiveStream::Config& config) { | 406 const webrtc::AudioReceiveStream::Config& config) { |
| 416 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); | 407 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); |
| 417 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 408 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 418 AudioReceiveStream* receive_stream = | 409 AudioReceiveStream* receive_stream = new AudioReceiveStream( |
| 419 new AudioReceiveStream(congestion_controller_.get(), config, | 410 congestion_controller_.get(), config, config_.audio_state, event_log_); |
| 420 config_.audio_state, event_log_.get()); | |
| 421 { | 411 { |
| 422 WriteLockScoped write_lock(*receive_crit_); | 412 WriteLockScoped write_lock(*receive_crit_); |
| 423 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == | 413 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
| 424 audio_receive_ssrcs_.end()); | 414 audio_receive_ssrcs_.end()); |
| 425 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; | 415 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; |
| 426 ConfigureSync(config.sync_group); | 416 ConfigureSync(config.sync_group); |
| 427 } | 417 } |
| 428 receive_stream->SignalNetworkState(audio_network_state_); | 418 receive_stream->SignalNetworkState(audio_network_state_); |
| 429 UpdateAggregateNetworkState(); | 419 UpdateAggregateNetworkState(); |
| 430 return receive_stream; | 420 return receive_stream; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 454 delete audio_receive_stream; | 444 delete audio_receive_stream; |
| 455 } | 445 } |
| 456 | 446 |
| 457 webrtc::VideoSendStream* Call::CreateVideoSendStream( | 447 webrtc::VideoSendStream* Call::CreateVideoSendStream( |
| 458 webrtc::VideoSendStream::Config config, | 448 webrtc::VideoSendStream::Config config, |
| 459 VideoEncoderConfig encoder_config) { | 449 VideoEncoderConfig encoder_config) { |
| 460 TRACE_EVENT0("webrtc", "Call::CreateVideoSendStream"); | 450 TRACE_EVENT0("webrtc", "Call::CreateVideoSendStream"); |
| 461 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 451 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 462 | 452 |
| 463 video_send_delay_stats_->AddSsrcs(config); | 453 video_send_delay_stats_->AddSsrcs(config); |
| 464 event_log_->LogVideoSendStreamConfig(config); | 454 if (event_log_) { |
|
stefan-webrtc
2016/09/29 07:56:24
Remove {} here and below since it's a two line if.
skvlad
2016/10/06 01:31:37
Done.
| |
| 455 event_log_->LogVideoSendStreamConfig(config); | |
| 456 } | |
| 465 | 457 |
| 466 // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if | 458 // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if |
| 467 // the call has already started. | 459 // the call has already started. |
| 468 // Copy ssrcs from |config| since |config| is moved. | 460 // Copy ssrcs from |config| since |config| is moved. |
| 469 std::vector<uint32_t> ssrcs = config.rtp.ssrcs; | 461 std::vector<uint32_t> ssrcs = config.rtp.ssrcs; |
| 470 VideoSendStream* send_stream = new VideoSendStream( | 462 VideoSendStream* send_stream = new VideoSendStream( |
| 471 num_cpu_cores_, module_process_thread_.get(), &worker_queue_, | 463 num_cpu_cores_, module_process_thread_.get(), &worker_queue_, |
| 472 call_stats_.get(), congestion_controller_.get(), bitrate_allocator_.get(), | 464 call_stats_.get(), congestion_controller_.get(), bitrate_allocator_.get(), |
| 473 video_send_delay_stats_.get(), &remb_, event_log_.get(), | 465 video_send_delay_stats_.get(), &remb_, event_log_, std::move(config), |
| 474 std::move(config), std::move(encoder_config), | 466 std::move(encoder_config), suspended_video_send_ssrcs_); |
| 475 suspended_video_send_ssrcs_); | |
| 476 | 467 |
| 477 { | 468 { |
| 478 WriteLockScoped write_lock(*send_crit_); | 469 WriteLockScoped write_lock(*send_crit_); |
| 479 for (uint32_t ssrc : ssrcs) { | 470 for (uint32_t ssrc : ssrcs) { |
| 480 RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end()); | 471 RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end()); |
| 481 video_send_ssrcs_[ssrc] = send_stream; | 472 video_send_ssrcs_[ssrc] = send_stream; |
| 482 } | 473 } |
| 483 video_send_streams_.insert(send_stream); | 474 video_send_streams_.insert(send_stream); |
| 484 } | 475 } |
| 485 send_stream->SignalNetworkState(video_network_state_); | 476 send_stream->SignalNetworkState(video_network_state_); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 // TODO(pbos): Configure different RTX payloads per receive payload. | 531 // TODO(pbos): Configure different RTX payloads per receive payload. |
| 541 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = | 532 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = |
| 542 config.rtp.rtx.begin(); | 533 config.rtp.rtx.begin(); |
| 543 if (it != config.rtp.rtx.end()) | 534 if (it != config.rtp.rtx.end()) |
| 544 video_receive_ssrcs_[it->second.ssrc] = receive_stream; | 535 video_receive_ssrcs_[it->second.ssrc] = receive_stream; |
| 545 video_receive_streams_.insert(receive_stream); | 536 video_receive_streams_.insert(receive_stream); |
| 546 ConfigureSync(config.sync_group); | 537 ConfigureSync(config.sync_group); |
| 547 } | 538 } |
| 548 receive_stream->SignalNetworkState(video_network_state_); | 539 receive_stream->SignalNetworkState(video_network_state_); |
| 549 UpdateAggregateNetworkState(); | 540 UpdateAggregateNetworkState(); |
| 550 event_log_->LogVideoReceiveStreamConfig(config); | 541 if (event_log_) { |
| 542 event_log_->LogVideoReceiveStreamConfig(config); | |
| 543 } | |
| 551 return receive_stream; | 544 return receive_stream; |
| 552 } | 545 } |
| 553 | 546 |
| 554 void Call::DestroyVideoReceiveStream( | 547 void Call::DestroyVideoReceiveStream( |
| 555 webrtc::VideoReceiveStream* receive_stream) { | 548 webrtc::VideoReceiveStream* receive_stream) { |
| 556 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); | 549 TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream"); |
| 557 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 550 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 558 RTC_DCHECK(receive_stream != nullptr); | 551 RTC_DCHECK(receive_stream != nullptr); |
| 559 VideoReceiveStream* receive_stream_impl = nullptr; | 552 VideoReceiveStream* receive_stream_impl = nullptr; |
| 560 { | 553 { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 905 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 898 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| 906 ReadLockScoped read_lock(*receive_crit_); | 899 ReadLockScoped read_lock(*receive_crit_); |
| 907 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { | 900 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
| 908 auto it = audio_receive_ssrcs_.find(ssrc); | 901 auto it = audio_receive_ssrcs_.find(ssrc); |
| 909 if (it != audio_receive_ssrcs_.end()) { | 902 if (it != audio_receive_ssrcs_.end()) { |
| 910 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 903 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
| 911 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); | 904 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); |
| 912 auto status = it->second->DeliverRtp(packet, length, packet_time) | 905 auto status = it->second->DeliverRtp(packet, length, packet_time) |
| 913 ? DELIVERY_OK | 906 ? DELIVERY_OK |
| 914 : DELIVERY_PACKET_ERROR; | 907 : DELIVERY_PACKET_ERROR; |
| 915 if (status == DELIVERY_OK) | 908 if (event_log_ && status == DELIVERY_OK) |
| 916 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 909 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
| 917 return status; | 910 return status; |
| 918 } | 911 } |
| 919 } | 912 } |
| 920 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { | 913 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| 921 auto it = video_receive_ssrcs_.find(ssrc); | 914 auto it = video_receive_ssrcs_.find(ssrc); |
| 922 if (it != video_receive_ssrcs_.end()) { | 915 if (it != video_receive_ssrcs_.end()) { |
| 923 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 916 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
| 924 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); | 917 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); |
| 925 auto status = it->second->DeliverRtp(packet, length, packet_time) | 918 auto status = it->second->DeliverRtp(packet, length, packet_time) |
| 926 ? DELIVERY_OK | 919 ? DELIVERY_OK |
| 927 : DELIVERY_PACKET_ERROR; | 920 : DELIVERY_PACKET_ERROR; |
| 928 if (status == DELIVERY_OK) | 921 if (event_log_ && status == DELIVERY_OK) |
| 929 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 922 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
| 930 return status; | 923 return status; |
| 931 } | 924 } |
| 932 } | 925 } |
| 933 return DELIVERY_UNKNOWN_SSRC; | 926 return DELIVERY_UNKNOWN_SSRC; |
| 934 } | 927 } |
| 935 | 928 |
| 936 PacketReceiver::DeliveryStatus Call::DeliverPacket( | 929 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
| 937 MediaType media_type, | 930 MediaType media_type, |
| 938 const uint8_t* packet, | 931 const uint8_t* packet, |
| 939 size_t length, | 932 size_t length, |
| 940 const PacketTime& packet_time) { | 933 const PacketTime& packet_time) { |
| 941 // TODO(solenberg): Tests call this function on a network thread, libjingle | 934 // TODO(solenberg): Tests call this function on a network thread, libjingle |
| 942 // calls on the worker thread. We should move towards always using a network | 935 // calls on the worker thread. We should move towards always using a network |
| 943 // thread. Then this check can be enabled. | 936 // thread. Then this check can be enabled. |
| 944 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 937 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 945 if (RtpHeaderParser::IsRtcp(packet, length)) | 938 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 946 return DeliverRtcp(media_type, packet, length); | 939 return DeliverRtcp(media_type, packet, length); |
| 947 | 940 |
| 948 return DeliverRtp(media_type, packet, length, packet_time); | 941 return DeliverRtp(media_type, packet, length, packet_time); |
| 949 } | 942 } |
| 950 | 943 |
| 951 } // namespace internal | 944 } // namespace internal |
| 952 } // namespace webrtc | 945 } // namespace webrtc |
| OLD | NEW |