Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions python-webrtc/cpp/src/interfaces/peer_connection_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "../utils/port_allocator.h"
#include "../utils/task_queue_factory.h"

#include <api/audio/builtin_audio_processing_builder.h>
#include <api/audio_codecs/builtin_audio_decoder_factory.h>
#include <api/audio_codecs/builtin_audio_encoder_factory.h>
#include <api/create_modular_peer_connection_factory.h>
Expand Down Expand Up @@ -84,7 +83,7 @@ namespace python_webrtc {
}
} // namespace

// webrtc::CreatePeerConnectionFactory without the RTC event log, which keeps every packet's buffer in memory
// webrtc::CreatePeerConnectionFactory without the RTC event log (holds every packet) or audio processing (no capture)
webrtc::PeerConnectionFactoryDependencies PeerConnectionFactory::Dependencies() {
webrtc::PeerConnectionFactoryDependencies dependencies;
dependencies.network_thread = _workerThread.get();
Expand All @@ -95,7 +94,6 @@ namespace python_webrtc {
dependencies.adm = _audioDeviceModule;
dependencies.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory();
dependencies.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
dependencies.audio_processing_builder = std::make_unique<webrtc::BuiltinAudioProcessingBuilder>();
dependencies.video_encoder_factory = std::make_unique<VideoEncoderFactory>();
dependencies.video_decoder_factory = std::make_unique<VideoDecoderFactory>();
webrtc::EnableMedia(dependencies);
Expand All @@ -117,9 +115,8 @@ namespace python_webrtc {

PeerConnectionFactory::PeerConnectionFactory()
: _fieldTrials(_trials), _networkIgnoreMask(_loopbackAllowed ? 0 : webrtc::kDefaultNetworkIgnoreMask) {
_workerThread = Started(std::make_unique<webrtc::Thread>(std::make_unique<NetworkSocketServer>()),
"PeerConnectionFactory:workerThread");
_signalingThread = Started(webrtc::Thread::Create(), "PeerConnectionFactory:signalingThread");
_workerThread = Started(std::make_unique<webrtc::Thread>(std::make_unique<NetworkSocketServer>()), "wrtc-network");
_signalingThread = Started(webrtc::Thread::Create(), "wrtc-signaling");
// sanitizer builds check that these threads never enter Python
_workerThread->PostTask(&TagNativeThread);
_signalingThread->PostTask(&TagNativeThread);
Expand Down
2 changes: 1 addition & 1 deletion python-webrtc/cpp/src/interfaces/rtc_data_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ namespace python_webrtc {
}

webrtc::Priority RTCDataChannel::GetPriority() {
// the ranges Chromium maps priority values to
// splits at the midpoints between the DCEP priority values of W3C webrtc-priority (128, 256, 512, 1024)
constexpr int veryLowMax = 192;
constexpr int lowMax = 384;
constexpr int mediumMax = 768;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ namespace python_webrtc {
auto configuration = webrtc::PeerConnectionInterface::RTCConfiguration();
configuration.sdp_semantics = webrtc::SdpSemantics::kUnifiedPlan;
configuration = _configuration.Apply(configuration);
// renders each decoded frame at once, without a smoothing queue per video receiver
configuration.set_prerenderer_smoothing(false);

webrtc::PeerConnectionDependencies dependencies(this);
dependencies.allocator = _factory->CreatePortAllocator(configuration);
Expand Down
2 changes: 1 addition & 1 deletion python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace python_webrtc {

namespace {

// only what setParameters may change, as in Chromium
// only the encoding members setParameters may change, the rest keep their current values
void applySettable(const webrtc::RtpEncodingParameters &requested, webrtc::RtpEncodingParameters &current) {
current.active = requested.active;
current.request_key_frame = requested.request_key_frame;
Expand Down
2 changes: 1 addition & 1 deletion python-webrtc/python/webrtc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __init__(self, init: RTCErrorInit, message: str = '') -> None:


_BY_RTC_ERROR_TYPE = {
# the same mapping as Chromium's
# the W3C error names for libwebrtc's RTCErrorType values
'UNSUPPORTED_OPERATION': OperationError,
'UNSUPPORTED_PARAMETER': InvalidAccessError,
'INVALID_PARAMETER': InvalidAccessError,
Expand Down
2 changes: 1 addition & 1 deletion python-webrtc/python/webrtc/models/rtp_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

_NativeCodecT = TypeVar('_NativeCodecT', bound='wrtc.RtpCodec')

# the bitrate priorities of libwebrtc for RTCRtpEncodingParameters.priority, as Chromium maps them
# libwebrtc's bitrate priorities for RTCRtpEncodingParameters.priority, doubling per level from low (the default) at 1.0
_BITRATE_PRIORITY = {
RTCPriorityType.very_low: 0.5,
RTCPriorityType.low: 1.0,
Expand Down
Loading