/* * Copyright 2019 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.
*/
bool track_enabled = track_->internal()->enabled();
worker_thread_->BlockingCall([&]() {
RTC_DCHECK_RUN_ON(worker_thread_); // Update the cached_volume_ even when stopped, to allow clients to set // the volume before starting/restarting, eg see crbug.com/1272566.
cached_volume_ = volume; // When the track is disabled, the volume of the source, which is the // corresponding WebRtc Voice Engine channel will be 0. So we do not // allow setting the volume to the source when the track is disabled. if (track_enabled)
SetOutputVolume_w(volume);
});
}
RtpParameters AudioRtpReceiver::GetParameters() const {
RTC_DCHECK_RUN_ON(worker_thread_); if (!media_channel_) return RtpParameters(); auto current_ssrc = ssrc(); return current_ssrc.has_value()
? media_channel_->GetRtpReceiverParameters(current_ssrc.value())
: media_channel_->GetDefaultRtpReceiveParameters();
}
void AudioRtpReceiver::SetFrameDecryptor(
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor) {
RTC_DCHECK_RUN_ON(worker_thread_);
frame_decryptor_ = std::move(frame_decryptor); // Special Case: Set the frame decryptor to any value on any existing channel. if (media_channel_ && signaled_ssrc_) {
media_channel_->SetFrameDecryptor(*signaled_ssrc_, frame_decryptor_);
}
}
// Make sure the safety flag is marked as `alive` for cases where the media // channel was provided via the ctor and not an explicit call to // SetMediaChannel.
worker_thread_safety_->SetAlive();
if (state != MediaSourceInterface::kInitializing) { if (signaled_ssrc_ == ssrc) return;
source_->Stop(media_channel_, signaled_ssrc_);
}
if (signaled_ssrc_ && frame_decryptor_) { // Reattach the frame decryptor if we were reconfigured.
media_channel_->SetFrameDecryptor(*signaled_ssrc_, frame_decryptor_);
}
if (frame_transformer_) {
media_channel_->SetDepacketizerToDecoderFrameTransformer(
signaled_ssrc_.value_or(0), frame_transformer_);
}
}
void AudioRtpReceiver::SetObserver(RtpReceiverObserverInterface* observer) {
RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
observer_ = observer; // Deliver any notifications the observer may have missed by being set late. if (received_first_packet_ && observer_) {
observer_->OnFirstPacketReceived(media_type());
}
}
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.