| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const VideoEncoderConfig& encoder_config) override; | 86 const VideoEncoderConfig& encoder_config) override; |
| 87 void DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) override; | 87 void DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) override; |
| 88 | 88 |
| 89 webrtc::VideoReceiveStream* CreateVideoReceiveStream( | 89 webrtc::VideoReceiveStream* CreateVideoReceiveStream( |
| 90 const webrtc::VideoReceiveStream::Config& config) override; | 90 const webrtc::VideoReceiveStream::Config& config) override; |
| 91 void DestroyVideoReceiveStream( | 91 void DestroyVideoReceiveStream( |
| 92 webrtc::VideoReceiveStream* receive_stream) override; | 92 webrtc::VideoReceiveStream* receive_stream) override; |
| 93 | 93 |
| 94 Stats GetStats() const override; | 94 Stats GetStats() const override; |
| 95 | 95 |
| 96 DeliveryStatus DeliverPacket(MediaType media_type, const uint8_t* packet, | 96 DeliveryStatus DeliverPacket(MediaType media_type, |
| 97 size_t length) override; | 97 const uint8_t* packet, |
| 98 size_t length, |
| 99 const PacketTime& packet_time) override; |
| 98 | 100 |
| 99 void SetBitrateConfig( | 101 void SetBitrateConfig( |
| 100 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; | 102 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
| 101 void SignalNetworkState(NetworkState state) override; | 103 void SignalNetworkState(NetworkState state) override; |
| 102 | 104 |
| 103 private: | 105 private: |
| 104 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, | 106 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, |
| 105 size_t length); | 107 size_t length); |
| 106 DeliveryStatus DeliverRtp(MediaType media_type, const uint8_t* packet, | 108 DeliveryStatus DeliverRtp(MediaType media_type, |
| 107 size_t length); | 109 const uint8_t* packet, |
| 110 size_t length, |
| 111 const PacketTime& packet_time); |
| 108 | 112 |
| 109 void SetBitrateControllerConfig( | 113 void SetBitrateControllerConfig( |
| 110 const webrtc::Call::Config::BitrateConfig& bitrate_config); | 114 const webrtc::Call::Config::BitrateConfig& bitrate_config); |
| 111 | 115 |
| 112 void ConfigureSync(const std::string& sync_group) | 116 void ConfigureSync(const std::string& sync_group) |
| 113 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); | 117 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); |
| 114 | 118 |
| 115 const int num_cpu_cores_; | 119 const int num_cpu_cores_; |
| 116 const rtc::scoped_ptr<ProcessThread> module_process_thread_; | 120 const rtc::scoped_ptr<ProcessThread> module_process_thread_; |
| 117 const rtc::scoped_ptr<ChannelGroup> channel_group_; | 121 const rtc::scoped_ptr<ChannelGroup> channel_group_; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 for (VideoSendStream* stream : video_send_streams_) { | 504 for (VideoSendStream* stream : video_send_streams_) { |
| 501 if (stream->DeliverRtcp(packet, length)) | 505 if (stream->DeliverRtcp(packet, length)) |
| 502 rtcp_delivered = true; | 506 rtcp_delivered = true; |
| 503 } | 507 } |
| 504 } | 508 } |
| 505 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; | 509 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; |
| 506 } | 510 } |
| 507 | 511 |
| 508 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, | 512 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
| 509 const uint8_t* packet, | 513 const uint8_t* packet, |
| 510 size_t length) { | 514 size_t length, |
| 515 const PacketTime& packet_time) { |
| 511 // Minimum RTP header size. | 516 // Minimum RTP header size. |
| 512 if (length < 12) | 517 if (length < 12) |
| 513 return DELIVERY_PACKET_ERROR; | 518 return DELIVERY_PACKET_ERROR; |
| 514 | 519 |
| 515 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 520 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| 516 | 521 |
| 517 ReadLockScoped read_lock(*receive_crit_); | 522 ReadLockScoped read_lock(*receive_crit_); |
| 518 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { | 523 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
| 519 auto it = audio_receive_ssrcs_.find(ssrc); | 524 auto it = audio_receive_ssrcs_.find(ssrc); |
| 520 if (it != audio_receive_ssrcs_.end()) { | 525 if (it != audio_receive_ssrcs_.end()) { |
| 521 return it->second->DeliverRtp(packet, length) ? DELIVERY_OK | 526 return it->second->DeliverRtp(packet, length, packet_time) |
| 522 : DELIVERY_PACKET_ERROR; | 527 ? DELIVERY_OK |
| 528 : DELIVERY_PACKET_ERROR; |
| 523 } | 529 } |
| 524 } | 530 } |
| 525 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { | 531 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| 526 auto it = video_receive_ssrcs_.find(ssrc); | 532 auto it = video_receive_ssrcs_.find(ssrc); |
| 527 if (it != video_receive_ssrcs_.end()) { | 533 if (it != video_receive_ssrcs_.end()) { |
| 528 return it->second->DeliverRtp(packet, length) ? DELIVERY_OK | 534 return it->second->DeliverRtp(packet, length, packet_time) |
| 529 : DELIVERY_PACKET_ERROR; | 535 ? DELIVERY_OK |
| 536 : DELIVERY_PACKET_ERROR; |
| 530 } | 537 } |
| 531 } | 538 } |
| 532 return DELIVERY_UNKNOWN_SSRC; | 539 return DELIVERY_UNKNOWN_SSRC; |
| 533 } | 540 } |
| 534 | 541 |
| 535 PacketReceiver::DeliveryStatus Call::DeliverPacket(MediaType media_type, | 542 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
| 536 const uint8_t* packet, | 543 MediaType media_type, |
| 537 size_t length) { | 544 const uint8_t* packet, |
| 545 size_t length, |
| 546 const PacketTime& packet_time) { |
| 538 if (RtpHeaderParser::IsRtcp(packet, length)) | 547 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 539 return DeliverRtcp(media_type, packet, length); | 548 return DeliverRtcp(media_type, packet, length); |
| 540 | 549 |
| 541 return DeliverRtp(media_type, packet, length); | 550 return DeliverRtp(media_type, packet, length, packet_time); |
| 542 } | 551 } |
| 543 | 552 |
| 544 } // namespace internal | 553 } // namespace internal |
| 545 } // namespace webrtc | 554 } // namespace webrtc |
| OLD | NEW |