/* * 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.
*/
// AudioChannel represents a single media session and provides APIs over // AudioIngress and AudioEgress. Note that a single RTP stack is shared with // these two classes as it has both sending and receiving capabilities. class AudioChannel : public RefCountInterface { public:
AudioChannel(const Environment& env,
Transport* transport,
uint32_t local_ssrc,
AudioMixer* audio_mixer,
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory);
~AudioChannel() override;
// Set and get ChannelId that this audio channel belongs for debugging and // logging purpose. void SetId(ChannelId id) { id_ = id; }
ChannelId GetId() const { return id_; }
// APIs to start/stop audio channel on each direction. // StartSend/StartPlay returns false if encoder/decoders // have not been set, respectively. bool StartSend(); void StopSend(); bool StartPlay(); void StopPlay();
// See comments on the methods used from AudioEgress and AudioIngress. // Conversion to double is following what is done in // DoubleAudioLevelFromIntAudioLevel method in rtc_stats_collector.cc to be // consistent. double GetInputAudioLevel() const { return egress_->GetInputAudioLevel() / 32767.0;
} double GetInputTotalEnergy() const { return egress_->GetInputTotalEnergy(); } double GetInputTotalDuration() const { return egress_->GetInputTotalDuration();
} double GetOutputAudioLevel() const { return ingress_->GetOutputAudioLevel() / 32767.0;
} double GetOutputTotalEnergy() const { return ingress_->GetOutputTotalEnergy();
} double GetOutputTotalDuration() const { return ingress_->GetOutputTotalDuration();
}
// Internal API for testing purpose. void SendRTCPReportForTesting(RTCPPacketType type) {
int32_t result = rtp_rtcp_->SendRTCP(type);
RTC_DCHECK(result == 0);
}
private: // ChannelId that this audio channel belongs for logging purpose.
ChannelId id_;
// Synchronization is handled internally by AudioMixer.
AudioMixer* audio_mixer_;
// Listed in order for safe destruction of AudioChannel object. // Synchronization for these are handled internally.
std::unique_ptr<ReceiveStatistics> receive_statistics_;
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
std::unique_ptr<AudioIngress> ingress_;
std::unique_ptr<AudioEgress> egress_;
};
} // namespace webrtc
#endif// AUDIO_VOIP_AUDIO_CHANNEL_H_
Messung V0.5
¤ Dauer der Verarbeitung: 0.23 Sekunden
(vorverarbeitet)
¤
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.