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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 "IncomingPacket invalid RTP header"); | 469 "IncomingPacket invalid RTP header"); |
470 return false; | 470 return false; |
471 } | 471 } |
472 header.payload_type_frequency = | 472 header.payload_type_frequency = |
473 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType); | 473 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType); |
474 if (header.payload_type_frequency < 0) | 474 if (header.payload_type_frequency < 0) |
475 return false; | 475 return false; |
476 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); | 476 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); |
477 } | 477 } |
478 | 478 |
479 int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { | 479 MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted( |
| 480 int32_t id, |
| 481 AudioFrame* audioFrame) { |
480 if (event_log_) { | 482 if (event_log_) { |
481 unsigned int ssrc; | 483 unsigned int ssrc; |
482 RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); | 484 RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); |
483 event_log_->LogAudioPlayout(ssrc); | 485 event_log_->LogAudioPlayout(ssrc); |
484 } | 486 } |
485 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) | 487 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) |
486 bool muted; | 488 bool muted; |
487 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, | 489 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, |
488 &muted) == -1) { | 490 &muted) == -1) { |
489 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), | 491 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), |
490 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); | 492 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); |
491 // In all likelihood, the audio in this frame is garbage. We return an | 493 // In all likelihood, the audio in this frame is garbage. We return an |
492 // error so that the audio mixer module doesn't add it to the mix. As | 494 // error so that the audio mixer module doesn't add it to the mix. As |
493 // a result, it won't be played out and the actions skipped here are | 495 // a result, it won't be played out and the actions skipped here are |
494 // irrelevant. | 496 // irrelevant. |
495 return -1; | 497 return MixerParticipant::AudioFrameInfo::kError; |
496 } | 498 } |
497 RTC_DCHECK(!muted); | 499 RTC_DCHECK(!muted); |
498 | 500 |
499 if (_RxVadDetection) { | 501 if (_RxVadDetection) { |
500 UpdateRxVadDetection(*audioFrame); | 502 UpdateRxVadDetection(*audioFrame); |
501 } | 503 } |
502 | 504 |
503 // Convert module ID to internal VoE channel ID | 505 // Convert module ID to internal VoE channel ID |
504 audioFrame->id_ = VoEChannelId(audioFrame->id_); | 506 audioFrame->id_ = VoEChannelId(audioFrame->id_); |
505 // Store speech type for dead-or-alive detection | 507 // Store speech type for dead-or-alive detection |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 // |ntp_time_ms_| won't be valid until at least 2 RTCP SRs are received. | 616 // |ntp_time_ms_| won't be valid until at least 2 RTCP SRs are received. |
615 if (audioFrame->ntp_time_ms_ > 0) { | 617 if (audioFrame->ntp_time_ms_ > 0) { |
616 // Compute |capture_start_ntp_time_ms_| so that | 618 // Compute |capture_start_ntp_time_ms_| so that |
617 // |capture_start_ntp_time_ms_| + |elapsed_time_ms_| == |ntp_time_ms_| | 619 // |capture_start_ntp_time_ms_| + |elapsed_time_ms_| == |ntp_time_ms_| |
618 capture_start_ntp_time_ms_ = | 620 capture_start_ntp_time_ms_ = |
619 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_; | 621 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_; |
620 } | 622 } |
621 } | 623 } |
622 } | 624 } |
623 | 625 |
624 return 0; | 626 return muted ? MixerParticipant::AudioFrameInfo::kMuted |
| 627 : MixerParticipant::AudioFrameInfo::kNormal; |
625 } | 628 } |
626 | 629 |
627 int32_t Channel::NeededFrequency(int32_t id) const { | 630 int32_t Channel::NeededFrequency(int32_t id) const { |
628 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), | 631 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), |
629 "Channel::NeededFrequency(id=%d)", id); | 632 "Channel::NeededFrequency(id=%d)", id); |
630 | 633 |
631 int highestNeeded = 0; | 634 int highestNeeded = 0; |
632 | 635 |
633 // Determine highest needed receive frequency | 636 // Determine highest needed receive frequency |
634 int32_t receiveFrequency = audio_coding_->ReceiveFrequency(); | 637 int32_t receiveFrequency = audio_coding_->ReceiveFrequency(); |
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3548 int64_t min_rtt = 0; | 3551 int64_t min_rtt = 0; |
3549 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3552 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3550 0) { | 3553 0) { |
3551 return 0; | 3554 return 0; |
3552 } | 3555 } |
3553 return rtt; | 3556 return rtt; |
3554 } | 3557 } |
3555 | 3558 |
3556 } // namespace voe | 3559 } // namespace voe |
3557 } // namespace webrtc | 3560 } // namespace webrtc |
OLD | NEW |