diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ba5eadb3..292e067518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ All user visible changes to this project will be documented in this file. This p [Diff](https://github.com/instrumentisto/medea-flutter-webrtc/compare/0.8.2...0.8.3) +### Added + +- `RtpTransceiverInit.sendEncodings` field with `SendEncodingParameters`. ([#125]) + ### Changed - Refactor Audio Device Module to use [OpenAL] library for playout. ([#117]) @@ -21,6 +25,7 @@ All user visible changes to this project will be documented in this file. This p [#119]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/119 [#120]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/120 [#123]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/123 +[#125]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/125 [116.0.5845.110]: https://github.com/instrumentisto/libwebrtc-bin/releases/tag/116.0.5845.110 diff --git a/Makefile b/Makefile index fda34b161f..3532775332 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ flutter.run: # Run Flutter plugin integration tests on the current host as desktop. # # Usage: -# make flutter.test [debug=(no|yes)] +# make flutter.test.desktop [debug=(no|yes)] flutter.test.desktop: cd example/ && \ @@ -302,7 +302,8 @@ endif --dart-output=lib/src/api/bridge.g.dart \ --skip-add-mod-to-lib \ --no-build-runner \ - --dart-format-line-length=80 + --dart-enums-style \ + --inline-rust flutter pub run build_runner build --delete-conflicting-outputs @@ -392,6 +393,7 @@ endif swift.fmt: ifeq ($(dockerized),yes) docker run --rm -v "$(PWD)":/app -w /app \ + -u $(shell id -u):$(shell id -g) \ ghcr.io/nicklockwood/swiftformat:latest \ $(if $(call eq,$(check),yes),--lint,) ios/Classes/ else diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 33af0f6e01..29709a56d5 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1 +1,2 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +#Thu Sep 28 10:50:19 CEST 2023 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip diff --git a/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/Encoding.kt b/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/Encoding.kt new file mode 100644 index 0000000000..82fad9e43a --- /dev/null +++ b/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/Encoding.kt @@ -0,0 +1,48 @@ +package com.instrumentisto.medea_flutter_webrtc.model + +import org.webrtc.RtpParameters.Encoding as WEncoding + +/** + * Representation of an [org.webrtc.RtpParameters.Encoding]. + * + * @property rid 'rid' of this encoding parameters, created from this config. + * @property active Indicates whether this parameters are active. + * @property maxBitrate Maximum bitrate for this parameters. + * @property maxFramerate Maximum framerate for this parameters. + * @property scaleResolutionDownBy Resolution will be scaled down for this parameters. + */ +data class Encoding( + var rid: String, + var active: Boolean, + var maxBitrate: Int?, + var maxFramerate: Double?, + var scaleResolutionDownBy: Double?, +) { + companion object { + /** + * Creates a new [Encoding] object based on the method call received from the Flutter side. + * + * @return [Encoding] created from the provided [Map]. + */ + fun fromMap(map: Map): Encoding { + return Encoding( + map["rid"] as String, + map["active"] as Boolean, + map["maxBitrate"] as Int?, + map["maxFramerate"] as Double?, + map["scaleResolutionDownBy"] as Double?) + } + } + + /** + * Converts this [Encoding] into an [org.webrtc.RtpParameters.Encoding]. + * + * @return [org.webrtc.RtpParameters.Encoding] created based on this [Encoding]. + */ + fun intoWebRtc(): WEncoding { + var encoding: WEncoding = WEncoding(rid, active, scaleResolutionDownBy) + encoding.maxBitrateBps = maxBitrate + encoding.maxFramerate = maxFramerate?.toInt() + return encoding + } +} diff --git a/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/RtpTransceiverInit.kt b/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/RtpTransceiverInit.kt index 6edbccf2d5..7935d9dee1 100644 --- a/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/RtpTransceiverInit.kt +++ b/android/src/main/kotlin/com/instrumentisto/medea_flutter_webrtc/model/RtpTransceiverInit.kt @@ -6,8 +6,12 @@ import org.webrtc.RtpTransceiver.RtpTransceiverInit as WRtpTransceiverInit * Representation of an [org.webrtc.RtpTransceiver.RtpTransceiverInit]. * * @property direction Direction of the transceiver, created from this config. + * @property encodings [List] of the [Encoding]s, created from this config. */ -data class RtpTransceiverInit(val direction: RtpTransceiverDirection) { +data class RtpTransceiverInit( + val direction: RtpTransceiverDirection, + var encodings: List +) { companion object { /** * Creates a new [RtpTransceiverInit] object based on the method call received from the Flutter @@ -16,7 +20,11 @@ data class RtpTransceiverInit(val direction: RtpTransceiverDirection) { * @return [RtpTransceiverInit] created from the provided [Map]. */ fun fromMap(map: Map): RtpTransceiverInit { - return RtpTransceiverInit(RtpTransceiverDirection.fromInt(map["direction"] as Int)) + return RtpTransceiverInit( + RtpTransceiverDirection.fromInt(map["direction"] as Int), + (map["sendEncodings"] as List>>).map { encoding -> + Encoding.fromMap(encoding) + }) } } @@ -27,6 +35,7 @@ data class RtpTransceiverInit(val direction: RtpTransceiverDirection) { * [RtpTransceiverInit]. */ fun intoWebRtc(): WRtpTransceiverInit { - return WRtpTransceiverInit(direction.intoWebRtc()) + return WRtpTransceiverInit( + direction.intoWebRtc(), listOf(), encodings.map { e -> e.intoWebRtc() }) } } diff --git a/crates/libwebrtc-sys/include/bridge.h b/crates/libwebrtc-sys/include/bridge.h index 29fca6a624..efbcec0eb2 100644 --- a/crates/libwebrtc-sys/include/bridge.h +++ b/crates/libwebrtc-sys/include/bridge.h @@ -10,11 +10,11 @@ #include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_track_source_proxy_factory.h" #if __APPLE__ - #include "libwebrtc-sys/include/device_info_mac.h" - #include "mac_capturer.h" - #include "device_info_mac.h" +#include "device_info_mac.h" +#include "libwebrtc-sys/include/device_info_mac.h" +#include "mac_capturer.h" #else - #include "device_video_capturer.h" +#include "device_video_capturer.h" #endif #include "modules/audio_device/include/audio_device.h" #include "modules/video_capture/video_capture_factory.h" @@ -30,8 +30,8 @@ #include "adm_proxy.h" #include "media/base/fake_frame_source.h" -#include "pc/test/fake_video_track_source.h" #include "modules/audio_device/include/test_audio_device.h" +#include "pc/test/fake_video_track_source.h" namespace bridge { @@ -172,8 +172,9 @@ int32_t set_audio_recording_device(const AudioDeviceModule& audio_device_module, int32_t stop_playout(const AudioDeviceModule& audio_device_module); // Sets stereo availability of the specified playout device. -int32_t stereo_playout_is_available(const AudioDeviceModule& audio_device_module, - bool available); +int32_t stereo_playout_is_available( + const AudioDeviceModule& audio_device_module, + bool available); // Initializes the specified audio playout device. int32_t init_playout(const AudioDeviceModule& audio_device_module); @@ -383,6 +384,21 @@ std::unique_ptr create_rtc_offer_answer_options( bool ice_restart, bool use_rtp_mux); +// Creates a new default `RtpTransceiverInit`. +std::unique_ptr create_default_rtp_transceiver_init(); + +// Sets an `RtpTransceiverDirection` for the provided `RtpTransceiverInit`. +void set_rtp_transceiver_init_direction(RtpTransceiverInit& init, + RtpTransceiverDirection direction); + +// Adds an `RtpEncodingParameters` to the provided `RtpTransceiverInit`. +void add_rtp_transceiver_init_send_encoding( + RtpTransceiverInit& init, + const RtpEncodingParametersContainer& params); + +// Creates new default `RtpEncodingParameters`. +RtpEncodingParametersContainer create_rtp_encoding_parameters(); + // Creates a new `CreateSessionDescriptionObserver` from the provided // `bridge::DynCreateSdpCallback`. std::unique_ptr diff --git a/crates/libwebrtc-sys/include/peer_connection.h b/crates/libwebrtc-sys/include/peer_connection.h index 669f9876d4..00da733e3c 100644 --- a/crates/libwebrtc-sys/include/peer_connection.h +++ b/crates/libwebrtc-sys/include/peer_connection.h @@ -17,6 +17,7 @@ using SessionDescriptionInterface = webrtc::SessionDescriptionInterface; using RtpTransceiverInterface = rtc::scoped_refptr; using RtpTransceiverDirection = webrtc::RtpTransceiverDirection; +using RtpTransceiverInit = webrtc::RtpTransceiverInit; struct TransceiverContainer; struct DynPeerConnectionEventsHandler; @@ -214,7 +215,7 @@ void set_remote_description(PeerConnectionInterface& peer, std::unique_ptr add_transceiver( PeerConnectionInterface& peer, cricket::MediaType media_type, - RtpTransceiverDirection direction); + const RtpTransceiverInit& init); // Returns a list of `RtpTransceiverInterface`s attached to the provided // `PeerConnectionInterface`. diff --git a/crates/libwebrtc-sys/include/rtp_encoding_parameters.h b/crates/libwebrtc-sys/include/rtp_encoding_parameters.h index fe68c3c0fb..3ac2df2769 100644 --- a/crates/libwebrtc-sys/include/rtp_encoding_parameters.h +++ b/crates/libwebrtc-sys/include/rtp_encoding_parameters.h @@ -1,25 +1,44 @@ #pragma once #include "bridge.h" +#include "rust/cxx.h" namespace bridge { +// Sets the `RtpEncodingParameters.rid` field value. +void set_rtp_encoding_parameters_rid(webrtc::RtpEncodingParameters& encoding, + rust::String rid); + // Returns the `RtpEncodingParameters.active` field value. bool rtp_encoding_parameters_active( const webrtc::RtpEncodingParameters& encoding); +// Sets the `RtpEncodingParameters.active` field value. +void set_rtp_encoding_parameters_active(webrtc::RtpEncodingParameters& encoding, + bool active); + // Returns the `RtpEncodingParameters.maxBitrate` field value. -int32_t rtp_encoding_parameters_maxBitrate( +int32_t rtp_encoding_parameters_max_bitrate( const webrtc::RtpEncodingParameters& encoding); +// Returns the `RtpEncodingParameters.maxBitrate` field value. +void set_rtp_encoding_parameters_max_bitrate( + webrtc::RtpEncodingParameters& encoding, + int32_t max_bitrate); + // Returns the `RtpEncodingParameters.minBitrate` field value. -int32_t rtp_encoding_parameters_minBitrate( +int32_t rtp_encoding_parameters_min_bitrate( const webrtc::RtpEncodingParameters& encoding); // Returns the `RtpEncodingParameters.maxFramerate` field value. -double rtp_encoding_parameters_maxFramerate( +double rtp_encoding_parameters_max_framerate( const webrtc::RtpEncodingParameters& encoding); +// Sets the `RtpEncodingParameters.maxFramerate` field value. +void set_rtp_encoding_parameters_max_framerate( + webrtc::RtpEncodingParameters& encoding, + double max_framrate); + // Returns the `RtpEncodingParameters.ssrc` field value. int64_t rtp_encoding_parameters_ssrc( const webrtc::RtpEncodingParameters& encoding); @@ -28,4 +47,14 @@ int64_t rtp_encoding_parameters_ssrc( double rtp_encoding_parameters_scale_resolution_down_by( const webrtc::RtpEncodingParameters& encoding); +// Sets the `RtpEncodingParameters.scale_resolution_down_by` field value. +void set_rtp_encoding_parameters_scale_resolution_down_by( + webrtc::RtpEncodingParameters& encoding, + double scale_resolution_down_by); + +// Sets the `RtpEncodingParameters.scalability_mode` field value. +void set_rtp_encoding_parameters_scalability_mode( + webrtc::RtpEncodingParameters& encoding, + rust::String scalability_mode); + } // namespace bridge diff --git a/crates/libwebrtc-sys/src/bridge.rs b/crates/libwebrtc-sys/src/bridge.rs index 79f7ec1a6b..828acb1bbd 100644 --- a/crates/libwebrtc-sys/src/bridge.rs +++ b/crates/libwebrtc-sys/src/bridge.rs @@ -1519,6 +1519,33 @@ pub(crate) mod webrtc { ) -> bool; } + #[rustfmt::skip] + unsafe extern "C++" { + pub type RtpTransceiverInit; + + /// Creates a new default [`RtpTransceiverInit`]. + #[must_use] + pub fn create_default_rtp_transceiver_init() -> UniquePtr; + + /// Sets an [`RtpTransceiverDirection`] for the provided + /// [`RtpTransceiverInit`]. + pub fn set_rtp_transceiver_init_direction( + init: Pin<&mut RtpTransceiverInit>, + direction: RtpTransceiverDirection + ); + + /// Adds an [`RtpEncodingParameters`] into the provided + /// [`RtpTransceiverInit`]. + pub fn add_rtp_transceiver_init_send_encoding( + init: Pin<&mut RtpTransceiverInit>, + encoding: &RtpEncodingParametersContainer + ); + + /// Creates new default [`RtpEncodingParameters`]. + #[must_use] + pub fn create_rtp_encoding_parameters() -> RtpEncodingParametersContainer; + } + #[rustfmt::skip] unsafe extern "C++" { include!("libwebrtc-sys/include/rtp_encoding_parameters.h"); @@ -1526,23 +1553,41 @@ pub(crate) mod webrtc { #[namespace = "webrtc"] pub type RtpEncodingParameters; + /// Sets the `rid` of the provided [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_rid( + encoding: Pin<&mut RtpEncodingParameters>, + rid: String + ); + /// Returns the `active` of the provided [`RtpEncodingParameters`]. #[must_use] pub fn rtp_encoding_parameters_active( encoding: &RtpEncodingParameters, ) -> bool; + /// Sets the `active` of the provided [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_active( + encoding: Pin<&mut RtpEncodingParameters>, + active: bool + ); + /// Returns the `maxBitrate` of the provided [`RtpEncodingParameters`]. /// /// [`Result::Err`] means [`None`]. - pub fn rtp_encoding_parameters_maxBitrate( + pub fn rtp_encoding_parameters_max_bitrate( encoding: &RtpEncodingParameters, ) -> Result; + /// Sets the `maxBitrate` of the provided [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_max_bitrate( + encoding: Pin<&mut RtpEncodingParameters>, + max_bitrate: i32 + ); + /// Returns the `minBitrate` of the provided [`RtpEncodingParameters`]. /// /// [`Result::Err`] means [`None`]. - pub fn rtp_encoding_parameters_minBitrate( + pub fn rtp_encoding_parameters_min_bitrate( encoding: &RtpEncodingParameters, ) -> Result; @@ -1550,10 +1595,16 @@ pub(crate) mod webrtc { /// [`RtpEncodingParameters`]. /// /// [`Result::Err`] means [`None`]. - pub fn rtp_encoding_parameters_maxFramerate( + pub fn rtp_encoding_parameters_max_framerate( encoding: &RtpEncodingParameters, ) -> Result; + /// Sets the `maxFramerate` of the provided [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_max_framerate( + encoding: Pin<&mut RtpEncodingParameters>, + max_framrate: f64 + ); + /// Returns the `ssrc` of the provided [`RtpEncodingParameters`]. /// /// [`Result::Err`] means [`None`]. @@ -1568,6 +1619,20 @@ pub(crate) mod webrtc { pub fn rtp_encoding_parameters_scale_resolution_down_by( encoding: &RtpEncodingParameters, ) -> Result; + + /// Sets the `scale_resolution_down_by` of the provided + /// [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_scale_resolution_down_by( + encoding: Pin<&mut RtpEncodingParameters>, + scale_resolution_down_by: f64 + ); + + /// Sets the `scalability_mode` of the provided + /// [`RtpEncodingParameters`]. + pub fn set_rtp_encoding_parameters_scalability_mode( + encoding: Pin<&mut RtpEncodingParameters>, + scalability_mode: String + ); } #[rustfmt::skip] @@ -2031,7 +2096,7 @@ pub(crate) mod webrtc { pub fn add_transceiver( peer_connection_interface: Pin<&mut PeerConnectionInterface>, media_type: MediaType, - direction: RtpTransceiverDirection + init: &RtpTransceiverInit ) -> UniquePtr; /// Returns a sequence of [`RtpTransceiverInterface`] objects diff --git a/crates/libwebrtc-sys/src/cpp/bridge.cc b/crates/libwebrtc-sys/src/cpp/bridge.cc index 2150907955..067a3fe1da 100644 --- a/crates/libwebrtc-sys/src/cpp/bridge.cc +++ b/crates/libwebrtc-sys/src/cpp/bridge.cc @@ -6,9 +6,6 @@ #include #include "api/video/i420_buffer.h" -#include "libwebrtc-sys/include/bridge.h" -#include "libyuv.h" -#include "modules/audio_device/include/audio_device_factory.h" #include "api/video_codecs/video_decoder_factory_template.h" #include "api/video_codecs/video_decoder_factory_template_dav1d_adapter.h" #include "api/video_codecs/video_decoder_factory_template_libvpx_vp8_adapter.h" @@ -19,11 +16,13 @@ #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_open_h264_adapter.h" -#include "pc/proxy.h" +#include "libwebrtc-sys/include/bridge.h" #include "libwebrtc-sys/src/bridge.rs.h" +#include "libyuv.h" +#include "modules/audio_device/include/audio_device_factory.h" +#include "pc/proxy.h" #include "test_audio_device_module.cc" - namespace bridge { // Creates a new `TrackEventObserver`. @@ -82,12 +81,11 @@ std::unique_ptr create_fake_device_video_source( // audio renderer. std::unique_ptr create_fake_audio_device_module( TaskQueueFactory& task_queue_factory) { - auto capture = - webrtc::CreatePulsedNoiseCapturer(1024, 8000, 1); + auto capture = webrtc::CreatePulsedNoiseCapturer(1024, 8000, 1); auto renderer = webrtc::CreateDiscardRenderer(8000, 1); - auto adm_fake = webrtc::CreateTestAdm( - &task_queue_factory, std::move(capture), std::move(renderer), 1); + auto adm_fake = webrtc::CreateTestAdm(&task_queue_factory, std::move(capture), + std::move(renderer), 1); return std::make_unique(adm_fake); } @@ -101,15 +99,15 @@ std::unique_ptr create_device_video_source( size_t height, size_t fps, uint32_t device) { - #if __APPLE__ - auto dvc = signaling_thread.BlockingCall([width, height, fps, device] { - return MacCapturer::Create(width, height, fps, device); - }); - #else - auto dvc = signaling_thread.BlockingCall([width, height, fps, device] { - return DeviceVideoCapturer::Create(width, height, fps, device); - }); - #endif +#if __APPLE__ + auto dvc = signaling_thread.BlockingCall([width, height, fps, device] { + return MacCapturer::Create(width, height, fps, device); + }); +#else + auto dvc = signaling_thread.BlockingCall([width, height, fps, device] { + return DeviceVideoCapturer::Create(width, height, fps, device); + }); +#endif if (dvc == nullptr) { return nullptr; @@ -129,10 +127,10 @@ std::unique_ptr create_audio_device_module( Thread& worker_thread, AudioLayer audio_layer, TaskQueueFactory& task_queue_factory) { - AudioDeviceModule adm = worker_thread.BlockingCall([audio_layer, - &task_queue_factory] { - return ::OpenALPlayoutADM::Create(audio_layer, &task_queue_factory); - }); + AudioDeviceModule adm = + worker_thread.BlockingCall([audio_layer, &task_queue_factory] { + return ::OpenALPlayoutADM::Create(audio_layer, &task_queue_factory); + }); if (adm == nullptr) { return nullptr; @@ -245,8 +243,9 @@ int32_t stop_playout(const AudioDeviceModule& audio_device_module) { } // Sets stereo availability of the specified playout device. -int32_t stereo_playout_is_available(const AudioDeviceModule& audio_device_module, - bool available) { +int32_t stereo_playout_is_available( + const AudioDeviceModule& audio_device_module, + bool available) { return audio_device_module->StereoPlayoutIsAvailable(&available); } @@ -331,14 +330,11 @@ std::unique_ptr create_display_video_source( size_t width, size_t height, size_t fps) { - rtc::scoped_refptr capturer( - new rtc::RefCountedObject(id, width, - height, fps)); + new rtc::RefCountedObject(id, width, height, fps)); - auto src = webrtc::CreateVideoTrackSourceProxy(&signaling_thread, - &worker_thread, - capturer.get()); + auto src = webrtc::CreateVideoTrackSourceProxy( + &signaling_thread, &worker_thread, capturer.get()); if (src == nullptr) { return nullptr; @@ -366,9 +362,8 @@ std::unique_ptr create_video_track( const PeerConnectionFactoryInterface& peer_connection_factory, rust::String id, const VideoTrackSourceInterface& video_source) { - auto track = - peer_connection_factory->CreateVideoTrack(std::string(id), - video_source.get()); + auto track = peer_connection_factory->CreateVideoTrack(std::string(id), + video_source.get()); if (track == nullptr) { return nullptr; @@ -382,9 +377,8 @@ std::unique_ptr create_audio_track( const PeerConnectionFactoryInterface& peer_connection_factory, rust::String id, const AudioSourceInterface& audio_source) { - auto track = - peer_connection_factory->CreateAudioTrack(std::string(id), - audio_source.get()); + auto track = peer_connection_factory->CreateAudioTrack(std::string(id), + audio_source.get()); if (track == nullptr) { return nullptr; @@ -493,8 +487,7 @@ void video_frame_to_argb(const webrtc::VideoFrame& frame, libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), buffer->DataU(), buffer->StrideU(), buffer->DataV(), buffer->StrideV(), - dst_argb, argb_stride, buffer->width(), - buffer->height()); + dst_argb, argb_stride, buffer->width(), buffer->height()); } // Creates a new `PeerConnectionFactoryInterface`. @@ -504,23 +497,26 @@ std::unique_ptr create_peer_connection_factory( const std::unique_ptr& signaling_thread, const std::unique_ptr& default_adm, const std::unique_ptr& ap) { - std::unique_ptr video_encoder_factory = std::make_unique>(); + webrtc::LibvpxVp8EncoderTemplateAdapter, + webrtc::LibvpxVp9EncoderTemplateAdapter, + webrtc::OpenH264EncoderTemplateAdapter, + webrtc::LibaomAv1EncoderTemplateAdapter>>(); std::unique_ptr video_decoder_factory = std::make_unique>(); + webrtc::LibvpxVp8DecoderTemplateAdapter, + webrtc::LibvpxVp9DecoderTemplateAdapter, + webrtc::OpenH264DecoderTemplateAdapter, + webrtc::Dav1dDecoderTemplateAdapter>>(); auto factory = webrtc::CreatePeerConnectionFactory( network_thread.get(), worker_thread.get(), signaling_thread.get(), default_adm ? *default_adm : nullptr, webrtc::CreateBuiltinAudioEncoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(), - std::move(video_encoder_factory), - std::move(video_decoder_factory), nullptr, ap ? *ap : nullptr); + std::move(video_encoder_factory), std::move(video_decoder_factory), + nullptr, ap ? *ap : nullptr); if (factory == nullptr) { return nullptr; @@ -622,6 +618,32 @@ std::unique_ptr create_rtc_offer_answer_options( ice_restart, use_rtp_mux); } +// Creates a new default `RtpTransceiverInit`. +std::unique_ptr create_default_rtp_transceiver_init() { + return std::make_unique(); +} + +// Sets an `RtpTransceiverDirection` for the provided `RtpTransceiverInit`. +void set_rtp_transceiver_init_direction( + RtpTransceiverInit& init, + webrtc::RtpTransceiverDirection direction) { + init.direction = direction; +} + +// Adds an `RtpEncodingParameters` to the provided `RtpTransceiverInit`. +void add_rtp_transceiver_init_send_encoding( + RtpTransceiverInit& init, + const RtpEncodingParametersContainer& params) { + init.send_encodings.push_back(*params.ptr); +} + +// Creates new default `RtpEncodingParameters`. +RtpEncodingParametersContainer create_rtp_encoding_parameters() { + RtpEncodingParametersContainer res = { + std::make_unique()}; + return res; +} + // Creates a new `CreateSessionDescriptionObserver` from the provided // `bridge::DynCreateSdpCallback`. std::unique_ptr diff --git a/crates/libwebrtc-sys/src/cpp/peer_connection.cc b/crates/libwebrtc-sys/src/cpp/peer_connection.cc index 9a6cfb8c5b..8d65589d72 100644 --- a/crates/libwebrtc-sys/src/cpp/peer_connection.cc +++ b/crates/libwebrtc-sys/src/cpp/peer_connection.cc @@ -221,12 +221,9 @@ void set_remote_description(PeerConnectionInterface& peer_connection_interface, std::unique_ptr add_transceiver( PeerConnectionInterface& peer, cricket::MediaType media_type, - RtpTransceiverDirection direction) { - auto transceiver_init = webrtc::RtpTransceiverInit(); - transceiver_init.direction = direction; - + const RtpTransceiverInit& init) { return std::make_unique( - peer->AddTransceiver(media_type, transceiver_init).MoveValue()); + peer->AddTransceiver(media_type, init).MoveValue()); } // Calls `PeerConnectionInterface->GetTransceivers`. diff --git a/crates/libwebrtc-sys/src/cpp/rtp_encoding_parameters.cc b/crates/libwebrtc-sys/src/cpp/rtp_encoding_parameters.cc index 8654d75aec..23ea826148 100644 --- a/crates/libwebrtc-sys/src/cpp/rtp_encoding_parameters.cc +++ b/crates/libwebrtc-sys/src/cpp/rtp_encoding_parameters.cc @@ -2,6 +2,12 @@ namespace bridge { +// Sets the `RtpEncodingParameters.rid` field value. +void set_rtp_encoding_parameters_rid(webrtc::RtpEncodingParameters& encoding, + rust::String rid) { + encoding.rid = std::string(rid); +} + // Returns the `RtpEncodingParameters.active` field value. bool rtp_encoding_parameters_active( const webrtc::RtpEncodingParameters& encoding) { @@ -9,23 +15,43 @@ bool rtp_encoding_parameters_active( } // Returns the `RtpEncodingParameters.maxBitrate` field value. -int32_t rtp_encoding_parameters_maxBitrate( +int32_t rtp_encoding_parameters_max_bitrate( const webrtc::RtpEncodingParameters& encoding) { return encoding.max_bitrate_bps.value(); } +// Sets the `RtpEncodingParameters.active` field value. +void set_rtp_encoding_parameters_active(webrtc::RtpEncodingParameters& encoding, + bool active) { + encoding.active = active; +} + // Returns the `RtpEncodingParameters.minBitrate` field value. -int32_t rtp_encoding_parameters_minBitrate( +int32_t rtp_encoding_parameters_min_bitrate( const webrtc::RtpEncodingParameters& encoding) { return encoding.min_bitrate_bps.value(); } +// Returns the `RtpEncodingParameters.maxBitrate` field value. +void set_rtp_encoding_parameters_max_bitrate( + webrtc::RtpEncodingParameters& encoding, + int32_t max_bitrate) { + encoding.max_bitrate_bps = max_bitrate; +} + // Returns the `RtpEncodingParameters.maxFramerate` field value. -double rtp_encoding_parameters_maxFramerate( +double rtp_encoding_parameters_max_framerate( const webrtc::RtpEncodingParameters& encoding) { return encoding.max_framerate.value(); } +// Sets the `RtpEncodingParameters.maxFramerate` field value. +void set_rtp_encoding_parameters_max_framerate( + webrtc::RtpEncodingParameters& encoding, + double max_framrate) { + encoding.max_framerate = max_framrate; +} + // Returns the `RtpEncodingParameters.ssrc` field value. int64_t rtp_encoding_parameters_ssrc( const webrtc::RtpEncodingParameters& encoding) { @@ -38,4 +64,18 @@ double rtp_encoding_parameters_scale_resolution_down_by( return encoding.scale_resolution_down_by.value(); } +// Sets the `RtpEncodingParameters.scale_resolution_down_by` field value. +void set_rtp_encoding_parameters_scale_resolution_down_by( + webrtc::RtpEncodingParameters& encoding, + double scale_resolution_down_by) { + encoding.scale_resolution_down_by = scale_resolution_down_by; +} + +// Sets the `RtpEncodingParameters.scalability_mode` field value. +void set_rtp_encoding_parameters_scalability_mode( + webrtc::RtpEncodingParameters& encoding, + rust::String scalability_mode) { + encoding.scalability_mode = std::string(scalability_mode); +} + } // namespace bridge diff --git a/crates/libwebrtc-sys/src/lib.rs b/crates/libwebrtc-sys/src/lib.rs index 92739f1a68..34887af661 100644 --- a/crates/libwebrtc-sys/src/lib.rs +++ b/crates/libwebrtc-sys/src/lib.rs @@ -1035,12 +1035,63 @@ impl RtpExtension { } } +/// [RTCRtpTransceiverInit][0] representation. +/// +/// [0]: https://w3.org/TR/webrtc#dictionary-rtcrtptransceiverinit-members +pub struct RtpTransceiverInit(UniquePtr); + +impl RtpTransceiverInit { + /// Creates a new [`RtpTransceiverInit`]. + #[must_use] + pub fn new() -> Self { + Self(webrtc::create_default_rtp_transceiver_init()) + } + + /// Sets the [`direction`][0] property of this [`RtpTransceiverInit`]. + /// + /// [0]: https://w3.org/TR/webrtc/#dom-rtcrtptransceiverinit-direction + pub fn set_direction(&mut self, direction: RtpTransceiverDirection) { + webrtc::set_rtp_transceiver_init_direction(self.0.pin_mut(), direction); + } + + /// Adds the provided [`RtpEncodingParameters`] to this + /// [`RtpTransceiverInit`]. + pub fn add_encoding(&mut self, encoding: &RtpEncodingParameters) { + webrtc::add_rtp_transceiver_init_send_encoding( + self.0.pin_mut(), + &encoding.0, + ); + } +} + +impl Default for RtpTransceiverInit { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Sync for webrtc::RtpTransceiverInit {} +unsafe impl Send for webrtc::RtpTransceiverInit {} + /// [RTCRtpEncodingParameters][0] representation. /// /// [0]: https://w3.org/TR/webrtc#dom-rtcrtpencodingparameters pub struct RtpEncodingParameters(webrtc::RtpEncodingParametersContainer); impl RtpEncodingParameters { + /// Creates new [`RtpEncodingParameters`]. + #[must_use] + pub fn new() -> Self { + Self(webrtc::create_rtp_encoding_parameters()) + } + + /// Sets the [`rid`][0] property of these [`RtpEncodingParameters`]. + /// + /// [0]: https://w3.org/TR/webrtc/#dom-rtcrtpcodingparameters-rid + pub fn set_rid(&mut self, rid: String) { + webrtc::set_rtp_encoding_parameters_rid(self.0.ptr.pin_mut(), rid); + } + /// Returns the [`active`][0] property of these [`RtpEncodingParameters`]. /// /// [0]: https://w3.org/TR/webrtc#dom-rtcrtpencodingparameters-active @@ -1049,33 +1100,68 @@ impl RtpEncodingParameters { webrtc::rtp_encoding_parameters_active(&self.0.ptr) } - /// Returns the [`maxBitrate`][0] of these [`RtpEncodingParameters`]. + /// Sets the [`active`][0] property of these [`RtpEncodingParameters`]. + /// + /// [0]: https://w3.org/TR/webrtc#dom-rtcrtpencodingparameters-active + pub fn set_active(&mut self, active: bool) { + webrtc::set_rtp_encoding_parameters_active( + self.0.ptr.pin_mut(), + active, + ); + } + + /// Returns the [`maxBitrate`][0] property of these + /// [`RtpEncodingParameters`]. /// /// [0]: https://w3.org/TR/webrtc#dom-rtcrtpencodingparameters-maxbitrate #[must_use] pub fn max_bitrate(&self) -> Option { - webrtc::rtp_encoding_parameters_maxBitrate(&self.0.ptr).ok() + webrtc::rtp_encoding_parameters_max_bitrate(&self.0.ptr).ok() + } + + /// Sets the [`maxBitrate`][0] property of these [`RtpEncodingParameters`]. + /// + /// [0]: https://w3.org/TR/webrtc#dom-rtcrtpencodingparameters-maxbitrate + pub fn set_max_bitrate(&mut self, max_bitrate: i32) { + webrtc::set_rtp_encoding_parameters_max_bitrate( + self.0.ptr.pin_mut(), + max_bitrate, + ); } /// Returns the `minBitrate` of these [`RtpEncodingParameters`]. #[must_use] pub fn min_bitrate(&self) -> Option { - webrtc::rtp_encoding_parameters_minBitrate(&self.0.ptr).ok() + webrtc::rtp_encoding_parameters_min_bitrate(&self.0.ptr).ok() } - /// Returns the `maxFramerate` of these [`RtpEncodingParameters`]. + /// Returns the [`maxFramerate`][0] property of these + /// [`RtpEncodingParameters`]. + /// + /// [0]: https://w3.org/TR/webrtc/#dom-rtcrtpencodingparameters-maxframerate #[must_use] pub fn max_framerate(&self) -> Option { - webrtc::rtp_encoding_parameters_maxFramerate(&self.0.ptr).ok() + webrtc::rtp_encoding_parameters_max_framerate(&self.0.ptr).ok() + } + + /// Sets the [`maxFramerate`][0] property of these + /// [`RtpEncodingParameters`]. + /// + /// [0]: https://w3.org/TR/webrtc/#dom-rtcrtpencodingparameters-maxframerate + pub fn set_max_framerate(&mut self, max_framrate: f64) { + webrtc::set_rtp_encoding_parameters_max_framerate( + self.0.ptr.pin_mut(), + max_framrate, + ); } - /// Returns the `ssrc` of these [`RtpEncodingParameters`]. + /// Returns the `ssrc` property of these [`RtpEncodingParameters`]. #[must_use] pub fn ssrc(&self) -> Option { webrtc::rtp_encoding_parameters_ssrc(&self.0.ptr).ok() } - /// Returns the [`scaleResolutionDownBy`][0] of these + /// Returns the [`scaleResolutionDownBy`][0] property of these /// [`RtpEncodingParameters`]. /// /// [0]: https://tinyurl.com/scaleresolutiondownby @@ -1084,8 +1170,42 @@ impl RtpEncodingParameters { webrtc::rtp_encoding_parameters_scale_resolution_down_by(&self.0.ptr) .ok() } + + /// Sets the [`scaleResolutionDownBy`][0] property of these + /// [`RtpEncodingParameters`]. + /// + /// [0]: https://tinyurl.com/scaleresolutiondownby + pub fn set_scale_resolution_down_by( + &mut self, + scale_resolution_down_by: f64, + ) { + webrtc::set_rtp_encoding_parameters_scale_resolution_down_by( + self.0.ptr.pin_mut(), + scale_resolution_down_by, + ); + } + + /// Sets the [`scalabilityMode`][0] property of these + /// [`RtpEncodingParameters`]. + /// + /// [0]: https://tinyurl.com/5jckh3nw + pub fn set_scalability_mode(&mut self, scalability_mode: String) { + webrtc::set_rtp_encoding_parameters_scalability_mode( + self.0.ptr.pin_mut(), + scalability_mode, + ); + } } +impl Default for RtpEncodingParameters { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Sync for webrtc::RtpEncodingParameters {} +unsafe impl Send for webrtc::RtpEncodingParameters {} + /// [RTCRtcpParameters][0] representation. /// /// [0]: https://w3.org/TR/webrtc#dom-rtcrtcpparameters @@ -1293,13 +1413,10 @@ impl PeerConnectionInterface { pub fn add_transceiver( &mut self, media_type: MediaType, - direction: RtpTransceiverDirection, + init: &RtpTransceiverInit, ) -> RtpTransceiverInterface { - let inner = webrtc::add_transceiver( - self.inner.pin_mut(), - media_type, - direction, - ); + let inner = + webrtc::add_transceiver(self.inner.pin_mut(), media_type, &init.0); RtpTransceiverInterface { inner, media_type } } diff --git a/crates/native/src/api.rs b/crates/native/src/api.rs index 9a665e5162..191a16a88a 100644 --- a/crates/native/src/api.rs +++ b/crates/native/src/api.rs @@ -16,7 +16,9 @@ use crate::{ }; // Re-exporting since it is used in the generated code. -pub use crate::{PeerConnection, RtpTransceiver}; +pub use crate::{ + PeerConnection, RtpEncodingParameters, RtpTransceiver, RtpTransceiverInit, +}; lazy_static::lazy_static! { static ref WEBRTC: Mutex = Mutex::new(Webrtc::new().unwrap()); @@ -1919,6 +1921,60 @@ pub fn create_answer( rx.recv_timeout(RX_TIMEOUT)? } +/// Creates a new default [`RtpTransceiverInit`]. +pub fn create_transceiver_init() -> RustOpaque> { + RustOpaque::new(Arc::new(RtpTransceiverInit::new())) +} + +/// Sets the provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`]. +#[allow(clippy::needless_pass_by_value)] +pub fn set_transceiver_init_direction( + init: RustOpaque>, + direction: RtpTransceiverDirection, +) { + init.set_direction(direction); +} + +/// Adds the provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`]. +#[allow(clippy::needless_pass_by_value)] +pub fn add_transceiver_init_send_encoding( + init: RustOpaque>, + encoding: RustOpaque>, +) { + init.add_encoding(&encoding); +} + +/// Creates new [`RtpEncodingParameters`] with the provided settings. +#[allow(clippy::needless_pass_by_value)] +pub fn create_encoding_parameters( + rid: String, + active: bool, + max_bitrate: Option, + max_framerate: Option, + scale_resolution_down_by: Option, + scalability_mode: Option, +) -> RustOpaque> { + let encoding = RtpEncodingParameters::new(); + + encoding.set_rid(rid); + encoding.set_active(active); + + if let Some(max_bitrate) = max_bitrate { + encoding.set_max_bitrate(max_bitrate); + } + if let Some(max_framerate) = max_framerate { + encoding.set_max_framerate(max_framerate); + } + if let Some(scale_resolution_down_by) = scale_resolution_down_by { + encoding.set_scale_resolution_down_by(scale_resolution_down_by); + } + if let Some(scalability_mode) = scalability_mode { + encoding.set_scalability_mode(scalability_mode); + } + + RustOpaque::new(Arc::new(encoding)) +} + /// Changes the local description associated with the connection. #[allow(clippy::needless_pass_by_value)] pub fn set_local_description( @@ -1946,12 +2002,13 @@ pub fn set_remote_description( /// Creates a new [`RtcRtpTransceiver`] and adds it to the set of transceivers /// of the specified [`PeerConnection`]. +#[allow(clippy::needless_pass_by_value)] pub fn add_transceiver( peer: RustOpaque>, media_type: MediaType, - direction: RtpTransceiverDirection, + init: RustOpaque>, ) -> anyhow::Result { - PeerConnection::add_transceiver(peer, media_type.into(), direction.into()) + PeerConnection::add_transceiver(peer, media_type.into(), &init) } /// Returns a sequence of [`RtcRtpTransceiver`] objects representing the RTP diff --git a/crates/native/src/bridge_generated.io.rs b/crates/native/src/bridge_generated.io.rs deleted file mode 100644 index 41e1a281ad..0000000000 --- a/crates/native/src/bridge_generated.io.rs +++ /dev/null @@ -1,710 +0,0 @@ -use super::*; -// Section: wire functions - -#[no_mangle] -pub extern "C" fn wire_enable_fake_media(port_: i64) { - wire_enable_fake_media_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_is_fake_media(port_: i64) { - wire_is_fake_media_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_enumerate_devices(port_: i64) { - wire_enumerate_devices_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_enumerate_displays(port_: i64) { - wire_enumerate_displays_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_create_peer_connection( - port_: i64, - configuration: *mut wire_RtcConfiguration, -) { - wire_create_peer_connection_impl(port_, configuration) -} - -#[no_mangle] -pub extern "C" fn wire_create_offer( - port_: i64, - peer: wire_ArcPeerConnection, - voice_activity_detection: bool, - ice_restart: bool, - use_rtp_mux: bool, -) { - wire_create_offer_impl( - port_, - peer, - voice_activity_detection, - ice_restart, - use_rtp_mux, - ) -} - -#[no_mangle] -pub extern "C" fn wire_create_answer( - port_: i64, - peer: wire_ArcPeerConnection, - voice_activity_detection: bool, - ice_restart: bool, - use_rtp_mux: bool, -) { - wire_create_answer_impl( - port_, - peer, - voice_activity_detection, - ice_restart, - use_rtp_mux, - ) -} - -#[no_mangle] -pub extern "C" fn wire_set_local_description( - port_: i64, - peer: wire_ArcPeerConnection, - kind: i32, - sdp: *mut wire_uint_8_list, -) { - wire_set_local_description_impl(port_, peer, kind, sdp) -} - -#[no_mangle] -pub extern "C" fn wire_set_remote_description( - port_: i64, - peer: wire_ArcPeerConnection, - kind: i32, - sdp: *mut wire_uint_8_list, -) { - wire_set_remote_description_impl(port_, peer, kind, sdp) -} - -#[no_mangle] -pub extern "C" fn wire_add_transceiver( - port_: i64, - peer: wire_ArcPeerConnection, - media_type: i32, - direction: i32, -) { - wire_add_transceiver_impl(port_, peer, media_type, direction) -} - -#[no_mangle] -pub extern "C" fn wire_get_transceivers( - port_: i64, - peer: wire_ArcPeerConnection, -) { - wire_get_transceivers_impl(port_, peer) -} - -#[no_mangle] -pub extern "C" fn wire_set_transceiver_direction( - port_: i64, - transceiver: wire_ArcRtpTransceiver, - direction: i32, -) { - wire_set_transceiver_direction_impl(port_, transceiver, direction) -} - -#[no_mangle] -pub extern "C" fn wire_set_transceiver_recv( - port_: i64, - transceiver: wire_ArcRtpTransceiver, - recv: bool, -) { - wire_set_transceiver_recv_impl(port_, transceiver, recv) -} - -#[no_mangle] -pub extern "C" fn wire_set_transceiver_send( - port_: i64, - transceiver: wire_ArcRtpTransceiver, - send: bool, -) { - wire_set_transceiver_send_impl(port_, transceiver, send) -} - -#[no_mangle] -pub extern "C" fn wire_get_transceiver_mid( - port_: i64, - transceiver: wire_ArcRtpTransceiver, -) { - wire_get_transceiver_mid_impl(port_, transceiver) -} - -#[no_mangle] -pub extern "C" fn wire_get_transceiver_direction( - port_: i64, - transceiver: wire_ArcRtpTransceiver, -) { - wire_get_transceiver_direction_impl(port_, transceiver) -} - -#[no_mangle] -pub extern "C" fn wire_get_peer_stats( - port_: i64, - peer: wire_ArcPeerConnection, -) { - wire_get_peer_stats_impl(port_, peer) -} - -#[no_mangle] -pub extern "C" fn wire_stop_transceiver( - port_: i64, - transceiver: wire_ArcRtpTransceiver, -) { - wire_stop_transceiver_impl(port_, transceiver) -} - -#[no_mangle] -pub extern "C" fn wire_sender_replace_track( - port_: i64, - peer: wire_ArcPeerConnection, - transceiver: wire_ArcRtpTransceiver, - track_id: *mut wire_uint_8_list, -) { - wire_sender_replace_track_impl(port_, peer, transceiver, track_id) -} - -#[no_mangle] -pub extern "C" fn wire_add_ice_candidate( - port_: i64, - peer: wire_ArcPeerConnection, - candidate: *mut wire_uint_8_list, - sdp_mid: *mut wire_uint_8_list, - sdp_mline_index: i32, -) { - wire_add_ice_candidate_impl( - port_, - peer, - candidate, - sdp_mid, - sdp_mline_index, - ) -} - -#[no_mangle] -pub extern "C" fn wire_restart_ice(port_: i64, peer: wire_ArcPeerConnection) { - wire_restart_ice_impl(port_, peer) -} - -#[no_mangle] -pub extern "C" fn wire_dispose_peer_connection( - port_: i64, - peer: wire_ArcPeerConnection, -) { - wire_dispose_peer_connection_impl(port_, peer) -} - -#[no_mangle] -pub extern "C" fn wire_get_media( - port_: i64, - constraints: *mut wire_MediaStreamConstraints, -) { - wire_get_media_impl(port_, constraints) -} - -#[no_mangle] -pub extern "C" fn wire_set_audio_playout_device( - port_: i64, - device_id: *mut wire_uint_8_list, -) { - wire_set_audio_playout_device_impl(port_, device_id) -} - -#[no_mangle] -pub extern "C" fn wire_microphone_volume_is_available(port_: i64) { - wire_microphone_volume_is_available_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_set_microphone_volume(port_: i64, level: u8) { - wire_set_microphone_volume_impl(port_, level) -} - -#[no_mangle] -pub extern "C" fn wire_microphone_volume(port_: i64) { - wire_microphone_volume_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_dispose_track( - port_: i64, - track_id: *mut wire_uint_8_list, - kind: i32, -) { - wire_dispose_track_impl(port_, track_id, kind) -} - -#[no_mangle] -pub extern "C" fn wire_track_state( - port_: i64, - track_id: *mut wire_uint_8_list, - kind: i32, -) { - wire_track_state_impl(port_, track_id, kind) -} - -#[no_mangle] -pub extern "C" fn wire_set_track_enabled( - port_: i64, - track_id: *mut wire_uint_8_list, - kind: i32, - enabled: bool, -) { - wire_set_track_enabled_impl(port_, track_id, kind, enabled) -} - -#[no_mangle] -pub extern "C" fn wire_clone_track( - port_: i64, - track_id: *mut wire_uint_8_list, - kind: i32, -) { - wire_clone_track_impl(port_, track_id, kind) -} - -#[no_mangle] -pub extern "C" fn wire_register_track_observer( - port_: i64, - track_id: *mut wire_uint_8_list, - kind: i32, -) { - wire_register_track_observer_impl(port_, track_id, kind) -} - -#[no_mangle] -pub extern "C" fn wire_set_on_device_changed(port_: i64) { - wire_set_on_device_changed_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_create_video_sink( - port_: i64, - sink_id: i64, - track_id: *mut wire_uint_8_list, - callback_ptr: u64, -) { - wire_create_video_sink_impl(port_, sink_id, track_id, callback_ptr) -} - -#[no_mangle] -pub extern "C" fn wire_dispose_video_sink(port_: i64, sink_id: i64) { - wire_dispose_video_sink_impl(port_, sink_id) -} - -// Section: allocate functions - -#[no_mangle] -pub extern "C" fn new_ArcPeerConnection() -> wire_ArcPeerConnection { - wire_ArcPeerConnection::new_with_null_ptr() -} - -#[no_mangle] -pub extern "C" fn new_ArcRtpTransceiver() -> wire_ArcRtpTransceiver { - wire_ArcRtpTransceiver::new_with_null_ptr() -} - -#[no_mangle] -pub extern "C" fn new_StringList_0(len: i32) -> *mut wire_StringList { - let wrap = wire_StringList { - ptr: support::new_leak_vec_ptr( - <*mut wire_uint_8_list>::new_with_null_ptr(), - len, - ), - len, - }; - support::new_leak_box_ptr(wrap) -} - -#[no_mangle] -pub extern "C" fn new_box_autoadd_audio_constraints_0( -) -> *mut wire_AudioConstraints { - support::new_leak_box_ptr(wire_AudioConstraints::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn new_box_autoadd_media_stream_constraints_0( -) -> *mut wire_MediaStreamConstraints { - support::new_leak_box_ptr(wire_MediaStreamConstraints::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn new_box_autoadd_rtc_configuration_0( -) -> *mut wire_RtcConfiguration { - support::new_leak_box_ptr(wire_RtcConfiguration::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn new_box_autoadd_video_constraints_0( -) -> *mut wire_VideoConstraints { - support::new_leak_box_ptr(wire_VideoConstraints::new_with_null_ptr()) -} - -#[no_mangle] -pub extern "C" fn new_list_rtc_ice_server_0( - len: i32, -) -> *mut wire_list_rtc_ice_server { - let wrap = wire_list_rtc_ice_server { - ptr: support::new_leak_vec_ptr( - ::new_with_null_ptr(), - len, - ), - len, - }; - support::new_leak_box_ptr(wrap) -} - -#[no_mangle] -pub extern "C" fn new_uint_8_list_0(len: i32) -> *mut wire_uint_8_list { - let ans = wire_uint_8_list { - ptr: support::new_leak_vec_ptr(Default::default(), len), - len, - }; - support::new_leak_box_ptr(ans) -} - -// Section: related functions - -#[no_mangle] -pub extern "C" fn drop_opaque_ArcPeerConnection(ptr: *const c_void) { - unsafe { - Arc::>::decrement_strong_count(ptr as _); - } -} - -#[no_mangle] -pub extern "C" fn share_opaque_ArcPeerConnection( - ptr: *const c_void, -) -> *const c_void { - unsafe { - Arc::>::increment_strong_count(ptr as _); - ptr - } -} - -#[no_mangle] -pub extern "C" fn drop_opaque_ArcRtpTransceiver(ptr: *const c_void) { - unsafe { - Arc::>::decrement_strong_count(ptr as _); - } -} - -#[no_mangle] -pub extern "C" fn share_opaque_ArcRtpTransceiver( - ptr: *const c_void, -) -> *const c_void { - unsafe { - Arc::>::increment_strong_count(ptr as _); - ptr - } -} - -// Section: impl Wire2Api - -impl Wire2Api>> for wire_ArcPeerConnection { - fn wire2api(self) -> RustOpaque> { - unsafe { support::opaque_from_dart(self.ptr as _) } - } -} -impl Wire2Api>> for wire_ArcRtpTransceiver { - fn wire2api(self) -> RustOpaque> { - unsafe { support::opaque_from_dart(self.ptr as _) } - } -} -impl Wire2Api for *mut wire_uint_8_list { - fn wire2api(self) -> String { - let vec: Vec = self.wire2api(); - String::from_utf8_lossy(&vec).into_owned() - } -} -impl Wire2Api> for *mut wire_StringList { - fn wire2api(self) -> Vec { - let vec = unsafe { - let wrap = support::box_from_leak_ptr(self); - support::vec_from_leak_ptr(wrap.ptr, wrap.len) - }; - vec.into_iter().map(Wire2Api::wire2api).collect() - } -} -impl Wire2Api for wire_AudioConstraints { - fn wire2api(self) -> AudioConstraints { - AudioConstraints { - device_id: self.device_id.wire2api(), - } - } -} - -impl Wire2Api for *mut wire_AudioConstraints { - fn wire2api(self) -> AudioConstraints { - let wrap = unsafe { support::box_from_leak_ptr(self) }; - Wire2Api::::wire2api(*wrap).into() - } -} -impl Wire2Api for *mut wire_MediaStreamConstraints { - fn wire2api(self) -> MediaStreamConstraints { - let wrap = unsafe { support::box_from_leak_ptr(self) }; - Wire2Api::::wire2api(*wrap).into() - } -} -impl Wire2Api for *mut wire_RtcConfiguration { - fn wire2api(self) -> RtcConfiguration { - let wrap = unsafe { support::box_from_leak_ptr(self) }; - Wire2Api::::wire2api(*wrap).into() - } -} -impl Wire2Api for *mut wire_VideoConstraints { - fn wire2api(self) -> VideoConstraints { - let wrap = unsafe { support::box_from_leak_ptr(self) }; - Wire2Api::::wire2api(*wrap).into() - } -} - -impl Wire2Api> for *mut wire_list_rtc_ice_server { - fn wire2api(self) -> Vec { - let vec = unsafe { - let wrap = support::box_from_leak_ptr(self); - support::vec_from_leak_ptr(wrap.ptr, wrap.len) - }; - vec.into_iter().map(Wire2Api::wire2api).collect() - } -} -impl Wire2Api for wire_MediaStreamConstraints { - fn wire2api(self) -> MediaStreamConstraints { - MediaStreamConstraints { - audio: self.audio.wire2api(), - video: self.video.wire2api(), - } - } -} - -impl Wire2Api for wire_RtcConfiguration { - fn wire2api(self) -> RtcConfiguration { - RtcConfiguration { - ice_transport_policy: self.ice_transport_policy.wire2api(), - bundle_policy: self.bundle_policy.wire2api(), - ice_servers: self.ice_servers.wire2api(), - } - } -} -impl Wire2Api for wire_RtcIceServer { - fn wire2api(self) -> RtcIceServer { - RtcIceServer { - urls: self.urls.wire2api(), - username: self.username.wire2api(), - credential: self.credential.wire2api(), - } - } -} - -impl Wire2Api> for *mut wire_uint_8_list { - fn wire2api(self) -> Vec { - unsafe { - let wrap = support::box_from_leak_ptr(self); - support::vec_from_leak_ptr(wrap.ptr, wrap.len) - } - } -} -impl Wire2Api for wire_VideoConstraints { - fn wire2api(self) -> VideoConstraints { - VideoConstraints { - device_id: self.device_id.wire2api(), - width: self.width.wire2api(), - height: self.height.wire2api(), - frame_rate: self.frame_rate.wire2api(), - is_display: self.is_display.wire2api(), - } - } -} -// Section: wire structs - -#[repr(C)] -#[derive(Clone)] -pub struct wire_ArcPeerConnection { - ptr: *const core::ffi::c_void, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_ArcRtpTransceiver { - ptr: *const core::ffi::c_void, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_StringList { - ptr: *mut *mut wire_uint_8_list, - len: i32, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_AudioConstraints { - device_id: *mut wire_uint_8_list, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_list_rtc_ice_server { - ptr: *mut wire_RtcIceServer, - len: i32, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_MediaStreamConstraints { - audio: *mut wire_AudioConstraints, - video: *mut wire_VideoConstraints, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_RtcConfiguration { - ice_transport_policy: i32, - bundle_policy: i32, - ice_servers: *mut wire_list_rtc_ice_server, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_RtcIceServer { - urls: *mut wire_StringList, - username: *mut wire_uint_8_list, - credential: *mut wire_uint_8_list, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_uint_8_list { - ptr: *mut u8, - len: i32, -} - -#[repr(C)] -#[derive(Clone)] -pub struct wire_VideoConstraints { - device_id: *mut wire_uint_8_list, - width: u32, - height: u32, - frame_rate: u32, - is_display: bool, -} - -// Section: impl NewWithNullPtr - -pub trait NewWithNullPtr { - fn new_with_null_ptr() -> Self; -} - -impl NewWithNullPtr for *mut T { - fn new_with_null_ptr() -> Self { - std::ptr::null_mut() - } -} - -impl NewWithNullPtr for wire_ArcPeerConnection { - fn new_with_null_ptr() -> Self { - Self { - ptr: core::ptr::null(), - } - } -} -impl NewWithNullPtr for wire_ArcRtpTransceiver { - fn new_with_null_ptr() -> Self { - Self { - ptr: core::ptr::null(), - } - } -} - -impl NewWithNullPtr for wire_AudioConstraints { - fn new_with_null_ptr() -> Self { - Self { - device_id: core::ptr::null_mut(), - } - } -} - -impl Default for wire_AudioConstraints { - fn default() -> Self { - Self::new_with_null_ptr() - } -} - -impl NewWithNullPtr for wire_MediaStreamConstraints { - fn new_with_null_ptr() -> Self { - Self { - audio: core::ptr::null_mut(), - video: core::ptr::null_mut(), - } - } -} - -impl Default for wire_MediaStreamConstraints { - fn default() -> Self { - Self::new_with_null_ptr() - } -} - -impl NewWithNullPtr for wire_RtcConfiguration { - fn new_with_null_ptr() -> Self { - Self { - ice_transport_policy: Default::default(), - bundle_policy: Default::default(), - ice_servers: core::ptr::null_mut(), - } - } -} - -impl Default for wire_RtcConfiguration { - fn default() -> Self { - Self::new_with_null_ptr() - } -} - -impl NewWithNullPtr for wire_RtcIceServer { - fn new_with_null_ptr() -> Self { - Self { - urls: core::ptr::null_mut(), - username: core::ptr::null_mut(), - credential: core::ptr::null_mut(), - } - } -} - -impl Default for wire_RtcIceServer { - fn default() -> Self { - Self::new_with_null_ptr() - } -} - -impl NewWithNullPtr for wire_VideoConstraints { - fn new_with_null_ptr() -> Self { - Self { - device_id: core::ptr::null_mut(), - width: Default::default(), - height: Default::default(), - frame_rate: Default::default(), - is_display: Default::default(), - } - } -} - -impl Default for wire_VideoConstraints { - fn default() -> Self { - Self::new_with_null_ptr() - } -} - -// Section: sync execution mode utility - -#[no_mangle] -pub extern "C" fn free_WireSyncReturn(ptr: support::WireSyncReturn) { - unsafe { - let _ = support::box_from_leak_ptr(ptr); - }; -} diff --git a/crates/native/src/bridge_generated.rs b/crates/native/src/bridge_generated.rs index 4924845f82..89d7dcd241 100644 --- a/crates/native/src/bridge_generated.rs +++ b/crates/native/src/bridge_generated.rs @@ -1,3 +1,4 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] #![allow( non_camel_case_types, unused, @@ -141,6 +142,94 @@ fn wire_create_answer_impl( }, ) } +fn wire_create_transceiver_init_impl(port_: MessagePort) { + FLUTTER_RUST_BRIDGE_HANDLER + .wrap::<_, _, _, RustOpaque>>( + WrapInfo { + debug_name: "create_transceiver_init", + port: Some(port_), + mode: FfiCallMode::Normal, + }, + move || move |task_callback| Ok(create_transceiver_init()), + ) +} +fn wire_set_transceiver_init_direction_impl( + port_: MessagePort, + init: impl Wire2Api>> + UnwindSafe, + direction: impl Wire2Api + UnwindSafe, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + WrapInfo { + debug_name: "set_transceiver_init_direction", + port: Some(port_), + mode: FfiCallMode::Normal, + }, + move || { + let api_init = init.wire2api(); + let api_direction = direction.wire2api(); + move |task_callback| { + Ok(set_transceiver_init_direction(api_init, api_direction)) + } + }, + ) +} +fn wire_add_transceiver_init_send_encoding_impl( + port_: MessagePort, + init: impl Wire2Api>> + UnwindSafe, + encoding: impl Wire2Api>> + UnwindSafe, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + WrapInfo { + debug_name: "add_transceiver_init_send_encoding", + port: Some(port_), + mode: FfiCallMode::Normal, + }, + move || { + let api_init = init.wire2api(); + let api_encoding = encoding.wire2api(); + move |task_callback| { + Ok(add_transceiver_init_send_encoding(api_init, api_encoding)) + } + }, + ) +} +fn wire_create_encoding_parameters_impl( + port_: MessagePort, + rid: impl Wire2Api + UnwindSafe, + active: impl Wire2Api + UnwindSafe, + max_bitrate: impl Wire2Api> + UnwindSafe, + max_framerate: impl Wire2Api> + UnwindSafe, + scale_resolution_down_by: impl Wire2Api> + UnwindSafe, + scalability_mode: impl Wire2Api> + UnwindSafe, +) { + FLUTTER_RUST_BRIDGE_HANDLER + .wrap::<_, _, _, RustOpaque>>( + WrapInfo { + debug_name: "create_encoding_parameters", + port: Some(port_), + mode: FfiCallMode::Normal, + }, + move || { + let api_rid = rid.wire2api(); + let api_active = active.wire2api(); + let api_max_bitrate = max_bitrate.wire2api(); + let api_max_framerate = max_framerate.wire2api(); + let api_scale_resolution_down_by = + scale_resolution_down_by.wire2api(); + let api_scalability_mode = scalability_mode.wire2api(); + move |task_callback| { + Ok(create_encoding_parameters( + api_rid, + api_active, + api_max_bitrate, + api_max_framerate, + api_scale_resolution_down_by, + api_scalability_mode, + )) + } + }, + ) +} fn wire_set_local_description_impl( port_: MessagePort, peer: impl Wire2Api>> + UnwindSafe, @@ -189,7 +278,7 @@ fn wire_add_transceiver_impl( port_: MessagePort, peer: impl Wire2Api>> + UnwindSafe, media_type: impl Wire2Api + UnwindSafe, - direction: impl Wire2Api + UnwindSafe, + init: impl Wire2Api>> + UnwindSafe, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, RtcRtpTransceiver>( WrapInfo { @@ -200,9 +289,9 @@ fn wire_add_transceiver_impl( move || { let api_peer = peer.wire2api(); let api_media_type = media_type.wire2api(); - let api_direction = direction.wire2api(); + let api_init = init.wire2api(); move |task_callback| { - add_transceiver(api_peer, api_media_type, api_direction) + add_transceiver(api_peer, api_media_type, api_init) } }, ) @@ -685,6 +774,11 @@ impl Wire2Api for i32 { } } } +impl Wire2Api for f64 { + fn wire2api(self) -> f64 { + self + } +} impl Wire2Api for i32 { fn wire2api(self) -> i32 { self @@ -1528,12 +1622,876 @@ impl rust2dart::IntoIntoDart for TrackState { // Section: executor support::lazy_static! { - pub static ref FLUTTER_RUST_BRIDGE_HANDLER: support::DefaultHandler = - Default::default(); + pub static ref FLUTTER_RUST_BRIDGE_HANDLER: support::DefaultHandler = Default::default(); } #[cfg(not(target_family = "wasm"))] -#[path = "bridge_generated.io.rs"] -mod io; +mod io { + use super::*; + // Section: wire functions + + #[no_mangle] + pub extern "C" fn wire_enable_fake_media(port_: i64) { + wire_enable_fake_media_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_is_fake_media(port_: i64) { + wire_is_fake_media_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_enumerate_devices(port_: i64) { + wire_enumerate_devices_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_enumerate_displays(port_: i64) { + wire_enumerate_displays_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_create_peer_connection( + port_: i64, + configuration: *mut wire_RtcConfiguration, + ) { + wire_create_peer_connection_impl(port_, configuration) + } + + #[no_mangle] + pub extern "C" fn wire_create_offer( + port_: i64, + peer: wire_ArcPeerConnection, + voice_activity_detection: bool, + ice_restart: bool, + use_rtp_mux: bool, + ) { + wire_create_offer_impl( + port_, + peer, + voice_activity_detection, + ice_restart, + use_rtp_mux, + ) + } + + #[no_mangle] + pub extern "C" fn wire_create_answer( + port_: i64, + peer: wire_ArcPeerConnection, + voice_activity_detection: bool, + ice_restart: bool, + use_rtp_mux: bool, + ) { + wire_create_answer_impl( + port_, + peer, + voice_activity_detection, + ice_restart, + use_rtp_mux, + ) + } + + #[no_mangle] + pub extern "C" fn wire_create_transceiver_init(port_: i64) { + wire_create_transceiver_init_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_set_transceiver_init_direction( + port_: i64, + init: wire_ArcRtpTransceiverInit, + direction: i32, + ) { + wire_set_transceiver_init_direction_impl(port_, init, direction) + } + + #[no_mangle] + pub extern "C" fn wire_add_transceiver_init_send_encoding( + port_: i64, + init: wire_ArcRtpTransceiverInit, + encoding: wire_ArcRtpEncodingParameters, + ) { + wire_add_transceiver_init_send_encoding_impl(port_, init, encoding) + } + + #[no_mangle] + pub extern "C" fn wire_create_encoding_parameters( + port_: i64, + rid: *mut wire_uint_8_list, + active: bool, + max_bitrate: *mut i32, + max_framerate: *mut f64, + scale_resolution_down_by: *mut f64, + scalability_mode: *mut wire_uint_8_list, + ) { + wire_create_encoding_parameters_impl( + port_, + rid, + active, + max_bitrate, + max_framerate, + scale_resolution_down_by, + scalability_mode, + ) + } + + #[no_mangle] + pub extern "C" fn wire_set_local_description( + port_: i64, + peer: wire_ArcPeerConnection, + kind: i32, + sdp: *mut wire_uint_8_list, + ) { + wire_set_local_description_impl(port_, peer, kind, sdp) + } + + #[no_mangle] + pub extern "C" fn wire_set_remote_description( + port_: i64, + peer: wire_ArcPeerConnection, + kind: i32, + sdp: *mut wire_uint_8_list, + ) { + wire_set_remote_description_impl(port_, peer, kind, sdp) + } + + #[no_mangle] + pub extern "C" fn wire_add_transceiver( + port_: i64, + peer: wire_ArcPeerConnection, + media_type: i32, + init: wire_ArcRtpTransceiverInit, + ) { + wire_add_transceiver_impl(port_, peer, media_type, init) + } + + #[no_mangle] + pub extern "C" fn wire_get_transceivers( + port_: i64, + peer: wire_ArcPeerConnection, + ) { + wire_get_transceivers_impl(port_, peer) + } + + #[no_mangle] + pub extern "C" fn wire_set_transceiver_direction( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + direction: i32, + ) { + wire_set_transceiver_direction_impl(port_, transceiver, direction) + } + + #[no_mangle] + pub extern "C" fn wire_set_transceiver_recv( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + recv: bool, + ) { + wire_set_transceiver_recv_impl(port_, transceiver, recv) + } + + #[no_mangle] + pub extern "C" fn wire_set_transceiver_send( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + send: bool, + ) { + wire_set_transceiver_send_impl(port_, transceiver, send) + } + + #[no_mangle] + pub extern "C" fn wire_get_transceiver_mid( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + ) { + wire_get_transceiver_mid_impl(port_, transceiver) + } + + #[no_mangle] + pub extern "C" fn wire_get_transceiver_direction( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + ) { + wire_get_transceiver_direction_impl(port_, transceiver) + } + + #[no_mangle] + pub extern "C" fn wire_get_peer_stats( + port_: i64, + peer: wire_ArcPeerConnection, + ) { + wire_get_peer_stats_impl(port_, peer) + } + + #[no_mangle] + pub extern "C" fn wire_stop_transceiver( + port_: i64, + transceiver: wire_ArcRtpTransceiver, + ) { + wire_stop_transceiver_impl(port_, transceiver) + } + + #[no_mangle] + pub extern "C" fn wire_sender_replace_track( + port_: i64, + peer: wire_ArcPeerConnection, + transceiver: wire_ArcRtpTransceiver, + track_id: *mut wire_uint_8_list, + ) { + wire_sender_replace_track_impl(port_, peer, transceiver, track_id) + } + + #[no_mangle] + pub extern "C" fn wire_add_ice_candidate( + port_: i64, + peer: wire_ArcPeerConnection, + candidate: *mut wire_uint_8_list, + sdp_mid: *mut wire_uint_8_list, + sdp_mline_index: i32, + ) { + wire_add_ice_candidate_impl( + port_, + peer, + candidate, + sdp_mid, + sdp_mline_index, + ) + } + + #[no_mangle] + pub extern "C" fn wire_restart_ice( + port_: i64, + peer: wire_ArcPeerConnection, + ) { + wire_restart_ice_impl(port_, peer) + } + + #[no_mangle] + pub extern "C" fn wire_dispose_peer_connection( + port_: i64, + peer: wire_ArcPeerConnection, + ) { + wire_dispose_peer_connection_impl(port_, peer) + } + + #[no_mangle] + pub extern "C" fn wire_get_media( + port_: i64, + constraints: *mut wire_MediaStreamConstraints, + ) { + wire_get_media_impl(port_, constraints) + } + + #[no_mangle] + pub extern "C" fn wire_set_audio_playout_device( + port_: i64, + device_id: *mut wire_uint_8_list, + ) { + wire_set_audio_playout_device_impl(port_, device_id) + } + + #[no_mangle] + pub extern "C" fn wire_microphone_volume_is_available(port_: i64) { + wire_microphone_volume_is_available_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_set_microphone_volume(port_: i64, level: u8) { + wire_set_microphone_volume_impl(port_, level) + } + + #[no_mangle] + pub extern "C" fn wire_microphone_volume(port_: i64) { + wire_microphone_volume_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_dispose_track( + port_: i64, + track_id: *mut wire_uint_8_list, + kind: i32, + ) { + wire_dispose_track_impl(port_, track_id, kind) + } + + #[no_mangle] + pub extern "C" fn wire_track_state( + port_: i64, + track_id: *mut wire_uint_8_list, + kind: i32, + ) { + wire_track_state_impl(port_, track_id, kind) + } + + #[no_mangle] + pub extern "C" fn wire_set_track_enabled( + port_: i64, + track_id: *mut wire_uint_8_list, + kind: i32, + enabled: bool, + ) { + wire_set_track_enabled_impl(port_, track_id, kind, enabled) + } + + #[no_mangle] + pub extern "C" fn wire_clone_track( + port_: i64, + track_id: *mut wire_uint_8_list, + kind: i32, + ) { + wire_clone_track_impl(port_, track_id, kind) + } + + #[no_mangle] + pub extern "C" fn wire_register_track_observer( + port_: i64, + track_id: *mut wire_uint_8_list, + kind: i32, + ) { + wire_register_track_observer_impl(port_, track_id, kind) + } + + #[no_mangle] + pub extern "C" fn wire_set_on_device_changed(port_: i64) { + wire_set_on_device_changed_impl(port_) + } + + #[no_mangle] + pub extern "C" fn wire_create_video_sink( + port_: i64, + sink_id: i64, + track_id: *mut wire_uint_8_list, + callback_ptr: u64, + ) { + wire_create_video_sink_impl(port_, sink_id, track_id, callback_ptr) + } + + #[no_mangle] + pub extern "C" fn wire_dispose_video_sink(port_: i64, sink_id: i64) { + wire_dispose_video_sink_impl(port_, sink_id) + } + + // Section: allocate functions + + #[no_mangle] + pub extern "C" fn new_ArcPeerConnection() -> wire_ArcPeerConnection { + wire_ArcPeerConnection::new_with_null_ptr() + } + + #[no_mangle] + pub extern "C" fn new_ArcRtpEncodingParameters( + ) -> wire_ArcRtpEncodingParameters { + wire_ArcRtpEncodingParameters::new_with_null_ptr() + } + + #[no_mangle] + pub extern "C" fn new_ArcRtpTransceiver() -> wire_ArcRtpTransceiver { + wire_ArcRtpTransceiver::new_with_null_ptr() + } + + #[no_mangle] + pub extern "C" fn new_ArcRtpTransceiverInit() -> wire_ArcRtpTransceiverInit + { + wire_ArcRtpTransceiverInit::new_with_null_ptr() + } + + #[no_mangle] + pub extern "C" fn new_StringList_0(len: i32) -> *mut wire_StringList { + let wrap = wire_StringList { + ptr: support::new_leak_vec_ptr( + <*mut wire_uint_8_list>::new_with_null_ptr(), + len, + ), + len, + }; + support::new_leak_box_ptr(wrap) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_audio_constraints_0( + ) -> *mut wire_AudioConstraints { + support::new_leak_box_ptr(wire_AudioConstraints::new_with_null_ptr()) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_f64_0(value: f64) -> *mut f64 { + support::new_leak_box_ptr(value) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_i32_0(value: i32) -> *mut i32 { + support::new_leak_box_ptr(value) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_media_stream_constraints_0( + ) -> *mut wire_MediaStreamConstraints { + support::new_leak_box_ptr( + wire_MediaStreamConstraints::new_with_null_ptr(), + ) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_rtc_configuration_0( + ) -> *mut wire_RtcConfiguration { + support::new_leak_box_ptr(wire_RtcConfiguration::new_with_null_ptr()) + } + + #[no_mangle] + pub extern "C" fn new_box_autoadd_video_constraints_0( + ) -> *mut wire_VideoConstraints { + support::new_leak_box_ptr(wire_VideoConstraints::new_with_null_ptr()) + } + + #[no_mangle] + pub extern "C" fn new_list_rtc_ice_server_0( + len: i32, + ) -> *mut wire_list_rtc_ice_server { + let wrap = wire_list_rtc_ice_server { + ptr: support::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + support::new_leak_box_ptr(wrap) + } + + #[no_mangle] + pub extern "C" fn new_uint_8_list_0(len: i32) -> *mut wire_uint_8_list { + let ans = wire_uint_8_list { + ptr: support::new_leak_vec_ptr(Default::default(), len), + len, + }; + support::new_leak_box_ptr(ans) + } + + // Section: related functions + + #[no_mangle] + pub extern "C" fn drop_opaque_ArcPeerConnection(ptr: *const c_void) { + unsafe { + Arc::>::decrement_strong_count(ptr as _); + } + } + + #[no_mangle] + pub extern "C" fn share_opaque_ArcPeerConnection( + ptr: *const c_void, + ) -> *const c_void { + unsafe { + Arc::>::increment_strong_count(ptr as _); + ptr + } + } + + #[no_mangle] + pub extern "C" fn drop_opaque_ArcRtpEncodingParameters(ptr: *const c_void) { + unsafe { + Arc::>::decrement_strong_count(ptr as _); + } + } + + #[no_mangle] + pub extern "C" fn share_opaque_ArcRtpEncodingParameters( + ptr: *const c_void, + ) -> *const c_void { + unsafe { + Arc::>::increment_strong_count(ptr as _); + ptr + } + } + + #[no_mangle] + pub extern "C" fn drop_opaque_ArcRtpTransceiver(ptr: *const c_void) { + unsafe { + Arc::>::decrement_strong_count(ptr as _); + } + } + + #[no_mangle] + pub extern "C" fn share_opaque_ArcRtpTransceiver( + ptr: *const c_void, + ) -> *const c_void { + unsafe { + Arc::>::increment_strong_count(ptr as _); + ptr + } + } + + #[no_mangle] + pub extern "C" fn drop_opaque_ArcRtpTransceiverInit(ptr: *const c_void) { + unsafe { + Arc::>::decrement_strong_count(ptr as _); + } + } + + #[no_mangle] + pub extern "C" fn share_opaque_ArcRtpTransceiverInit( + ptr: *const c_void, + ) -> *const c_void { + unsafe { + Arc::>::increment_strong_count(ptr as _); + ptr + } + } + + // Section: impl Wire2Api + + impl Wire2Api>> for wire_ArcPeerConnection { + fn wire2api(self) -> RustOpaque> { + unsafe { support::opaque_from_dart(self.ptr as _) } + } + } + impl Wire2Api>> + for wire_ArcRtpEncodingParameters + { + fn wire2api(self) -> RustOpaque> { + unsafe { support::opaque_from_dart(self.ptr as _) } + } + } + impl Wire2Api>> for wire_ArcRtpTransceiver { + fn wire2api(self) -> RustOpaque> { + unsafe { support::opaque_from_dart(self.ptr as _) } + } + } + impl Wire2Api>> + for wire_ArcRtpTransceiverInit + { + fn wire2api(self) -> RustOpaque> { + unsafe { support::opaque_from_dart(self.ptr as _) } + } + } + impl Wire2Api for *mut wire_uint_8_list { + fn wire2api(self) -> String { + let vec: Vec = self.wire2api(); + String::from_utf8_lossy(&vec).into_owned() + } + } + impl Wire2Api> for *mut wire_StringList { + fn wire2api(self) -> Vec { + let vec = unsafe { + let wrap = support::box_from_leak_ptr(self); + support::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(Wire2Api::wire2api).collect() + } + } + impl Wire2Api for wire_AudioConstraints { + fn wire2api(self) -> AudioConstraints { + AudioConstraints { + device_id: self.device_id.wire2api(), + } + } + } + + impl Wire2Api for *mut wire_AudioConstraints { + fn wire2api(self) -> AudioConstraints { + let wrap = unsafe { support::box_from_leak_ptr(self) }; + Wire2Api::::wire2api(*wrap).into() + } + } + impl Wire2Api for *mut f64 { + fn wire2api(self) -> f64 { + unsafe { *support::box_from_leak_ptr(self) } + } + } + impl Wire2Api for *mut i32 { + fn wire2api(self) -> i32 { + unsafe { *support::box_from_leak_ptr(self) } + } + } + impl Wire2Api for *mut wire_MediaStreamConstraints { + fn wire2api(self) -> MediaStreamConstraints { + let wrap = unsafe { support::box_from_leak_ptr(self) }; + Wire2Api::::wire2api(*wrap).into() + } + } + impl Wire2Api for *mut wire_RtcConfiguration { + fn wire2api(self) -> RtcConfiguration { + let wrap = unsafe { support::box_from_leak_ptr(self) }; + Wire2Api::::wire2api(*wrap).into() + } + } + impl Wire2Api for *mut wire_VideoConstraints { + fn wire2api(self) -> VideoConstraints { + let wrap = unsafe { support::box_from_leak_ptr(self) }; + Wire2Api::::wire2api(*wrap).into() + } + } + + impl Wire2Api> for *mut wire_list_rtc_ice_server { + fn wire2api(self) -> Vec { + let vec = unsafe { + let wrap = support::box_from_leak_ptr(self); + support::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(Wire2Api::wire2api).collect() + } + } + impl Wire2Api for wire_MediaStreamConstraints { + fn wire2api(self) -> MediaStreamConstraints { + MediaStreamConstraints { + audio: self.audio.wire2api(), + video: self.video.wire2api(), + } + } + } + + impl Wire2Api for wire_RtcConfiguration { + fn wire2api(self) -> RtcConfiguration { + RtcConfiguration { + ice_transport_policy: self.ice_transport_policy.wire2api(), + bundle_policy: self.bundle_policy.wire2api(), + ice_servers: self.ice_servers.wire2api(), + } + } + } + impl Wire2Api for wire_RtcIceServer { + fn wire2api(self) -> RtcIceServer { + RtcIceServer { + urls: self.urls.wire2api(), + username: self.username.wire2api(), + credential: self.credential.wire2api(), + } + } + } + + impl Wire2Api> for *mut wire_uint_8_list { + fn wire2api(self) -> Vec { + unsafe { + let wrap = support::box_from_leak_ptr(self); + support::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } + } + impl Wire2Api for wire_VideoConstraints { + fn wire2api(self) -> VideoConstraints { + VideoConstraints { + device_id: self.device_id.wire2api(), + width: self.width.wire2api(), + height: self.height.wire2api(), + frame_rate: self.frame_rate.wire2api(), + is_display: self.is_display.wire2api(), + } + } + } + // Section: wire structs + + #[repr(C)] + #[derive(Clone)] + pub struct wire_ArcPeerConnection { + ptr: *const core::ffi::c_void, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_ArcRtpEncodingParameters { + ptr: *const core::ffi::c_void, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_ArcRtpTransceiver { + ptr: *const core::ffi::c_void, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_ArcRtpTransceiverInit { + ptr: *const core::ffi::c_void, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_StringList { + ptr: *mut *mut wire_uint_8_list, + len: i32, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_AudioConstraints { + device_id: *mut wire_uint_8_list, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_list_rtc_ice_server { + ptr: *mut wire_RtcIceServer, + len: i32, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_MediaStreamConstraints { + audio: *mut wire_AudioConstraints, + video: *mut wire_VideoConstraints, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_RtcConfiguration { + ice_transport_policy: i32, + bundle_policy: i32, + ice_servers: *mut wire_list_rtc_ice_server, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_RtcIceServer { + urls: *mut wire_StringList, + username: *mut wire_uint_8_list, + credential: *mut wire_uint_8_list, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_uint_8_list { + ptr: *mut u8, + len: i32, + } + + #[repr(C)] + #[derive(Clone)] + pub struct wire_VideoConstraints { + device_id: *mut wire_uint_8_list, + width: u32, + height: u32, + frame_rate: u32, + is_display: bool, + } + + // Section: impl NewWithNullPtr + + pub trait NewWithNullPtr { + fn new_with_null_ptr() -> Self; + } + + impl NewWithNullPtr for *mut T { + fn new_with_null_ptr() -> Self { + std::ptr::null_mut() + } + } + + impl NewWithNullPtr for wire_ArcPeerConnection { + fn new_with_null_ptr() -> Self { + Self { + ptr: core::ptr::null(), + } + } + } + impl NewWithNullPtr for wire_ArcRtpEncodingParameters { + fn new_with_null_ptr() -> Self { + Self { + ptr: core::ptr::null(), + } + } + } + impl NewWithNullPtr for wire_ArcRtpTransceiver { + fn new_with_null_ptr() -> Self { + Self { + ptr: core::ptr::null(), + } + } + } + impl NewWithNullPtr for wire_ArcRtpTransceiverInit { + fn new_with_null_ptr() -> Self { + Self { + ptr: core::ptr::null(), + } + } + } + + impl NewWithNullPtr for wire_AudioConstraints { + fn new_with_null_ptr() -> Self { + Self { + device_id: core::ptr::null_mut(), + } + } + } + + impl Default for wire_AudioConstraints { + fn default() -> Self { + Self::new_with_null_ptr() + } + } + + impl NewWithNullPtr for wire_MediaStreamConstraints { + fn new_with_null_ptr() -> Self { + Self { + audio: core::ptr::null_mut(), + video: core::ptr::null_mut(), + } + } + } + + impl Default for wire_MediaStreamConstraints { + fn default() -> Self { + Self::new_with_null_ptr() + } + } + + impl NewWithNullPtr for wire_RtcConfiguration { + fn new_with_null_ptr() -> Self { + Self { + ice_transport_policy: Default::default(), + bundle_policy: Default::default(), + ice_servers: core::ptr::null_mut(), + } + } + } + + impl Default for wire_RtcConfiguration { + fn default() -> Self { + Self::new_with_null_ptr() + } + } + + impl NewWithNullPtr for wire_RtcIceServer { + fn new_with_null_ptr() -> Self { + Self { + urls: core::ptr::null_mut(), + username: core::ptr::null_mut(), + credential: core::ptr::null_mut(), + } + } + } + + impl Default for wire_RtcIceServer { + fn default() -> Self { + Self::new_with_null_ptr() + } + } + + impl NewWithNullPtr for wire_VideoConstraints { + fn new_with_null_ptr() -> Self { + Self { + device_id: core::ptr::null_mut(), + width: Default::default(), + height: Default::default(), + frame_rate: Default::default(), + is_display: Default::default(), + } + } + } + + impl Default for wire_VideoConstraints { + fn default() -> Self { + Self::new_with_null_ptr() + } + } + + // Section: sync execution mode utility + + #[no_mangle] + pub extern "C" fn free_WireSyncReturn(ptr: support::WireSyncReturn) { + unsafe { + let _ = support::box_from_leak_ptr(ptr); + }; + } +} #[cfg(not(target_family = "wasm"))] pub use io::*; diff --git a/crates/native/src/lib.rs b/crates/native/src/lib.rs index 48c55607bf..ea56c92e34 100644 --- a/crates/native/src/lib.rs +++ b/crates/native/src/lib.rs @@ -34,7 +34,10 @@ use crate::video_sink::Id as VideoSinkId; #[doc(inline)] pub use crate::{ - pc::{PeerConnection, RtpTransceiver}, + pc::{ + PeerConnection, RtpEncodingParameters, RtpTransceiver, + RtpTransceiverInit, + }, user_media::{ AudioDeviceId, AudioDeviceModule, AudioTrack, AudioTrackId, MediaStreamId, VideoDeviceId, VideoDeviceInfo, VideoSource, VideoTrack, diff --git a/crates/native/src/pc.rs b/crates/native/src/pc.rs index 2652f02c9f..74f88812c4 100644 --- a/crates/native/src/pc.rs +++ b/crates/native/src/pc.rs @@ -434,12 +434,16 @@ impl PeerConnection { pub fn add_transceiver( this: RustOpaque>, media_type: sys::MediaType, - direction: sys::RtpTransceiverDirection, + init: &RustOpaque>, ) -> anyhow::Result { let (mid, direction, transceiver) = { let mut peer = this.inner.lock().unwrap(); - let transceiver = peer.add_transceiver(media_type, direction); + let transceiver = { + let init = init.0.lock().unwrap(); + + peer.add_transceiver(media_type, &init) + }; let index = peer.get_transceivers().len() - 1; ( @@ -561,6 +565,128 @@ impl PeerConnection { } } +/// Wrapper around a [`sys::RtpTransceiverInit`]. +pub struct RtpTransceiverInit(Arc>); + +impl RtpTransceiverInit { + /// Creates a new [`RtpTransceiverInit`]. + #[must_use] + pub fn new() -> Self { + Self(Arc::new(Mutex::new(sys::RtpTransceiverInit::new()))) + } + + /// Sets a provided [`api::RtpTransceiverDirection`] to this + /// [`RtpTransceiverInit`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpTransceiverInit`] is poisoned. + pub fn set_direction(&self, direction: api::RtpTransceiverDirection) { + self.0.lock().unwrap().set_direction(direction.into()); + } + + /// Adds a provided [`RtpEncodingParameters`] to this + /// [`RtpTransceiverInit`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpTransceiverInit`] or the + /// [`sys::RtpEncodingParameters`] is poisoned. + pub fn add_encoding( + &self, + encoding: &RustOpaque>, + ) { + self.0 + .lock() + .unwrap() + .add_encoding(&encoding.0.lock().unwrap()); + } +} + +impl Default for RtpTransceiverInit { + fn default() -> Self { + Self::new() + } +} + +/// Wrapper around a [`sys::RtpEncodingParameters`]. +pub struct RtpEncodingParameters(Arc>); + +impl RtpEncodingParameters { + /// Creates a new [`RtpEncodingParameters`]. + #[must_use] + pub fn new() -> Self { + Self(Arc::new(Mutex::new(sys::RtpEncodingParameters::new()))) + } + + /// Sets a provided `rid` to this [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_rid(&self, rid: String) { + self.0.lock().unwrap().set_rid(rid); + } + + /// Sets `active` to this [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_active(&self, active: bool) { + self.0.lock().unwrap().set_active(active); + } + + /// Sets a provided `max_bitrate` to this [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_max_bitrate(&self, max_bitrate: i32) { + self.0.lock().unwrap().set_max_bitrate(max_bitrate); + } + + /// Sets a provided `max_framerate` to this [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_max_framerate(&self, max_framerate: f64) { + self.0.lock().unwrap().set_max_framerate(max_framerate); + } + + /// Sets a provided `scale_resolution_down_by` to this + /// [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_scale_resolution_down_by(&self, scale_resolution_down_by: f64) { + self.0 + .lock() + .unwrap() + .set_scale_resolution_down_by(scale_resolution_down_by); + } + + /// Sets a provided `scalability_mode` to this [`RtpEncodingParameters`]. + /// + /// # Panics + /// + /// If the mutex guarding the [`sys::RtpEncodingParameters`] is poisoned. + pub fn set_scalability_mode(&self, scalability_mode: String) { + self.0 + .lock() + .unwrap() + .set_scalability_mode(scalability_mode); + } +} + +impl Default for RtpEncodingParameters { + fn default() -> Self { + Self::new() + } +} + /// Wrapper around a [`sys::RtpTransceiverInterface`] with a unique ID. pub struct RtpTransceiver { /// Native-side transceiver. diff --git a/example/integration_test/webrtc_test.dart b/example/integration_test/webrtc_test.dart index ed8ca17832..b7851ed90d 100644 --- a/example/integration_test/webrtc_test.dart +++ b/example/integration_test/webrtc_test.dart @@ -28,6 +28,42 @@ void main() { await trans.dispose(); }); + testWidgets('Add transceiver with simulcast', (WidgetTester tester) async { + var pc = await PeerConnection.create(IceTransportType.all, []); + + var videoInit1 = RtpTransceiverInit(TransceiverDirection.sendOnly); + + var p1 = SendEncodingParameters("h", true); + p1.maxBitrate = 1200 * 1024; + p1.maxFramerate = 30; + videoInit1.sendEncodings.add(p1); + + var p2 = SendEncodingParameters("m", true); + p2.maxBitrate = 600 * 1024; + p2.maxFramerate = 30; + p2.scaleResolutionDownBy = 2; + videoInit1.sendEncodings.add(p2); + + var p3 = SendEncodingParameters("l", true); + p3.maxBitrate = 300 * 1024; + p3.scaleResolutionDownBy = 4; + videoInit1.sendEncodings.add(p3); + + var videoTrans1 = await pc.addTransceiver(MediaKind.video, videoInit1); + var response = await pc.createOffer(); + + expect(response.description.contains('a=mid:0'), isTrue); + expect(response.description.contains('m=video'), isTrue); + expect(response.description.contains('sendonly'), isTrue); + expect(response.description.contains('a=rid:h send'), isTrue); + expect(response.description.contains('a=rid:m send'), isTrue); + expect(response.description.contains('a=rid:l send'), isTrue); + expect(response.description.contains('a=simulcast:send h;m;l'), isTrue); + + await pc.close(); + await videoTrans1.dispose(); + }); + testWidgets('Get transceivers', (WidgetTester tester) async { var pc = await PeerConnection.create(IceTransportType.all, []); var t1 = await pc.addTransceiver( diff --git a/ios/Classes/controller/PeerConnectionController.swift b/ios/Classes/controller/PeerConnectionController.swift index bd802a893e..3726bb21a4 100644 --- a/ios/Classes/controller/PeerConnectionController.swift +++ b/ios/Classes/controller/PeerConnectionController.swift @@ -143,8 +143,30 @@ class PeerConnectionController { let mediaType = argsMap!["mediaType"] as? Int let initArgs = argsMap!["init"] as? [String: Any] let direction = initArgs!["direction"] as? Int + let argEncodings = initArgs!["sendEncodings"] as? [[String: Any]] + var sendEncodings: [Encoding] = [] + + for e in argEncodings! { + let rid = e["rid"] as? String + let active = e["active"] as? Bool + let maxBitrate = e["maxBitrate"] as? Int + let maxFramerate = e["maxFramerate"] as? Double + let scaleResolutionDownBy = e["scaleResolutionDownBy"] as? Double + + sendEncodings.append(Encoding( + rid: rid!, + active: active!, + maxBitrate: maxBitrate, + maxFramerate: maxFramerate, + scaleResolutionDownBy: scaleResolutionDownBy + )) + } + let transceiverInit = - TransceiverInit(direction: TransceiverDirection(rawValue: direction!)!) + TransceiverInit( + direction: TransceiverDirection(rawValue: direction!)!, + encodings: sendEncodings + ) let transceiver = RtpTransceiverController( messenger: self.messenger, transceiver: self.peer.addTransceiver( diff --git a/ios/Classes/model/Encoding.swift b/ios/Classes/model/Encoding.swift new file mode 100755 index 0000000000..dff566c567 --- /dev/null +++ b/ios/Classes/model/Encoding.swift @@ -0,0 +1,54 @@ +import WebRTC + +/// Encoding describes a single configuration of a codec for an RTCRtpSender. +class Encoding { + /// A string which, if set, specifies an RTP stream ID (RID) to be sent using + /// the RID header extension. + var rid: String + + /// If true, the described encoding is currently actively being used. + var active: Bool + + /// Indicates the maximum number of bits per second to allow for this + /// encoding. + var maxBitrate: Int? + + /// A value specifying the maximum number of frames per second to allow for + /// this encoding. + var maxFramerate: Double? + + /// This is a double-precision floating-point value specifying a factor by + /// which to scale down the video during encoding. + var scaleResolutionDownBy: Double? + + /// Initializes a new `Encoding` configuration with the provided data. + init( + rid: String, active: Bool, maxBitrate: Int?, maxFramerate: Double?, + scaleResolutionDownBy: Double? + ) { + self.rid = rid + self.active = active + self.maxBitrate = maxBitrate + self.maxFramerate = maxFramerate + self.scaleResolutionDownBy = scaleResolutionDownBy + } + + /// Converts this `Encoding` into an `RTCRtpEncodingParameters`. + func intoWebRtc() -> RTCRtpEncodingParameters { + let params = RTCRtpEncodingParameters() + params.rid = self.rid + params.isActive = self.active + + if let maxBitrate = maxBitrate { + params.maxBitrateBps = NSNumber(value: maxBitrate) + } + if let maxFramerate = maxFramerate { + params.maxFramerate = NSNumber(value: maxFramerate) + } + if let scaleResolutionDownBy = scaleResolutionDownBy { + params.scaleResolutionDownBy = NSNumber(value: scaleResolutionDownBy) + } + + return params + } +} diff --git a/ios/Classes/model/PeerConnectionConfiguration.swift b/ios/Classes/model/PeerConnectionConfiguration.swift index 3ecb67a671..93a53a319d 100644 --- a/ios/Classes/model/PeerConnectionConfiguration.swift +++ b/ios/Classes/model/PeerConnectionConfiguration.swift @@ -5,15 +5,25 @@ class TransceiverInit { /// Direction of the transceiver, created from this configuration. private var direction: TransceiverDirection + /// Sequence containing parameters for sending RTP encodings of media. + private var encodings: [Encoding] + /// Initializes a new `TransceiverInit` configuration with the provided data. - init(direction: TransceiverDirection) { + init(direction: TransceiverDirection, encodings: [Encoding]) { self.direction = direction + self.encodings = encodings } /// Converts this `RtpTransceiverInit` into an `RTCRtpTransceiverInit`. func intoWebRtc() -> RTCRtpTransceiverInit { let conf = RTCRtpTransceiverInit() + conf.direction = self.direction.intoWebRtc() + conf.sendEncodings = self.encodings + .map { (encoding: Encoding) -> RTCRtpEncodingParameters in + encoding.intoWebRtc() + } + return conf } } diff --git a/lib/src/api/bridge.g.dart b/lib/src/api/bridge.g.dart index 42e41889d1..3f505b4b20 100644 --- a/lib/src/api/bridge.g.dart +++ b/lib/src/api/bridge.g.dart @@ -65,6 +65,39 @@ abstract class MedeaFlutterWebrtcNative { FlutterRustBridgeTaskConstMeta get kCreateAnswerConstMeta; + /// Creates a new default [`RtpTransceiverInit`]. + Future createTransceiverInit({dynamic hint}); + + FlutterRustBridgeTaskConstMeta get kCreateTransceiverInitConstMeta; + + /// Sets the provided [`RtpTransceiverDirection`] to the [`RtpTransceiverInit`]. + Future setTransceiverInitDirection( + {required ArcRtpTransceiverInit init, + required RtpTransceiverDirection direction, + dynamic hint}); + + FlutterRustBridgeTaskConstMeta get kSetTransceiverInitDirectionConstMeta; + + /// Adds the provided [`RtpEncodingParameters`] to the [`RtpTransceiverInit`]. + Future addTransceiverInitSendEncoding( + {required ArcRtpTransceiverInit init, + required ArcRtpEncodingParameters encoding, + dynamic hint}); + + FlutterRustBridgeTaskConstMeta get kAddTransceiverInitSendEncodingConstMeta; + + /// Creates new [`RtpEncodingParameters`] with the provided settings. + Future createEncodingParameters( + {required String rid, + required bool active, + int? maxBitrate, + double? maxFramerate, + double? scaleResolutionDownBy, + String? scalabilityMode, + dynamic hint}); + + FlutterRustBridgeTaskConstMeta get kCreateEncodingParametersConstMeta; + /// Changes the local description associated with the connection. Future setLocalDescription( {required ArcPeerConnection peer, @@ -89,7 +122,7 @@ abstract class MedeaFlutterWebrtcNative { Future addTransceiver( {required ArcPeerConnection peer, required MediaType mediaType, - required RtpTransceiverDirection direction, + required ArcRtpTransceiverInit init, dynamic hint}); FlutterRustBridgeTaskConstMeta get kAddTransceiverConstMeta; @@ -286,9 +319,17 @@ abstract class MedeaFlutterWebrtcNative { ShareFnType get shareOpaqueArcPeerConnection; OpaqueTypeFinalizer get ArcPeerConnectionFinalizer; + DropFnType get dropOpaqueArcRtpEncodingParameters; + ShareFnType get shareOpaqueArcRtpEncodingParameters; + OpaqueTypeFinalizer get ArcRtpEncodingParametersFinalizer; + DropFnType get dropOpaqueArcRtpTransceiver; ShareFnType get shareOpaqueArcRtpTransceiver; OpaqueTypeFinalizer get ArcRtpTransceiverFinalizer; + + DropFnType get dropOpaqueArcRtpTransceiverInit; + ShareFnType get shareOpaqueArcRtpTransceiverInit; + OpaqueTypeFinalizer get ArcRtpTransceiverInitFinalizer; } @sealed @@ -306,6 +347,22 @@ class ArcPeerConnection extends FrbOpaque { OpaqueTypeFinalizer get staticFinalizer => bridge.ArcPeerConnectionFinalizer; } +@sealed +class ArcRtpEncodingParameters extends FrbOpaque { + final MedeaFlutterWebrtcNative bridge; + ArcRtpEncodingParameters.fromRaw(int ptr, int size, this.bridge) + : super.unsafe(ptr, size); + @override + DropFnType get dropFn => bridge.dropOpaqueArcRtpEncodingParameters; + + @override + ShareFnType get shareFn => bridge.shareOpaqueArcRtpEncodingParameters; + + @override + OpaqueTypeFinalizer get staticFinalizer => + bridge.ArcRtpEncodingParametersFinalizer; +} + @sealed class ArcRtpTransceiver extends FrbOpaque { final MedeaFlutterWebrtcNative bridge; @@ -321,6 +378,22 @@ class ArcRtpTransceiver extends FrbOpaque { OpaqueTypeFinalizer get staticFinalizer => bridge.ArcRtpTransceiverFinalizer; } +@sealed +class ArcRtpTransceiverInit extends FrbOpaque { + final MedeaFlutterWebrtcNative bridge; + ArcRtpTransceiverInit.fromRaw(int ptr, int size, this.bridge) + : super.unsafe(ptr, size); + @override + DropFnType get dropFn => bridge.dropOpaqueArcRtpTransceiverInit; + + @override + ShareFnType get shareFn => bridge.shareOpaqueArcRtpTransceiverInit; + + @override + OpaqueTypeFinalizer get staticFinalizer => + bridge.ArcRtpTransceiverInitFinalizer; +} + /// Nature and settings of the audio [`MediaStreamTrack`] returned by /// [`Webrtc::get_users_media()`]. class AudioConstraints { @@ -351,17 +424,17 @@ enum BundlePolicy { /// [RTCBundlePolicy.balanced][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcbundlepolicy-balanced - Balanced, + balanced, /// [RTCBundlePolicy.max-bundle][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcbundlepolicy-max-bundle - MaxBundle, + maxBundle, /// [RTCBundlePolicy.max-compat][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcbundlepolicy-max-compat - MaxCompat, + maxCompat, } /// [RTCIceCandidateType] represents the type of the ICE candidate, as defined @@ -373,24 +446,24 @@ enum CandidateType { /// Host candidate, as defined in [Section 4.1.1.1 of RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-4.1.1.1 - Host, + host, /// Server reflexive candidate, as defined in /// [Section 4.1.1.2 of RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-4.1.1.2 - Srflx, + srflx, /// Peer reflexive candidate, as defined in /// [Section 4.1.1.2 of RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-4.1.1.2 - Prflx, + prflx, /// Relay candidate, as defined in [Section 7.1.3.2.1 of RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-7.1.3.2.1 - Relay, + relay, } @freezed @@ -493,32 +566,32 @@ enum IceConnectionState { /// [RTCIceConnectionState.checking][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-checking - Checking, + checking, /// [RTCIceConnectionState.connected][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-connected - Connected, + connected, /// [RTCIceConnectionState.completed][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-completed - Completed, + completed, /// [RTCIceConnectionState.failed][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-failed - Failed, + failed, /// [RTCIceConnectionState.disconnected][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-disconnected - Disconnected, + disconnected, /// [RTCIceConnectionState.closed][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtciceconnectionstate-closed - Closed, + closed, } /// [RTCIceGatheringState][1] representation. @@ -533,12 +606,12 @@ enum IceGatheringState { /// [RTCIceGatheringState.gathering][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcicegatheringstate-gathering - Gathering, + gathering, /// [RTCIceGatheringState.complete][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcicegatheringstate-complete - Complete, + complete, } /// Variants of [ICE roles][1]. @@ -552,17 +625,17 @@ enum IceRole { /// been determined. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-3 - Unknown, + unknown, /// Controlling agent as defined by [Section 3 in RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-3 - Controlling, + controlling, /// Controlled agent as defined by [Section 3 in RFC 5245][1]. /// /// [1]: https://tools.ietf.org/html/rfc5245#section-3 - Controlled, + controlled, } /// [RTCIceTransportPolicy][1] representation. @@ -577,20 +650,20 @@ enum IceTransportsType { /// [RTCIceTransportPolicy.all][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcicetransportpolicy-all - All, + all, /// [RTCIceTransportPolicy.relay][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcicetransportpolicy-relay - Relay, + relay, /// ICE Agent can't use `typ host` candidates when this value is specified. /// /// Non-spec-compliant variant. - NoHost, + noHost, /// No ICE candidate offered. - None, + none, } /// Information describing a single media input or output device. @@ -614,13 +687,13 @@ class MediaDeviceInfo { /// Possible kinds of media devices. enum MediaDeviceKind { /// Audio input device (for example, a microphone). - AudioInput, + audioInput, /// Audio output device (for example, a pair of headphones). - AudioOutput, + audioOutput, /// Video input device (for example, a webcam). - VideoInput, + videoInput, } /// Information describing a display. @@ -686,10 +759,10 @@ class MediaStreamTrack { /// Possible media types of a [`MediaStreamTrack`]. enum MediaType { /// Audio [`MediaStreamTrack`]. - Audio, + audio, /// Video [`MediaStreamTrack`]. - Video, + video, } @freezed @@ -806,24 +879,24 @@ enum PeerConnectionState { /// either [`IceConnectionState::Checking`] or /// [`IceConnectionState::Connected`], and no transports are in the /// `failed` state. - Connecting, + connecting, /// Every ICE transport used by the connection is either in use (state /// `connected` or `completed`) or is closed (state `closed`). In addition, /// at least one transport is either `connected` or `completed`. - Connected, + connected, /// At least one of the ICE transports for the connection is in the /// `disconnected` state and none of the other transports are in the state /// `failed`, `connecting` or `checking`. - Disconnected, + disconnected, /// One or more of the ICE transports on the connection is in the `failed` /// state. - Failed, + failed, /// Peer connection is closed. - Closed, + closed, } /// Transport protocols used in [WebRTC]. @@ -833,12 +906,12 @@ enum Protocol { /// [Transmission Control Protocol][1]. /// /// [1]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol - Tcp, + tcp, /// [User Datagram Protocol][1]. /// /// [1]: https://en.wikipedia.org/wiki/User_Datagram_Protocol - Udp, + udp, } /// [`PeerConnection`]'s configuration. @@ -1221,21 +1294,21 @@ enum RtcStatsIceCandidatePairState { /// Check for this pair hasn't been performed, and it can't yet be performed /// until some other check succeeds, allowing this pair to unfreeze and move /// into the [`RtcStatsIceCandidatePairState::Waiting`] state. - Frozen, + frozen, /// Check has not been performed for this pair, and can be performed as soon /// as it is the highest-priority Waiting pair on the check list. - Waiting, + waiting, /// Check has been sent for this pair, but the transaction is in progress. - InProgress, + inProgress, /// Check for this pair was already done and failed, either never producing /// any response or producing an unrecoverable failure response. - Failed, + failed, /// Check for this pair was already done and produced a successful result. - Succeeded, + succeeded, } @freezed @@ -1605,7 +1678,7 @@ enum RtpTransceiverDirection { /// /// [RTCRtpSender]: https://w3.org/TR/webrtc#dom-rtcrtpsender /// [RTCRtpReceiver]: https://w3.org/TR/webrtc#dom-rtcrtpreceiver - SendRecv, + sendRecv, /// The [`RTCRtpTransceiver`]'s [RTCRtpSender] will offer to send RTP, and /// will send RTP if the remote peer accepts. The [`RTCRtpTransceiver`]'s @@ -1614,7 +1687,7 @@ enum RtpTransceiverDirection { /// /// [RTCRtpSender]: https://w3.org/TR/webrtc#dom-rtcrtpsender /// [RTCRtpReceiver]: https://w3.org/TR/webrtc#dom-rtcrtpreceiver - SendOnly, + sendOnly, /// The [`RTCRtpTransceiver`]'s [RTCRtpSender] will not offer to send RTP, /// and will not send RTP. The [`RTCRtpTransceiver`]'s [RTCRtpReceiver] will @@ -1622,7 +1695,7 @@ enum RtpTransceiverDirection { /// /// [RTCRtpSender]: https://w3.org/TR/webrtc#dom-rtcrtpsender /// [RTCRtpReceiver]: https://w3.org/TR/webrtc#dom-rtcrtpreceiver - RecvOnly, + recvOnly, /// The [`RTCRtpTransceiver`]'s [RTCRtpSender] will not offer to send RTP, /// and will not send RTP. The [`RTCRtpTransceiver`]'s [RTCRtpReceiver] will @@ -1630,7 +1703,7 @@ enum RtpTransceiverDirection { /// /// [RTCRtpSender]: https://w3.org/TR/webrtc#dom-rtcrtpsender /// [RTCRtpReceiver]: https://w3.org/TR/webrtc#dom-rtcrtpreceiver - Inactive, + inactive, /// The [`RTCRtpTransceiver`] will neither send nor receive RTP. It will /// generate a zero port in the offer. In answers, its [RTCRtpSender] will @@ -1639,7 +1712,7 @@ enum RtpTransceiverDirection { /// /// [RTCRtpSender]: https://w3.org/TR/webrtc#dom-rtcrtpsender /// [RTCRtpReceiver]: https://w3.org/TR/webrtc#dom-rtcrtpreceiver - Stopped, + stopped, } /// [RTCSdpType] representation. @@ -1649,22 +1722,22 @@ enum SdpType { /// [RTCSdpType.offer][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsdptype-offer - Offer, + offer, /// [RTCSdpType.pranswer][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsdptype-pranswer - PrAnswer, + prAnswer, /// [RTCSdpType.answer][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsdptype-answer - Answer, + answer, /// [RTCSdpType.rollback][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsdptype-rollback - Rollback, + rollback, } /// [RTCSignalingState] representation. @@ -1674,32 +1747,32 @@ enum SignalingState { /// [RTCSignalingState.stable][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsignalingstate-stable - Stable, + stable, /// [RTCSignalingState.have-local-offer][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsignalingstate-have-local-offer - HaveLocalOffer, + haveLocalOffer, /// [RTCSignalingState.have-local-pranswer][1] representation. /// /// [1]: https://tinyurl.com/have-local-pranswer - HaveLocalPrAnswer, + haveLocalPrAnswer, /// [RTCSignalingState.have-remote-offer][1] representation. /// /// [1]: https://tinyurl.com/have-remote-offer - HaveRemoteOffer, + haveRemoteOffer, /// [RTCSignalingState.have-remote-pranswer][1] representation. /// /// [1]: https://tinyurl.com/have-remote-pranswer - HaveRemotePrAnswer, + haveRemotePrAnswer, /// [RTCSignalingState.closed][1] representation. /// /// [1]: https://w3.org/TR/webrtc#dom-rtcsignalingstate-closed - Closed, + closed, } /// Indicator of the current state of a [`MediaStreamTrack`]. @@ -1707,7 +1780,7 @@ enum TrackEvent { /// Ended event of the [`MediaStreamTrack`] interface is fired when playback /// or streaming has stopped because the end of the media was reached or /// because no further data is available. - Ended, + ended, } /// Indicator of the current [MediaStreamTrackState][0] of a @@ -1718,12 +1791,12 @@ enum TrackState { /// [MediaStreamTrackState.live][0] representation. /// /// [0]: https://tinyurl.com/w3mcs#idl-def-MediaStreamTrackState.live - Live, + live, /// [MediaStreamTrackState.ended][0] representation. /// /// [0]: https://tinyurl.com/w3mcs#idl-def-MediaStreamTrackState.ended - Ended, + ended, } /// Nature and settings of the video [`MediaStreamTrack`] returned by @@ -1901,6 +1974,110 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { argNames: ["peer", "voiceActivityDetection", "iceRestart", "useRtpMux"], ); + Future createTransceiverInit({dynamic hint}) { + return _platform.executeNormal(FlutterRustBridgeTask( + callFfi: (port_) => _platform.inner.wire_create_transceiver_init(port_), + parseSuccessData: _wire2api_ArcRtpTransceiverInit, + constMeta: kCreateTransceiverInitConstMeta, + argValues: [], + hint: hint, + )); + } + + FlutterRustBridgeTaskConstMeta get kCreateTransceiverInitConstMeta => + const FlutterRustBridgeTaskConstMeta( + debugName: "create_transceiver_init", + argNames: [], + ); + + Future setTransceiverInitDirection( + {required ArcRtpTransceiverInit init, + required RtpTransceiverDirection direction, + dynamic hint}) { + var arg0 = _platform.api2wire_ArcRtpTransceiverInit(init); + var arg1 = api2wire_rtp_transceiver_direction(direction); + return _platform.executeNormal(FlutterRustBridgeTask( + callFfi: (port_) => _platform.inner + .wire_set_transceiver_init_direction(port_, arg0, arg1), + parseSuccessData: _wire2api_unit, + constMeta: kSetTransceiverInitDirectionConstMeta, + argValues: [init, direction], + hint: hint, + )); + } + + FlutterRustBridgeTaskConstMeta get kSetTransceiverInitDirectionConstMeta => + const FlutterRustBridgeTaskConstMeta( + debugName: "set_transceiver_init_direction", + argNames: ["init", "direction"], + ); + + Future addTransceiverInitSendEncoding( + {required ArcRtpTransceiverInit init, + required ArcRtpEncodingParameters encoding, + dynamic hint}) { + var arg0 = _platform.api2wire_ArcRtpTransceiverInit(init); + var arg1 = _platform.api2wire_ArcRtpEncodingParameters(encoding); + return _platform.executeNormal(FlutterRustBridgeTask( + callFfi: (port_) => _platform.inner + .wire_add_transceiver_init_send_encoding(port_, arg0, arg1), + parseSuccessData: _wire2api_unit, + constMeta: kAddTransceiverInitSendEncodingConstMeta, + argValues: [init, encoding], + hint: hint, + )); + } + + FlutterRustBridgeTaskConstMeta get kAddTransceiverInitSendEncodingConstMeta => + const FlutterRustBridgeTaskConstMeta( + debugName: "add_transceiver_init_send_encoding", + argNames: ["init", "encoding"], + ); + + Future createEncodingParameters( + {required String rid, + required bool active, + int? maxBitrate, + double? maxFramerate, + double? scaleResolutionDownBy, + String? scalabilityMode, + dynamic hint}) { + var arg0 = _platform.api2wire_String(rid); + var arg1 = active; + var arg2 = _platform.api2wire_opt_box_autoadd_i32(maxBitrate); + var arg3 = _platform.api2wire_opt_box_autoadd_f64(maxFramerate); + var arg4 = _platform.api2wire_opt_box_autoadd_f64(scaleResolutionDownBy); + var arg5 = _platform.api2wire_opt_String(scalabilityMode); + return _platform.executeNormal(FlutterRustBridgeTask( + callFfi: (port_) => _platform.inner.wire_create_encoding_parameters( + port_, arg0, arg1, arg2, arg3, arg4, arg5), + parseSuccessData: _wire2api_ArcRtpEncodingParameters, + constMeta: kCreateEncodingParametersConstMeta, + argValues: [ + rid, + active, + maxBitrate, + maxFramerate, + scaleResolutionDownBy, + scalabilityMode + ], + hint: hint, + )); + } + + FlutterRustBridgeTaskConstMeta get kCreateEncodingParametersConstMeta => + const FlutterRustBridgeTaskConstMeta( + debugName: "create_encoding_parameters", + argNames: [ + "rid", + "active", + "maxBitrate", + "maxFramerate", + "scaleResolutionDownBy", + "scalabilityMode" + ], + ); + Future setLocalDescription( {required ArcPeerConnection peer, required SdpType kind, @@ -1952,17 +2129,17 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { Future addTransceiver( {required ArcPeerConnection peer, required MediaType mediaType, - required RtpTransceiverDirection direction, + required ArcRtpTransceiverInit init, dynamic hint}) { var arg0 = _platform.api2wire_ArcPeerConnection(peer); var arg1 = api2wire_media_type(mediaType); - var arg2 = api2wire_rtp_transceiver_direction(direction); + var arg2 = _platform.api2wire_ArcRtpTransceiverInit(init); return _platform.executeNormal(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_add_transceiver(port_, arg0, arg1, arg2), parseSuccessData: _wire2api_rtc_rtp_transceiver, constMeta: kAddTransceiverConstMeta, - argValues: [peer, mediaType, direction], + argValues: [peer, mediaType, init], hint: hint, )); } @@ -1970,7 +2147,7 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { FlutterRustBridgeTaskConstMeta get kAddTransceiverConstMeta => const FlutterRustBridgeTaskConstMeta( debugName: "add_transceiver", - argNames: ["peer", "mediaType", "direction"], + argNames: ["peer", "mediaType", "init"], ); Future> getTransceivers( @@ -2469,6 +2646,13 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { OpaqueTypeFinalizer get ArcPeerConnectionFinalizer => _platform.ArcPeerConnectionFinalizer; + DropFnType get dropOpaqueArcRtpEncodingParameters => + _platform.inner.drop_opaque_ArcRtpEncodingParameters; + ShareFnType get shareOpaqueArcRtpEncodingParameters => + _platform.inner.share_opaque_ArcRtpEncodingParameters; + OpaqueTypeFinalizer get ArcRtpEncodingParametersFinalizer => + _platform.ArcRtpEncodingParametersFinalizer; + DropFnType get dropOpaqueArcRtpTransceiver => _platform.inner.drop_opaque_ArcRtpTransceiver; ShareFnType get shareOpaqueArcRtpTransceiver => @@ -2476,6 +2660,13 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { OpaqueTypeFinalizer get ArcRtpTransceiverFinalizer => _platform.ArcRtpTransceiverFinalizer; + DropFnType get dropOpaqueArcRtpTransceiverInit => + _platform.inner.drop_opaque_ArcRtpTransceiverInit; + ShareFnType get shareOpaqueArcRtpTransceiverInit => + _platform.inner.share_opaque_ArcRtpTransceiverInit; + OpaqueTypeFinalizer get ArcRtpTransceiverInitFinalizer => + _platform.ArcRtpTransceiverInitFinalizer; + void dispose() { _platform.dispose(); } @@ -2485,10 +2676,18 @@ class MedeaFlutterWebrtcNativeImpl implements MedeaFlutterWebrtcNative { return ArcPeerConnection.fromRaw(raw[0], raw[1], this); } + ArcRtpEncodingParameters _wire2api_ArcRtpEncodingParameters(dynamic raw) { + return ArcRtpEncodingParameters.fromRaw(raw[0], raw[1], this); + } + ArcRtpTransceiver _wire2api_ArcRtpTransceiver(dynamic raw) { return ArcRtpTransceiver.fromRaw(raw[0], raw[1], this); } + ArcRtpTransceiverInit _wire2api_ArcRtpTransceiverInit(dynamic raw) { + return ArcRtpTransceiverInit.fromRaw(raw[0], raw[1], this); + } + String _wire2api_String(dynamic raw) { return raw as String; } @@ -3051,6 +3250,11 @@ int api2wire_bundle_policy(BundlePolicy raw) { return api2wire_i32(raw.index); } +@protected +double api2wire_f64(double raw) { + return raw; +} + @protected int api2wire_i32(int raw) { return raw; @@ -3102,6 +3306,14 @@ class MedeaFlutterWebrtcNativePlatform return ptr; } + @protected + wire_ArcRtpEncodingParameters api2wire_ArcRtpEncodingParameters( + ArcRtpEncodingParameters raw) { + final ptr = inner.new_ArcRtpEncodingParameters(); + _api_fill_to_wire_ArcRtpEncodingParameters(raw, ptr); + return ptr; + } + @protected wire_ArcRtpTransceiver api2wire_ArcRtpTransceiver(ArcRtpTransceiver raw) { final ptr = inner.new_ArcRtpTransceiver(); @@ -3109,6 +3321,14 @@ class MedeaFlutterWebrtcNativePlatform return ptr; } + @protected + wire_ArcRtpTransceiverInit api2wire_ArcRtpTransceiverInit( + ArcRtpTransceiverInit raw) { + final ptr = inner.new_ArcRtpTransceiverInit(); + _api_fill_to_wire_ArcRtpTransceiverInit(raw, ptr); + return ptr; + } + @protected ffi.Pointer api2wire_String(String raw) { return api2wire_uint_8_list(utf8.encoder.convert(raw)); @@ -3131,6 +3351,16 @@ class MedeaFlutterWebrtcNativePlatform return ptr; } + @protected + ffi.Pointer api2wire_box_autoadd_f64(double raw) { + return inner.new_box_autoadd_f64_0(api2wire_f64(raw)); + } + + @protected + ffi.Pointer api2wire_box_autoadd_i32(int raw) { + return inner.new_box_autoadd_i32_0(api2wire_i32(raw)); + } + @protected ffi.Pointer api2wire_box_autoadd_media_stream_constraints( @@ -3184,6 +3414,16 @@ class MedeaFlutterWebrtcNativePlatform : api2wire_box_autoadd_audio_constraints(raw); } + @protected + ffi.Pointer api2wire_opt_box_autoadd_f64(double? raw) { + return raw == null ? ffi.nullptr : api2wire_box_autoadd_f64(raw); + } + + @protected + ffi.Pointer api2wire_opt_box_autoadd_i32(int? raw) { + return raw == null ? ffi.nullptr : api2wire_box_autoadd_i32(raw); + } + @protected ffi.Pointer api2wire_opt_box_autoadd_video_constraints( VideoConstraints? raw) { @@ -3210,10 +3450,18 @@ class MedeaFlutterWebrtcNativePlatform OpaqueTypeFinalizer(inner._drop_opaque_ArcPeerConnectionPtr); OpaqueTypeFinalizer get ArcPeerConnectionFinalizer => _ArcPeerConnectionFinalizer; + late final OpaqueTypeFinalizer _ArcRtpEncodingParametersFinalizer = + OpaqueTypeFinalizer(inner._drop_opaque_ArcRtpEncodingParametersPtr); + OpaqueTypeFinalizer get ArcRtpEncodingParametersFinalizer => + _ArcRtpEncodingParametersFinalizer; late final OpaqueTypeFinalizer _ArcRtpTransceiverFinalizer = OpaqueTypeFinalizer(inner._drop_opaque_ArcRtpTransceiverPtr); OpaqueTypeFinalizer get ArcRtpTransceiverFinalizer => _ArcRtpTransceiverFinalizer; + late final OpaqueTypeFinalizer _ArcRtpTransceiverInitFinalizer = + OpaqueTypeFinalizer(inner._drop_opaque_ArcRtpTransceiverInitPtr); + OpaqueTypeFinalizer get ArcRtpTransceiverInitFinalizer => + _ArcRtpTransceiverInitFinalizer; // Section: api_fill_to_wire void _api_fill_to_wire_ArcPeerConnection( @@ -3221,11 +3469,21 @@ class MedeaFlutterWebrtcNativePlatform wireObj.ptr = apiObj.shareOrMove(); } + void _api_fill_to_wire_ArcRtpEncodingParameters( + ArcRtpEncodingParameters apiObj, wire_ArcRtpEncodingParameters wireObj) { + wireObj.ptr = apiObj.shareOrMove(); + } + void _api_fill_to_wire_ArcRtpTransceiver( ArcRtpTransceiver apiObj, wire_ArcRtpTransceiver wireObj) { wireObj.ptr = apiObj.shareOrMove(); } + void _api_fill_to_wire_ArcRtpTransceiverInit( + ArcRtpTransceiverInit apiObj, wire_ArcRtpTransceiverInit wireObj) { + wireObj.ptr = apiObj.shareOrMove(); + } + void _api_fill_to_wire_audio_constraints( AudioConstraints apiObj, wire_AudioConstraints wireObj) { wireObj.device_id = api2wire_opt_String(apiObj.deviceId); @@ -3511,6 +3769,104 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { late final _wire_create_answer = _wire_create_answerPtr.asFunction< void Function(int, wire_ArcPeerConnection, bool, bool, bool)>(); + void wire_create_transceiver_init( + int port_, + ) { + return _wire_create_transceiver_init( + port_, + ); + } + + late final _wire_create_transceiver_initPtr = + _lookup>( + 'wire_create_transceiver_init'); + late final _wire_create_transceiver_init = + _wire_create_transceiver_initPtr.asFunction(); + + void wire_set_transceiver_init_direction( + int port_, + wire_ArcRtpTransceiverInit init, + int direction, + ) { + return _wire_set_transceiver_init_direction( + port_, + init, + direction, + ); + } + + late final _wire_set_transceiver_init_directionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, wire_ArcRtpTransceiverInit, + ffi.Int32)>>('wire_set_transceiver_init_direction'); + late final _wire_set_transceiver_init_direction = + _wire_set_transceiver_init_directionPtr + .asFunction(); + + void wire_add_transceiver_init_send_encoding( + int port_, + wire_ArcRtpTransceiverInit init, + wire_ArcRtpEncodingParameters encoding, + ) { + return _wire_add_transceiver_init_send_encoding( + port_, + init, + encoding, + ); + } + + late final _wire_add_transceiver_init_send_encodingPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, wire_ArcRtpTransceiverInit, + wire_ArcRtpEncodingParameters)>>( + 'wire_add_transceiver_init_send_encoding'); + late final _wire_add_transceiver_init_send_encoding = + _wire_add_transceiver_init_send_encodingPtr.asFunction< + void Function(int, wire_ArcRtpTransceiverInit, + wire_ArcRtpEncodingParameters)>(); + + void wire_create_encoding_parameters( + int port_, + ffi.Pointer rid, + bool active, + ffi.Pointer max_bitrate, + ffi.Pointer max_framerate, + ffi.Pointer scale_resolution_down_by, + ffi.Pointer scalability_mode, + ) { + return _wire_create_encoding_parameters( + port_, + rid, + active, + max_bitrate, + max_framerate, + scale_resolution_down_by, + scalability_mode, + ); + } + + late final _wire_create_encoding_parametersPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'wire_create_encoding_parameters'); + late final _wire_create_encoding_parameters = + _wire_create_encoding_parametersPtr.asFunction< + void Function( + int, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + void wire_set_local_description( int port_, wire_ArcPeerConnection peer, @@ -3561,22 +3917,23 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { int port_, wire_ArcPeerConnection peer, int media_type, - int direction, + wire_ArcRtpTransceiverInit init, ) { return _wire_add_transceiver( port_, peer, media_type, - direction, + init, ); } late final _wire_add_transceiverPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int64, wire_ArcPeerConnection, ffi.Int32, - ffi.Int32)>>('wire_add_transceiver'); - late final _wire_add_transceiver = _wire_add_transceiverPtr - .asFunction(); + wire_ArcRtpTransceiverInit)>>('wire_add_transceiver'); + late final _wire_add_transceiver = _wire_add_transceiverPtr.asFunction< + void Function( + int, wire_ArcPeerConnection, int, wire_ArcRtpTransceiverInit)>(); void wire_get_transceivers( int port_, @@ -4046,6 +4403,16 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { late final _new_ArcPeerConnection = _new_ArcPeerConnectionPtr.asFunction(); + wire_ArcRtpEncodingParameters new_ArcRtpEncodingParameters() { + return _new_ArcRtpEncodingParameters(); + } + + late final _new_ArcRtpEncodingParametersPtr = + _lookup>( + 'new_ArcRtpEncodingParameters'); + late final _new_ArcRtpEncodingParameters = _new_ArcRtpEncodingParametersPtr + .asFunction(); + wire_ArcRtpTransceiver new_ArcRtpTransceiver() { return _new_ArcRtpTransceiver(); } @@ -4056,6 +4423,16 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { late final _new_ArcRtpTransceiver = _new_ArcRtpTransceiverPtr.asFunction(); + wire_ArcRtpTransceiverInit new_ArcRtpTransceiverInit() { + return _new_ArcRtpTransceiverInit(); + } + + late final _new_ArcRtpTransceiverInitPtr = + _lookup>( + 'new_ArcRtpTransceiverInit'); + late final _new_ArcRtpTransceiverInit = _new_ArcRtpTransceiverInitPtr + .asFunction(); + ffi.Pointer new_StringList_0( int len, ) { @@ -4081,6 +4458,34 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { _new_box_autoadd_audio_constraints_0Ptr .asFunction Function()>(); + ffi.Pointer new_box_autoadd_f64_0( + double value, + ) { + return _new_box_autoadd_f64_0( + value, + ); + } + + late final _new_box_autoadd_f64_0Ptr = + _lookup Function(ffi.Double)>>( + 'new_box_autoadd_f64_0'); + late final _new_box_autoadd_f64_0 = _new_box_autoadd_f64_0Ptr + .asFunction Function(double)>(); + + ffi.Pointer new_box_autoadd_i32_0( + int value, + ) { + return _new_box_autoadd_i32_0( + value, + ); + } + + late final _new_box_autoadd_i32_0Ptr = + _lookup Function(ffi.Int32)>>( + 'new_box_autoadd_i32_0'); + late final _new_box_autoadd_i32_0 = _new_box_autoadd_i32_0Ptr + .asFunction Function(int)>(); + ffi.Pointer new_box_autoadd_media_stream_constraints_0() { return _new_box_autoadd_media_stream_constraints_0(); @@ -4176,6 +4581,37 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { _share_opaque_ArcPeerConnectionPtr .asFunction Function(ffi.Pointer)>(); + void drop_opaque_ArcRtpEncodingParameters( + ffi.Pointer ptr, + ) { + return _drop_opaque_ArcRtpEncodingParameters( + ptr, + ); + } + + late final _drop_opaque_ArcRtpEncodingParametersPtr = + _lookup)>>( + 'drop_opaque_ArcRtpEncodingParameters'); + late final _drop_opaque_ArcRtpEncodingParameters = + _drop_opaque_ArcRtpEncodingParametersPtr + .asFunction)>(); + + ffi.Pointer share_opaque_ArcRtpEncodingParameters( + ffi.Pointer ptr, + ) { + return _share_opaque_ArcRtpEncodingParameters( + ptr, + ); + } + + late final _share_opaque_ArcRtpEncodingParametersPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('share_opaque_ArcRtpEncodingParameters'); + late final _share_opaque_ArcRtpEncodingParameters = + _share_opaque_ArcRtpEncodingParametersPtr + .asFunction Function(ffi.Pointer)>(); + void drop_opaque_ArcRtpTransceiver( ffi.Pointer ptr, ) { @@ -4206,6 +4642,37 @@ class MedeaFlutterWebrtcNativeWire implements FlutterRustBridgeWireBase { _share_opaque_ArcRtpTransceiverPtr .asFunction Function(ffi.Pointer)>(); + void drop_opaque_ArcRtpTransceiverInit( + ffi.Pointer ptr, + ) { + return _drop_opaque_ArcRtpTransceiverInit( + ptr, + ); + } + + late final _drop_opaque_ArcRtpTransceiverInitPtr = + _lookup)>>( + 'drop_opaque_ArcRtpTransceiverInit'); + late final _drop_opaque_ArcRtpTransceiverInit = + _drop_opaque_ArcRtpTransceiverInitPtr + .asFunction)>(); + + ffi.Pointer share_opaque_ArcRtpTransceiverInit( + ffi.Pointer ptr, + ) { + return _share_opaque_ArcRtpTransceiverInit( + ptr, + ); + } + + late final _share_opaque_ArcRtpTransceiverInitPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('share_opaque_ArcRtpTransceiverInit'); + late final _share_opaque_ArcRtpTransceiverInit = + _share_opaque_ArcRtpTransceiverInitPtr + .asFunction Function(ffi.Pointer)>(); + void free_WireSyncReturn( WireSyncReturn ptr, ) { @@ -4266,6 +4733,14 @@ final class wire_ArcPeerConnection extends ffi.Struct { external ffi.Pointer ptr; } +final class wire_ArcRtpTransceiverInit extends ffi.Struct { + external ffi.Pointer ptr; +} + +final class wire_ArcRtpEncodingParameters extends ffi.Struct { + external ffi.Pointer ptr; +} + final class wire_ArcRtpTransceiver extends ffi.Struct { external ffi.Pointer ptr; } diff --git a/lib/src/api/bridge.g.freezed.dart b/lib/src/api/bridge.g.freezed.dart index ee0d5b9147..294effbff5 100644 --- a/lib/src/api/bridge.g.freezed.dart +++ b/lib/src/api/bridge.g.freezed.dart @@ -95,22 +95,22 @@ class _$GetMediaErrorCopyWithImpl<$Res, $Val extends GetMediaError> } /// @nodoc -abstract class _$$GetMediaError_AudioCopyWith<$Res> +abstract class _$$GetMediaError_AudioImplCopyWith<$Res> implements $GetMediaErrorCopyWith<$Res> { - factory _$$GetMediaError_AudioCopyWith(_$GetMediaError_Audio value, - $Res Function(_$GetMediaError_Audio) then) = - __$$GetMediaError_AudioCopyWithImpl<$Res>; + factory _$$GetMediaError_AudioImplCopyWith(_$GetMediaError_AudioImpl value, + $Res Function(_$GetMediaError_AudioImpl) then) = + __$$GetMediaError_AudioImplCopyWithImpl<$Res>; @override @useResult $Res call({String field0}); } /// @nodoc -class __$$GetMediaError_AudioCopyWithImpl<$Res> - extends _$GetMediaErrorCopyWithImpl<$Res, _$GetMediaError_Audio> - implements _$$GetMediaError_AudioCopyWith<$Res> { - __$$GetMediaError_AudioCopyWithImpl( - _$GetMediaError_Audio _value, $Res Function(_$GetMediaError_Audio) _then) +class __$$GetMediaError_AudioImplCopyWithImpl<$Res> + extends _$GetMediaErrorCopyWithImpl<$Res, _$GetMediaError_AudioImpl> + implements _$$GetMediaError_AudioImplCopyWith<$Res> { + __$$GetMediaError_AudioImplCopyWithImpl(_$GetMediaError_AudioImpl _value, + $Res Function(_$GetMediaError_AudioImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -118,7 +118,7 @@ class __$$GetMediaError_AudioCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$GetMediaError_Audio( + return _then(_$GetMediaError_AudioImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -129,8 +129,8 @@ class __$$GetMediaError_AudioCopyWithImpl<$Res> /// @nodoc -class _$GetMediaError_Audio implements GetMediaError_Audio { - const _$GetMediaError_Audio(this.field0); +class _$GetMediaError_AudioImpl implements GetMediaError_Audio { + const _$GetMediaError_AudioImpl(this.field0); @override final String field0; @@ -144,7 +144,7 @@ class _$GetMediaError_Audio implements GetMediaError_Audio { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetMediaError_Audio && + other is _$GetMediaError_AudioImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -154,8 +154,8 @@ class _$GetMediaError_Audio implements GetMediaError_Audio { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetMediaError_AudioCopyWith<_$GetMediaError_Audio> get copyWith => - __$$GetMediaError_AudioCopyWithImpl<_$GetMediaError_Audio>( + _$$GetMediaError_AudioImplCopyWith<_$GetMediaError_AudioImpl> get copyWith => + __$$GetMediaError_AudioImplCopyWithImpl<_$GetMediaError_AudioImpl>( this, _$identity); @override @@ -223,33 +223,33 @@ class _$GetMediaError_Audio implements GetMediaError_Audio { abstract class GetMediaError_Audio implements GetMediaError { const factory GetMediaError_Audio(final String field0) = - _$GetMediaError_Audio; + _$GetMediaError_AudioImpl; @override String get field0; @override @JsonKey(ignore: true) - _$$GetMediaError_AudioCopyWith<_$GetMediaError_Audio> get copyWith => + _$$GetMediaError_AudioImplCopyWith<_$GetMediaError_AudioImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GetMediaError_VideoCopyWith<$Res> +abstract class _$$GetMediaError_VideoImplCopyWith<$Res> implements $GetMediaErrorCopyWith<$Res> { - factory _$$GetMediaError_VideoCopyWith(_$GetMediaError_Video value, - $Res Function(_$GetMediaError_Video) then) = - __$$GetMediaError_VideoCopyWithImpl<$Res>; + factory _$$GetMediaError_VideoImplCopyWith(_$GetMediaError_VideoImpl value, + $Res Function(_$GetMediaError_VideoImpl) then) = + __$$GetMediaError_VideoImplCopyWithImpl<$Res>; @override @useResult $Res call({String field0}); } /// @nodoc -class __$$GetMediaError_VideoCopyWithImpl<$Res> - extends _$GetMediaErrorCopyWithImpl<$Res, _$GetMediaError_Video> - implements _$$GetMediaError_VideoCopyWith<$Res> { - __$$GetMediaError_VideoCopyWithImpl( - _$GetMediaError_Video _value, $Res Function(_$GetMediaError_Video) _then) +class __$$GetMediaError_VideoImplCopyWithImpl<$Res> + extends _$GetMediaErrorCopyWithImpl<$Res, _$GetMediaError_VideoImpl> + implements _$$GetMediaError_VideoImplCopyWith<$Res> { + __$$GetMediaError_VideoImplCopyWithImpl(_$GetMediaError_VideoImpl _value, + $Res Function(_$GetMediaError_VideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -257,7 +257,7 @@ class __$$GetMediaError_VideoCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$GetMediaError_Video( + return _then(_$GetMediaError_VideoImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -268,8 +268,8 @@ class __$$GetMediaError_VideoCopyWithImpl<$Res> /// @nodoc -class _$GetMediaError_Video implements GetMediaError_Video { - const _$GetMediaError_Video(this.field0); +class _$GetMediaError_VideoImpl implements GetMediaError_Video { + const _$GetMediaError_VideoImpl(this.field0); @override final String field0; @@ -283,7 +283,7 @@ class _$GetMediaError_Video implements GetMediaError_Video { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetMediaError_Video && + other is _$GetMediaError_VideoImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -293,8 +293,8 @@ class _$GetMediaError_Video implements GetMediaError_Video { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetMediaError_VideoCopyWith<_$GetMediaError_Video> get copyWith => - __$$GetMediaError_VideoCopyWithImpl<_$GetMediaError_Video>( + _$$GetMediaError_VideoImplCopyWith<_$GetMediaError_VideoImpl> get copyWith => + __$$GetMediaError_VideoImplCopyWithImpl<_$GetMediaError_VideoImpl>( this, _$identity); @override @@ -362,13 +362,13 @@ class _$GetMediaError_Video implements GetMediaError_Video { abstract class GetMediaError_Video implements GetMediaError { const factory GetMediaError_Video(final String field0) = - _$GetMediaError_Video; + _$GetMediaError_VideoImpl; @override String get field0; @override @JsonKey(ignore: true) - _$$GetMediaError_VideoCopyWith<_$GetMediaError_Video> get copyWith => + _$$GetMediaError_VideoImplCopyWith<_$GetMediaError_VideoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -434,20 +434,20 @@ class _$GetMediaResultCopyWithImpl<$Res, $Val extends GetMediaResult> } /// @nodoc -abstract class _$$GetMediaResult_OkCopyWith<$Res> { - factory _$$GetMediaResult_OkCopyWith( - _$GetMediaResult_Ok value, $Res Function(_$GetMediaResult_Ok) then) = - __$$GetMediaResult_OkCopyWithImpl<$Res>; +abstract class _$$GetMediaResult_OkImplCopyWith<$Res> { + factory _$$GetMediaResult_OkImplCopyWith(_$GetMediaResult_OkImpl value, + $Res Function(_$GetMediaResult_OkImpl) then) = + __$$GetMediaResult_OkImplCopyWithImpl<$Res>; @useResult $Res call({List field0}); } /// @nodoc -class __$$GetMediaResult_OkCopyWithImpl<$Res> - extends _$GetMediaResultCopyWithImpl<$Res, _$GetMediaResult_Ok> - implements _$$GetMediaResult_OkCopyWith<$Res> { - __$$GetMediaResult_OkCopyWithImpl( - _$GetMediaResult_Ok _value, $Res Function(_$GetMediaResult_Ok) _then) +class __$$GetMediaResult_OkImplCopyWithImpl<$Res> + extends _$GetMediaResultCopyWithImpl<$Res, _$GetMediaResult_OkImpl> + implements _$$GetMediaResult_OkImplCopyWith<$Res> { + __$$GetMediaResult_OkImplCopyWithImpl(_$GetMediaResult_OkImpl _value, + $Res Function(_$GetMediaResult_OkImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -455,7 +455,7 @@ class __$$GetMediaResult_OkCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$GetMediaResult_Ok( + return _then(_$GetMediaResult_OkImpl( null == field0 ? _value._field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -466,8 +466,8 @@ class __$$GetMediaResult_OkCopyWithImpl<$Res> /// @nodoc -class _$GetMediaResult_Ok implements GetMediaResult_Ok { - const _$GetMediaResult_Ok(final List field0) +class _$GetMediaResult_OkImpl implements GetMediaResult_Ok { + const _$GetMediaResult_OkImpl(final List field0) : _field0 = field0; final List _field0; @@ -487,7 +487,7 @@ class _$GetMediaResult_Ok implements GetMediaResult_Ok { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetMediaResult_Ok && + other is _$GetMediaResult_OkImpl && const DeepCollectionEquality().equals(other._field0, _field0)); } @@ -498,8 +498,9 @@ class _$GetMediaResult_Ok implements GetMediaResult_Ok { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetMediaResult_OkCopyWith<_$GetMediaResult_Ok> get copyWith => - __$$GetMediaResult_OkCopyWithImpl<_$GetMediaResult_Ok>(this, _$identity); + _$$GetMediaResult_OkImplCopyWith<_$GetMediaResult_OkImpl> get copyWith => + __$$GetMediaResult_OkImplCopyWithImpl<_$GetMediaResult_OkImpl>( + this, _$identity); @override @optionalTypeArgs @@ -566,20 +567,20 @@ class _$GetMediaResult_Ok implements GetMediaResult_Ok { abstract class GetMediaResult_Ok implements GetMediaResult { const factory GetMediaResult_Ok(final List field0) = - _$GetMediaResult_Ok; + _$GetMediaResult_OkImpl; @override List get field0; @JsonKey(ignore: true) - _$$GetMediaResult_OkCopyWith<_$GetMediaResult_Ok> get copyWith => + _$$GetMediaResult_OkImplCopyWith<_$GetMediaResult_OkImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GetMediaResult_ErrCopyWith<$Res> { - factory _$$GetMediaResult_ErrCopyWith(_$GetMediaResult_Err value, - $Res Function(_$GetMediaResult_Err) then) = - __$$GetMediaResult_ErrCopyWithImpl<$Res>; +abstract class _$$GetMediaResult_ErrImplCopyWith<$Res> { + factory _$$GetMediaResult_ErrImplCopyWith(_$GetMediaResult_ErrImpl value, + $Res Function(_$GetMediaResult_ErrImpl) then) = + __$$GetMediaResult_ErrImplCopyWithImpl<$Res>; @useResult $Res call({GetMediaError field0}); @@ -587,11 +588,11 @@ abstract class _$$GetMediaResult_ErrCopyWith<$Res> { } /// @nodoc -class __$$GetMediaResult_ErrCopyWithImpl<$Res> - extends _$GetMediaResultCopyWithImpl<$Res, _$GetMediaResult_Err> - implements _$$GetMediaResult_ErrCopyWith<$Res> { - __$$GetMediaResult_ErrCopyWithImpl( - _$GetMediaResult_Err _value, $Res Function(_$GetMediaResult_Err) _then) +class __$$GetMediaResult_ErrImplCopyWithImpl<$Res> + extends _$GetMediaResultCopyWithImpl<$Res, _$GetMediaResult_ErrImpl> + implements _$$GetMediaResult_ErrImplCopyWith<$Res> { + __$$GetMediaResult_ErrImplCopyWithImpl(_$GetMediaResult_ErrImpl _value, + $Res Function(_$GetMediaResult_ErrImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -599,7 +600,7 @@ class __$$GetMediaResult_ErrCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$GetMediaResult_Err( + return _then(_$GetMediaResult_ErrImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -618,8 +619,8 @@ class __$$GetMediaResult_ErrCopyWithImpl<$Res> /// @nodoc -class _$GetMediaResult_Err implements GetMediaResult_Err { - const _$GetMediaResult_Err(this.field0); +class _$GetMediaResult_ErrImpl implements GetMediaResult_Err { + const _$GetMediaResult_ErrImpl(this.field0); @override final GetMediaError field0; @@ -633,7 +634,7 @@ class _$GetMediaResult_Err implements GetMediaResult_Err { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetMediaResult_Err && + other is _$GetMediaResult_ErrImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -643,8 +644,8 @@ class _$GetMediaResult_Err implements GetMediaResult_Err { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetMediaResult_ErrCopyWith<_$GetMediaResult_Err> get copyWith => - __$$GetMediaResult_ErrCopyWithImpl<_$GetMediaResult_Err>( + _$$GetMediaResult_ErrImplCopyWith<_$GetMediaResult_ErrImpl> get copyWith => + __$$GetMediaResult_ErrImplCopyWithImpl<_$GetMediaResult_ErrImpl>( this, _$identity); @override @@ -712,12 +713,12 @@ class _$GetMediaResult_Err implements GetMediaResult_Err { abstract class GetMediaResult_Err implements GetMediaResult { const factory GetMediaResult_Err(final GetMediaError field0) = - _$GetMediaResult_Err; + _$GetMediaResult_ErrImpl; @override GetMediaError get field0; @JsonKey(ignore: true) - _$$GetMediaResult_ErrCopyWith<_$GetMediaResult_Err> get copyWith => + _$$GetMediaResult_ErrImplCopyWith<_$GetMediaResult_ErrImpl> get copyWith => throw _privateConstructorUsedError; } @@ -856,23 +857,23 @@ class _$PeerConnectionEventCopyWithImpl<$Res, $Val extends PeerConnectionEvent> } /// @nodoc -abstract class _$$PeerConnectionEvent_PeerCreatedCopyWith<$Res> { - factory _$$PeerConnectionEvent_PeerCreatedCopyWith( - _$PeerConnectionEvent_PeerCreated value, - $Res Function(_$PeerConnectionEvent_PeerCreated) then) = - __$$PeerConnectionEvent_PeerCreatedCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_PeerCreatedImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_PeerCreatedImplCopyWith( + _$PeerConnectionEvent_PeerCreatedImpl value, + $Res Function(_$PeerConnectionEvent_PeerCreatedImpl) then) = + __$$PeerConnectionEvent_PeerCreatedImplCopyWithImpl<$Res>; @useResult $Res call({ArcPeerConnection peer}); } /// @nodoc -class __$$PeerConnectionEvent_PeerCreatedCopyWithImpl<$Res> +class __$$PeerConnectionEvent_PeerCreatedImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_PeerCreated> - implements _$$PeerConnectionEvent_PeerCreatedCopyWith<$Res> { - __$$PeerConnectionEvent_PeerCreatedCopyWithImpl( - _$PeerConnectionEvent_PeerCreated _value, - $Res Function(_$PeerConnectionEvent_PeerCreated) _then) + _$PeerConnectionEvent_PeerCreatedImpl> + implements _$$PeerConnectionEvent_PeerCreatedImplCopyWith<$Res> { + __$$PeerConnectionEvent_PeerCreatedImplCopyWithImpl( + _$PeerConnectionEvent_PeerCreatedImpl _value, + $Res Function(_$PeerConnectionEvent_PeerCreatedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -880,7 +881,7 @@ class __$$PeerConnectionEvent_PeerCreatedCopyWithImpl<$Res> $Res call({ Object? peer = null, }) { - return _then(_$PeerConnectionEvent_PeerCreated( + return _then(_$PeerConnectionEvent_PeerCreatedImpl( peer: null == peer ? _value.peer : peer // ignore: cast_nullable_to_non_nullable @@ -891,9 +892,9 @@ class __$$PeerConnectionEvent_PeerCreatedCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_PeerCreated +class _$PeerConnectionEvent_PeerCreatedImpl implements PeerConnectionEvent_PeerCreated { - const _$PeerConnectionEvent_PeerCreated({required this.peer}); + const _$PeerConnectionEvent_PeerCreatedImpl({required this.peer}); /// Rust side [`PeerConnection`]. @override @@ -908,7 +909,7 @@ class _$PeerConnectionEvent_PeerCreated bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_PeerCreated && + other is _$PeerConnectionEvent_PeerCreatedImpl && (identical(other.peer, peer) || other.peer == peer)); } @@ -918,9 +919,10 @@ class _$PeerConnectionEvent_PeerCreated @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_PeerCreatedCopyWith<_$PeerConnectionEvent_PeerCreated> - get copyWith => __$$PeerConnectionEvent_PeerCreatedCopyWithImpl< - _$PeerConnectionEvent_PeerCreated>(this, _$identity); + _$$PeerConnectionEvent_PeerCreatedImplCopyWith< + _$PeerConnectionEvent_PeerCreatedImpl> + get copyWith => __$$PeerConnectionEvent_PeerCreatedImplCopyWithImpl< + _$PeerConnectionEvent_PeerCreatedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1062,33 +1064,34 @@ class _$PeerConnectionEvent_PeerCreated abstract class PeerConnectionEvent_PeerCreated implements PeerConnectionEvent { const factory PeerConnectionEvent_PeerCreated( {required final ArcPeerConnection peer}) = - _$PeerConnectionEvent_PeerCreated; + _$PeerConnectionEvent_PeerCreatedImpl; /// Rust side [`PeerConnection`]. ArcPeerConnection get peer; @JsonKey(ignore: true) - _$$PeerConnectionEvent_PeerCreatedCopyWith<_$PeerConnectionEvent_PeerCreated> + _$$PeerConnectionEvent_PeerCreatedImplCopyWith< + _$PeerConnectionEvent_PeerCreatedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_IceCandidateCopyWith<$Res> { - factory _$$PeerConnectionEvent_IceCandidateCopyWith( - _$PeerConnectionEvent_IceCandidate value, - $Res Function(_$PeerConnectionEvent_IceCandidate) then) = - __$$PeerConnectionEvent_IceCandidateCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_IceCandidateImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_IceCandidateImplCopyWith( + _$PeerConnectionEvent_IceCandidateImpl value, + $Res Function(_$PeerConnectionEvent_IceCandidateImpl) then) = + __$$PeerConnectionEvent_IceCandidateImplCopyWithImpl<$Res>; @useResult $Res call({String sdpMid, int sdpMlineIndex, String candidate}); } /// @nodoc -class __$$PeerConnectionEvent_IceCandidateCopyWithImpl<$Res> +class __$$PeerConnectionEvent_IceCandidateImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_IceCandidate> - implements _$$PeerConnectionEvent_IceCandidateCopyWith<$Res> { - __$$PeerConnectionEvent_IceCandidateCopyWithImpl( - _$PeerConnectionEvent_IceCandidate _value, - $Res Function(_$PeerConnectionEvent_IceCandidate) _then) + _$PeerConnectionEvent_IceCandidateImpl> + implements _$$PeerConnectionEvent_IceCandidateImplCopyWith<$Res> { + __$$PeerConnectionEvent_IceCandidateImplCopyWithImpl( + _$PeerConnectionEvent_IceCandidateImpl _value, + $Res Function(_$PeerConnectionEvent_IceCandidateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1098,7 +1101,7 @@ class __$$PeerConnectionEvent_IceCandidateCopyWithImpl<$Res> Object? sdpMlineIndex = null, Object? candidate = null, }) { - return _then(_$PeerConnectionEvent_IceCandidate( + return _then(_$PeerConnectionEvent_IceCandidateImpl( sdpMid: null == sdpMid ? _value.sdpMid : sdpMid // ignore: cast_nullable_to_non_nullable @@ -1117,9 +1120,9 @@ class __$$PeerConnectionEvent_IceCandidateCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_IceCandidate +class _$PeerConnectionEvent_IceCandidateImpl implements PeerConnectionEvent_IceCandidate { - const _$PeerConnectionEvent_IceCandidate( + const _$PeerConnectionEvent_IceCandidateImpl( {required this.sdpMid, required this.sdpMlineIndex, required this.candidate}); @@ -1160,7 +1163,7 @@ class _$PeerConnectionEvent_IceCandidate bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_IceCandidate && + other is _$PeerConnectionEvent_IceCandidateImpl && (identical(other.sdpMid, sdpMid) || other.sdpMid == sdpMid) && (identical(other.sdpMlineIndex, sdpMlineIndex) || other.sdpMlineIndex == sdpMlineIndex) && @@ -1175,10 +1178,10 @@ class _$PeerConnectionEvent_IceCandidate @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_IceCandidateCopyWith< - _$PeerConnectionEvent_IceCandidate> - get copyWith => __$$PeerConnectionEvent_IceCandidateCopyWithImpl< - _$PeerConnectionEvent_IceCandidate>(this, _$identity); + _$$PeerConnectionEvent_IceCandidateImplCopyWith< + _$PeerConnectionEvent_IceCandidateImpl> + get copyWith => __$$PeerConnectionEvent_IceCandidateImplCopyWithImpl< + _$PeerConnectionEvent_IceCandidateImpl>(this, _$identity); @override @optionalTypeArgs @@ -1319,9 +1322,10 @@ class _$PeerConnectionEvent_IceCandidate abstract class PeerConnectionEvent_IceCandidate implements PeerConnectionEvent { const factory PeerConnectionEvent_IceCandidate( - {required final String sdpMid, - required final int sdpMlineIndex, - required final String candidate}) = _$PeerConnectionEvent_IceCandidate; + {required final String sdpMid, + required final int sdpMlineIndex, + required final String candidate}) = + _$PeerConnectionEvent_IceCandidateImpl; /// Media stream "identification-tag" defined in [RFC 5888] for the /// media component the discovered [RTCIceCandidate][1] is associated @@ -1347,29 +1351,32 @@ abstract class PeerConnectionEvent_IceCandidate implements PeerConnectionEvent { /// [RFC 5245]: https://tools.ietf.org/html/rfc5245 String get candidate; @JsonKey(ignore: true) - _$$PeerConnectionEvent_IceCandidateCopyWith< - _$PeerConnectionEvent_IceCandidate> + _$$PeerConnectionEvent_IceCandidateImplCopyWith< + _$PeerConnectionEvent_IceCandidateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_IceGatheringStateChangeCopyWith<$Res> { - factory _$$PeerConnectionEvent_IceGatheringStateChangeCopyWith( - _$PeerConnectionEvent_IceGatheringStateChange value, - $Res Function(_$PeerConnectionEvent_IceGatheringStateChange) then) = - __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWith< + $Res> { + factory _$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWith( + _$PeerConnectionEvent_IceGatheringStateChangeImpl value, + $Res Function(_$PeerConnectionEvent_IceGatheringStateChangeImpl) + then) = + __$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWithImpl<$Res>; @useResult $Res call({IceGatheringState field0}); } /// @nodoc -class __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl<$Res> +class __$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_IceGatheringStateChange> - implements _$$PeerConnectionEvent_IceGatheringStateChangeCopyWith<$Res> { - __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl( - _$PeerConnectionEvent_IceGatheringStateChange _value, - $Res Function(_$PeerConnectionEvent_IceGatheringStateChange) _then) + _$PeerConnectionEvent_IceGatheringStateChangeImpl> + implements + _$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWith<$Res> { + __$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWithImpl( + _$PeerConnectionEvent_IceGatheringStateChangeImpl _value, + $Res Function(_$PeerConnectionEvent_IceGatheringStateChangeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1377,7 +1384,7 @@ class __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$PeerConnectionEvent_IceGatheringStateChange( + return _then(_$PeerConnectionEvent_IceGatheringStateChangeImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -1388,9 +1395,9 @@ class __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_IceGatheringStateChange +class _$PeerConnectionEvent_IceGatheringStateChangeImpl implements PeerConnectionEvent_IceGatheringStateChange { - const _$PeerConnectionEvent_IceGatheringStateChange(this.field0); + const _$PeerConnectionEvent_IceGatheringStateChangeImpl(this.field0); @override final IceGatheringState field0; @@ -1404,7 +1411,7 @@ class _$PeerConnectionEvent_IceGatheringStateChange bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_IceGatheringStateChange && + other is _$PeerConnectionEvent_IceGatheringStateChangeImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -1414,11 +1421,12 @@ class _$PeerConnectionEvent_IceGatheringStateChange @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_IceGatheringStateChangeCopyWith< - _$PeerConnectionEvent_IceGatheringStateChange> + _$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWith< + _$PeerConnectionEvent_IceGatheringStateChangeImpl> get copyWith => - __$$PeerConnectionEvent_IceGatheringStateChangeCopyWithImpl< - _$PeerConnectionEvent_IceGatheringStateChange>(this, _$identity); + __$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWithImpl< + _$PeerConnectionEvent_IceGatheringStateChangeImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1561,34 +1569,34 @@ abstract class PeerConnectionEvent_IceGatheringStateChange implements PeerConnectionEvent { const factory PeerConnectionEvent_IceGatheringStateChange( final IceGatheringState field0) = - _$PeerConnectionEvent_IceGatheringStateChange; + _$PeerConnectionEvent_IceGatheringStateChangeImpl; IceGatheringState get field0; @JsonKey(ignore: true) - _$$PeerConnectionEvent_IceGatheringStateChangeCopyWith< - _$PeerConnectionEvent_IceGatheringStateChange> + _$$PeerConnectionEvent_IceGatheringStateChangeImplCopyWith< + _$PeerConnectionEvent_IceGatheringStateChangeImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_IceCandidateErrorCopyWith<$Res> { - factory _$$PeerConnectionEvent_IceCandidateErrorCopyWith( - _$PeerConnectionEvent_IceCandidateError value, - $Res Function(_$PeerConnectionEvent_IceCandidateError) then) = - __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_IceCandidateErrorImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_IceCandidateErrorImplCopyWith( + _$PeerConnectionEvent_IceCandidateErrorImpl value, + $Res Function(_$PeerConnectionEvent_IceCandidateErrorImpl) then) = + __$$PeerConnectionEvent_IceCandidateErrorImplCopyWithImpl<$Res>; @useResult $Res call( {String address, int port, String url, int errorCode, String errorText}); } /// @nodoc -class __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl<$Res> +class __$$PeerConnectionEvent_IceCandidateErrorImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_IceCandidateError> - implements _$$PeerConnectionEvent_IceCandidateErrorCopyWith<$Res> { - __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl( - _$PeerConnectionEvent_IceCandidateError _value, - $Res Function(_$PeerConnectionEvent_IceCandidateError) _then) + _$PeerConnectionEvent_IceCandidateErrorImpl> + implements _$$PeerConnectionEvent_IceCandidateErrorImplCopyWith<$Res> { + __$$PeerConnectionEvent_IceCandidateErrorImplCopyWithImpl( + _$PeerConnectionEvent_IceCandidateErrorImpl _value, + $Res Function(_$PeerConnectionEvent_IceCandidateErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1600,7 +1608,7 @@ class __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl<$Res> Object? errorCode = null, Object? errorText = null, }) { - return _then(_$PeerConnectionEvent_IceCandidateError( + return _then(_$PeerConnectionEvent_IceCandidateErrorImpl( address: null == address ? _value.address : address // ignore: cast_nullable_to_non_nullable @@ -1627,9 +1635,9 @@ class __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_IceCandidateError +class _$PeerConnectionEvent_IceCandidateErrorImpl implements PeerConnectionEvent_IceCandidateError { - const _$PeerConnectionEvent_IceCandidateError( + const _$PeerConnectionEvent_IceCandidateErrorImpl( {required this.address, required this.port, required this.url, @@ -1678,7 +1686,7 @@ class _$PeerConnectionEvent_IceCandidateError bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_IceCandidateError && + other is _$PeerConnectionEvent_IceCandidateErrorImpl && (identical(other.address, address) || other.address == address) && (identical(other.port, port) || other.port == port) && (identical(other.url, url) || other.url == url) && @@ -1695,10 +1703,10 @@ class _$PeerConnectionEvent_IceCandidateError @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_IceCandidateErrorCopyWith< - _$PeerConnectionEvent_IceCandidateError> - get copyWith => __$$PeerConnectionEvent_IceCandidateErrorCopyWithImpl< - _$PeerConnectionEvent_IceCandidateError>(this, _$identity); + _$$PeerConnectionEvent_IceCandidateErrorImplCopyWith< + _$PeerConnectionEvent_IceCandidateErrorImpl> + get copyWith => __$$PeerConnectionEvent_IceCandidateErrorImplCopyWithImpl< + _$PeerConnectionEvent_IceCandidateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1845,7 +1853,7 @@ abstract class PeerConnectionEvent_IceCandidateError required final String url, required final int errorCode, required final String errorText}) = - _$PeerConnectionEvent_IceCandidateError; + _$PeerConnectionEvent_IceCandidateErrorImpl; /// Local IP address used to communicate with the STUN or TURN server. String get address; @@ -1875,35 +1883,35 @@ abstract class PeerConnectionEvent_IceCandidateError /// [1]: https://tinyurl.com/stun-parameters-6 String get errorText; @JsonKey(ignore: true) - _$$PeerConnectionEvent_IceCandidateErrorCopyWith< - _$PeerConnectionEvent_IceCandidateError> + _$$PeerConnectionEvent_IceCandidateErrorImplCopyWith< + _$PeerConnectionEvent_IceCandidateErrorImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_NegotiationNeededCopyWith<$Res> { - factory _$$PeerConnectionEvent_NegotiationNeededCopyWith( - _$PeerConnectionEvent_NegotiationNeeded value, - $Res Function(_$PeerConnectionEvent_NegotiationNeeded) then) = - __$$PeerConnectionEvent_NegotiationNeededCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_NegotiationNeededImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_NegotiationNeededImplCopyWith( + _$PeerConnectionEvent_NegotiationNeededImpl value, + $Res Function(_$PeerConnectionEvent_NegotiationNeededImpl) then) = + __$$PeerConnectionEvent_NegotiationNeededImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PeerConnectionEvent_NegotiationNeededCopyWithImpl<$Res> +class __$$PeerConnectionEvent_NegotiationNeededImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_NegotiationNeeded> - implements _$$PeerConnectionEvent_NegotiationNeededCopyWith<$Res> { - __$$PeerConnectionEvent_NegotiationNeededCopyWithImpl( - _$PeerConnectionEvent_NegotiationNeeded _value, - $Res Function(_$PeerConnectionEvent_NegotiationNeeded) _then) + _$PeerConnectionEvent_NegotiationNeededImpl> + implements _$$PeerConnectionEvent_NegotiationNeededImplCopyWith<$Res> { + __$$PeerConnectionEvent_NegotiationNeededImplCopyWithImpl( + _$PeerConnectionEvent_NegotiationNeededImpl _value, + $Res Function(_$PeerConnectionEvent_NegotiationNeededImpl) _then) : super(_value, _then); } /// @nodoc -class _$PeerConnectionEvent_NegotiationNeeded +class _$PeerConnectionEvent_NegotiationNeededImpl implements PeerConnectionEvent_NegotiationNeeded { - const _$PeerConnectionEvent_NegotiationNeeded(); + const _$PeerConnectionEvent_NegotiationNeededImpl(); @override String toString() { @@ -1914,7 +1922,7 @@ class _$PeerConnectionEvent_NegotiationNeeded bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_NegotiationNeeded); + other is _$PeerConnectionEvent_NegotiationNeededImpl); } @override @@ -2060,27 +2068,27 @@ class _$PeerConnectionEvent_NegotiationNeeded abstract class PeerConnectionEvent_NegotiationNeeded implements PeerConnectionEvent { const factory PeerConnectionEvent_NegotiationNeeded() = - _$PeerConnectionEvent_NegotiationNeeded; + _$PeerConnectionEvent_NegotiationNeededImpl; } /// @nodoc -abstract class _$$PeerConnectionEvent_SignallingChangeCopyWith<$Res> { - factory _$$PeerConnectionEvent_SignallingChangeCopyWith( - _$PeerConnectionEvent_SignallingChange value, - $Res Function(_$PeerConnectionEvent_SignallingChange) then) = - __$$PeerConnectionEvent_SignallingChangeCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_SignallingChangeImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_SignallingChangeImplCopyWith( + _$PeerConnectionEvent_SignallingChangeImpl value, + $Res Function(_$PeerConnectionEvent_SignallingChangeImpl) then) = + __$$PeerConnectionEvent_SignallingChangeImplCopyWithImpl<$Res>; @useResult $Res call({SignalingState field0}); } /// @nodoc -class __$$PeerConnectionEvent_SignallingChangeCopyWithImpl<$Res> +class __$$PeerConnectionEvent_SignallingChangeImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_SignallingChange> - implements _$$PeerConnectionEvent_SignallingChangeCopyWith<$Res> { - __$$PeerConnectionEvent_SignallingChangeCopyWithImpl( - _$PeerConnectionEvent_SignallingChange _value, - $Res Function(_$PeerConnectionEvent_SignallingChange) _then) + _$PeerConnectionEvent_SignallingChangeImpl> + implements _$$PeerConnectionEvent_SignallingChangeImplCopyWith<$Res> { + __$$PeerConnectionEvent_SignallingChangeImplCopyWithImpl( + _$PeerConnectionEvent_SignallingChangeImpl _value, + $Res Function(_$PeerConnectionEvent_SignallingChangeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2088,7 +2096,7 @@ class __$$PeerConnectionEvent_SignallingChangeCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$PeerConnectionEvent_SignallingChange( + return _then(_$PeerConnectionEvent_SignallingChangeImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -2099,9 +2107,9 @@ class __$$PeerConnectionEvent_SignallingChangeCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_SignallingChange +class _$PeerConnectionEvent_SignallingChangeImpl implements PeerConnectionEvent_SignallingChange { - const _$PeerConnectionEvent_SignallingChange(this.field0); + const _$PeerConnectionEvent_SignallingChangeImpl(this.field0); @override final SignalingState field0; @@ -2115,7 +2123,7 @@ class _$PeerConnectionEvent_SignallingChange bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_SignallingChange && + other is _$PeerConnectionEvent_SignallingChangeImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -2125,10 +2133,10 @@ class _$PeerConnectionEvent_SignallingChange @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_SignallingChangeCopyWith< - _$PeerConnectionEvent_SignallingChange> - get copyWith => __$$PeerConnectionEvent_SignallingChangeCopyWithImpl< - _$PeerConnectionEvent_SignallingChange>(this, _$identity); + _$$PeerConnectionEvent_SignallingChangeImplCopyWith< + _$PeerConnectionEvent_SignallingChangeImpl> + get copyWith => __$$PeerConnectionEvent_SignallingChangeImplCopyWithImpl< + _$PeerConnectionEvent_SignallingChangeImpl>(this, _$identity); @override @optionalTypeArgs @@ -2270,33 +2278,36 @@ class _$PeerConnectionEvent_SignallingChange abstract class PeerConnectionEvent_SignallingChange implements PeerConnectionEvent { const factory PeerConnectionEvent_SignallingChange( - final SignalingState field0) = _$PeerConnectionEvent_SignallingChange; + final SignalingState field0) = _$PeerConnectionEvent_SignallingChangeImpl; SignalingState get field0; @JsonKey(ignore: true) - _$$PeerConnectionEvent_SignallingChangeCopyWith< - _$PeerConnectionEvent_SignallingChange> + _$$PeerConnectionEvent_SignallingChangeImplCopyWith< + _$PeerConnectionEvent_SignallingChangeImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_IceConnectionStateChangeCopyWith<$Res> { - factory _$$PeerConnectionEvent_IceConnectionStateChangeCopyWith( - _$PeerConnectionEvent_IceConnectionStateChange value, - $Res Function(_$PeerConnectionEvent_IceConnectionStateChange) then) = - __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWith< + $Res> { + factory _$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWith( + _$PeerConnectionEvent_IceConnectionStateChangeImpl value, + $Res Function(_$PeerConnectionEvent_IceConnectionStateChangeImpl) + then) = + __$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWithImpl<$Res>; @useResult $Res call({IceConnectionState field0}); } /// @nodoc -class __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl<$Res> +class __$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_IceConnectionStateChange> - implements _$$PeerConnectionEvent_IceConnectionStateChangeCopyWith<$Res> { - __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl( - _$PeerConnectionEvent_IceConnectionStateChange _value, - $Res Function(_$PeerConnectionEvent_IceConnectionStateChange) _then) + _$PeerConnectionEvent_IceConnectionStateChangeImpl> + implements + _$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWith<$Res> { + __$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWithImpl( + _$PeerConnectionEvent_IceConnectionStateChangeImpl _value, + $Res Function(_$PeerConnectionEvent_IceConnectionStateChangeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2304,7 +2315,7 @@ class __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$PeerConnectionEvent_IceConnectionStateChange( + return _then(_$PeerConnectionEvent_IceConnectionStateChangeImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -2315,9 +2326,9 @@ class __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_IceConnectionStateChange +class _$PeerConnectionEvent_IceConnectionStateChangeImpl implements PeerConnectionEvent_IceConnectionStateChange { - const _$PeerConnectionEvent_IceConnectionStateChange(this.field0); + const _$PeerConnectionEvent_IceConnectionStateChangeImpl(this.field0); @override final IceConnectionState field0; @@ -2331,7 +2342,7 @@ class _$PeerConnectionEvent_IceConnectionStateChange bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_IceConnectionStateChange && + other is _$PeerConnectionEvent_IceConnectionStateChangeImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -2341,11 +2352,12 @@ class _$PeerConnectionEvent_IceConnectionStateChange @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_IceConnectionStateChangeCopyWith< - _$PeerConnectionEvent_IceConnectionStateChange> + _$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWith< + _$PeerConnectionEvent_IceConnectionStateChangeImpl> get copyWith => - __$$PeerConnectionEvent_IceConnectionStateChangeCopyWithImpl< - _$PeerConnectionEvent_IceConnectionStateChange>(this, _$identity); + __$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWithImpl< + _$PeerConnectionEvent_IceConnectionStateChangeImpl>( + this, _$identity); @override @optionalTypeArgs @@ -2488,33 +2500,33 @@ abstract class PeerConnectionEvent_IceConnectionStateChange implements PeerConnectionEvent { const factory PeerConnectionEvent_IceConnectionStateChange( final IceConnectionState field0) = - _$PeerConnectionEvent_IceConnectionStateChange; + _$PeerConnectionEvent_IceConnectionStateChangeImpl; IceConnectionState get field0; @JsonKey(ignore: true) - _$$PeerConnectionEvent_IceConnectionStateChangeCopyWith< - _$PeerConnectionEvent_IceConnectionStateChange> + _$$PeerConnectionEvent_IceConnectionStateChangeImplCopyWith< + _$PeerConnectionEvent_IceConnectionStateChangeImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_ConnectionStateChangeCopyWith<$Res> { - factory _$$PeerConnectionEvent_ConnectionStateChangeCopyWith( - _$PeerConnectionEvent_ConnectionStateChange value, - $Res Function(_$PeerConnectionEvent_ConnectionStateChange) then) = - __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_ConnectionStateChangeImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_ConnectionStateChangeImplCopyWith( + _$PeerConnectionEvent_ConnectionStateChangeImpl value, + $Res Function(_$PeerConnectionEvent_ConnectionStateChangeImpl) then) = + __$$PeerConnectionEvent_ConnectionStateChangeImplCopyWithImpl<$Res>; @useResult $Res call({PeerConnectionState field0}); } /// @nodoc -class __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl<$Res> +class __$$PeerConnectionEvent_ConnectionStateChangeImplCopyWithImpl<$Res> extends _$PeerConnectionEventCopyWithImpl<$Res, - _$PeerConnectionEvent_ConnectionStateChange> - implements _$$PeerConnectionEvent_ConnectionStateChangeCopyWith<$Res> { - __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl( - _$PeerConnectionEvent_ConnectionStateChange _value, - $Res Function(_$PeerConnectionEvent_ConnectionStateChange) _then) + _$PeerConnectionEvent_ConnectionStateChangeImpl> + implements _$$PeerConnectionEvent_ConnectionStateChangeImplCopyWith<$Res> { + __$$PeerConnectionEvent_ConnectionStateChangeImplCopyWithImpl( + _$PeerConnectionEvent_ConnectionStateChangeImpl _value, + $Res Function(_$PeerConnectionEvent_ConnectionStateChangeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2522,7 +2534,7 @@ class __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$PeerConnectionEvent_ConnectionStateChange( + return _then(_$PeerConnectionEvent_ConnectionStateChangeImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -2533,9 +2545,9 @@ class __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_ConnectionStateChange +class _$PeerConnectionEvent_ConnectionStateChangeImpl implements PeerConnectionEvent_ConnectionStateChange { - const _$PeerConnectionEvent_ConnectionStateChange(this.field0); + const _$PeerConnectionEvent_ConnectionStateChangeImpl(this.field0); @override final PeerConnectionState field0; @@ -2549,7 +2561,7 @@ class _$PeerConnectionEvent_ConnectionStateChange bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_ConnectionStateChange && + other is _$PeerConnectionEvent_ConnectionStateChangeImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -2559,10 +2571,12 @@ class _$PeerConnectionEvent_ConnectionStateChange @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_ConnectionStateChangeCopyWith< - _$PeerConnectionEvent_ConnectionStateChange> - get copyWith => __$$PeerConnectionEvent_ConnectionStateChangeCopyWithImpl< - _$PeerConnectionEvent_ConnectionStateChange>(this, _$identity); + _$$PeerConnectionEvent_ConnectionStateChangeImplCopyWith< + _$PeerConnectionEvent_ConnectionStateChangeImpl> + get copyWith => + __$$PeerConnectionEvent_ConnectionStateChangeImplCopyWithImpl< + _$PeerConnectionEvent_ConnectionStateChangeImpl>( + this, _$identity); @override @optionalTypeArgs @@ -2705,31 +2719,33 @@ abstract class PeerConnectionEvent_ConnectionStateChange implements PeerConnectionEvent { const factory PeerConnectionEvent_ConnectionStateChange( final PeerConnectionState field0) = - _$PeerConnectionEvent_ConnectionStateChange; + _$PeerConnectionEvent_ConnectionStateChangeImpl; PeerConnectionState get field0; @JsonKey(ignore: true) - _$$PeerConnectionEvent_ConnectionStateChangeCopyWith< - _$PeerConnectionEvent_ConnectionStateChange> + _$$PeerConnectionEvent_ConnectionStateChangeImplCopyWith< + _$PeerConnectionEvent_ConnectionStateChangeImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PeerConnectionEvent_TrackCopyWith<$Res> { - factory _$$PeerConnectionEvent_TrackCopyWith( - _$PeerConnectionEvent_Track value, - $Res Function(_$PeerConnectionEvent_Track) then) = - __$$PeerConnectionEvent_TrackCopyWithImpl<$Res>; +abstract class _$$PeerConnectionEvent_TrackImplCopyWith<$Res> { + factory _$$PeerConnectionEvent_TrackImplCopyWith( + _$PeerConnectionEvent_TrackImpl value, + $Res Function(_$PeerConnectionEvent_TrackImpl) then) = + __$$PeerConnectionEvent_TrackImplCopyWithImpl<$Res>; @useResult $Res call({RtcTrackEvent field0}); } /// @nodoc -class __$$PeerConnectionEvent_TrackCopyWithImpl<$Res> - extends _$PeerConnectionEventCopyWithImpl<$Res, _$PeerConnectionEvent_Track> - implements _$$PeerConnectionEvent_TrackCopyWith<$Res> { - __$$PeerConnectionEvent_TrackCopyWithImpl(_$PeerConnectionEvent_Track _value, - $Res Function(_$PeerConnectionEvent_Track) _then) +class __$$PeerConnectionEvent_TrackImplCopyWithImpl<$Res> + extends _$PeerConnectionEventCopyWithImpl<$Res, + _$PeerConnectionEvent_TrackImpl> + implements _$$PeerConnectionEvent_TrackImplCopyWith<$Res> { + __$$PeerConnectionEvent_TrackImplCopyWithImpl( + _$PeerConnectionEvent_TrackImpl _value, + $Res Function(_$PeerConnectionEvent_TrackImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2737,7 +2753,7 @@ class __$$PeerConnectionEvent_TrackCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$PeerConnectionEvent_Track( + return _then(_$PeerConnectionEvent_TrackImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -2748,8 +2764,8 @@ class __$$PeerConnectionEvent_TrackCopyWithImpl<$Res> /// @nodoc -class _$PeerConnectionEvent_Track implements PeerConnectionEvent_Track { - const _$PeerConnectionEvent_Track(this.field0); +class _$PeerConnectionEvent_TrackImpl implements PeerConnectionEvent_Track { + const _$PeerConnectionEvent_TrackImpl(this.field0); @override final RtcTrackEvent field0; @@ -2763,7 +2779,7 @@ class _$PeerConnectionEvent_Track implements PeerConnectionEvent_Track { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerConnectionEvent_Track && + other is _$PeerConnectionEvent_TrackImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -2773,9 +2789,9 @@ class _$PeerConnectionEvent_Track implements PeerConnectionEvent_Track { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PeerConnectionEvent_TrackCopyWith<_$PeerConnectionEvent_Track> - get copyWith => __$$PeerConnectionEvent_TrackCopyWithImpl< - _$PeerConnectionEvent_Track>(this, _$identity); + _$$PeerConnectionEvent_TrackImplCopyWith<_$PeerConnectionEvent_TrackImpl> + get copyWith => __$$PeerConnectionEvent_TrackImplCopyWithImpl< + _$PeerConnectionEvent_TrackImpl>(this, _$identity); @override @optionalTypeArgs @@ -2916,11 +2932,11 @@ class _$PeerConnectionEvent_Track implements PeerConnectionEvent_Track { abstract class PeerConnectionEvent_Track implements PeerConnectionEvent { const factory PeerConnectionEvent_Track(final RtcTrackEvent field0) = - _$PeerConnectionEvent_Track; + _$PeerConnectionEvent_TrackImpl; RtcTrackEvent get field0; @JsonKey(ignore: true) - _$$PeerConnectionEvent_TrackCopyWith<_$PeerConnectionEvent_Track> + _$$PeerConnectionEvent_TrackImplCopyWith<_$PeerConnectionEvent_TrackImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3006,25 +3022,25 @@ class _$RtcIceCandidateStatsCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RtcIceCandidateStats_LocalCopyWith<$Res> +abstract class _$$RtcIceCandidateStats_LocalImplCopyWith<$Res> implements $RtcIceCandidateStatsCopyWith<$Res> { - factory _$$RtcIceCandidateStats_LocalCopyWith( - _$RtcIceCandidateStats_Local value, - $Res Function(_$RtcIceCandidateStats_Local) then) = - __$$RtcIceCandidateStats_LocalCopyWithImpl<$Res>; + factory _$$RtcIceCandidateStats_LocalImplCopyWith( + _$RtcIceCandidateStats_LocalImpl value, + $Res Function(_$RtcIceCandidateStats_LocalImpl) then) = + __$$RtcIceCandidateStats_LocalImplCopyWithImpl<$Res>; @override @useResult $Res call({IceCandidateStats field0}); } /// @nodoc -class __$$RtcIceCandidateStats_LocalCopyWithImpl<$Res> +class __$$RtcIceCandidateStats_LocalImplCopyWithImpl<$Res> extends _$RtcIceCandidateStatsCopyWithImpl<$Res, - _$RtcIceCandidateStats_Local> - implements _$$RtcIceCandidateStats_LocalCopyWith<$Res> { - __$$RtcIceCandidateStats_LocalCopyWithImpl( - _$RtcIceCandidateStats_Local _value, - $Res Function(_$RtcIceCandidateStats_Local) _then) + _$RtcIceCandidateStats_LocalImpl> + implements _$$RtcIceCandidateStats_LocalImplCopyWith<$Res> { + __$$RtcIceCandidateStats_LocalImplCopyWithImpl( + _$RtcIceCandidateStats_LocalImpl _value, + $Res Function(_$RtcIceCandidateStats_LocalImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3032,7 +3048,7 @@ class __$$RtcIceCandidateStats_LocalCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$RtcIceCandidateStats_Local( + return _then(_$RtcIceCandidateStats_LocalImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -3043,8 +3059,8 @@ class __$$RtcIceCandidateStats_LocalCopyWithImpl<$Res> /// @nodoc -class _$RtcIceCandidateStats_Local implements RtcIceCandidateStats_Local { - const _$RtcIceCandidateStats_Local(this.field0); +class _$RtcIceCandidateStats_LocalImpl implements RtcIceCandidateStats_Local { + const _$RtcIceCandidateStats_LocalImpl(this.field0); @override final IceCandidateStats field0; @@ -3058,7 +3074,7 @@ class _$RtcIceCandidateStats_Local implements RtcIceCandidateStats_Local { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcIceCandidateStats_Local && + other is _$RtcIceCandidateStats_LocalImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -3068,9 +3084,9 @@ class _$RtcIceCandidateStats_Local implements RtcIceCandidateStats_Local { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcIceCandidateStats_LocalCopyWith<_$RtcIceCandidateStats_Local> - get copyWith => __$$RtcIceCandidateStats_LocalCopyWithImpl< - _$RtcIceCandidateStats_Local>(this, _$identity); + _$$RtcIceCandidateStats_LocalImplCopyWith<_$RtcIceCandidateStats_LocalImpl> + get copyWith => __$$RtcIceCandidateStats_LocalImplCopyWithImpl< + _$RtcIceCandidateStats_LocalImpl>(this, _$identity); @override @optionalTypeArgs @@ -3137,36 +3153,36 @@ class _$RtcIceCandidateStats_Local implements RtcIceCandidateStats_Local { abstract class RtcIceCandidateStats_Local implements RtcIceCandidateStats { const factory RtcIceCandidateStats_Local(final IceCandidateStats field0) = - _$RtcIceCandidateStats_Local; + _$RtcIceCandidateStats_LocalImpl; @override IceCandidateStats get field0; @override @JsonKey(ignore: true) - _$$RtcIceCandidateStats_LocalCopyWith<_$RtcIceCandidateStats_Local> + _$$RtcIceCandidateStats_LocalImplCopyWith<_$RtcIceCandidateStats_LocalImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcIceCandidateStats_RemoteCopyWith<$Res> +abstract class _$$RtcIceCandidateStats_RemoteImplCopyWith<$Res> implements $RtcIceCandidateStatsCopyWith<$Res> { - factory _$$RtcIceCandidateStats_RemoteCopyWith( - _$RtcIceCandidateStats_Remote value, - $Res Function(_$RtcIceCandidateStats_Remote) then) = - __$$RtcIceCandidateStats_RemoteCopyWithImpl<$Res>; + factory _$$RtcIceCandidateStats_RemoteImplCopyWith( + _$RtcIceCandidateStats_RemoteImpl value, + $Res Function(_$RtcIceCandidateStats_RemoteImpl) then) = + __$$RtcIceCandidateStats_RemoteImplCopyWithImpl<$Res>; @override @useResult $Res call({IceCandidateStats field0}); } /// @nodoc -class __$$RtcIceCandidateStats_RemoteCopyWithImpl<$Res> +class __$$RtcIceCandidateStats_RemoteImplCopyWithImpl<$Res> extends _$RtcIceCandidateStatsCopyWithImpl<$Res, - _$RtcIceCandidateStats_Remote> - implements _$$RtcIceCandidateStats_RemoteCopyWith<$Res> { - __$$RtcIceCandidateStats_RemoteCopyWithImpl( - _$RtcIceCandidateStats_Remote _value, - $Res Function(_$RtcIceCandidateStats_Remote) _then) + _$RtcIceCandidateStats_RemoteImpl> + implements _$$RtcIceCandidateStats_RemoteImplCopyWith<$Res> { + __$$RtcIceCandidateStats_RemoteImplCopyWithImpl( + _$RtcIceCandidateStats_RemoteImpl _value, + $Res Function(_$RtcIceCandidateStats_RemoteImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3174,7 +3190,7 @@ class __$$RtcIceCandidateStats_RemoteCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$RtcIceCandidateStats_Remote( + return _then(_$RtcIceCandidateStats_RemoteImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -3185,8 +3201,8 @@ class __$$RtcIceCandidateStats_RemoteCopyWithImpl<$Res> /// @nodoc -class _$RtcIceCandidateStats_Remote implements RtcIceCandidateStats_Remote { - const _$RtcIceCandidateStats_Remote(this.field0); +class _$RtcIceCandidateStats_RemoteImpl implements RtcIceCandidateStats_Remote { + const _$RtcIceCandidateStats_RemoteImpl(this.field0); @override final IceCandidateStats field0; @@ -3200,7 +3216,7 @@ class _$RtcIceCandidateStats_Remote implements RtcIceCandidateStats_Remote { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcIceCandidateStats_Remote && + other is _$RtcIceCandidateStats_RemoteImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -3210,9 +3226,9 @@ class _$RtcIceCandidateStats_Remote implements RtcIceCandidateStats_Remote { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcIceCandidateStats_RemoteCopyWith<_$RtcIceCandidateStats_Remote> - get copyWith => __$$RtcIceCandidateStats_RemoteCopyWithImpl< - _$RtcIceCandidateStats_Remote>(this, _$identity); + _$$RtcIceCandidateStats_RemoteImplCopyWith<_$RtcIceCandidateStats_RemoteImpl> + get copyWith => __$$RtcIceCandidateStats_RemoteImplCopyWithImpl< + _$RtcIceCandidateStats_RemoteImpl>(this, _$identity); @override @optionalTypeArgs @@ -3279,13 +3295,13 @@ class _$RtcIceCandidateStats_Remote implements RtcIceCandidateStats_Remote { abstract class RtcIceCandidateStats_Remote implements RtcIceCandidateStats { const factory RtcIceCandidateStats_Remote(final IceCandidateStats field0) = - _$RtcIceCandidateStats_Remote; + _$RtcIceCandidateStats_RemoteImpl; @override IceCandidateStats get field0; @override @JsonKey(ignore: true) - _$$RtcIceCandidateStats_RemoteCopyWith<_$RtcIceCandidateStats_Remote> + _$$RtcIceCandidateStats_RemoteImplCopyWith<_$RtcIceCandidateStats_RemoteImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3413,11 +3429,11 @@ class _$RtcInboundRtpStreamMediaTypeCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RtcInboundRtpStreamMediaType_AudioCopyWith<$Res> { - factory _$$RtcInboundRtpStreamMediaType_AudioCopyWith( - _$RtcInboundRtpStreamMediaType_Audio value, - $Res Function(_$RtcInboundRtpStreamMediaType_Audio) then) = - __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl<$Res>; +abstract class _$$RtcInboundRtpStreamMediaType_AudioImplCopyWith<$Res> { + factory _$$RtcInboundRtpStreamMediaType_AudioImplCopyWith( + _$RtcInboundRtpStreamMediaType_AudioImpl value, + $Res Function(_$RtcInboundRtpStreamMediaType_AudioImpl) then) = + __$$RtcInboundRtpStreamMediaType_AudioImplCopyWithImpl<$Res>; @useResult $Res call( {bool? voiceActivityFlag, @@ -3430,13 +3446,13 @@ abstract class _$$RtcInboundRtpStreamMediaType_AudioCopyWith<$Res> { } /// @nodoc -class __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl<$Res> +class __$$RtcInboundRtpStreamMediaType_AudioImplCopyWithImpl<$Res> extends _$RtcInboundRtpStreamMediaTypeCopyWithImpl<$Res, - _$RtcInboundRtpStreamMediaType_Audio> - implements _$$RtcInboundRtpStreamMediaType_AudioCopyWith<$Res> { - __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl( - _$RtcInboundRtpStreamMediaType_Audio _value, - $Res Function(_$RtcInboundRtpStreamMediaType_Audio) _then) + _$RtcInboundRtpStreamMediaType_AudioImpl> + implements _$$RtcInboundRtpStreamMediaType_AudioImplCopyWith<$Res> { + __$$RtcInboundRtpStreamMediaType_AudioImplCopyWithImpl( + _$RtcInboundRtpStreamMediaType_AudioImpl _value, + $Res Function(_$RtcInboundRtpStreamMediaType_AudioImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3450,7 +3466,7 @@ class __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl<$Res> Object? totalAudioEnergy = freezed, Object? totalSamplesDuration = freezed, }) { - return _then(_$RtcInboundRtpStreamMediaType_Audio( + return _then(_$RtcInboundRtpStreamMediaType_AudioImpl( voiceActivityFlag: freezed == voiceActivityFlag ? _value.voiceActivityFlag : voiceActivityFlag // ignore: cast_nullable_to_non_nullable @@ -3485,9 +3501,9 @@ class __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl<$Res> /// @nodoc -class _$RtcInboundRtpStreamMediaType_Audio +class _$RtcInboundRtpStreamMediaType_AudioImpl implements RtcInboundRtpStreamMediaType_Audio { - const _$RtcInboundRtpStreamMediaType_Audio( + const _$RtcInboundRtpStreamMediaType_AudioImpl( {this.voiceActivityFlag, this.totalSamplesReceived, this.concealedSamples, @@ -3562,7 +3578,7 @@ class _$RtcInboundRtpStreamMediaType_Audio bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcInboundRtpStreamMediaType_Audio && + other is _$RtcInboundRtpStreamMediaType_AudioImpl && (identical(other.voiceActivityFlag, voiceActivityFlag) || other.voiceActivityFlag == voiceActivityFlag) && (identical(other.totalSamplesReceived, totalSamplesReceived) || @@ -3593,10 +3609,10 @@ class _$RtcInboundRtpStreamMediaType_Audio @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcInboundRtpStreamMediaType_AudioCopyWith< - _$RtcInboundRtpStreamMediaType_Audio> - get copyWith => __$$RtcInboundRtpStreamMediaType_AudioCopyWithImpl< - _$RtcInboundRtpStreamMediaType_Audio>(this, _$identity); + _$$RtcInboundRtpStreamMediaType_AudioImplCopyWith< + _$RtcInboundRtpStreamMediaType_AudioImpl> + get copyWith => __$$RtcInboundRtpStreamMediaType_AudioImplCopyWithImpl< + _$RtcInboundRtpStreamMediaType_AudioImpl>(this, _$identity); @override @optionalTypeArgs @@ -3752,7 +3768,7 @@ abstract class RtcInboundRtpStreamMediaType_Audio final double? audioLevel, final double? totalAudioEnergy, final double? totalSamplesDuration}) = - _$RtcInboundRtpStreamMediaType_Audio; + _$RtcInboundRtpStreamMediaType_AudioImpl; /// Indicator whether the last RTP packet whose frame was delivered to /// the [RTCRtpReceiver]'s [MediaStreamTrack][1] for playout contained @@ -3804,17 +3820,17 @@ abstract class RtcInboundRtpStreamMediaType_Audio /// [1]: https://w3.org/TR/webrtc-stats#dom-rtcaudiosourcestats double? get totalSamplesDuration; @JsonKey(ignore: true) - _$$RtcInboundRtpStreamMediaType_AudioCopyWith< - _$RtcInboundRtpStreamMediaType_Audio> + _$$RtcInboundRtpStreamMediaType_AudioImplCopyWith< + _$RtcInboundRtpStreamMediaType_AudioImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcInboundRtpStreamMediaType_VideoCopyWith<$Res> { - factory _$$RtcInboundRtpStreamMediaType_VideoCopyWith( - _$RtcInboundRtpStreamMediaType_Video value, - $Res Function(_$RtcInboundRtpStreamMediaType_Video) then) = - __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl<$Res>; +abstract class _$$RtcInboundRtpStreamMediaType_VideoImplCopyWith<$Res> { + factory _$$RtcInboundRtpStreamMediaType_VideoImplCopyWith( + _$RtcInboundRtpStreamMediaType_VideoImpl value, + $Res Function(_$RtcInboundRtpStreamMediaType_VideoImpl) then) = + __$$RtcInboundRtpStreamMediaType_VideoImplCopyWithImpl<$Res>; @useResult $Res call( {int? framesDecoded, @@ -3831,13 +3847,13 @@ abstract class _$$RtcInboundRtpStreamMediaType_VideoCopyWith<$Res> { } /// @nodoc -class __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl<$Res> +class __$$RtcInboundRtpStreamMediaType_VideoImplCopyWithImpl<$Res> extends _$RtcInboundRtpStreamMediaTypeCopyWithImpl<$Res, - _$RtcInboundRtpStreamMediaType_Video> - implements _$$RtcInboundRtpStreamMediaType_VideoCopyWith<$Res> { - __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl( - _$RtcInboundRtpStreamMediaType_Video _value, - $Res Function(_$RtcInboundRtpStreamMediaType_Video) _then) + _$RtcInboundRtpStreamMediaType_VideoImpl> + implements _$$RtcInboundRtpStreamMediaType_VideoImplCopyWith<$Res> { + __$$RtcInboundRtpStreamMediaType_VideoImplCopyWithImpl( + _$RtcInboundRtpStreamMediaType_VideoImpl _value, + $Res Function(_$RtcInboundRtpStreamMediaType_VideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3855,7 +3871,7 @@ class __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl<$Res> Object? concealmentEvents = freezed, Object? framesReceived = freezed, }) { - return _then(_$RtcInboundRtpStreamMediaType_Video( + return _then(_$RtcInboundRtpStreamMediaType_VideoImpl( framesDecoded: freezed == framesDecoded ? _value.framesDecoded : framesDecoded // ignore: cast_nullable_to_non_nullable @@ -3906,9 +3922,9 @@ class __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl<$Res> /// @nodoc -class _$RtcInboundRtpStreamMediaType_Video +class _$RtcInboundRtpStreamMediaType_VideoImpl implements RtcInboundRtpStreamMediaType_Video { - const _$RtcInboundRtpStreamMediaType_Video( + const _$RtcInboundRtpStreamMediaType_VideoImpl( {this.framesDecoded, this.keyFramesDecoded, this.frameWidth, @@ -4003,7 +4019,7 @@ class _$RtcInboundRtpStreamMediaType_Video bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcInboundRtpStreamMediaType_Video && + other is _$RtcInboundRtpStreamMediaType_VideoImpl && (identical(other.framesDecoded, framesDecoded) || other.framesDecoded == framesDecoded) && (identical(other.keyFramesDecoded, keyFramesDecoded) || @@ -4046,10 +4062,10 @@ class _$RtcInboundRtpStreamMediaType_Video @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcInboundRtpStreamMediaType_VideoCopyWith< - _$RtcInboundRtpStreamMediaType_Video> - get copyWith => __$$RtcInboundRtpStreamMediaType_VideoCopyWithImpl< - _$RtcInboundRtpStreamMediaType_Video>(this, _$identity); + _$$RtcInboundRtpStreamMediaType_VideoImplCopyWith< + _$RtcInboundRtpStreamMediaType_VideoImpl> + get copyWith => __$$RtcInboundRtpStreamMediaType_VideoImplCopyWithImpl< + _$RtcInboundRtpStreamMediaType_VideoImpl>(this, _$identity); @override @optionalTypeArgs @@ -4220,7 +4236,7 @@ abstract class RtcInboundRtpStreamMediaType_Video final int? pliCount, final int? sliCount, final int? concealmentEvents, - final int? framesReceived}) = _$RtcInboundRtpStreamMediaType_Video; + final int? framesReceived}) = _$RtcInboundRtpStreamMediaType_VideoImpl; /// Total number of frames correctly decoded for this RTP stream, i.e. /// frames that would be displayed if no frames are dropped. @@ -4284,8 +4300,8 @@ abstract class RtcInboundRtpStreamMediaType_Video /// This metric is incremented when the complete frame is received. int? get framesReceived; @JsonKey(ignore: true) - _$$RtcInboundRtpStreamMediaType_VideoCopyWith< - _$RtcInboundRtpStreamMediaType_Video> + _$$RtcInboundRtpStreamMediaType_VideoImplCopyWith< + _$RtcInboundRtpStreamMediaType_VideoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -4385,26 +4401,28 @@ class _$RtcMediaSourceStatsMediaTypeCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWith< +abstract class _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWith< $Res> { - factory _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWith( - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats value, - $Res Function(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStats) + factory _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWith( + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl value, + $Res Function(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl) then) = - __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl<$Res>; + __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWithImpl< + $Res>; @useResult $Res call({int? width, int? height, int? frames, double? framesPerSecond}); } /// @nodoc -class __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl<$Res> +class __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWithImpl<$Res> extends _$RtcMediaSourceStatsMediaTypeCopyWithImpl<$Res, - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats> + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl> implements - _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWith<$Res> { - __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl( - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats _value, - $Res Function(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStats) _then) + _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWith<$Res> { + __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWithImpl( + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl _value, + $Res Function(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4415,7 +4433,7 @@ class __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl<$Res> Object? frames = freezed, Object? framesPerSecond = freezed, }) { - return _then(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStats( + return _then(_$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl( width: freezed == width ? _value.width : width // ignore: cast_nullable_to_non_nullable @@ -4438,9 +4456,9 @@ class __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats +class _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl implements RtcMediaSourceStatsMediaType_RtcVideoSourceStats { - const _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats( + const _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl( {this.width, this.height, this.frames, this.framesPerSecond}); /// Width (in pixels) of the last frame originating from the source. @@ -4472,7 +4490,7 @@ class _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats && + other is _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl && (identical(other.width, width) || other.width == width) && (identical(other.height, height) || other.height == height) && (identical(other.frames, frames) || other.frames == frames) && @@ -4487,11 +4505,11 @@ class _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWith< - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats> + _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWith< + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl> get copyWith => - __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWithImpl< - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats>( + __$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWithImpl< + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl>( this, _$identity); @override @@ -4596,7 +4614,7 @@ abstract class RtcMediaSourceStatsMediaType_RtcVideoSourceStats final int? height, final int? frames, final double? framesPerSecond}) = - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats; + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl; /// Width (in pixels) of the last frame originating from the source. /// Before a frame has been produced this attribute is missing. @@ -4614,19 +4632,20 @@ abstract class RtcMediaSourceStatsMediaType_RtcVideoSourceStats /// attribute is missing. double? get framesPerSecond; @JsonKey(ignore: true) - _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsCopyWith< - _$RtcMediaSourceStatsMediaType_RtcVideoSourceStats> + _$$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImplCopyWith< + _$RtcMediaSourceStatsMediaType_RtcVideoSourceStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith< +abstract class _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWith< $Res> { - factory _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith( - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats value, - $Res Function(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStats) + factory _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWith( + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl value, + $Res Function(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl) then) = - __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl<$Res>; + __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWithImpl< + $Res>; @useResult $Res call( {double? audioLevel, @@ -4637,14 +4656,15 @@ abstract class _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith< } /// @nodoc -class __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl<$Res> +class __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWithImpl<$Res> extends _$RtcMediaSourceStatsMediaTypeCopyWithImpl<$Res, - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats> + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl> implements - _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith<$Res> { - __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl( - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats _value, - $Res Function(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStats) _then) + _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWith<$Res> { + __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWithImpl( + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl _value, + $Res Function(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl) + _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4656,7 +4676,7 @@ class __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl<$Res> Object? echoReturnLoss = freezed, Object? echoReturnLossEnhancement = freezed, }) { - return _then(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStats( + return _then(_$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl( audioLevel: freezed == audioLevel ? _value.audioLevel : audioLevel // ignore: cast_nullable_to_non_nullable @@ -4683,9 +4703,9 @@ class __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats +class _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl implements RtcMediaSourceStatsMediaType_RtcAudioSourceStats { - const _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats( + const _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl( {this.audioLevel, this.totalAudioEnergy, this.totalSamplesDuration, @@ -4727,7 +4747,7 @@ class _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats && + other is _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl && (identical(other.audioLevel, audioLevel) || other.audioLevel == audioLevel) && (identical(other.totalAudioEnergy, totalAudioEnergy) || @@ -4748,11 +4768,11 @@ class _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith< - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats> + _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWith< + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl> get copyWith => - __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWithImpl< - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats>( + __$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWithImpl< + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl>( this, _$identity); @override @@ -4861,7 +4881,7 @@ abstract class RtcMediaSourceStatsMediaType_RtcAudioSourceStats final double? totalSamplesDuration, final double? echoReturnLoss, final double? echoReturnLossEnhancement}) = - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats; + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl; /// Audio level of the media source. double? get audioLevel; @@ -4884,8 +4904,8 @@ abstract class RtcMediaSourceStatsMediaType_RtcAudioSourceStats /// [1]: https://w3.org/TR/mediacapture-streams#mediastreamtrack double? get echoReturnLossEnhancement; @JsonKey(ignore: true) - _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsCopyWith< - _$RtcMediaSourceStatsMediaType_RtcAudioSourceStats> + _$$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImplCopyWith< + _$RtcMediaSourceStatsMediaType_RtcAudioSourceStatsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -4962,23 +4982,23 @@ class _$RtcOutboundRtpStreamStatsMediaTypeCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWith<$Res> { - factory _$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWith( - _$RtcOutboundRtpStreamStatsMediaType_Audio value, - $Res Function(_$RtcOutboundRtpStreamStatsMediaType_Audio) then) = - __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl<$Res>; +abstract class _$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWith<$Res> { + factory _$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWith( + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl value, + $Res Function(_$RtcOutboundRtpStreamStatsMediaType_AudioImpl) then) = + __$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWithImpl<$Res>; @useResult $Res call({int? totalSamplesSent, bool? voiceActivityFlag}); } /// @nodoc -class __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl<$Res> +class __$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWithImpl<$Res> extends _$RtcOutboundRtpStreamStatsMediaTypeCopyWithImpl<$Res, - _$RtcOutboundRtpStreamStatsMediaType_Audio> - implements _$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWith<$Res> { - __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl( - _$RtcOutboundRtpStreamStatsMediaType_Audio _value, - $Res Function(_$RtcOutboundRtpStreamStatsMediaType_Audio) _then) + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl> + implements _$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWith<$Res> { + __$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWithImpl( + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl _value, + $Res Function(_$RtcOutboundRtpStreamStatsMediaType_AudioImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4987,7 +5007,7 @@ class __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl<$Res> Object? totalSamplesSent = freezed, Object? voiceActivityFlag = freezed, }) { - return _then(_$RtcOutboundRtpStreamStatsMediaType_Audio( + return _then(_$RtcOutboundRtpStreamStatsMediaType_AudioImpl( totalSamplesSent: freezed == totalSamplesSent ? _value.totalSamplesSent : totalSamplesSent // ignore: cast_nullable_to_non_nullable @@ -5002,9 +5022,9 @@ class __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl<$Res> /// @nodoc -class _$RtcOutboundRtpStreamStatsMediaType_Audio +class _$RtcOutboundRtpStreamStatsMediaType_AudioImpl implements RtcOutboundRtpStreamStatsMediaType_Audio { - const _$RtcOutboundRtpStreamStatsMediaType_Audio( + const _$RtcOutboundRtpStreamStatsMediaType_AudioImpl( {this.totalSamplesSent, this.voiceActivityFlag}); /// Total number of samples that have been sent over the RTP stream. @@ -5025,7 +5045,7 @@ class _$RtcOutboundRtpStreamStatsMediaType_Audio bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcOutboundRtpStreamStatsMediaType_Audio && + other is _$RtcOutboundRtpStreamStatsMediaType_AudioImpl && (identical(other.totalSamplesSent, totalSamplesSent) || other.totalSamplesSent == totalSamplesSent) && (identical(other.voiceActivityFlag, voiceActivityFlag) || @@ -5039,10 +5059,11 @@ class _$RtcOutboundRtpStreamStatsMediaType_Audio @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWith< - _$RtcOutboundRtpStreamStatsMediaType_Audio> - get copyWith => __$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWithImpl< - _$RtcOutboundRtpStreamStatsMediaType_Audio>(this, _$identity); + _$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWith< + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl> + get copyWith => + __$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWithImpl< + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl>(this, _$identity); @override @optionalTypeArgs @@ -5120,7 +5141,7 @@ abstract class RtcOutboundRtpStreamStatsMediaType_Audio implements RtcOutboundRtpStreamStatsMediaType { const factory RtcOutboundRtpStreamStatsMediaType_Audio( {final int? totalSamplesSent, final bool? voiceActivityFlag}) = - _$RtcOutboundRtpStreamStatsMediaType_Audio; + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl; /// Total number of samples that have been sent over the RTP stream. int? get totalSamplesSent; @@ -5129,29 +5150,29 @@ abstract class RtcOutboundRtpStreamStatsMediaType_Audio /// based on the presence of the V bit in the extension header. bool? get voiceActivityFlag; @JsonKey(ignore: true) - _$$RtcOutboundRtpStreamStatsMediaType_AudioCopyWith< - _$RtcOutboundRtpStreamStatsMediaType_Audio> + _$$RtcOutboundRtpStreamStatsMediaType_AudioImplCopyWith< + _$RtcOutboundRtpStreamStatsMediaType_AudioImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWith<$Res> { - factory _$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWith( - _$RtcOutboundRtpStreamStatsMediaType_Video value, - $Res Function(_$RtcOutboundRtpStreamStatsMediaType_Video) then) = - __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl<$Res>; +abstract class _$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWith<$Res> { + factory _$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWith( + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl value, + $Res Function(_$RtcOutboundRtpStreamStatsMediaType_VideoImpl) then) = + __$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWithImpl<$Res>; @useResult $Res call({int? frameWidth, int? frameHeight, double? framesPerSecond}); } /// @nodoc -class __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl<$Res> +class __$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWithImpl<$Res> extends _$RtcOutboundRtpStreamStatsMediaTypeCopyWithImpl<$Res, - _$RtcOutboundRtpStreamStatsMediaType_Video> - implements _$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWith<$Res> { - __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl( - _$RtcOutboundRtpStreamStatsMediaType_Video _value, - $Res Function(_$RtcOutboundRtpStreamStatsMediaType_Video) _then) + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl> + implements _$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWith<$Res> { + __$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWithImpl( + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl _value, + $Res Function(_$RtcOutboundRtpStreamStatsMediaType_VideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -5161,7 +5182,7 @@ class __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl<$Res> Object? frameHeight = freezed, Object? framesPerSecond = freezed, }) { - return _then(_$RtcOutboundRtpStreamStatsMediaType_Video( + return _then(_$RtcOutboundRtpStreamStatsMediaType_VideoImpl( frameWidth: freezed == frameWidth ? _value.frameWidth : frameWidth // ignore: cast_nullable_to_non_nullable @@ -5180,9 +5201,9 @@ class __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl<$Res> /// @nodoc -class _$RtcOutboundRtpStreamStatsMediaType_Video +class _$RtcOutboundRtpStreamStatsMediaType_VideoImpl implements RtcOutboundRtpStreamStatsMediaType_Video { - const _$RtcOutboundRtpStreamStatsMediaType_Video( + const _$RtcOutboundRtpStreamStatsMediaType_VideoImpl( {this.frameWidth, this.frameHeight, this.framesPerSecond}); /// Width of the last encoded frame. @@ -5225,7 +5246,7 @@ class _$RtcOutboundRtpStreamStatsMediaType_Video bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcOutboundRtpStreamStatsMediaType_Video && + other is _$RtcOutboundRtpStreamStatsMediaType_VideoImpl && (identical(other.frameWidth, frameWidth) || other.frameWidth == frameWidth) && (identical(other.frameHeight, frameHeight) || @@ -5241,10 +5262,11 @@ class _$RtcOutboundRtpStreamStatsMediaType_Video @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWith< - _$RtcOutboundRtpStreamStatsMediaType_Video> - get copyWith => __$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWithImpl< - _$RtcOutboundRtpStreamStatsMediaType_Video>(this, _$identity); + _$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWith< + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl> + get copyWith => + __$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWithImpl< + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl>(this, _$identity); @override @optionalTypeArgs @@ -5324,7 +5346,7 @@ abstract class RtcOutboundRtpStreamStatsMediaType_Video {final int? frameWidth, final int? frameHeight, final double? framesPerSecond}) = - _$RtcOutboundRtpStreamStatsMediaType_Video; + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl; /// Width of the last encoded frame. /// @@ -5354,8 +5376,8 @@ abstract class RtcOutboundRtpStreamStatsMediaType_Video /// [1]: https://tinyurl.com/rrmkrfk double? get framesPerSecond; @JsonKey(ignore: true) - _$$RtcOutboundRtpStreamStatsMediaType_VideoCopyWith< - _$RtcOutboundRtpStreamStatsMediaType_Video> + _$$RtcOutboundRtpStreamStatsMediaType_VideoImplCopyWith< + _$RtcOutboundRtpStreamStatsMediaType_VideoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -5593,11 +5615,11 @@ class _$RtcStatsTypeCopyWithImpl<$Res, $Val extends RtcStatsType> } /// @nodoc -abstract class _$$RtcStatsType_RtcMediaSourceStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcMediaSourceStatsCopyWith( - _$RtcStatsType_RtcMediaSourceStats value, - $Res Function(_$RtcStatsType_RtcMediaSourceStats) then) = - __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcMediaSourceStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcMediaSourceStatsImplCopyWith( + _$RtcStatsType_RtcMediaSourceStatsImpl value, + $Res Function(_$RtcStatsType_RtcMediaSourceStatsImpl) then) = + __$$RtcStatsType_RtcMediaSourceStatsImplCopyWithImpl<$Res>; @useResult $Res call({String? trackIdentifier, RtcMediaSourceStatsMediaType kind}); @@ -5605,12 +5627,13 @@ abstract class _$$RtcStatsType_RtcMediaSourceStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl<$Res> - extends _$RtcStatsTypeCopyWithImpl<$Res, _$RtcStatsType_RtcMediaSourceStats> - implements _$$RtcStatsType_RtcMediaSourceStatsCopyWith<$Res> { - __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl( - _$RtcStatsType_RtcMediaSourceStats _value, - $Res Function(_$RtcStatsType_RtcMediaSourceStats) _then) +class __$$RtcStatsType_RtcMediaSourceStatsImplCopyWithImpl<$Res> + extends _$RtcStatsTypeCopyWithImpl<$Res, + _$RtcStatsType_RtcMediaSourceStatsImpl> + implements _$$RtcStatsType_RtcMediaSourceStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcMediaSourceStatsImplCopyWithImpl( + _$RtcStatsType_RtcMediaSourceStatsImpl _value, + $Res Function(_$RtcStatsType_RtcMediaSourceStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -5619,7 +5642,7 @@ class __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl<$Res> Object? trackIdentifier = freezed, Object? kind = null, }) { - return _then(_$RtcStatsType_RtcMediaSourceStats( + return _then(_$RtcStatsType_RtcMediaSourceStatsImpl( trackIdentifier: freezed == trackIdentifier ? _value.trackIdentifier : trackIdentifier // ignore: cast_nullable_to_non_nullable @@ -5642,9 +5665,9 @@ class __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcMediaSourceStats +class _$RtcStatsType_RtcMediaSourceStatsImpl implements RtcStatsType_RtcMediaSourceStats { - const _$RtcStatsType_RtcMediaSourceStats( + const _$RtcStatsType_RtcMediaSourceStatsImpl( {this.trackIdentifier, required this.kind}); /// Value of the [MediaStreamTrack][1]'s ID attribute. @@ -5666,7 +5689,7 @@ class _$RtcStatsType_RtcMediaSourceStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcMediaSourceStats && + other is _$RtcStatsType_RtcMediaSourceStatsImpl && (identical(other.trackIdentifier, trackIdentifier) || other.trackIdentifier == trackIdentifier) && (identical(other.kind, kind) || other.kind == kind)); @@ -5678,10 +5701,10 @@ class _$RtcStatsType_RtcMediaSourceStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcMediaSourceStatsCopyWith< - _$RtcStatsType_RtcMediaSourceStats> - get copyWith => __$$RtcStatsType_RtcMediaSourceStatsCopyWithImpl< - _$RtcStatsType_RtcMediaSourceStats>(this, _$identity); + _$$RtcStatsType_RtcMediaSourceStatsImplCopyWith< + _$RtcStatsType_RtcMediaSourceStatsImpl> + get copyWith => __$$RtcStatsType_RtcMediaSourceStatsImplCopyWithImpl< + _$RtcStatsType_RtcMediaSourceStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -5923,7 +5946,7 @@ abstract class RtcStatsType_RtcMediaSourceStats implements RtcStatsType { const factory RtcStatsType_RtcMediaSourceStats( {final String? trackIdentifier, required final RtcMediaSourceStatsMediaType kind}) = - _$RtcStatsType_RtcMediaSourceStats; + _$RtcStatsType_RtcMediaSourceStatsImpl; /// Value of the [MediaStreamTrack][1]'s ID attribute. /// @@ -5933,17 +5956,17 @@ abstract class RtcStatsType_RtcMediaSourceStats implements RtcStatsType { /// Fields which should be in these [`RtcStats`] based on their `kind`. RtcMediaSourceStatsMediaType get kind; @JsonKey(ignore: true) - _$$RtcStatsType_RtcMediaSourceStatsCopyWith< - _$RtcStatsType_RtcMediaSourceStats> + _$$RtcStatsType_RtcMediaSourceStatsImplCopyWith< + _$RtcStatsType_RtcMediaSourceStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcIceCandidateStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcIceCandidateStatsCopyWith( - _$RtcStatsType_RtcIceCandidateStats value, - $Res Function(_$RtcStatsType_RtcIceCandidateStats) then) = - __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcIceCandidateStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcIceCandidateStatsImplCopyWith( + _$RtcStatsType_RtcIceCandidateStatsImpl value, + $Res Function(_$RtcStatsType_RtcIceCandidateStatsImpl) then) = + __$$RtcStatsType_RtcIceCandidateStatsImplCopyWithImpl<$Res>; @useResult $Res call({RtcIceCandidateStats field0}); @@ -5951,13 +5974,13 @@ abstract class _$$RtcStatsType_RtcIceCandidateStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcIceCandidateStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcIceCandidateStats> - implements _$$RtcStatsType_RtcIceCandidateStatsCopyWith<$Res> { - __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl( - _$RtcStatsType_RtcIceCandidateStats _value, - $Res Function(_$RtcStatsType_RtcIceCandidateStats) _then) + _$RtcStatsType_RtcIceCandidateStatsImpl> + implements _$$RtcStatsType_RtcIceCandidateStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcIceCandidateStatsImplCopyWithImpl( + _$RtcStatsType_RtcIceCandidateStatsImpl _value, + $Res Function(_$RtcStatsType_RtcIceCandidateStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -5965,7 +5988,7 @@ class __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl<$Res> $Res call({ Object? field0 = null, }) { - return _then(_$RtcStatsType_RtcIceCandidateStats( + return _then(_$RtcStatsType_RtcIceCandidateStatsImpl( null == field0 ? _value.field0 : field0 // ignore: cast_nullable_to_non_nullable @@ -5984,9 +6007,9 @@ class __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcIceCandidateStats +class _$RtcStatsType_RtcIceCandidateStatsImpl implements RtcStatsType_RtcIceCandidateStats { - const _$RtcStatsType_RtcIceCandidateStats(this.field0); + const _$RtcStatsType_RtcIceCandidateStatsImpl(this.field0); @override final RtcIceCandidateStats field0; @@ -6000,7 +6023,7 @@ class _$RtcStatsType_RtcIceCandidateStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcIceCandidateStats && + other is _$RtcStatsType_RtcIceCandidateStatsImpl && (identical(other.field0, field0) || other.field0 == field0)); } @@ -6010,10 +6033,10 @@ class _$RtcStatsType_RtcIceCandidateStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcIceCandidateStatsCopyWith< - _$RtcStatsType_RtcIceCandidateStats> - get copyWith => __$$RtcStatsType_RtcIceCandidateStatsCopyWithImpl< - _$RtcStatsType_RtcIceCandidateStats>(this, _$identity); + _$$RtcStatsType_RtcIceCandidateStatsImplCopyWith< + _$RtcStatsType_RtcIceCandidateStatsImpl> + get copyWith => __$$RtcStatsType_RtcIceCandidateStatsImplCopyWithImpl< + _$RtcStatsType_RtcIceCandidateStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -6253,21 +6276,22 @@ class _$RtcStatsType_RtcIceCandidateStats abstract class RtcStatsType_RtcIceCandidateStats implements RtcStatsType { const factory RtcStatsType_RtcIceCandidateStats( - final RtcIceCandidateStats field0) = _$RtcStatsType_RtcIceCandidateStats; + final RtcIceCandidateStats field0) = + _$RtcStatsType_RtcIceCandidateStatsImpl; RtcIceCandidateStats get field0; @JsonKey(ignore: true) - _$$RtcStatsType_RtcIceCandidateStatsCopyWith< - _$RtcStatsType_RtcIceCandidateStats> + _$$RtcStatsType_RtcIceCandidateStatsImplCopyWith< + _$RtcStatsType_RtcIceCandidateStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith( - _$RtcStatsType_RtcOutboundRtpStreamStats value, - $Res Function(_$RtcStatsType_RtcOutboundRtpStreamStats) then) = - __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWith( + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl value, + $Res Function(_$RtcStatsType_RtcOutboundRtpStreamStatsImpl) then) = + __$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWithImpl<$Res>; @useResult $Res call( {String? trackId, @@ -6280,13 +6304,13 @@ abstract class _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcOutboundRtpStreamStats> - implements _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith<$Res> { - __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl( - _$RtcStatsType_RtcOutboundRtpStreamStats _value, - $Res Function(_$RtcStatsType_RtcOutboundRtpStreamStats) _then) + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl> + implements _$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWithImpl( + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl _value, + $Res Function(_$RtcStatsType_RtcOutboundRtpStreamStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -6298,7 +6322,7 @@ class __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl<$Res> Object? packetsSent = freezed, Object? mediaSourceId = freezed, }) { - return _then(_$RtcStatsType_RtcOutboundRtpStreamStats( + return _then(_$RtcStatsType_RtcOutboundRtpStreamStatsImpl( trackId: freezed == trackId ? _value.trackId : trackId // ignore: cast_nullable_to_non_nullable @@ -6334,9 +6358,9 @@ class __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcOutboundRtpStreamStats +class _$RtcStatsType_RtcOutboundRtpStreamStatsImpl implements RtcStatsType_RtcOutboundRtpStreamStats { - const _$RtcStatsType_RtcOutboundRtpStreamStats( + const _$RtcStatsType_RtcOutboundRtpStreamStatsImpl( {this.trackId, required this.mediaType, this.bytesSent, @@ -6379,7 +6403,7 @@ class _$RtcStatsType_RtcOutboundRtpStreamStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcOutboundRtpStreamStats && + other is _$RtcStatsType_RtcOutboundRtpStreamStatsImpl && (identical(other.trackId, trackId) || other.trackId == trackId) && (identical(other.mediaType, mediaType) || other.mediaType == mediaType) && @@ -6398,10 +6422,11 @@ class _$RtcStatsType_RtcOutboundRtpStreamStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcOutboundRtpStreamStats> - get copyWith => __$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWithImpl< - _$RtcStatsType_RtcOutboundRtpStreamStats>(this, _$identity); + _$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl> + get copyWith => + __$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWithImpl< + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -6644,11 +6669,12 @@ class _$RtcStatsType_RtcOutboundRtpStreamStats abstract class RtcStatsType_RtcOutboundRtpStreamStats implements RtcStatsType { const factory RtcStatsType_RtcOutboundRtpStreamStats( - {final String? trackId, - required final RtcOutboundRtpStreamStatsMediaType mediaType, - final int? bytesSent, - final int? packetsSent, - final String? mediaSourceId}) = _$RtcStatsType_RtcOutboundRtpStreamStats; + {final String? trackId, + required final RtcOutboundRtpStreamStatsMediaType mediaType, + final int? bytesSent, + final int? packetsSent, + final String? mediaSourceId}) = + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl; /// ID of the stats object representing the current track attachment to /// the sender of the stream. @@ -6672,17 +6698,17 @@ abstract class RtcStatsType_RtcOutboundRtpStreamStats implements RtcStatsType { /// the sender of the stream. String? get mediaSourceId; @JsonKey(ignore: true) - _$$RtcStatsType_RtcOutboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcOutboundRtpStreamStats> + _$$RtcStatsType_RtcOutboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcOutboundRtpStreamStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith( - _$RtcStatsType_RtcInboundRtpStreamStats value, - $Res Function(_$RtcStatsType_RtcInboundRtpStreamStats) then) = - __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWith( + _$RtcStatsType_RtcInboundRtpStreamStatsImpl value, + $Res Function(_$RtcStatsType_RtcInboundRtpStreamStatsImpl) then) = + __$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWithImpl<$Res>; @useResult $Res call( {String? remoteId, @@ -6698,13 +6724,13 @@ abstract class _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcInboundRtpStreamStats> - implements _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith<$Res> { - __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl( - _$RtcStatsType_RtcInboundRtpStreamStats _value, - $Res Function(_$RtcStatsType_RtcInboundRtpStreamStats) _then) + _$RtcStatsType_RtcInboundRtpStreamStatsImpl> + implements _$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWithImpl( + _$RtcStatsType_RtcInboundRtpStreamStatsImpl _value, + $Res Function(_$RtcStatsType_RtcInboundRtpStreamStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -6719,7 +6745,7 @@ class __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl<$Res> Object? jitterBufferEmittedCount = freezed, Object? mediaType = freezed, }) { - return _then(_$RtcStatsType_RtcInboundRtpStreamStats( + return _then(_$RtcStatsType_RtcInboundRtpStreamStatsImpl( remoteId: freezed == remoteId ? _value.remoteId : remoteId // ignore: cast_nullable_to_non_nullable @@ -6771,9 +6797,9 @@ class __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcInboundRtpStreamStats +class _$RtcStatsType_RtcInboundRtpStreamStatsImpl implements RtcStatsType_RtcInboundRtpStreamStats { - const _$RtcStatsType_RtcInboundRtpStreamStats( + const _$RtcStatsType_RtcInboundRtpStreamStatsImpl( {this.remoteId, this.bytesReceived, this.packetsReceived, @@ -6851,7 +6877,7 @@ class _$RtcStatsType_RtcInboundRtpStreamStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcInboundRtpStreamStats && + other is _$RtcStatsType_RtcInboundRtpStreamStatsImpl && (identical(other.remoteId, remoteId) || other.remoteId == remoteId) && (identical(other.bytesReceived, bytesReceived) || @@ -6885,10 +6911,10 @@ class _$RtcStatsType_RtcInboundRtpStreamStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcInboundRtpStreamStats> - get copyWith => __$$RtcStatsType_RtcInboundRtpStreamStatsCopyWithImpl< - _$RtcStatsType_RtcInboundRtpStreamStats>(this, _$identity); + _$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcInboundRtpStreamStatsImpl> + get copyWith => __$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWithImpl< + _$RtcStatsType_RtcInboundRtpStreamStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -7160,7 +7186,7 @@ abstract class RtcStatsType_RtcInboundRtpStreamStats implements RtcStatsType { final double? totalDecodeTime, final int? jitterBufferEmittedCount, final RtcInboundRtpStreamMediaType? mediaType}) = - _$RtcStatsType_RtcInboundRtpStreamStats; + _$RtcStatsType_RtcInboundRtpStreamStatsImpl; /// ID of the stats object representing the receiving track. String? get remoteId; @@ -7213,17 +7239,17 @@ abstract class RtcStatsType_RtcInboundRtpStreamStats implements RtcStatsType { /// `media_type`. RtcInboundRtpStreamMediaType? get mediaType; @JsonKey(ignore: true) - _$$RtcStatsType_RtcInboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcInboundRtpStreamStats> + _$$RtcStatsType_RtcInboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcInboundRtpStreamStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith( - _$RtcStatsType_RtcIceCandidatePairStats value, - $Res Function(_$RtcStatsType_RtcIceCandidatePairStats) then) = - __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWith( + _$RtcStatsType_RtcIceCandidatePairStatsImpl value, + $Res Function(_$RtcStatsType_RtcIceCandidatePairStatsImpl) then) = + __$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWithImpl<$Res>; @useResult $Res call( {RtcStatsIceCandidatePairState state, @@ -7236,13 +7262,13 @@ abstract class _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcIceCandidatePairStats> - implements _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith<$Res> { - __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl( - _$RtcStatsType_RtcIceCandidatePairStats _value, - $Res Function(_$RtcStatsType_RtcIceCandidatePairStats) _then) + _$RtcStatsType_RtcIceCandidatePairStatsImpl> + implements _$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWithImpl( + _$RtcStatsType_RtcIceCandidatePairStatsImpl _value, + $Res Function(_$RtcStatsType_RtcIceCandidatePairStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -7256,7 +7282,7 @@ class __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl<$Res> Object? currentRoundTripTime = freezed, Object? availableOutgoingBitrate = freezed, }) { - return _then(_$RtcStatsType_RtcIceCandidatePairStats( + return _then(_$RtcStatsType_RtcIceCandidatePairStatsImpl( state: null == state ? _value.state : state // ignore: cast_nullable_to_non_nullable @@ -7291,9 +7317,9 @@ class __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcIceCandidatePairStats +class _$RtcStatsType_RtcIceCandidatePairStatsImpl implements RtcStatsType_RtcIceCandidatePairStats { - const _$RtcStatsType_RtcIceCandidatePairStats( + const _$RtcStatsType_RtcIceCandidatePairStatsImpl( {required this.state, this.nominated, this.bytesSent, @@ -7378,7 +7404,7 @@ class _$RtcStatsType_RtcIceCandidatePairStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcIceCandidatePairStats && + other is _$RtcStatsType_RtcIceCandidatePairStatsImpl && (identical(other.state, state) || other.state == state) && (identical(other.nominated, nominated) || other.nominated == nominated) && @@ -7409,10 +7435,10 @@ class _$RtcStatsType_RtcIceCandidatePairStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith< - _$RtcStatsType_RtcIceCandidatePairStats> - get copyWith => __$$RtcStatsType_RtcIceCandidatePairStatsCopyWithImpl< - _$RtcStatsType_RtcIceCandidatePairStats>(this, _$identity); + _$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWith< + _$RtcStatsType_RtcIceCandidatePairStatsImpl> + get copyWith => __$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWithImpl< + _$RtcStatsType_RtcIceCandidatePairStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -7674,7 +7700,7 @@ abstract class RtcStatsType_RtcIceCandidatePairStats implements RtcStatsType { final double? totalRoundTripTime, final double? currentRoundTripTime, final double? availableOutgoingBitrate}) = - _$RtcStatsType_RtcIceCandidatePairStats; + _$RtcStatsType_RtcIceCandidatePairStatsImpl; /// State of the checklist for the local and remote candidates in a /// pair. @@ -7736,17 +7762,17 @@ abstract class RtcStatsType_RtcIceCandidatePairStats implements RtcStatsType { /// [1]: https://tinyurl.com/rfc72eh double? get availableOutgoingBitrate; @JsonKey(ignore: true) - _$$RtcStatsType_RtcIceCandidatePairStatsCopyWith< - _$RtcStatsType_RtcIceCandidatePairStats> + _$$RtcStatsType_RtcIceCandidatePairStatsImplCopyWith< + _$RtcStatsType_RtcIceCandidatePairStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcTransportStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcTransportStatsCopyWith( - _$RtcStatsType_RtcTransportStats value, - $Res Function(_$RtcStatsType_RtcTransportStats) then) = - __$$RtcStatsType_RtcTransportStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcTransportStatsImplCopyWith<$Res> { + factory _$$RtcStatsType_RtcTransportStatsImplCopyWith( + _$RtcStatsType_RtcTransportStatsImpl value, + $Res Function(_$RtcStatsType_RtcTransportStatsImpl) then) = + __$$RtcStatsType_RtcTransportStatsImplCopyWithImpl<$Res>; @useResult $Res call( {int? packetsSent, @@ -7757,12 +7783,13 @@ abstract class _$$RtcStatsType_RtcTransportStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcTransportStatsCopyWithImpl<$Res> - extends _$RtcStatsTypeCopyWithImpl<$Res, _$RtcStatsType_RtcTransportStats> - implements _$$RtcStatsType_RtcTransportStatsCopyWith<$Res> { - __$$RtcStatsType_RtcTransportStatsCopyWithImpl( - _$RtcStatsType_RtcTransportStats _value, - $Res Function(_$RtcStatsType_RtcTransportStats) _then) +class __$$RtcStatsType_RtcTransportStatsImplCopyWithImpl<$Res> + extends _$RtcStatsTypeCopyWithImpl<$Res, + _$RtcStatsType_RtcTransportStatsImpl> + implements _$$RtcStatsType_RtcTransportStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcTransportStatsImplCopyWithImpl( + _$RtcStatsType_RtcTransportStatsImpl _value, + $Res Function(_$RtcStatsType_RtcTransportStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -7774,7 +7801,7 @@ class __$$RtcStatsType_RtcTransportStatsCopyWithImpl<$Res> Object? bytesReceived = freezed, Object? iceRole = freezed, }) { - return _then(_$RtcStatsType_RtcTransportStats( + return _then(_$RtcStatsType_RtcTransportStatsImpl( packetsSent: freezed == packetsSent ? _value.packetsSent : packetsSent // ignore: cast_nullable_to_non_nullable @@ -7801,9 +7828,9 @@ class __$$RtcStatsType_RtcTransportStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcTransportStats +class _$RtcStatsType_RtcTransportStatsImpl implements RtcStatsType_RtcTransportStats { - const _$RtcStatsType_RtcTransportStats( + const _$RtcStatsType_RtcTransportStatsImpl( {this.packetsSent, this.packetsReceived, this.bytesSent, @@ -7850,7 +7877,7 @@ class _$RtcStatsType_RtcTransportStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcTransportStats && + other is _$RtcStatsType_RtcTransportStatsImpl && (identical(other.packetsSent, packetsSent) || other.packetsSent == packetsSent) && (identical(other.packetsReceived, packetsReceived) || @@ -7869,9 +7896,10 @@ class _$RtcStatsType_RtcTransportStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcTransportStatsCopyWith<_$RtcStatsType_RtcTransportStats> - get copyWith => __$$RtcStatsType_RtcTransportStatsCopyWithImpl< - _$RtcStatsType_RtcTransportStats>(this, _$identity); + _$$RtcStatsType_RtcTransportStatsImplCopyWith< + _$RtcStatsType_RtcTransportStatsImpl> + get copyWith => __$$RtcStatsType_RtcTransportStatsImplCopyWithImpl< + _$RtcStatsType_RtcTransportStatsImpl>(this, _$identity); @override @optionalTypeArgs @@ -8118,7 +8146,7 @@ abstract class RtcStatsType_RtcTransportStats implements RtcStatsType { final int? packetsReceived, final int? bytesSent, final int? bytesReceived, - final IceRole? iceRole}) = _$RtcStatsType_RtcTransportStats; + final IceRole? iceRole}) = _$RtcStatsType_RtcTransportStatsImpl; /// Total number of packets sent over this transport. int? get packetsSent; @@ -8146,16 +8174,19 @@ abstract class RtcStatsType_RtcTransportStats implements RtcStatsType { /// [3]: https://w3.org/TR/webrtc#dom-rtcdtlstransport-icetransport IceRole? get iceRole; @JsonKey(ignore: true) - _$$RtcStatsType_RtcTransportStatsCopyWith<_$RtcStatsType_RtcTransportStats> + _$$RtcStatsType_RtcTransportStatsImplCopyWith< + _$RtcStatsType_RtcTransportStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith( - _$RtcStatsType_RtcRemoteInboundRtpStreamStats value, - $Res Function(_$RtcStatsType_RtcRemoteInboundRtpStreamStats) then) = - __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWith< + $Res> { + factory _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWith( + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl value, + $Res Function(_$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl) + then) = + __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWithImpl<$Res>; @useResult $Res call( {String? localId, @@ -8167,13 +8198,14 @@ abstract class _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith<$Res> { } /// @nodoc -class __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcRemoteInboundRtpStreamStats> - implements _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith<$Res> { - __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl( - _$RtcStatsType_RtcRemoteInboundRtpStreamStats _value, - $Res Function(_$RtcStatsType_RtcRemoteInboundRtpStreamStats) _then) + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl> + implements + _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWithImpl( + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl _value, + $Res Function(_$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -8186,7 +8218,7 @@ class __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl<$Res> Object? reportsReceived = freezed, Object? roundTripTimeMeasurements = freezed, }) { - return _then(_$RtcStatsType_RtcRemoteInboundRtpStreamStats( + return _then(_$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl( localId: freezed == localId ? _value.localId : localId // ignore: cast_nullable_to_non_nullable @@ -8217,9 +8249,9 @@ class __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcRemoteInboundRtpStreamStats +class _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl implements RtcStatsType_RtcRemoteInboundRtpStreamStats { - const _$RtcStatsType_RtcRemoteInboundRtpStreamStats( + const _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl( {this.localId, this.jitter, this.roundTripTime, @@ -8286,7 +8318,7 @@ class _$RtcStatsType_RtcRemoteInboundRtpStreamStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcRemoteInboundRtpStreamStats && + other is _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl && (identical(other.localId, localId) || other.localId == localId) && (identical(other.jitter, jitter) || other.jitter == jitter) && (identical(other.roundTripTime, roundTripTime) || @@ -8307,11 +8339,12 @@ class _$RtcStatsType_RtcRemoteInboundRtpStreamStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcRemoteInboundRtpStreamStats> + _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl> get copyWith => - __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWithImpl< - _$RtcStatsType_RtcRemoteInboundRtpStreamStats>(this, _$identity); + __$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWithImpl< + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl>( + this, _$identity); @override @optionalTypeArgs @@ -8561,7 +8594,7 @@ abstract class RtcStatsType_RtcRemoteInboundRtpStreamStats final double? fractionLost, final int? reportsReceived, final int? roundTripTimeMeasurements}) = - _$RtcStatsType_RtcRemoteInboundRtpStreamStats; + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl; /// [localId] is used for looking up the local /// [RTCOutboundRtpStreamStats][1] object for the same [SSRC]. @@ -8607,29 +8640,32 @@ abstract class RtcStatsType_RtcRemoteInboundRtpStreamStats /// [SSRC]: https://w3.org/TR/webrtc-stats#dfn-ssrc int? get roundTripTimeMeasurements; @JsonKey(ignore: true) - _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcRemoteInboundRtpStreamStats> + _$$RtcStatsType_RtcRemoteInboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcRemoteInboundRtpStreamStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWith<$Res> { - factory _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWith( - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats value, - $Res Function(_$RtcStatsType_RtcRemoteOutboundRtpStreamStats) then) = - __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWith< + $Res> { + factory _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWith( + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl value, + $Res Function(_$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl) + then) = + __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWithImpl<$Res>; @useResult $Res call({String? localId, double? remoteTimestamp, int? reportsSent}); } /// @nodoc -class __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl<$Res> +class __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWithImpl<$Res> extends _$RtcStatsTypeCopyWithImpl<$Res, - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats> - implements _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWith<$Res> { - __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl( - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats _value, - $Res Function(_$RtcStatsType_RtcRemoteOutboundRtpStreamStats) _then) + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl> + implements + _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWith<$Res> { + __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWithImpl( + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl _value, + $Res Function(_$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -8639,7 +8675,7 @@ class __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl<$Res> Object? remoteTimestamp = freezed, Object? reportsSent = freezed, }) { - return _then(_$RtcStatsType_RtcRemoteOutboundRtpStreamStats( + return _then(_$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl( localId: freezed == localId ? _value.localId : localId // ignore: cast_nullable_to_non_nullable @@ -8658,9 +8694,9 @@ class __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl<$Res> /// @nodoc -class _$RtcStatsType_RtcRemoteOutboundRtpStreamStats +class _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl implements RtcStatsType_RtcRemoteOutboundRtpStreamStats { - const _$RtcStatsType_RtcRemoteOutboundRtpStreamStats( + const _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl( {this.localId, this.remoteTimestamp, this.reportsSent}); /// [localId] is used for looking up the local @@ -8701,7 +8737,7 @@ class _$RtcStatsType_RtcRemoteOutboundRtpStreamStats bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_RtcRemoteOutboundRtpStreamStats && + other is _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl && (identical(other.localId, localId) || other.localId == localId) && (identical(other.remoteTimestamp, remoteTimestamp) || other.remoteTimestamp == remoteTimestamp) && @@ -8716,11 +8752,12 @@ class _$RtcStatsType_RtcRemoteOutboundRtpStreamStats @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats> + _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl> get copyWith => - __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWithImpl< - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats>(this, _$identity); + __$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWithImpl< + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl>( + this, _$identity); @override @optionalTypeArgs @@ -8964,9 +9001,10 @@ class _$RtcStatsType_RtcRemoteOutboundRtpStreamStats abstract class RtcStatsType_RtcRemoteOutboundRtpStreamStats implements RtcStatsType { const factory RtcStatsType_RtcRemoteOutboundRtpStreamStats( - {final String? localId, - final double? remoteTimestamp, - final int? reportsSent}) = _$RtcStatsType_RtcRemoteOutboundRtpStreamStats; + {final String? localId, + final double? remoteTimestamp, + final int? reportsSent}) = + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl; /// [localId] is used for looking up the local /// [RTCInboundRtpStreamStats][1] object for the same [SSRC]. @@ -8994,33 +9032,33 @@ abstract class RtcStatsType_RtcRemoteOutboundRtpStreamStats /// [SSRC]: https://w3.org/TR/webrtc-stats#dfn-ssrc int? get reportsSent; @JsonKey(ignore: true) - _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsCopyWith< - _$RtcStatsType_RtcRemoteOutboundRtpStreamStats> + _$$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImplCopyWith< + _$RtcStatsType_RtcRemoteOutboundRtpStreamStatsImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$RtcStatsType_UnimplementedCopyWith<$Res> { - factory _$$RtcStatsType_UnimplementedCopyWith( - _$RtcStatsType_Unimplemented value, - $Res Function(_$RtcStatsType_Unimplemented) then) = - __$$RtcStatsType_UnimplementedCopyWithImpl<$Res>; +abstract class _$$RtcStatsType_UnimplementedImplCopyWith<$Res> { + factory _$$RtcStatsType_UnimplementedImplCopyWith( + _$RtcStatsType_UnimplementedImpl value, + $Res Function(_$RtcStatsType_UnimplementedImpl) then) = + __$$RtcStatsType_UnimplementedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RtcStatsType_UnimplementedCopyWithImpl<$Res> - extends _$RtcStatsTypeCopyWithImpl<$Res, _$RtcStatsType_Unimplemented> - implements _$$RtcStatsType_UnimplementedCopyWith<$Res> { - __$$RtcStatsType_UnimplementedCopyWithImpl( - _$RtcStatsType_Unimplemented _value, - $Res Function(_$RtcStatsType_Unimplemented) _then) +class __$$RtcStatsType_UnimplementedImplCopyWithImpl<$Res> + extends _$RtcStatsTypeCopyWithImpl<$Res, _$RtcStatsType_UnimplementedImpl> + implements _$$RtcStatsType_UnimplementedImplCopyWith<$Res> { + __$$RtcStatsType_UnimplementedImplCopyWithImpl( + _$RtcStatsType_UnimplementedImpl _value, + $Res Function(_$RtcStatsType_UnimplementedImpl) _then) : super(_value, _then); } /// @nodoc -class _$RtcStatsType_Unimplemented implements RtcStatsType_Unimplemented { - const _$RtcStatsType_Unimplemented(); +class _$RtcStatsType_UnimplementedImpl implements RtcStatsType_Unimplemented { + const _$RtcStatsType_UnimplementedImpl(); @override String toString() { @@ -9031,7 +9069,7 @@ class _$RtcStatsType_Unimplemented implements RtcStatsType_Unimplemented { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RtcStatsType_Unimplemented); + other is _$RtcStatsType_UnimplementedImpl); } @override @@ -9274,5 +9312,5 @@ class _$RtcStatsType_Unimplemented implements RtcStatsType_Unimplemented { } abstract class RtcStatsType_Unimplemented implements RtcStatsType { - const factory RtcStatsType_Unimplemented() = _$RtcStatsType_Unimplemented; + const factory RtcStatsType_Unimplemented() = _$RtcStatsType_UnimplementedImpl; } diff --git a/lib/src/api/peer.dart b/lib/src/api/peer.dart index c7c9e1a8d3..045dcfe6b7 100644 --- a/lib/src/api/peer.dart +++ b/lib/src/api/peer.dart @@ -440,7 +440,7 @@ class _PeerConnectionFFI extends PeerConnection { IceTransportType iceType, List iceServers) async { var cfg = ffi.RtcConfiguration( iceTransportPolicy: ffi.IceTransportsType.values[iceType.index], - bundlePolicy: ffi.BundlePolicy.MaxBundle, + bundlePolicy: ffi.BundlePolicy.maxBundle, iceServers: iceServers .map((server) => ffi.RtcIceServer( urls: server.urls, @@ -537,10 +537,27 @@ class _PeerConnectionFFI extends PeerConnection { MediaKind mediaType, RtpTransceiverInit init) async { _checkNotClosed(); + var ffiInit = await api!.createTransceiverInit(); + await api!.setTransceiverInitDirection( + init: ffiInit, + direction: ffi.RtpTransceiverDirection.values[init.direction.index]); + + for (var encoding in init.sendEncodings) { + var ffiEncoding = await api!.createEncodingParameters( + rid: encoding.rid, + active: encoding.active, + maxBitrate: encoding.maxBitrate, + maxFramerate: encoding.maxFramerate, + scaleResolutionDownBy: encoding.scaleResolutionDownBy, + scalabilityMode: encoding.scalabilityMode); + await api! + .addTransceiverInitSendEncoding(init: ffiInit, encoding: ffiEncoding); + } + var transceiver = RtpTransceiver.fromFFI(await api!.addTransceiver( peer: _peer!, mediaType: ffi.MediaType.values[mediaType.index], - direction: ffi.RtpTransceiverDirection.values[init.direction.index])); + init: ffiInit)); _transceivers.add(transceiver); return transceiver; diff --git a/lib/src/model/transceiver.dart b/lib/src/model/transceiver.dart index 9d9298e8e3..d29fe7d3c1 100644 --- a/lib/src/model/transceiver.dart +++ b/lib/src/model/transceiver.dart @@ -30,8 +30,57 @@ class RtpTransceiverInit { /// Direction of an `RtpTransceiver` which will be created from this config. late TransceiverDirection direction; + /// [SendEncodingParameters] of an `RtpTransceiver` which will be created from + /// this config. + late List sendEncodings = List.empty(growable: true); + + /// Converts this model to the [Map] expected by Flutter. + Map toMap() { + return { + 'direction': direction.index, + 'sendEncodings': + sendEncodings.map((encoding) => encoding.toMap()).toList() + }; + } +} + +/// Encoding describing a single configuration of a codec for an RTCRtpSender. +class SendEncodingParameters { + /// String which, if set, specifies an RTP stream ID (RID) to be sent using + /// the RID header extension. + SendEncodingParameters(this.rid, this.active); + + /// String which, if set, specifies an RTP stream ID (RID) to be sent using + /// the RID header extension. + late String rid; + + /// If true, the described encoding is currently actively being used. + late bool active; + + /// Indicator of the maximum number of bits per second to allow for this + /// encoding. + int? maxBitrate; + + /// Value specifying the maximum number of frames per second to allow for + /// this encoding. + double? maxFramerate; + + /// Double-precision floating-point value specifying a factor by which to + /// scale down the video during encoding. + double? scaleResolutionDownBy; + + /// Scalability mode describes layers within the media stream. + String? scalabilityMode; + /// Converts this model to the [Map] expected by Flutter. Map toMap() { - return {'direction': direction.index}; + return { + 'rid': rid, + 'active': active, + 'maxBitrate': maxBitrate, + 'maxFramerate': maxFramerate, + 'scaleResolutionDownBy': scaleResolutionDownBy, + 'scalabilityMode': scalabilityMode + }; } }