mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00
m122 merge fixes
This commit is contained in:
parent
c37ca3fc86
commit
5b1a8a189a
7 changed files with 33 additions and 32 deletions
|
@ -104,7 +104,6 @@ void PacketBuffer::Flush() {
|
||||||
<< ", num_gaps_below_40ms=" << num_gaps_below_40ms
|
<< ", num_gaps_below_40ms=" << num_gaps_below_40ms
|
||||||
<< ", num_gaps_above_90ms=" << num_gaps_above_90ms
|
<< ", num_gaps_above_90ms=" << num_gaps_above_90ms
|
||||||
<< ", num_no_packet_info=" << num_no_packet_info;
|
<< ", num_no_packet_info=" << num_no_packet_info;
|
||||||
|
|
||||||
}
|
}
|
||||||
buffer_.clear();
|
buffer_.clear();
|
||||||
stats_->FlushedPacketBuffer();
|
stats_->FlushedPacketBuffer();
|
||||||
|
@ -129,9 +128,12 @@ int PacketBuffer::InsertPacket(Packet&& packet) {
|
||||||
|
|
||||||
if (buffer_.size() >= max_number_of_packets_) {
|
if (buffer_.size() >= max_number_of_packets_) {
|
||||||
// Buffer is full.
|
// Buffer is full.
|
||||||
|
// RingRTC change to log more information around audio jitter buffer flushes
|
||||||
|
size_t buffer_size_before_flush = buffer_.size();
|
||||||
Flush();
|
Flush();
|
||||||
return_val = kFlushed;
|
return_val = kFlushed;
|
||||||
RTC_LOG(LS_WARNING) << "Packet buffer flushed.";
|
RTC_LOG(LS_WARNING) << "Packet buffer flushed"
|
||||||
|
<< ", packets discarded=" << buffer_size_before_flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get an iterator pointing to the place in the buffer where the new packet
|
// Get an iterator pointing to the place in the buffer where the new packet
|
||||||
|
|
|
@ -332,7 +332,8 @@ class TurnPort;
|
||||||
// Performs the allocation of ports, in a sequenced (timed) manner, for a given
|
// Performs the allocation of ports, in a sequenced (timed) manner, for a given
|
||||||
// network and IP address.
|
// network and IP address.
|
||||||
// This class is thread-compatible.
|
// This class is thread-compatible.
|
||||||
class AllocationSequence {
|
// RingRTC change to support ICE forking
|
||||||
|
class AllocationSequence : public sigslot::has_slots<> {
|
||||||
public:
|
public:
|
||||||
enum State {
|
enum State {
|
||||||
kInit, // Initial state.
|
kInit, // Initial state.
|
||||||
|
|
|
@ -248,7 +248,7 @@ PeerConnectionFactory::CreatePeerConnectionOrError(
|
||||||
// RingRTC change to control whether PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS
|
// RingRTC change to control whether PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS
|
||||||
// is enabled.
|
// is enabled.
|
||||||
uint32_t port_allocator_flags = configuration.port_allocator_config.flags;
|
uint32_t port_allocator_flags = configuration.port_allocator_config.flags;
|
||||||
if (trials->IsEnabled("RingRTC-AnyAddressPortsKillSwitch")) {
|
if (env.field_trials().IsEnabled("RingRTC-AnyAddressPortsKillSwitch")) {
|
||||||
port_allocator_flags &= ~cricket::PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS;
|
port_allocator_flags &= ~cricket::PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS;
|
||||||
}
|
}
|
||||||
dependencies.allocator->set_flags(
|
dependencies.allocator->set_flags(
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "p2p/client/basic_port_allocator.h"
|
#include "p2p/client/basic_port_allocator.h"
|
||||||
#include "rffi/api/network.h"
|
#include "rffi/api/network.h"
|
||||||
#include "rtc_base/ip_address.h"
|
#include "rtc_base/ip_address.h"
|
||||||
|
#include "rtc_base/network/received_packet.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -67,8 +68,10 @@ class InjectableUdpSocket : public rtc::AsyncPacketSocket {
|
||||||
RTC_LOG(LS_VERBOSE) << "InjectableUdpSocket::ReceiveFrom()"
|
RTC_LOG(LS_VERBOSE) << "InjectableUdpSocket::ReceiveFrom()"
|
||||||
<< " from " << remote_address.ToString()
|
<< " from " << remote_address.ToString()
|
||||||
<< " to " << local_address_.ToString();
|
<< " to " << local_address_.ToString();
|
||||||
auto now = rtc::TimeMicros();
|
NotifyPacketReceived(rtc::ReceivedPacket::CreateFromLegacy(reinterpret_cast<const char*>(data),
|
||||||
SignalReadPacket(this, reinterpret_cast<const char*>(data), data_size, remote_address, now);
|
data_size,
|
||||||
|
rtc::TimeMicros(),
|
||||||
|
remote_address));
|
||||||
}
|
}
|
||||||
|
|
||||||
// As rtc::AsyncPacketSocket
|
// As rtc::AsyncPacketSocket
|
||||||
|
@ -380,6 +383,3 @@ RUSTEXPORT void Rust_InjectableNetwork_ReceiveUdp(
|
||||||
} // namespace rffi
|
} // namespace rffi
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "api/create_peerconnection_factory.h"
|
#include "api/create_peerconnection_factory.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
#include "api/enable_media.h"
|
||||||
#include "api/task_queue/default_task_queue_factory.h"
|
#include "api/task_queue/default_task_queue_factory.h"
|
||||||
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
||||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||||
|
@ -16,7 +16,6 @@
|
||||||
#include "api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter.h"
|
#include "api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter.h"
|
||||||
#include "api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter.h"
|
#include "api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter.h"
|
||||||
#include "media/engine/simulcast_encoder_adapter.h"
|
#include "media/engine/simulcast_encoder_adapter.h"
|
||||||
#include "media/engine/webrtc_media_engine.h"
|
|
||||||
#include "modules/audio_mixer/audio_mixer_impl.h"
|
#include "modules/audio_mixer/audio_mixer_impl.h"
|
||||||
#include "modules/audio_device/dummy/file_audio_device_factory.h"
|
#include "modules/audio_device/dummy/file_audio_device_factory.h"
|
||||||
#include "modules/audio_processing/include/audio_processing.h"
|
#include "modules/audio_processing/include/audio_processing.h"
|
||||||
|
@ -118,10 +117,7 @@ class PeerConnectionFactoryWithOwnedThreads
|
||||||
dependencies.worker_thread = worker_thread.get();
|
dependencies.worker_thread = worker_thread.get();
|
||||||
dependencies.signaling_thread = signaling_thread.get();
|
dependencies.signaling_thread = signaling_thread.get();
|
||||||
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
dependencies.call_factory = CreateCallFactory();
|
dependencies.event_log_factory = std::make_unique<RtcEventLogFactory>();
|
||||||
dependencies.event_log_factory = std::make_unique<RtcEventLogFactory>(dependencies.task_queue_factory.get());
|
|
||||||
cricket::MediaEngineDependencies media_dependencies;
|
|
||||||
media_dependencies.task_queue_factory = dependencies.task_queue_factory.get();
|
|
||||||
|
|
||||||
#if defined(WEBRTC_WIN)
|
#if defined(WEBRTC_WIN)
|
||||||
std::unique_ptr<ScopedCOMInitializer> com_initializer;
|
std::unique_ptr<ScopedCOMInitializer> com_initializer;
|
||||||
|
@ -149,9 +145,10 @@ class PeerConnectionFactoryWithOwnedThreads
|
||||||
AudioDeviceModule::kPlatformDefaultAudio, dependencies.task_queue_factory.get());
|
AudioDeviceModule::kPlatformDefaultAudio, dependencies.task_queue_factory.get());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
media_dependencies.adm = adm;
|
|
||||||
media_dependencies.audio_encoder_factory = CreateBuiltinAudioEncoderFactory();
|
dependencies.adm = adm;
|
||||||
media_dependencies.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
|
dependencies.audio_encoder_factory = CreateBuiltinAudioEncoderFactory();
|
||||||
|
dependencies.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
|
||||||
|
|
||||||
AudioProcessing::Config config;
|
AudioProcessing::Config config;
|
||||||
config.high_pass_filter.enabled = audio_config.high_pass_filter_enabled;
|
config.high_pass_filter.enabled = audio_config.high_pass_filter_enabled;
|
||||||
|
@ -159,17 +156,18 @@ class PeerConnectionFactoryWithOwnedThreads
|
||||||
config.noise_suppression.enabled = audio_config.ns_enabled;
|
config.noise_suppression.enabled = audio_config.ns_enabled;
|
||||||
config.gain_controller1.enabled = audio_config.agc_enabled;
|
config.gain_controller1.enabled = audio_config.agc_enabled;
|
||||||
|
|
||||||
media_dependencies.audio_processing = AudioProcessingBuilder()
|
dependencies.audio_processing = AudioProcessingBuilder()
|
||||||
.SetConfig(config)
|
.SetConfig(config)
|
||||||
.Create();
|
.Create();
|
||||||
|
dependencies.audio_mixer = AudioMixerImpl::Create();
|
||||||
|
|
||||||
media_dependencies.audio_mixer = AudioMixerImpl::Create();
|
dependencies.video_encoder_factory =
|
||||||
media_dependencies.video_encoder_factory =
|
|
||||||
std::make_unique<RingRTCVideoEncoderFactory>();
|
std::make_unique<RingRTCVideoEncoderFactory>();
|
||||||
media_dependencies.video_decoder_factory =
|
dependencies.video_decoder_factory =
|
||||||
std::make_unique<VideoDecoderFactoryTemplate<
|
std::make_unique<VideoDecoderFactoryTemplate<
|
||||||
LibvpxVp8DecoderTemplateAdapter, LibvpxVp9DecoderTemplateAdapter>>();
|
LibvpxVp8DecoderTemplateAdapter, LibvpxVp9DecoderTemplateAdapter>>();
|
||||||
dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_dependencies));
|
|
||||||
|
EnableMedia(dependencies);
|
||||||
|
|
||||||
auto factory = CreateModularPeerConnectionFactory(std::move(dependencies));
|
auto factory = CreateModularPeerConnectionFactory(std::move(dependencies));
|
||||||
return rtc::make_ref_counted<PeerConnectionFactoryWithOwnedThreads>(
|
return rtc::make_ref_counted<PeerConnectionFactoryWithOwnedThreads>(
|
||||||
|
|
|
@ -42,7 +42,7 @@ void StatsObserverRffi::OnStatsDelivered(const rtc::scoped_refptr<const RTCStats
|
||||||
audio_sender.packets_sent = stat->packets_sent.ValueOrDefault(0);
|
audio_sender.packets_sent = stat->packets_sent.ValueOrDefault(0);
|
||||||
audio_sender.bytes_sent = stat->bytes_sent.ValueOrDefault(0);
|
audio_sender.bytes_sent = stat->bytes_sent.ValueOrDefault(0);
|
||||||
|
|
||||||
if (stat->remote_id.is_defined()) {
|
if (stat->remote_id.has_value()) {
|
||||||
auto remote_stat = report->GetAs<RTCRemoteInboundRtpStreamStats>(*stat->remote_id);
|
auto remote_stat = report->GetAs<RTCRemoteInboundRtpStreamStats>(*stat->remote_id);
|
||||||
if (remote_stat) {
|
if (remote_stat) {
|
||||||
audio_sender.remote_packets_lost = remote_stat->packets_lost.ValueOrDefault(0);
|
audio_sender.remote_packets_lost = remote_stat->packets_lost.ValueOrDefault(0);
|
||||||
|
@ -51,7 +51,7 @@ void StatsObserverRffi::OnStatsDelivered(const rtc::scoped_refptr<const RTCStats
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stat->media_source_id.is_defined()) {
|
if (stat->media_source_id.has_value()) {
|
||||||
auto audio_source_stat = report->GetAs<RTCAudioSourceStats>(*stat->media_source_id);
|
auto audio_source_stat = report->GetAs<RTCAudioSourceStats>(*stat->media_source_id);
|
||||||
if (audio_source_stat) {
|
if (audio_source_stat) {
|
||||||
audio_sender.total_audio_energy = audio_source_stat->total_audio_energy.ValueOrDefault(0.0);
|
audio_sender.total_audio_energy = audio_source_stat->total_audio_energy.ValueOrDefault(0.0);
|
||||||
|
@ -75,7 +75,7 @@ void StatsObserverRffi::OnStatsDelivered(const rtc::scoped_refptr<const RTCStats
|
||||||
video_sender.total_packet_send_delay = stat->total_packet_send_delay.ValueOrDefault(0.0);
|
video_sender.total_packet_send_delay = stat->total_packet_send_delay.ValueOrDefault(0.0);
|
||||||
video_sender.nack_count = stat->nack_count.ValueOrDefault(0);
|
video_sender.nack_count = stat->nack_count.ValueOrDefault(0);
|
||||||
video_sender.pli_count = stat->pli_count.ValueOrDefault(0);
|
video_sender.pli_count = stat->pli_count.ValueOrDefault(0);
|
||||||
if (stat->quality_limitation_reason.is_defined()) {
|
if (stat->quality_limitation_reason.has_value()) {
|
||||||
// "none" = 0 (the default)
|
// "none" = 0 (the default)
|
||||||
if (*stat->quality_limitation_reason == "cpu") {
|
if (*stat->quality_limitation_reason == "cpu") {
|
||||||
video_sender.quality_limitation_reason = 1;
|
video_sender.quality_limitation_reason = 1;
|
||||||
|
@ -87,7 +87,7 @@ void StatsObserverRffi::OnStatsDelivered(const rtc::scoped_refptr<const RTCStats
|
||||||
}
|
}
|
||||||
video_sender.quality_limitation_resolution_changes = stat->quality_limitation_resolution_changes.ValueOrDefault(0);
|
video_sender.quality_limitation_resolution_changes = stat->quality_limitation_resolution_changes.ValueOrDefault(0);
|
||||||
|
|
||||||
if (stat->remote_id.is_defined()) {
|
if (stat->remote_id.has_value()) {
|
||||||
auto remote_stat = report->GetAs<RTCRemoteInboundRtpStreamStats>(*stat->remote_id);
|
auto remote_stat = report->GetAs<RTCRemoteInboundRtpStreamStats>(*stat->remote_id);
|
||||||
if (remote_stat) {
|
if (remote_stat) {
|
||||||
video_sender.remote_packets_lost = remote_stat->packets_lost.ValueOrDefault(0);
|
video_sender.remote_packets_lost = remote_stat->packets_lost.ValueOrDefault(0);
|
||||||
|
|
|
@ -905,7 +905,7 @@ int VideoReceiveStream2::DecodeAndMaybeDispatchEncodedFrame(
|
||||||
if (decode_result < WEBRTC_VIDEO_CODEC_OK) {
|
if (decode_result < WEBRTC_VIDEO_CODEC_OK) {
|
||||||
// Asynchronous decoders may delay error reporting, potentially resulting in
|
// Asynchronous decoders may delay error reporting, potentially resulting in
|
||||||
// error reports reflecting issues that occurred several frames back.
|
// error reports reflecting issues that occurred several frames back.
|
||||||
RTC_LOG(LS_WARNING)
|
RTC_LOG(LS_INFO)
|
||||||
<< "Failed to decode frame. Return code: " << decode_result
|
<< "Failed to decode frame. Return code: " << decode_result
|
||||||
<< ", SSRC: " << remote_ssrc()
|
<< ", SSRC: " << remote_ssrc()
|
||||||
<< ", frame RTP timestamp: " << frame_ptr->RtpTimestamp()
|
<< ", frame RTP timestamp: " << frame_ptr->RtpTimestamp()
|
||||||
|
|
Loading…
Reference in a new issue