| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #include "audio/channel_send.h" |
| 12 |
| 13 | #include <algorithm> |
| 14 | #include <map> |
| 15 | #include <memory> |
| 16 | #include <string> |
| 17 | #include <utility> |
| 18 | #include <vector> |
| 19 |
| 20 | #include "api/array_view.h" |
| 21 | #include "api/call/transport.h" |
| 22 | #include "api/crypto/frame_encryptor_interface.h" |
| 23 | #include "api/rtc_event_log/rtc_event_log.h" |
| 24 | #include "api/sequence_checker.h" |
| 25 | #include "audio/channel_send_frame_transformer_delegate.h" |
| 26 | #include "audio/utility/audio_frame_operations.h" |
| 27 | #include "call/rtp_transport_controller_send_interface.h" |
| 28 | #include "logging/rtc_event_log/events/rtc_event_audio_playout.h" |
| 29 | #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h" |
| 30 | #include "modules/audio_coding/include/audio_coding_module.h" |
| 31 | #include "modules/audio_processing/rms_level.h" |
| 32 | #include "modules/pacing/packet_router.h" |
| 33 | #include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h" |
| 34 | #include "rtc_base/checks.h" |
| 35 | #include "rtc_base/event.h" |
| 36 | #include "rtc_base/logging.h" |
| 37 | #include "rtc_base/numerics/safe_conversions.h" |
| 38 | #include "rtc_base/race_checker.h" |
| 39 | #include "rtc_base/rate_limiter.h" |
| 40 | #include "rtc_base/strings/string_builder.h" |
| 41 | #include "rtc_base/synchronization/mutex.h" |
| 42 | #include "rtc_base/system/no_unique_address.h" |
| 43 | #include "rtc_base/time_utils.h" |
| 44 | #include "rtc_base/trace_event.h" |
| 45 | #include "system_wrappers/include/clock.h" |
| 46 | #include "system_wrappers/include/metrics.h" |
| 47 |
| 48 | namespace webrtc { |
| 49 | namespace voe { |
| 50 |
| 51 | namespace { |
| 52 |
| 53 | constexpr int64_t kMaxRetransmissionWindowMs = 1000; |
| 54 | constexpr int64_t kMinRetransmissionWindowMs = 30; |
| 55 |
| 56 | class RtpPacketSenderProxy; |
| 57 | class TransportSequenceNumberProxy; |
| 58 |
| 59 | class ChannelSend : public ChannelSendInterface, |
| 60 | public AudioPacketizationCallback, // receive encoded |
| 61 | // packets from the ACM |
| 62 | public RtcpPacketTypeCounterObserver, |
| 63 | public ReportBlockDataObserver { |
| 64 | public: |
| 65 | ChannelSend(Clock* clock, |
| 66 | TaskQueueFactory* task_queue_factory, |
| 67 | Transport* rtp_transport, |
| 68 | RtcpRttStats* rtcp_rtt_stats, |
| 69 | RtcEventLog* rtc_event_log, |
| 70 | FrameEncryptorInterface* frame_encryptor, |
| 71 | const webrtc::CryptoOptions& crypto_options, |
| 72 | bool extmap_allow_mixed, |
| 73 | int rtcp_report_interval_ms, |
| 74 | uint32_t ssrc, |
| 75 | rtc::scoped_refptr<FrameTransformerInterface> frame_transformer, |
| 76 | RtpTransportControllerSendInterface* transport_controller, |
| 77 | const FieldTrialsView& field_trials); |
| 78 |
| 79 | ~ChannelSend() override; |
| 80 |
| 81 | // Send using this encoder, with this payload type. |
| 82 | void SetEncoder(int payload_type, |
| 83 | const SdpAudioFormat& encoder_format, |
| 84 | std::unique_ptr<AudioEncoder> encoder) override; |
| 85 | void ModifyEncoder(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> |
| 86 | modifier) override; |
| 87 | void CallEncoder(rtc::FunctionView<void(AudioEncoder*)> modifier) override; |
| 88 |
| 89 | // API methods |
| 90 | void StartSend() override; |
| 91 | void StopSend() override; |
| 92 |
| 93 | // Codecs |
| 94 | void OnBitrateAllocation(BitrateAllocationUpdate update) override; |
| 95 | int GetTargetBitrate() const override; |
| 96 |
| 97 | // Network |
| 98 | void ReceivedRTCPPacket(const uint8_t* data, size_t length) override; |
| 99 |
| 100 | // Muting, Volume and Level. |
| 101 | void SetInputMute(bool enable) override; |
| 102 |
| 103 | // Stats. |
| 104 | ANAStats GetANAStatistics() const override; |
| 105 |
| 106 | // Used by AudioSendStream. |
| 107 | RtpRtcpInterface* GetRtpRtcp() const override; |
| 108 |
| 109 | void RegisterCngPayloadType(int payload_type, int payload_frequency) override; |
| 110 |
| 111 | // DTMF. |
| 112 | bool SendTelephoneEventOutband(int event, int duration_ms) override; |
| 113 | void SetSendTelephoneEventPayloadType(int payload_type, |
| 114 | int payload_frequency) override; |
| 115 |
| 116 | // RTP+RTCP |
| 117 | void SetSendAudioLevelIndicationStatus(bool enable, int id) override; |
| 118 |
| 119 | void RegisterSenderCongestionControlObjects( |
| 120 | RtpTransportControllerSendInterface* transport) override; |
| 121 | void ResetSenderCongestionControlObjects() override; |
| 122 | void SetRTCP_CNAME(absl::string_view c_name) override; |
| 123 | std::vector<ReportBlockData> GetRemoteRTCPReportBlocks() const override; |
| 124 | CallSendStatistics GetRTCPStatistics() const override; |
| 125 |
| 126 | // ProcessAndEncodeAudio() posts a task on the shared encoder task queue, |
| 127 | // which in turn calls (on the queue) ProcessAndEncodeAudioOnTaskQueue() where |
| 128 | // the actual processing of the audio takes place. The processing mainly |
| 129 | // consists of encoding and preparing the result for sending by adding it to a |
| 130 | // send queue. |
| 131 | // The main reason for using a task queue here is to release the native, |
| 132 | // OS-specific, audio capture thread as soon as possible to ensure that it |
| 133 | // can go back to sleep and be prepared to deliver an new captured audio |
| 134 | // packet. |
| 135 | void ProcessAndEncodeAudio(std::unique_ptr<AudioFrame> audio_frame) override; |
| 136 |
| 137 | int64_t GetRTT() const override; |
| 138 |
| 139 | // E2EE Custom Audio Frame Encryption |
| 140 | void SetFrameEncryptor( |
| 141 | rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) override; |
| 142 |
| 143 | // Sets a frame transformer between encoder and packetizer, to transform |
| 144 | // encoded frames before sending them out the network. |
| 145 | void SetEncoderToPacketizerFrameTransformer( |
| 146 | rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) |
| 147 | override; |
| 148 |
| 149 | // RtcpPacketTypeCounterObserver. |
| 150 | void RtcpPacketTypesCounterUpdated( |
| 151 | uint32_t ssrc, |
| 152 | const RtcpPacketTypeCounter& packet_counter) override; |
| 153 |
| 154 | // ReportBlockDataObserver. |
| 155 | void OnReportBlockDataUpdated(ReportBlockData report_block) override; |
| 156 |
| 157 | private: |
| 158 | // From AudioPacketizationCallback in the ACM |
| 159 | int32_t SendData(AudioFrameType frameType, |
| 160 | uint8_t payloadType, |
| 161 | uint32_t rtp_timestamp, |
| 162 | const uint8_t* payloadData, |
| 163 | size_t payloadSize, |
| 164 | int64_t absolute_capture_timestamp_ms) override; |
| 165 |
| 166 | bool InputMute() const; |
| 167 |
| 168 | int32_t SendRtpAudio(AudioFrameType frameType, |
| 169 | uint8_t payloadType, |
| 170 | uint32_t rtp_timestamp_without_offset, |
| 171 | rtc::ArrayView<const uint8_t> payload, |
| 172 | int64_t absolute_capture_timestamp_ms, |
| 173 | rtc::ArrayView<const uint32_t> csrcs) |
| 174 | RTC_RUN_ON(encoder_queue_checker_); |
| 175 |
| 176 | void OnReceivedRtt(int64_t rtt_ms); |
| 177 |
| 178 | void InitFrameTransformerDelegate( |
| 179 | rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer); |
| 180 |
| 181 | // Thread checkers document and lock usage of some methods on voe::Channel to |
| 182 | // specific threads we know about. The goal is to eventually split up |
| 183 | // voe::Channel into parts with single-threaded semantics, and thereby reduce |
| 184 | // the need for locks. |
| 185 | RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_thread_checker_; |
| 186 | // Methods accessed from audio and video threads are checked for sequential- |
| 187 | // only access. We don't necessarily own and control these threads, so thread |
| 188 | // checkers cannot be used. E.g. Chromium may transfer "ownership" from one |
| 189 | // audio thread to another, but access is still sequential. |
| 190 | rtc::RaceChecker audio_thread_race_checker_; |
| 191 |
| 192 | mutable Mutex volume_settings_mutex_; |
| 193 |
| 194 | const uint32_t ssrc_; |
| 195 | bool sending_ RTC_GUARDED_BY(&worker_thread_checker_) = false; |
| 196 |
| 197 | RtcEventLog* const event_log_; |
| 198 |
| 199 | std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_; |
| 200 | std::unique_ptr<RTPSenderAudio> rtp_sender_audio_; |
| 201 |
| 202 | std::unique_ptr<AudioCodingModule> audio_coding_; |
| 203 |
| 204 | // This is just an offset, RTP module will add its own random offset. |
| 205 | uint32_t timestamp_ RTC_GUARDED_BY(audio_thread_race_checker_) = 0; |
| 206 | absl::optional<int64_t> last_capture_timestamp_ms_ |
| 207 | RTC_GUARDED_BY(audio_thread_race_checker_); |
| 208 |
| 209 | RmsLevel rms_level_ RTC_GUARDED_BY(encoder_queue_checker_); |
| 210 | bool input_mute_ RTC_GUARDED_BY(volume_settings_mutex_) = false; |
| 211 | bool previous_frame_muted_ RTC_GUARDED_BY(encoder_queue_checker_) = false; |
| 212 |
| 213 | PacketRouter* packet_router_ RTC_GUARDED_BY(&worker_thread_checker_) = |
| 214 | nullptr; |
| 215 | const std::unique_ptr<RtpPacketSenderProxy> rtp_packet_pacer_proxy_; |
| 216 | const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
| 217 |
| 218 | RTC_NO_UNIQUE_ADDRESS SequenceChecker construction_thread_; |
| 219 |
| 220 | std::atomic<bool> include_audio_level_indication_ = false; |
| 221 | std::atomic<bool> encoder_queue_is_active_ = false; |
| 222 | std::atomic<bool> first_frame_ = true; |
| 223 |
| 224 | // E2EE Audio Frame Encryption |
| 225 | rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_ |
| 226 | RTC_GUARDED_BY(encoder_queue_checker_); |
| 227 | // E2EE Frame Encryption Options |
| 228 | const webrtc::CryptoOptions crypto_options_; |
| 229 |
| 230 | // Delegates calls to a frame transformer to transform audio, and |
| 231 | // receives callbacks with the transformed frames; delegates calls to |
| 232 | // ChannelSend::SendRtpAudio to send the transformed audio. |
| 233 | rtc::scoped_refptr<ChannelSendFrameTransformerDelegate> |
| 234 | frame_transformer_delegate_ RTC_GUARDED_BY(encoder_queue_checker_); |
| 235 |
| 236 | mutable Mutex rtcp_counter_mutex_; |
| 237 | RtcpPacketTypeCounter rtcp_packet_type_counter_ |
| 238 | RTC_GUARDED_BY(rtcp_counter_mutex_); |
| 239 |
| 240 | std::unique_ptr<TaskQueueBase, TaskQueueDeleter> encoder_queue_; |
| 241 | RTC_NO_UNIQUE_ADDRESS SequenceChecker encoder_queue_checker_; |
| 242 |
| 243 | SdpAudioFormat encoder_format_; |
| 244 | }; |
| 245 |
| 246 | const int kTelephoneEventAttenuationdB = 10; |
| 247 |
| 248 | class RtpPacketSenderProxy : public RtpPacketSender { |
| 249 | public: |
| 250 | RtpPacketSenderProxy() : rtp_packet_pacer_(nullptr) {} |
| 251 |
| 252 | void SetPacketPacer(RtpPacketSender* rtp_packet_pacer) { |
| 253 | RTC_DCHECK(thread_checker_.IsCurrent()); |
| 254 | MutexLock lock(&mutex_); |
| 255 | rtp_packet_pacer_ = rtp_packet_pacer; |
| 256 | } |
| 257 |
| 258 | void EnqueuePackets( |
| 259 | std::vector<std::unique_ptr<RtpPacketToSend>> packets) override { |
| 260 | MutexLock lock(&mutex_); |
| 261 | rtp_packet_pacer_->EnqueuePackets(std::move(packets)); |
| 262 | } |
| 263 |
| 264 | void RemovePacketsForSsrc(uint32_t ssrc) override { |
| 265 | MutexLock lock(&mutex_); |
| 266 | rtp_packet_pacer_->RemovePacketsForSsrc(ssrc); |
| 267 | } |
| 268 |
| 269 | private: |
| 270 | RTC_NO_UNIQUE_ADDRESS SequenceChecker thread_checker_; |
| 271 | Mutex mutex_; |
| 272 | RtpPacketSender* rtp_packet_pacer_ RTC_GUARDED_BY(&mutex_); |
| 273 | }; |
| 274 |
| 275 | int32_t ChannelSend::SendData(AudioFrameType frameType, |
| 276 | uint8_t payloadType, |
| 277 | uint32_t rtp_timestamp, |
| 278 | const uint8_t* payloadData, |
| 279 | size_t payloadSize, |
| 280 | int64_t absolute_capture_timestamp_ms) { |
| 281 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 282 | rtc::ArrayView<const uint8_t> payload(payloadData, payloadSize); |
| 283 | if (frame_transformer_delegate_) { |
| 284 | // Asynchronously transform the payload before sending it. After the payload |
| 285 | // is transformed, the delegate will call SendRtpAudio to send it. |
| 286 | char buf[1024]; |
| 287 | rtc::SimpleStringBuilder mime_type(buf); |
| 288 | mime_type << MediaTypeToString(cricket::MEDIA_TYPE_AUDIO) << "/" |
| 289 | << encoder_format_.name; |
| 290 | frame_transformer_delegate_->Transform( |
| 291 | frameType, payloadType, rtp_timestamp + rtp_rtcp_->StartTimestamp(), |
| 292 | payloadData, payloadSize, absolute_capture_timestamp_ms, |
| 293 | rtp_rtcp_->SSRC(), mime_type.str()); |
| 294 | return 0; |
| 295 | } |
| 296 | return SendRtpAudio(frameType, payloadType, rtp_timestamp, payload, |
| 297 | absolute_capture_timestamp_ms, /*csrcs=*/{}); |
| 298 | } |
| 299 |
| 300 | int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType, |
| 301 | uint8_t payloadType, |
| 302 | uint32_t rtp_timestamp_without_offset, |
| 303 | rtc::ArrayView<const uint8_t> payload, |
| 304 | int64_t absolute_capture_timestamp_ms, |
| 305 | rtc::ArrayView<const uint32_t> csrcs) { |
| 306 | // E2EE Custom Audio Frame Encryption (This is optional). |
| 307 | // Keep this buffer around for the lifetime of the send call. |
| 308 | rtc::Buffer encrypted_audio_payload; |
| 309 | // We don't invoke encryptor if payload is empty, which means we are to send |
| 310 | // DTMF, or the encoder entered DTX. |
| 311 | // TODO(minyue): see whether DTMF packets should be encrypted or not. In |
| 312 | // current implementation, they are not. |
| 313 | if (!payload.empty()) { |
| 314 | if (frame_encryptor_ != nullptr) { |
| 315 | // TODO(benwright@webrtc.org) - Allocate enough to always encrypt inline. |
| 316 | // Allocate a buffer to hold the maximum possible encrypted payload. |
| 317 | size_t max_ciphertext_size = frame_encryptor_->GetMaxCiphertextByteSize( |
| 318 | cricket::MEDIA_TYPE_AUDIO, payload.size()); |
| 319 | encrypted_audio_payload.SetSize(max_ciphertext_size); |
| 320 |
| 321 | // Encrypt the audio payload into the buffer. |
| 322 | size_t bytes_written = 0; |
| 323 | int encrypt_status = frame_encryptor_->Encrypt( |
| 324 | cricket::MEDIA_TYPE_AUDIO, rtp_rtcp_->SSRC(), |
| 325 | /*additional_data=*/nullptr, payload, encrypted_audio_payload, |
| 326 | &bytes_written); |
| 327 | if (encrypt_status != 0) { |
| 328 | RTC_DLOG(LS_ERROR) |
| 329 | << "Channel::SendData() failed encrypt audio payload: " |
| 330 | << encrypt_status; |
| 331 | return -1; |
| 332 | } |
| 333 | // Resize the buffer to the exact number of bytes actually used. |
| 334 | encrypted_audio_payload.SetSize(bytes_written); |
| 335 | // Rewrite the payloadData and size to the new encrypted payload. |
| 336 | payload = encrypted_audio_payload; |
| 337 | } else if (crypto_options_.sframe.require_frame_encryption) { |
| 338 | RTC_DLOG(LS_ERROR) << "Channel::SendData() failed sending audio payload: " |
| 339 | "A frame encryptor is required but one is not set."; |
| 340 | return -1; |
| 341 | } |
| 342 | } |
| 343 |
| 344 | // Push data from ACM to RTP/RTCP-module to deliver audio frame for |
| 345 | // packetization. |
| 346 | if (!rtp_rtcp_->OnSendingRtpFrame(rtp_timestamp_without_offset, |
| 347 | // Leaving the time when this frame was |
| 348 | // received from the capture device as |
| 349 | // undefined for voice for now. |
| 350 | -1, payloadType, |
| 351 | /*force_sender_report=*/false)) { |
| 352 | return -1; |
| 353 | } |
| 354 |
| 355 | // RTCPSender has it's own copy of the timestamp offset, added in |
| 356 | // RTCPSender::BuildSR, hence we must not add the in the offset for the above |
| 357 | // call. |
| 358 | // TODO(nisse): Delete RTCPSender:timestamp_offset_, and see if we can confine |
| 359 | // knowledge of the offset to a single place. |
| 360 |
| 361 | // This call will trigger Transport::SendPacket() from the RTP/RTCP module. |
| 362 | RTPSenderAudio::RtpAudioFrame frame = { |
| 363 | .type = frameType, |
| 364 | .payload = payload, |
| 365 | .payload_id = payloadType, |
| 366 | .rtp_timestamp = |
| 367 | rtp_timestamp_without_offset + rtp_rtcp_->StartTimestamp(), |
| 368 | .csrcs = csrcs}; |
| 369 | if (absolute_capture_timestamp_ms > 0) { |
| 370 | frame.capture_time = Timestamp::Millis(absolute_capture_timestamp_ms); |
| 371 | } |
| 372 | if (include_audio_level_indication_.load()) { |
| 373 | frame.audio_level_dbov = rms_level_.Average(); |
| 374 | } |
| 375 | if (!rtp_sender_audio_->SendAudio(frame)) { |
| 376 | RTC_DLOG(LS_ERROR) |
| 377 | << "ChannelSend::SendData() failed to send data to RTP/RTCP module"; |
| 378 | return -1; |
| 379 | } |
| 380 |
| 381 | return 0; |
| 382 | } |
| 383 |
| 384 | ChannelSend::ChannelSend( |
| 385 | Clock* clock, |
| 386 | TaskQueueFactory* task_queue_factory, |
| 387 | Transport* rtp_transport, |
| 388 | RtcpRttStats* rtcp_rtt_stats, |
| 389 | RtcEventLog* rtc_event_log, |
| 390 | FrameEncryptorInterface* frame_encryptor, |
| 391 | const webrtc::CryptoOptions& crypto_options, |
| 392 | bool extmap_allow_mixed, |
| 393 | int rtcp_report_interval_ms, |
| 394 | uint32_t ssrc, |
| 395 | rtc::scoped_refptr<FrameTransformerInterface> frame_transformer, |
| 396 | RtpTransportControllerSendInterface* transport_controller, |
| 397 | const FieldTrialsView& field_trials) |
| 398 | : ssrc_(ssrc), |
| 399 | event_log_(rtc_event_log), |
| 400 | rtp_packet_pacer_proxy_(new RtpPacketSenderProxy()), |
| 401 | retransmission_rate_limiter_( |
| 402 | new RateLimiter(clock, kMaxRetransmissionWindowMs)), |
| 403 | frame_encryptor_(frame_encryptor), |
| 404 | crypto_options_(crypto_options), |
| 405 | encoder_queue_(task_queue_factory->CreateTaskQueue( |
| 406 | "AudioEncoder", |
| 407 | TaskQueueFactory::Priority::NORMAL)), |
| 408 | encoder_queue_checker_(encoder_queue_.get()), |
| 409 | encoder_format_("x-unknown", 0, 0) { |
| 410 | audio_coding_ = AudioCodingModule::Create(); |
| 411 |
| 412 | RtpRtcpInterface::Configuration configuration; |
| 413 | configuration.report_block_data_observer = this; |
| 414 | configuration.network_link_rtcp_observer = |
| 415 | transport_controller->GetRtcpObserver(); |
| 416 | configuration.transport_feedback_callback = |
| 417 | transport_controller->transport_feedback_observer(); |
| 418 | configuration.clock = (clock ? clock : Clock::GetRealTimeClock()); |
| 419 | configuration.audio = true; |
| 420 | configuration.outgoing_transport = rtp_transport; |
| 421 |
| 422 | configuration.paced_sender = rtp_packet_pacer_proxy_.get(); |
| 423 |
| 424 | configuration.event_log = event_log_; |
| 425 | configuration.rtt_stats = rtcp_rtt_stats; |
| 426 | if (field_trials.IsDisabled("WebRTC-DisableRtxRateLimiter")) { |
| 427 | configuration.retransmission_rate_limiter = |
| 428 | retransmission_rate_limiter_.get(); |
| 429 | } |
| 430 | configuration.extmap_allow_mixed = extmap_allow_mixed; |
| 431 | configuration.rtcp_report_interval_ms = rtcp_report_interval_ms; |
| 432 | configuration.rtcp_packet_type_counter_observer = this; |
| 433 |
| 434 | configuration.local_media_ssrc = ssrc; |
| 435 |
| 436 | rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(configuration); |
| 437 | rtp_rtcp_->SetSendingMediaStatus(false); |
| 438 |
| 439 | rtp_sender_audio_ = std::make_unique<RTPSenderAudio>(configuration.clock, |
| 440 | rtp_rtcp_->RtpSender()); |
| 441 |
| 442 | // Ensure that RTCP is enabled by default for the created channel. |
| 443 | rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound); |
| 444 |
| 445 | int error = audio_coding_->RegisterTransportCallback(this); |
| 446 | RTC_DCHECK_EQ(0, error); |
| 447 | if (frame_transformer) |
| 448 | InitFrameTransformerDelegate(std::move(frame_transformer)); |
| 449 | } |
| 450 |
| 451 | ChannelSend::~ChannelSend() { |
| 452 | RTC_DCHECK(construction_thread_.IsCurrent()); |
| 453 |
| 454 | // Resets the delegate's callback to ChannelSend::SendRtpAudio. |
| 455 | if (frame_transformer_delegate_) |
| 456 | frame_transformer_delegate_->Reset(); |
| 457 |
| 458 | StopSend(); |
| 459 | int error = audio_coding_->RegisterTransportCallback(NULL); |
| 460 | RTC_DCHECK_EQ(0, error); |
| 461 |
| 462 | // Delete the encoder task queue first to ensure that there are no running |
| 463 | // tasks when the other members are destroyed. |
| 464 | encoder_queue_ = nullptr; |
| 465 | } |
| 466 |
| 467 | void ChannelSend::StartSend() { |
| 468 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 469 | RTC_DCHECK(!sending_); |
| 470 | sending_ = true; |
| 471 |
| 472 | RTC_DCHECK(packet_router_); |
| 473 | packet_router_->AddSendRtpModule(rtp_rtcp_.get(), /*remb_candidate=*/false); |
| 474 | rtp_rtcp_->SetSendingMediaStatus(true); |
| 475 | int ret = rtp_rtcp_->SetSendingStatus(true); |
| 476 | RTC_DCHECK_EQ(0, ret); |
| 477 |
| 478 | // It is now OK to start processing on the encoder task queue. |
| 479 | first_frame_.store(true); |
| 480 | encoder_queue_is_active_.store(true); |
| 481 | } |
| 482 |
| 483 | void ChannelSend::StopSend() { |
| 484 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 485 | if (!sending_) { |
| 486 | return; |
| 487 | } |
| 488 | sending_ = false; |
| 489 | encoder_queue_is_active_.store(false); |
| 490 |
| 491 | // Wait until all pending encode tasks are executed and clear any remaining |
| 492 | // buffers in the encoder. |
| 493 | rtc::Event flush; |
| 494 | encoder_queue_->PostTask([this, &flush]() { |
| 495 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 496 | CallEncoder([](AudioEncoder* encoder) { encoder->Reset(); }); |
| 497 | flush.Set(); |
| 498 | }); |
| 499 | flush.Wait(rtc::Event::kForever); |
| 500 |
| 501 | // Reset sending SSRC and sequence number and triggers direct transmission |
| 502 | // of RTCP BYE |
| 503 | if (rtp_rtcp_->SetSendingStatus(false) == -1) { |
| 504 | RTC_DLOG(LS_ERROR) << "StartSend() RTP/RTCP failed to stop sending"; |
| 505 | } |
| 506 | rtp_rtcp_->SetSendingMediaStatus(false); |
| 507 |
| 508 | RTC_DCHECK(packet_router_); |
| 509 | packet_router_->RemoveSendRtpModule(rtp_rtcp_.get()); |
| 510 | rtp_packet_pacer_proxy_->RemovePacketsForSsrc(rtp_rtcp_->SSRC()); |
| 511 | } |
| 512 |
| 513 | void ChannelSend::SetEncoder(int payload_type, |
| 514 | const SdpAudioFormat& encoder_format, |
| 515 | std::unique_ptr<AudioEncoder> encoder) { |
| 516 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 517 | RTC_DCHECK_GE(payload_type, 0); |
| 518 | RTC_DCHECK_LE(payload_type, 127); |
| 519 |
| 520 | // The RTP/RTCP module needs to know the RTP timestamp rate (i.e. clockrate) |
| 521 | // as well as some other things, so we collect this info and send it along. |
| 522 | rtp_rtcp_->RegisterSendPayloadFrequency(payload_type, |
| 523 | encoder->RtpTimestampRateHz()); |
| 524 | rtp_sender_audio_->RegisterAudioPayload("audio", payload_type, |
| 525 | encoder->RtpTimestampRateHz(), |
| 526 | encoder->NumChannels(), 0); |
| 527 |
| 528 | encoder_format_ = encoder_format; |
| 529 | audio_coding_->SetEncoder(std::move(encoder)); |
| 530 | } |
| 531 |
| 532 | void ChannelSend::ModifyEncoder( |
| 533 | rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier) { |
| 534 | // This method can be called on the worker thread, module process thread |
| 535 | // or network thread. Audio coding is thread safe, so we do not need to |
| 536 | // enforce the calling thread. |
| 537 | audio_coding_->ModifyEncoder(modifier); |
| 538 | } |
| 539 |
| 540 | void ChannelSend::CallEncoder(rtc::FunctionView<void(AudioEncoder*)> modifier) { |
| 541 | ModifyEncoder([modifier](std::unique_ptr<AudioEncoder>* encoder_ptr) { |
| 542 | if (*encoder_ptr) { |
| 543 | modifier(encoder_ptr->get()); |
| 544 | } else { |
| 545 | RTC_DLOG(LS_WARNING) << "Trying to call unset encoder."; |
| 546 | } |
| 547 | }); |
| 548 | } |
| 549 |
| 550 | void ChannelSend::OnBitrateAllocation(BitrateAllocationUpdate update) { |
| 551 | // This method can be called on the worker thread, module process thread |
| 552 | // or on a TaskQueue via VideoSendStreamImpl::OnEncoderConfigurationChanged. |
| 553 | // TODO(solenberg): Figure out a good way to check this or enforce calling |
| 554 | // rules. |
| 555 | // RTC_DCHECK(worker_thread_checker_.IsCurrent() || |
| 556 | // module_process_thread_checker_.IsCurrent()); |
| 557 | CallEncoder([&](AudioEncoder* encoder) { |
| 558 | encoder->OnReceivedUplinkAllocation(update); |
| 559 | }); |
| 560 | retransmission_rate_limiter_->SetMaxRate(update.target_bitrate.bps()); |
| 561 | } |
| 562 |
| 563 | int ChannelSend::GetTargetBitrate() const { |
| 564 | return audio_coding_->GetTargetBitrate(); |
| 565 | } |
| 566 |
| 567 | void ChannelSend::OnReportBlockDataUpdated(ReportBlockData report_block) { |
| 568 | float packet_loss_rate = report_block.fraction_lost(); |
| 569 | CallEncoder([&](AudioEncoder* encoder) { |
| 570 | encoder->OnReceivedUplinkPacketLossFraction(packet_loss_rate); |
| 571 | }); |
| 572 | } |
| 573 |
| 574 | void ChannelSend::ReceivedRTCPPacket(const uint8_t* data, size_t length) { |
| 575 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 576 |
| 577 | // Deliver RTCP packet to RTP/RTCP module for parsing |
| 578 | rtp_rtcp_->IncomingRtcpPacket(rtc::MakeArrayView(data, length)); |
| 579 |
| 580 | int64_t rtt = GetRTT(); |
| 581 | if (rtt == 0) { |
| 582 | // Waiting for valid RTT. |
| 583 | return; |
| 584 | } |
| 585 |
| 586 | int64_t nack_window_ms = rtt; |
| 587 | if (nack_window_ms < kMinRetransmissionWindowMs) { |
| 588 | nack_window_ms = kMinRetransmissionWindowMs; |
| 589 | } else if (nack_window_ms > kMaxRetransmissionWindowMs) { |
| 590 | nack_window_ms = kMaxRetransmissionWindowMs; |
| 591 | } |
| 592 | retransmission_rate_limiter_->SetWindowSize(nack_window_ms); |
| 593 |
| 594 | OnReceivedRtt(rtt); |
| 595 | } |
| 596 |
| 597 | void ChannelSend::SetInputMute(bool enable) { |
| 598 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 599 | MutexLock lock(&volume_settings_mutex_); |
| 600 | input_mute_ = enable; |
| 601 | } |
| 602 |
| 603 | bool ChannelSend::InputMute() const { |
| 604 | MutexLock lock(&volume_settings_mutex_); |
| 605 | return input_mute_; |
| 606 | } |
| 607 |
| 608 | bool ChannelSend::SendTelephoneEventOutband(int event, int duration_ms) { |
| 609 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 610 | RTC_DCHECK_LE(0, event); |
| 611 | RTC_DCHECK_GE(255, event); |
| 612 | RTC_DCHECK_LE(0, duration_ms); |
| 613 | RTC_DCHECK_GE(65535, duration_ms); |
| 614 | if (!sending_) { |
| 615 | return false; |
| 616 | } |
| 617 | if (rtp_sender_audio_->SendTelephoneEvent( |
| 618 | event, duration_ms, kTelephoneEventAttenuationdB) != 0) { |
| 619 | RTC_DLOG(LS_ERROR) << "SendTelephoneEvent() failed to send event"; |
| 620 | return false; |
| 621 | } |
| 622 | return true; |
| 623 | } |
| 624 |
| 625 | void ChannelSend::RegisterCngPayloadType(int payload_type, |
| 626 | int payload_frequency) { |
| 627 | rtp_rtcp_->RegisterSendPayloadFrequency(payload_type, payload_frequency); |
| 628 | rtp_sender_audio_->RegisterAudioPayload("CN", payload_type, payload_frequency, |
| 629 | 1, 0); |
| 630 | } |
| 631 |
| 632 | void ChannelSend::SetSendTelephoneEventPayloadType(int payload_type, |
| 633 | int payload_frequency) { |
| 634 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 635 | RTC_DCHECK_LE(0, payload_type); |
| 636 | RTC_DCHECK_GE(127, payload_type); |
| 637 | rtp_rtcp_->RegisterSendPayloadFrequency(payload_type, payload_frequency); |
| 638 | rtp_sender_audio_->RegisterAudioPayload("telephone-event", payload_type, |
| 639 | payload_frequency, 0, 0); |
| 640 | } |
| 641 |
| 642 | void ChannelSend::SetSendAudioLevelIndicationStatus(bool enable, int id) { |
| 643 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 644 | include_audio_level_indication_.store(enable); |
| 645 | if (enable) { |
| 646 | rtp_rtcp_->RegisterRtpHeaderExtension(AudioLevel::Uri(), id); |
| 647 | } else { |
| 648 | rtp_rtcp_->DeregisterSendRtpHeaderExtension(AudioLevel::Uri()); |
| 649 | } |
| 650 | } |
| 651 |
| 652 | void ChannelSend::RegisterSenderCongestionControlObjects( |
| 653 | RtpTransportControllerSendInterface* transport) { |
| 654 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 655 | RtpPacketSender* rtp_packet_pacer = transport->packet_sender(); |
| 656 | PacketRouter* packet_router = transport->packet_router(); |
| 657 |
| 658 | RTC_DCHECK(rtp_packet_pacer); |
| 659 | RTC_DCHECK(packet_router); |
| 660 | RTC_DCHECK(!packet_router_); |
| 661 | rtp_packet_pacer_proxy_->SetPacketPacer(rtp_packet_pacer); |
| 662 | rtp_rtcp_->SetStorePacketsStatus(true, 600); |
| 663 | packet_router_ = packet_router; |
| 664 | } |
| 665 |
| 666 | void ChannelSend::ResetSenderCongestionControlObjects() { |
| 667 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 668 | RTC_DCHECK(packet_router_); |
| 669 | rtp_rtcp_->SetStorePacketsStatus(false, 600); |
| 670 | packet_router_ = nullptr; |
| 671 | rtp_packet_pacer_proxy_->SetPacketPacer(nullptr); |
| 672 | } |
| 673 |
| 674 | void ChannelSend::SetRTCP_CNAME(absl::string_view c_name) { |
| 675 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 676 | // Note: SetCNAME() accepts a c string of length at most 255. |
| 677 | const std::string c_name_limited(c_name.substr(0, 255)); |
| 678 | int ret = rtp_rtcp_->SetCNAME(c_name_limited.c_str()) != 0; |
| 679 | RTC_DCHECK_EQ(0, ret) << "SetRTCP_CNAME() failed to set RTCP CNAME"; |
| 680 | } |
| 681 |
| 682 | std::vector<ReportBlockData> ChannelSend::GetRemoteRTCPReportBlocks() const { |
| 683 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 684 | // Get the report blocks from the latest received RTCP Sender or Receiver |
| 685 | // Report. Each element in the vector contains the sender's SSRC and a |
| 686 | // report block according to RFC 3550. |
| 687 | return rtp_rtcp_->GetLatestReportBlockData(); |
| 688 | } |
| 689 |
| 690 | CallSendStatistics ChannelSend::GetRTCPStatistics() const { |
| 691 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 692 | CallSendStatistics stats = {0}; |
| 693 | stats.rttMs = GetRTT(); |
| 694 |
| 695 | StreamDataCounters rtp_stats; |
| 696 | StreamDataCounters rtx_stats; |
| 697 | rtp_rtcp_->GetSendStreamDataCounters(&rtp_stats, &rtx_stats); |
| 698 | stats.payload_bytes_sent = |
| 699 | rtp_stats.transmitted.payload_bytes + rtx_stats.transmitted.payload_bytes; |
| 700 | stats.header_and_padding_bytes_sent = |
| 701 | rtp_stats.transmitted.padding_bytes + rtp_stats.transmitted.header_bytes + |
| 702 | rtx_stats.transmitted.padding_bytes + rtx_stats.transmitted.header_bytes; |
| 703 |
| 704 | // TODO(https://crbug.com/webrtc/10555): RTX retransmissions should show up in |
| 705 | // separate outbound-rtp stream objects. |
| 706 | stats.retransmitted_bytes_sent = rtp_stats.retransmitted.payload_bytes; |
| 707 | stats.packetsSent = |
| 708 | rtp_stats.transmitted.packets + rtx_stats.transmitted.packets; |
| 709 | stats.total_packet_send_delay = rtp_stats.transmitted.total_packet_delay; |
| 710 | stats.retransmitted_packets_sent = rtp_stats.retransmitted.packets; |
| 711 | stats.report_block_datas = rtp_rtcp_->GetLatestReportBlockData(); |
| 712 |
| 713 | { |
| 714 | MutexLock lock(&rtcp_counter_mutex_); |
| 715 | stats.nacks_received = rtcp_packet_type_counter_.nack_packets; |
| 716 | } |
| 717 |
| 718 | return stats; |
| 719 | } |
| 720 |
| 721 | void ChannelSend::RtcpPacketTypesCounterUpdated( |
| 722 | uint32_t ssrc, |
| 723 | const RtcpPacketTypeCounter& packet_counter) { |
| 724 | if (ssrc != ssrc_) { |
| 725 | return; |
| 726 | } |
| 727 | MutexLock lock(&rtcp_counter_mutex_); |
| 728 | rtcp_packet_type_counter_ = packet_counter; |
| 729 | } |
| 730 |
| 731 | void ChannelSend::ProcessAndEncodeAudio( |
| 732 | std::unique_ptr<AudioFrame> audio_frame) { |
| 733 | TRACE_EVENT0("webrtc", "ChannelSend::ProcessAndEncodeAudio"); |
| 734 |
| 735 | RTC_DCHECK_RUNS_SERIALIZED(&audio_thread_race_checker_); |
| 736 | RTC_DCHECK_GT(audio_frame->samples_per_channel_, 0); |
| 737 | RTC_DCHECK_LE(audio_frame->num_channels_, 8); |
| 738 |
| 739 | if (!encoder_queue_is_active_.load()) { |
| 740 | return; |
| 741 | } |
| 742 |
| 743 | // Update `timestamp_` based on the capture timestamp for the first frame |
| 744 | // after sending is resumed. |
| 745 | if (first_frame_.load()) { |
| 746 | first_frame_.store(false); |
| 747 | if (last_capture_timestamp_ms_ && |
| 748 | audio_frame->absolute_capture_timestamp_ms()) { |
| 749 | int64_t diff_ms = *audio_frame->absolute_capture_timestamp_ms() - |
| 750 | *last_capture_timestamp_ms_; |
| 751 | // Truncate to whole frames and subtract one since `timestamp_` was |
| 752 | // incremented after the last frame. |
| 753 | int64_t diff_frames = diff_ms * audio_frame->sample_rate_hz() / 1000 / |
| 754 | audio_frame->samples_per_channel() - |
| 755 | 1; |
| 756 | timestamp_ += std::max<int64_t>( |
| 757 | diff_frames * audio_frame->samples_per_channel(), 0); |
| 758 | } |
| 759 | } |
| 760 |
| 761 | audio_frame->timestamp_ = timestamp_; |
| 762 | timestamp_ += audio_frame->samples_per_channel_; |
| 763 | last_capture_timestamp_ms_ = audio_frame->absolute_capture_timestamp_ms(); |
| 764 |
| 765 | // Profile time between when the audio frame is added to the task queue and |
| 766 | // when the task is actually executed. |
| 767 | audio_frame->UpdateProfileTimeStamp(); |
| 768 | encoder_queue_->PostTask( |
| 769 | [this, audio_frame = std::move(audio_frame)]() mutable { |
| 770 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 771 | if (!encoder_queue_is_active_.load()) { |
| 772 | return; |
| 773 | } |
| 774 | // Measure time between when the audio frame is added to the task queue |
| 775 | // and when the task is actually executed. Goal is to keep track of |
| 776 | // unwanted extra latency added by the task queue. |
| 777 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Audio.EncodingTaskQueueLatencyMs", |
| 778 | audio_frame->ElapsedProfileTimeMs()); |
| 779 |
| 780 | bool is_muted = InputMute(); |
| 781 | AudioFrameOperations::Mute(audio_frame.get(), previous_frame_muted_, |
| 782 | is_muted); |
| 783 |
| 784 | if (include_audio_level_indication_.load()) { |
| 785 | size_t length = |
| 786 | audio_frame->samples_per_channel_ * audio_frame->num_channels_; |
| 787 | RTC_CHECK_LE(length, AudioFrame::kMaxDataSizeBytes); |
| 788 | if (is_muted && previous_frame_muted_) { |
| 789 | rms_level_.AnalyzeMuted(length); |
| 790 | } else { |
| 791 | rms_level_.Analyze( |
| 792 | rtc::ArrayView<const int16_t>(audio_frame->data(), length)); |
| 793 | } |
| 794 | } |
| 795 | previous_frame_muted_ = is_muted; |
| 796 |
| 797 | // This call will trigger AudioPacketizationCallback::SendData if |
| 798 | // encoding is done and payload is ready for packetization and |
| 799 | // transmission. Otherwise, it will return without invoking the |
| 800 | // callback. |
| 801 | if (audio_coding_->Add10MsData(*audio_frame) < 0) { |
| 802 | RTC_DLOG(LS_ERROR) << "ACM::Add10MsData() failed."; |
| 803 | return; |
| 804 | } |
| 805 | }); |
| 806 | } |
| 807 |
| 808 | ANAStats ChannelSend::GetANAStatistics() const { |
| 809 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 810 | return audio_coding_->GetANAStats(); |
| 811 | } |
| 812 |
| 813 | RtpRtcpInterface* ChannelSend::GetRtpRtcp() const { |
| 814 | return rtp_rtcp_.get(); |
| 815 | } |
| 816 |
| 817 | int64_t ChannelSend::GetRTT() const { |
| 818 | std::vector<ReportBlockData> report_blocks = |
| 819 | rtp_rtcp_->GetLatestReportBlockData(); |
| 820 | if (report_blocks.empty()) { |
| 821 | return 0; |
| 822 | } |
| 823 |
| 824 | // We don't know in advance the remote ssrc used by the other end's receiver |
| 825 | // reports, so use the first report block for the RTT. |
| 826 | return report_blocks.front().last_rtt().ms(); |
| 827 | } |
| 828 |
| 829 | void ChannelSend::SetFrameEncryptor( |
| 830 | rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) { |
| 831 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 832 | encoder_queue_->PostTask([this, frame_encryptor]() mutable { |
| 833 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 834 | frame_encryptor_ = std::move(frame_encryptor); |
| 835 | }); |
| 836 | } |
| 837 |
| 838 | void ChannelSend::SetEncoderToPacketizerFrameTransformer( |
| 839 | rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) { |
| 840 | RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 841 | if (!frame_transformer) |
| 842 | return; |
| 843 |
| 844 | encoder_queue_->PostTask( |
| 845 | [this, frame_transformer = std::move(frame_transformer)]() mutable { |
| 846 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 847 | InitFrameTransformerDelegate(std::move(frame_transformer)); |
| 848 | }); |
| 849 | } |
| 850 |
| 851 | void ChannelSend::OnReceivedRtt(int64_t rtt_ms) { |
| 852 | // Invoke audio encoders OnReceivedRtt(). |
| 853 | CallEncoder( |
| 854 | [rtt_ms](AudioEncoder* encoder) { encoder->OnReceivedRtt(rtt_ms); }); |
| 855 | } |
| 856 |
| 857 | void ChannelSend::InitFrameTransformerDelegate( |
| 858 | rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) { |
| 859 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 860 | RTC_DCHECK(frame_transformer); |
| 861 | RTC_DCHECK(!frame_transformer_delegate_); |
| 862 |
| 863 | // Pass a callback to ChannelSend::SendRtpAudio, to be called by the delegate |
| 864 | // to send the transformed audio. |
| 865 | ChannelSendFrameTransformerDelegate::SendFrameCallback send_audio_callback = |
| 866 | [this](AudioFrameType frameType, uint8_t payloadType, |
| 867 | uint32_t rtp_timestamp_with_offset, |
| 868 | rtc::ArrayView<const uint8_t> payload, |
| 869 | int64_t absolute_capture_timestamp_ms, |
| 870 | rtc::ArrayView<const uint32_t> csrcs) { |
| 871 | RTC_DCHECK_RUN_ON(&encoder_queue_checker_); |
| 872 | return SendRtpAudio( |
| 873 | frameType, payloadType, |
| 874 | rtp_timestamp_with_offset - rtp_rtcp_->StartTimestamp(), payload, |
| 875 | absolute_capture_timestamp_ms, csrcs); |
| 876 | }; |
| 877 | frame_transformer_delegate_ = |
| 878 | rtc::make_ref_counted<ChannelSendFrameTransformerDelegate>( |
| 879 | std::move(send_audio_callback), std::move(frame_transformer), |
| 880 | encoder_queue_.get()); |
| 881 | frame_transformer_delegate_->Init(); |
| 882 | } |
| 883 |
| 884 | } // namespace |
| 885 |
| 886 | std::unique_ptr<ChannelSendInterface> CreateChannelSend( |
| 887 | Clock* clock, |
| 888 | TaskQueueFactory* task_queue_factory, |
| 889 | Transport* rtp_transport, |
| 890 | RtcpRttStats* rtcp_rtt_stats, |
| 891 | RtcEventLog* rtc_event_log, |
| 892 | FrameEncryptorInterface* frame_encryptor, |
| 893 | const webrtc::CryptoOptions& crypto_options, |
| 894 | bool extmap_allow_mixed, |
| 895 | int rtcp_report_interval_ms, |
| 896 | uint32_t ssrc, |
| 897 | rtc::scoped_refptr<FrameTransformerInterface> frame_transformer, |
| 898 | RtpTransportControllerSendInterface* transport_controller, |
| 899 | const FieldTrialsView& field_trials) { |
| 900 | return std::make_unique<ChannelSend>( |
| 901 | clock, task_queue_factory, rtp_transport, rtcp_rtt_stats, rtc_event_log, |
| 902 | frame_encryptor, crypto_options, extmap_allow_mixed, |
| 903 | rtcp_report_interval_ms, ssrc, std::move(frame_transformer), |
| 904 | transport_controller, field_trials); |
| 905 | } |
| 906 |
| 907 | } // namespace voe |
| 908 | } // namespace webrtc |
| 909 |