/* * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
// The RTP/RTCP module needs to know the RTP timestamp rate (i.e. clockrate) // as well as some other things, so we collect this info and send it along.
rtp_rtcp_->RegisterSendPayloadFrequency(payload_type,
encoder->RtpTimestampRateHz());
rtp_sender_audio_.RegisterAudioPayload("audio", payload_type,
encoder->RtpTimestampRateHz(),
encoder->NumChannels(), 0);
audio_coding_->SetEncoder(std::move(encoder));
}
bool AudioEgress::StartSend() { if (!GetEncoderFormat()) {
RTC_DLOG(LS_WARNING) << "Send codec has not been set yet"; returnfalse;
}
rtp_rtcp_->SetSendingMediaStatus(true); returntrue;
}
// This call will trigger AudioPacketizationCallback::SendData if // encoding is done and payload is ready for packetization and // transmission. Otherwise, it will return without invoking the // callback. if (audio_coding_->Add10MsData(*audio_frame) < 0) {
RTC_DLOG(LS_ERROR) << "ACM::Add10MsData() failed."; return;
}
// Currently we don't get a capture time from downstream modules (ADM, // AudioTransportImpl). // TODO(natim@webrtc.org): Integrate once it's ready.
constexpr uint32_t kUndefinedCaptureTime = -1;
// Push data from ACM to RTP/RTCP-module to deliver audio frame for // packetization. if (!rtp_rtcp_->OnSendingRtpFrame(timestamp, kUndefinedCaptureTime,
payload_type, /*force_sender_report=*/false)) { return -1;
}
// This call will trigger Transport::SendPacket() from the RTP/RTCP module. if (!rtp_sender_audio_.SendAudio({.type = frame_type,
.payload = payload,
.payload_id = payload_type,
.rtp_timestamp = rtp_timestamp})) {
RTC_DLOG(LS_ERROR)
<< "AudioEgress::SendData() failed to send data to RTP/RTCP module"; return -1;
}
return 0;
}
void AudioEgress::RegisterTelephoneEventType(int rtp_payload_type, int sample_rate_hz) {
RTC_DCHECK_GE(rtp_payload_type, 0);
RTC_DCHECK_LE(rtp_payload_type, 127);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.