From 00c26a34ab279f07cbee618e2c2523f41f6e3a81 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Sat, 7 Dec 2024 02:13:54 -0800 Subject: [PATCH] adding disconnect reason, pass through to FFI used for `ParticipantDisconnected` events --- Cargo.lock | 3 +- livekit-api/Cargo.toml | 1 + livekit-api/src/services/sip.rs | 123 +-- livekit-ffi/protocol/participant.proto | 31 + livekit-ffi/protocol/room.proto | 36 +- livekit-ffi/src/conversion/participant.rs | 24 + livekit-ffi/src/conversion/room.rs | 3 + livekit-ffi/src/livekit.proto.rs | 936 ++++++++++++------ livekit/src/prelude.rs | 8 +- livekit/src/proto.rs | 21 + livekit/src/room/mod.rs | 1 + .../src/room/participant/local_participant.rs | 4 + livekit/src/room/participant/mod.rs | 22 + .../room/participant/remote_participant.rs | 4 + 14 files changed, 792 insertions(+), 425 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d907dc78..6154cfb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1628,6 +1628,7 @@ dependencies = [ "livekit-runtime", "log", "parking_lot", + "pbjson-types", "prost 0.12.3", "reqwest", "scopeguard", diff --git a/livekit-api/Cargo.toml b/livekit-api/Cargo.toml index 99538ca4..cca76985 100644 --- a/livekit-api/Cargo.toml +++ b/livekit-api/Cargo.toml @@ -73,6 +73,7 @@ url = "2.3" log = "0.4" parking_lot = { version = "0.12" } prost = "0.12" +pbjson-types = "0.6" # webhooks serde_json = { version = "1.0", optional = true } diff --git a/livekit-api/src/services/sip.rs b/livekit-api/src/services/sip.rs index e2517be9..aca2d11e 100644 --- a/livekit-api/src/services/sip.rs +++ b/livekit-api/src/services/sip.rs @@ -14,11 +14,13 @@ use livekit_protocol as proto; use std::collections::HashMap; +use std::time::Duration; use crate::access_token::SIPGrants; use crate::get_env_keys; use crate::services::twirp_client::TwirpClient; use crate::services::{ServiceBase, ServiceResult, LIVEKIT_PACKAGE}; +use pbjson_types::Duration as ProtoDuration; const SVC: &str = "SIP"; @@ -58,18 +60,24 @@ pub struct CreateSIPTrunkOptions { #[derive(Default, Clone, Debug)] pub struct CreateSIPInboundTrunkOptions { /// Optional free-form metadata. - pub metadata: String, + pub metadata: Option, /// CIDR or IPs that traffic is accepted from /// An empty list means all inbound traffic is accepted. - pub allowed_addresses: Vec, + pub allowed_addresses: Option>, /// Accepted `To` values. This Trunk will only accept a call made to /// these numbers. This allows you to have distinct Trunks for different phone /// numbers at the same provider. - pub allowed_numbers: Vec, + pub allowed_numbers: Option>, /// Username and password used to authenticate inbound SIP invites /// May be empty to have no Authentication - pub auth_username: String, - pub auth_password: String, + pub auth_username: Option, + pub auth_password: Option, + pub headers: Option>, + pub headers_to_attributes: Option>, + pub attributes_to_headers: Option>, + pub max_call_duration: Option, + pub ringing_timeout: Option, + pub krisp_enabled: Option, } #[derive(Default, Clone, Debug)] @@ -81,6 +89,10 @@ pub struct CreateSIPOutboundTrunkOptions { /// May be empty to have no Authentication pub auth_username: String, pub auth_password: String, + + pub headers: Option>, + pub headers_to_attributes: Option>, + pub attributes_to_headers: Option>, } #[deprecated] @@ -119,16 +131,21 @@ pub struct CreateSIPParticipantOptions { /// Optional identity of the participant in LiveKit room pub participant_identity: String, /// Optionally set the name of the participant in a LiveKit room - pub participant_name: String, + pub participant_name: Option, /// Optionally set the free-form metadata of the participant in a LiveKit room - pub participant_metadata: String, - pub participant_attributes: HashMap, + pub participant_metadata: Option, + pub participant_attributes: Option>, + // What number should be dialed via SIP + pub sip_number: Option, /// Optionally send following DTMF digits (extension codes) when making a call. /// Character 'w' can be used to add a 0.5 sec delay. - pub dtmf: String, - /// Optionally play ringtone in the room as an audible indicator for existing participants - pub play_ringtone: bool, - pub hide_phone_number: bool, + pub dtmf: Option, + /// Optionally play dialtone in the room as an audible indicator for existing participants + pub play_dialtone: Option, + pub hide_phone_number: Option, + pub ringing_timeout: Option, + pub max_call_duration: Option, + pub enable_krisp: Option, } impl SIPClient { @@ -144,38 +161,8 @@ impl SIPClient { Ok(Self::with_api_key(host, &api_key, &api_secret)) } - #[deprecated] - pub async fn create_sip_trunk( - &self, - number: String, - options: CreateSIPTrunkOptions, - ) -> ServiceResult { - self.client - .request( - SVC, - "CreateSIPTrunk", - proto::CreateSipTrunkRequest { - name: options.name, - metadata: options.metadata, - - outbound_number: number.to_owned(), - outbound_address: options.outbound_address.to_owned(), - outbound_username: options.outbound_username.to_owned(), - outbound_password: options.outbound_password.to_owned(), - - inbound_numbers: options.inbound_numbers.to_owned(), - inbound_numbers_regex: Vec::new(), - inbound_addresses: options.inbound_addresses.to_owned(), - inbound_username: options.inbound_username.to_owned(), - inbound_password: options.inbound_password.to_owned(), - }, - self.base.auth_header( - Default::default(), - Some(SIPGrants { admin: true, ..Default::default() }), - )?, - ) - .await - .map_err(Into::into) + fn duration_to_proto(d: Option) -> Option { + d.map(|d| ProtoDuration { seconds: d.as_secs() as i64, nanos: d.subsec_nanos() as i32 }) } pub async fn create_sip_inbound_trunk( @@ -193,15 +180,17 @@ impl SIPClient { sip_trunk_id: Default::default(), name, numbers, - metadata: options.metadata, - - allowed_numbers: options.allowed_numbers.to_owned(), - allowed_addresses: options.allowed_addresses.to_owned(), - auth_username: options.auth_username.to_owned(), - auth_password: options.auth_password.to_owned(), - - headers: Default::default(), - headers_to_attributes: Default::default(), + metadata: options.metadata.unwrap_or_default(), + allowed_numbers: options.allowed_numbers.unwrap_or_default(), + allowed_addresses: options.allowed_addresses.unwrap_or_default(), + auth_username: options.auth_username.unwrap_or_default(), + auth_password: options.auth_password.unwrap_or_default(), + headers: options.headers.unwrap_or_default(), + headers_to_attributes: options.headers_to_attributes.unwrap_or_default(), + attributes_to_headers: options.attributes_to_headers.unwrap_or_default(), + krisp_enabled: options.krisp_enabled.unwrap_or(false), + max_call_duration: Self::duration_to_proto(options.max_call_duration), + ringing_timeout: Self::duration_to_proto(options.ringing_timeout), }), }, self.base.auth_header( @@ -236,8 +225,9 @@ impl SIPClient { auth_username: options.auth_username.to_owned(), auth_password: options.auth_password.to_owned(), - headers: Default::default(), - headers_to_attributes: Default::default(), + headers: options.headers.unwrap_or_default(), + headers_to_attributes: options.headers_to_attributes.unwrap_or_default(), + attributes_to_headers: options.attributes_to_headers.unwrap_or_default(), }), }, self.base.auth_header( @@ -406,14 +396,25 @@ impl SIPClient { proto::CreateSipParticipantRequest { sip_trunk_id: sip_trunk_id.to_owned(), sip_call_to: call_to.to_owned(), + sip_number: options.sip_number.to_owned().unwrap_or_default(), room_name: room_name.to_owned(), participant_identity: options.participant_identity.to_owned(), - participant_name: options.participant_name.to_owned(), - participant_metadata: options.participant_metadata.to_owned(), - participant_attributes: options.participant_attributes.to_owned(), - dtmf: options.dtmf.to_owned(), - play_ringtone: options.play_ringtone, - hide_phone_number: options.hide_phone_number, + participant_name: options.participant_name.to_owned().unwrap_or_default(), + participant_metadata: options + .participant_metadata + .to_owned() + .unwrap_or_default(), + participant_attributes: options + .participant_attributes + .to_owned() + .unwrap_or_default(), + dtmf: options.dtmf.to_owned().unwrap_or_default(), + play_ringtone: options.play_dialtone.unwrap_or(false), + play_dialtone: options.play_dialtone.unwrap_or(false), + hide_phone_number: options.hide_phone_number.unwrap_or(false), + max_call_duration: Self::duration_to_proto(options.max_call_duration), + ringing_timeout: Self::duration_to_proto(options.ringing_timeout), + enable_krisp: options.enable_krisp.unwrap_or(false), }, self.base.auth_header( Default::default(), diff --git a/livekit-ffi/protocol/participant.proto b/livekit-ffi/protocol/participant.proto index c0a480f2..3f1e2720 100644 --- a/livekit-ffi/protocol/participant.proto +++ b/livekit-ffi/protocol/participant.proto @@ -26,6 +26,7 @@ message ParticipantInfo { required string metadata = 4; map attributes = 5; required ParticipantKind kind = 6; + required DisconnectReason disconnect_reason = 7; } message OwnedParticipant { @@ -39,4 +40,34 @@ enum ParticipantKind { PARTICIPANT_KIND_EGRESS = 2; PARTICIPANT_KIND_SIP = 3; PARTICIPANT_KIND_AGENT = 4; +} + +enum DisconnectReason { + UNKNOWN_REASON = 0; + // the client initiated the disconnect + CLIENT_INITIATED = 1; + // another participant with the same identity has joined the room + DUPLICATE_IDENTITY = 2; + // the server instance is shutting down + SERVER_SHUTDOWN = 3; + // RoomService.RemoveParticipant was called + PARTICIPANT_REMOVED = 4; + // RoomService.DeleteRoom was called + ROOM_DELETED = 5; + // the client is attempting to resume a session, but server is not aware of it + STATE_MISMATCH = 6; + // client was unable to connect fully + JOIN_FAILURE = 7; + // Cloud-only, the server requested Participant to migrate the connection elsewhere + MIGRATION = 8; + // the signal websocket was closed unexpectedly + SIGNAL_CLOSE = 9; + // the room was closed, due to all Standard and Ingress participants having left + ROOM_CLOSED = 10; + // SIP callee did not respond in time + USER_UNAVAILABLE = 11; + // SIP callee rejected the call (busy) + USER_REJECTED = 12; + // SIP protocol failure or unexpected response + SIP_TRUNK_FAILURE = 13; } \ No newline at end of file diff --git a/livekit-ffi/protocol/room.proto b/livekit-ffi/protocol/room.proto index edae5c00..4d0f3d92 100644 --- a/livekit-ffi/protocol/room.proto +++ b/livekit-ffi/protocol/room.proto @@ -53,7 +53,7 @@ message ConnectCallback { string error = 2; Result result = 3; } - + } // Disconnect from the a room @@ -76,7 +76,7 @@ message PublishTrackCallback { string error = 2; OwnedTrackPublication publication = 3; } - + } // Unpublish a track from the room @@ -316,30 +316,6 @@ enum DataPacketKind { KIND_RELIABLE = 1; } -enum DisconnectReason { - UNKNOWN_REASON = 0; - // the client initiated the disconnect - CLIENT_INITIATED = 1; - // another participant with the same identity has joined the room - DUPLICATE_IDENTITY = 2; - // the server instance is shutting down - SERVER_SHUTDOWN = 3; - // RoomService.RemoveParticipant was called - PARTICIPANT_REMOVED = 4; - // RoomService.DeleteRoom was called - ROOM_DELETED = 5; - // the client is attempting to resume a session, but server is not aware of it - STATE_MISMATCH = 6; - // client was unable to connect fully - JOIN_FAILURE = 7; - // Cloud-only, the server requested Participant to migrate the connection elsewhere - MIGRATION = 8; - // the signal websocket was closed unexpectedly - SIGNAL_CLOSE = 9; - // the room was closed, due to all Standard and Ingress participants having left - ROOM_CLOSED = 10; -} - message TranscriptionSegment { required string id = 1; required string text = 2; @@ -407,7 +383,7 @@ message OwnedRoom { message ParticipantConnected { required OwnedParticipant info = 1; } -message ParticipantDisconnected { +message ParticipantDisconnected { required string participant_identity = 1; } @@ -471,7 +447,7 @@ message E2eeStateChanged { message ActiveSpeakersChanged { repeated string participant_identities = 1; } -message RoomMetadataChanged { +message RoomMetadataChanged { required string metadata = 1; } @@ -479,7 +455,7 @@ message RoomSidChanged { required string sid = 1; } -message ParticipantMetadataChanged { +message ParticipantMetadataChanged { required string participant_identity = 1; required string metadata = 2; } @@ -490,7 +466,7 @@ message ParticipantAttributesChanged { repeated AttributesEntry changed_attributes = 3; } -message ParticipantNameChanged { +message ParticipantNameChanged { required string participant_identity = 1; required string name = 2; } diff --git a/livekit-ffi/src/conversion/participant.rs b/livekit-ffi/src/conversion/participant.rs index 755f0bd0..c80453cd 100644 --- a/livekit-ffi/src/conversion/participant.rs +++ b/livekit-ffi/src/conversion/participant.rs @@ -13,6 +13,7 @@ // limitations under the License. use crate::{proto, server::participant::FfiParticipant}; +use livekit::DisconnectReason; use livekit::ParticipantKind; impl From<&FfiParticipant> for proto::ParticipantInfo { @@ -25,6 +26,8 @@ impl From<&FfiParticipant> for proto::ParticipantInfo { metadata: participant.metadata(), attributes: participant.attributes(), kind: proto::ParticipantKind::from(participant.kind()).into(), + disconnect_reason: proto::DisconnectReason::from(participant.disconnect_reason()) + .into(), } } } @@ -40,3 +43,24 @@ impl From for proto::ParticipantKind { } } } + +impl From for proto::DisconnectReason { + fn from(reason: DisconnectReason) -> Self { + match reason { + DisconnectReason::UnknownReason => proto::DisconnectReason::UnknownReason, + DisconnectReason::ClientInitiated => proto::DisconnectReason::ClientInitiated, + DisconnectReason::DuplicateIdentity => proto::DisconnectReason::DuplicateIdentity, + DisconnectReason::ServerShutdown => proto::DisconnectReason::ServerShutdown, + DisconnectReason::ParticipantRemoved => proto::DisconnectReason::ParticipantRemoved, + DisconnectReason::RoomDeleted => proto::DisconnectReason::RoomDeleted, + DisconnectReason::StateMismatch => proto::DisconnectReason::StateMismatch, + DisconnectReason::JoinFailure => proto::DisconnectReason::JoinFailure, + DisconnectReason::Migration => proto::DisconnectReason::Migration, + DisconnectReason::SignalClose => proto::DisconnectReason::SignalClose, + DisconnectReason::RoomClosed => proto::DisconnectReason::RoomClosed, + DisconnectReason::UserUnavailable => proto::DisconnectReason::UserUnavailable, + DisconnectReason::UserRejected => proto::DisconnectReason::UserRejected, + DisconnectReason::SipTrunkFailure => proto::DisconnectReason::SipTrunkFailure, + } + } +} diff --git a/livekit-ffi/src/conversion/room.rs b/livekit-ffi/src/conversion/room.rs index 2dc32170..dac00067 100644 --- a/livekit-ffi/src/conversion/room.rs +++ b/livekit-ffi/src/conversion/room.rs @@ -95,6 +95,9 @@ impl From for proto::DisconnectReason { DisconnectReason::Migration => Self::Migration, DisconnectReason::SignalClose => Self::SignalClose, DisconnectReason::RoomClosed => Self::RoomClosed, + DisconnectReason::UserUnavailable => Self::UserUnavailable, + DisconnectReason::UserRejected => Self::UserRejected, + DisconnectReason::SipTrunkFailure => Self::SipTrunkFailure, } } } diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index 077dc4ae..70066690 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -1,5 +1,5 @@ // @generated -// This file is @generated by prost-build. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FrameCryptor { #[prost(string, required, tag="1")] @@ -11,6 +11,7 @@ pub struct FrameCryptor { #[prost(bool, required, tag="4")] pub enabled: bool, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyProviderOptions { /// Only specify if you want to use a shared_key @@ -24,6 +25,7 @@ pub struct KeyProviderOptions { #[prost(int32, required, tag="4")] pub failure_tolerance: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeOptions { #[prost(enumeration="EncryptionType", required, tag="1")] @@ -31,22 +33,27 @@ pub struct E2eeOptions { #[prost(message, required, tag="2")] pub key_provider_options: KeyProviderOptions, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeManagerSetEnabledRequest { #[prost(bool, required, tag="1")] pub enabled: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeManagerSetEnabledResponse { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeManagerGetFrameCryptorsRequest { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeManagerGetFrameCryptorsResponse { #[prost(message, repeated, tag="1")] pub frame_cryptors: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FrameCryptorSetEnabledRequest { #[prost(string, required, tag="1")] @@ -56,9 +63,11 @@ pub struct FrameCryptorSetEnabledRequest { #[prost(bool, required, tag="3")] pub enabled: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FrameCryptorSetEnabledResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FrameCryptorSetKeyIndexRequest { #[prost(string, required, tag="1")] @@ -68,9 +77,11 @@ pub struct FrameCryptorSetKeyIndexRequest { #[prost(int32, required, tag="3")] pub key_index: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FrameCryptorSetKeyIndexResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetSharedKeyRequest { #[prost(bytes="vec", required, tag="1")] @@ -78,29 +89,35 @@ pub struct SetSharedKeyRequest { #[prost(int32, required, tag="2")] pub key_index: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetSharedKeyResponse { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RatchetSharedKeyRequest { #[prost(int32, required, tag="1")] pub key_index: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RatchetSharedKeyResponse { #[prost(bytes="vec", optional, tag="1")] pub new_key: ::core::option::Option<::prost::alloc::vec::Vec>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSharedKeyRequest { #[prost(int32, required, tag="1")] pub key_index: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSharedKeyResponse { #[prost(bytes="vec", optional, tag="1")] pub key: ::core::option::Option<::prost::alloc::vec::Vec>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetKeyRequest { #[prost(string, required, tag="1")] @@ -110,9 +127,11 @@ pub struct SetKeyRequest { #[prost(int32, required, tag="3")] pub key_index: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetKeyResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RatchetKeyRequest { #[prost(string, required, tag="1")] @@ -120,11 +139,13 @@ pub struct RatchetKeyRequest { #[prost(int32, required, tag="2")] pub key_index: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RatchetKeyResponse { #[prost(bytes="vec", optional, tag="1")] pub new_key: ::core::option::Option<::prost::alloc::vec::Vec>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetKeyRequest { #[prost(string, required, tag="1")] @@ -132,11 +153,13 @@ pub struct GetKeyRequest { #[prost(int32, required, tag="2")] pub key_index: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetKeyResponse { #[prost(bytes="vec", optional, tag="1")] pub key: ::core::option::Option<::prost::alloc::vec::Vec>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeRequest { #[prost(uint64, required, tag="1")] @@ -146,7 +169,8 @@ pub struct E2eeRequest { } /// Nested message and enum types in `E2eeRequest`. pub mod e2ee_request { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] ManagerSetEnabled(super::E2eeManagerSetEnabledRequest), @@ -170,6 +194,7 @@ pub mod e2ee_request { GetKey(super::GetKeyRequest), } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeResponse { #[prost(oneof="e2ee_response::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10")] @@ -177,7 +202,8 @@ pub struct E2eeResponse { } /// Nested message and enum types in `E2eeResponse`. pub mod e2ee_response { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] ManagerSetEnabled(super::E2eeManagerSetEnabledResponse), @@ -217,9 +243,9 @@ impl EncryptionType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::None => "NONE", - Self::Gcm => "GCM", - Self::Custom => "CUSTOM", + EncryptionType::None => "NONE", + EncryptionType::Gcm => "GCM", + EncryptionType::Custom => "CUSTOM", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -250,13 +276,13 @@ impl EncryptionState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::New => "NEW", - Self::Ok => "OK", - Self::EncryptionFailed => "ENCRYPTION_FAILED", - Self::DecryptionFailed => "DECRYPTION_FAILED", - Self::MissingKey => "MISSING_KEY", - Self::KeyRatcheted => "KEY_RATCHETED", - Self::InternalError => "INTERNAL_ERROR", + EncryptionState::New => "NEW", + EncryptionState::Ok => "OK", + EncryptionState::EncryptionFailed => "ENCRYPTION_FAILED", + EncryptionState::DecryptionFailed => "DECRYPTION_FAILED", + EncryptionState::MissingKey => "MISSING_KEY", + EncryptionState::KeyRatcheted => "KEY_RATCHETED", + EncryptionState::InternalError => "INTERNAL_ERROR", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -282,11 +308,13 @@ impl EncryptionState { /// /// When refering to a handle without owning it, we just use a uint32 without this message. /// (the variable name is suffixed with "_handle") -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FfiOwnedHandle { #[prost(uint64, required, tag="1")] pub id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RtcStats { #[prost(oneof="rtc_stats::Stats", tags="3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18")] @@ -294,14 +322,16 @@ pub struct RtcStats { } /// Nested message and enum types in `RtcStats`. pub mod rtc_stats { - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Codec { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub codec: super::CodecStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct InboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -312,7 +342,8 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub inbound: super::InboundRtpStreamStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OutboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -323,7 +354,8 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub outbound: super::OutboundRtpStreamStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteInboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -334,7 +366,8 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub remote_inbound: super::RemoteInboundRtpStreamStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteOutboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -345,7 +378,8 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub remote_outbound: super::RemoteOutboundRtpStreamStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct MediaSource { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -356,63 +390,72 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub video: super::VideoSourceStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct MediaPlayout { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub audio_playout: super::AudioPlayoutStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PeerConnection { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub pc: super::PeerConnectionStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DataChannel { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub dc: super::DataChannelStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Transport { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub transport: super::TransportStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CandidatePair { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub candidate_pair: super::CandidatePairStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalCandidate { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub candidate: super::IceCandidateStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteCandidate { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub candidate: super::IceCandidateStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Certificate { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, #[prost(message, required, tag="2")] pub certificate: super::CertificateStats, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Stream { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -420,10 +463,12 @@ pub mod rtc_stats { pub stream: super::StreamStats, } /// Deprecated - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Track { } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Stats { #[prost(message, tag="3")] Codec(Codec), @@ -459,6 +504,7 @@ pub mod rtc_stats { Track(Track), } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RtcStatsData { #[prost(string, required, tag="1")] @@ -466,6 +512,7 @@ pub struct RtcStatsData { #[prost(int64, required, tag="2")] pub timestamp: i64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodecStats { #[prost(uint32, required, tag="1")] @@ -481,6 +528,7 @@ pub struct CodecStats { #[prost(string, required, tag="6")] pub sdp_fmtp_line: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RtpStreamStats { #[prost(uint32, required, tag="1")] @@ -492,7 +540,8 @@ pub struct RtpStreamStats { #[prost(string, required, tag="4")] pub codec_id: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ReceivedRtpStreamStats { #[prost(uint64, required, tag="1")] pub packets_received: u64, @@ -501,6 +550,7 @@ pub struct ReceivedRtpStreamStats { #[prost(double, required, tag="3")] pub jitter: f64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InboundRtpStreamStats { #[prost(string, required, tag="1")] @@ -610,13 +660,15 @@ pub struct InboundRtpStreamStats { #[prost(uint32, required, tag="53")] pub fec_ssrc: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SentRtpStreamStats { #[prost(uint64, required, tag="1")] pub packets_sent: u64, #[prost(uint64, required, tag="2")] pub bytes_sent: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutboundRtpStreamStats { #[prost(string, required, tag="1")] @@ -680,6 +732,7 @@ pub struct OutboundRtpStreamStats { #[prost(string, required, tag="30")] pub scalability_mode: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteInboundRtpStreamStats { #[prost(string, required, tag="1")] @@ -693,6 +746,7 @@ pub struct RemoteInboundRtpStreamStats { #[prost(uint64, required, tag="5")] pub round_trip_time_measurements: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteOutboundRtpStreamStats { #[prost(string, required, tag="1")] @@ -708,6 +762,7 @@ pub struct RemoteOutboundRtpStreamStats { #[prost(uint64, required, tag="6")] pub round_trip_time_measurements: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MediaSourceStats { #[prost(string, required, tag="1")] @@ -715,7 +770,8 @@ pub struct MediaSourceStats { #[prost(string, required, tag="2")] pub kind: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioSourceStats { #[prost(double, required, tag="1")] pub audio_level: f64, @@ -736,7 +792,8 @@ pub struct AudioSourceStats { #[prost(uint64, required, tag="9")] pub total_samples_captured: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoSourceStats { #[prost(uint32, required, tag="1")] pub width: u32, @@ -747,6 +804,7 @@ pub struct VideoSourceStats { #[prost(double, required, tag="4")] pub frames_per_second: f64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioPlayoutStats { #[prost(string, required, tag="1")] @@ -762,13 +820,15 @@ pub struct AudioPlayoutStats { #[prost(uint64, required, tag="6")] pub total_samples_count: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PeerConnectionStats { #[prost(uint32, required, tag="1")] pub data_channels_opened: u32, #[prost(uint32, required, tag="2")] pub data_channels_closed: u32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataChannelStats { #[prost(string, required, tag="1")] @@ -788,6 +848,7 @@ pub struct DataChannelStats { #[prost(uint64, required, tag="8")] pub bytes_received: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransportStats { #[prost(uint64, required, tag="1")] @@ -823,6 +884,7 @@ pub struct TransportStats { #[prost(uint32, required, tag="16")] pub selected_candidate_pair_changes: u32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CandidatePairStats { #[prost(string, required, tag="1")] @@ -870,6 +932,7 @@ pub struct CandidatePairStats { #[prost(uint64, required, tag="22")] pub bytes_discarded_on_send: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IceCandidateStats { #[prost(string, required, tag="1")] @@ -899,6 +962,7 @@ pub struct IceCandidateStats { #[prost(enumeration="IceTcpCandidateType", optional, tag="13")] pub tcp_type: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CertificateStats { #[prost(string, required, tag="1")] @@ -910,6 +974,7 @@ pub struct CertificateStats { #[prost(string, required, tag="4")] pub issuer_certificate_id: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamStats { #[prost(string, required, tag="1")] @@ -933,10 +998,10 @@ impl DataChannelState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::DcConnecting => "DC_CONNECTING", - Self::DcOpen => "DC_OPEN", - Self::DcClosing => "DC_CLOSING", - Self::DcClosed => "DC_CLOSED", + DataChannelState::DcConnecting => "DC_CONNECTING", + DataChannelState::DcOpen => "DC_OPEN", + DataChannelState::DcClosing => "DC_CLOSING", + DataChannelState::DcClosed => "DC_CLOSED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -965,10 +1030,10 @@ impl QualityLimitationReason { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::LimitationNone => "LIMITATION_NONE", - Self::LimitationCpu => "LIMITATION_CPU", - Self::LimitationBandwidth => "LIMITATION_BANDWIDTH", - Self::LimitationOther => "LIMITATION_OTHER", + QualityLimitationReason::LimitationNone => "LIMITATION_NONE", + QualityLimitationReason::LimitationCpu => "LIMITATION_CPU", + QualityLimitationReason::LimitationBandwidth => "LIMITATION_BANDWIDTH", + QualityLimitationReason::LimitationOther => "LIMITATION_OTHER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -996,9 +1061,9 @@ impl IceRole { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::IceUnknown => "ICE_UNKNOWN", - Self::IceControlling => "ICE_CONTROLLING", - Self::IceControlled => "ICE_CONTROLLED", + IceRole::IceUnknown => "ICE_UNKNOWN", + IceRole::IceControlling => "ICE_CONTROLLING", + IceRole::IceControlled => "ICE_CONTROLLED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1027,11 +1092,11 @@ impl DtlsTransportState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::DtlsTransportNew => "DTLS_TRANSPORT_NEW", - Self::DtlsTransportConnecting => "DTLS_TRANSPORT_CONNECTING", - Self::DtlsTransportConnected => "DTLS_TRANSPORT_CONNECTED", - Self::DtlsTransportClosed => "DTLS_TRANSPORT_CLOSED", - Self::DtlsTransportFailed => "DTLS_TRANSPORT_FAILED", + DtlsTransportState::DtlsTransportNew => "DTLS_TRANSPORT_NEW", + DtlsTransportState::DtlsTransportConnecting => "DTLS_TRANSPORT_CONNECTING", + DtlsTransportState::DtlsTransportConnected => "DTLS_TRANSPORT_CONNECTED", + DtlsTransportState::DtlsTransportClosed => "DTLS_TRANSPORT_CLOSED", + DtlsTransportState::DtlsTransportFailed => "DTLS_TRANSPORT_FAILED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1064,13 +1129,13 @@ impl IceTransportState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::IceTransportNew => "ICE_TRANSPORT_NEW", - Self::IceTransportChecking => "ICE_TRANSPORT_CHECKING", - Self::IceTransportConnected => "ICE_TRANSPORT_CONNECTED", - Self::IceTransportCompleted => "ICE_TRANSPORT_COMPLETED", - Self::IceTransportDisconnected => "ICE_TRANSPORT_DISCONNECTED", - Self::IceTransportFailed => "ICE_TRANSPORT_FAILED", - Self::IceTransportClosed => "ICE_TRANSPORT_CLOSED", + IceTransportState::IceTransportNew => "ICE_TRANSPORT_NEW", + IceTransportState::IceTransportChecking => "ICE_TRANSPORT_CHECKING", + IceTransportState::IceTransportConnected => "ICE_TRANSPORT_CONNECTED", + IceTransportState::IceTransportCompleted => "ICE_TRANSPORT_COMPLETED", + IceTransportState::IceTransportDisconnected => "ICE_TRANSPORT_DISCONNECTED", + IceTransportState::IceTransportFailed => "ICE_TRANSPORT_FAILED", + IceTransportState::IceTransportClosed => "ICE_TRANSPORT_CLOSED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1101,9 +1166,9 @@ impl DtlsRole { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::DtlsClient => "DTLS_CLIENT", - Self::DtlsServer => "DTLS_SERVER", - Self::DtlsUnknown => "DTLS_UNKNOWN", + DtlsRole::DtlsClient => "DTLS_CLIENT", + DtlsRole::DtlsServer => "DTLS_SERVER", + DtlsRole::DtlsUnknown => "DTLS_UNKNOWN", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1132,11 +1197,11 @@ impl IceCandidatePairState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::PairFrozen => "PAIR_FROZEN", - Self::PairWaiting => "PAIR_WAITING", - Self::PairInProgress => "PAIR_IN_PROGRESS", - Self::PairFailed => "PAIR_FAILED", - Self::PairSucceeded => "PAIR_SUCCEEDED", + IceCandidatePairState::PairFrozen => "PAIR_FROZEN", + IceCandidatePairState::PairWaiting => "PAIR_WAITING", + IceCandidatePairState::PairInProgress => "PAIR_IN_PROGRESS", + IceCandidatePairState::PairFailed => "PAIR_FAILED", + IceCandidatePairState::PairSucceeded => "PAIR_SUCCEEDED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1166,10 +1231,10 @@ impl IceCandidateType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Host => "HOST", - Self::Srflx => "SRFLX", - Self::Prflx => "PRFLX", - Self::Relay => "RELAY", + IceCandidateType::Host => "HOST", + IceCandidateType::Srflx => "SRFLX", + IceCandidateType::Prflx => "PRFLX", + IceCandidateType::Relay => "RELAY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1197,9 +1262,9 @@ impl IceServerTransportProtocol { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::TransportUdp => "TRANSPORT_UDP", - Self::TransportTcp => "TRANSPORT_TCP", - Self::TransportTls => "TRANSPORT_TLS", + IceServerTransportProtocol::TransportUdp => "TRANSPORT_UDP", + IceServerTransportProtocol::TransportTcp => "TRANSPORT_TCP", + IceServerTransportProtocol::TransportTls => "TRANSPORT_TLS", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1226,9 +1291,9 @@ impl IceTcpCandidateType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::CandidateActive => "CANDIDATE_ACTIVE", - Self::CandidatePassive => "CANDIDATE_PASSIVE", - Self::CandidateSo => "CANDIDATE_SO", + IceTcpCandidateType::CandidateActive => "CANDIDATE_ACTIVE", + IceTcpCandidateType::CandidatePassive => "CANDIDATE_PASSIVE", + IceTcpCandidateType::CandidateSo => "CANDIDATE_SO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1242,6 +1307,7 @@ impl IceTcpCandidateType { } } /// Create a new VideoTrack from a VideoSource +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateVideoTrackRequest { #[prost(string, required, tag="1")] @@ -1249,12 +1315,14 @@ pub struct CreateVideoTrackRequest { #[prost(uint64, required, tag="2")] pub source_handle: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateVideoTrackResponse { #[prost(message, required, tag="1")] pub track: OwnedTrack, } /// Create a new AudioTrack from a AudioSource +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateAudioTrackRequest { #[prost(string, required, tag="1")] @@ -1262,21 +1330,25 @@ pub struct CreateAudioTrackRequest { #[prost(uint64, required, tag="2")] pub source_handle: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateAudioTrackResponse { #[prost(message, required, tag="1")] pub track: OwnedTrack, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStatsRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStatsResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStatsCallback { #[prost(uint64, required, tag="1")] @@ -1290,9 +1362,11 @@ pub struct GetStatsCallback { // Track // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackEvent { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackPublicationInfo { #[prost(string, required, tag="1")] @@ -1318,6 +1392,7 @@ pub struct TrackPublicationInfo { #[prost(enumeration="EncryptionType", required, tag="11")] pub encryption_type: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedTrackPublication { #[prost(message, required, tag="1")] @@ -1325,6 +1400,7 @@ pub struct OwnedTrackPublication { #[prost(message, required, tag="2")] pub info: TrackPublicationInfo, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackInfo { #[prost(string, required, tag="1")] @@ -1340,6 +1416,7 @@ pub struct TrackInfo { #[prost(bool, required, tag="6")] pub remote: bool, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedTrack { #[prost(message, required, tag="1")] @@ -1348,27 +1425,31 @@ pub struct OwnedTrack { pub info: TrackInfo, } /// Mute/UnMute a track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalTrackMuteRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, #[prost(bool, required, tag="2")] pub mute: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalTrackMuteResponse { #[prost(bool, required, tag="1")] pub muted: bool, } /// Enable/Disable a remote track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, #[prost(bool, required, tag="2")] pub enabled: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackResponse { #[prost(bool, required, tag="1")] pub enabled: bool, @@ -1387,9 +1468,9 @@ impl TrackKind { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::KindUnknown => "KIND_UNKNOWN", - Self::KindAudio => "KIND_AUDIO", - Self::KindVideo => "KIND_VIDEO", + TrackKind::KindUnknown => "KIND_UNKNOWN", + TrackKind::KindAudio => "KIND_AUDIO", + TrackKind::KindVideo => "KIND_VIDEO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1418,11 +1499,11 @@ impl TrackSource { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::SourceUnknown => "SOURCE_UNKNOWN", - Self::SourceCamera => "SOURCE_CAMERA", - Self::SourceMicrophone => "SOURCE_MICROPHONE", - Self::SourceScreenshare => "SOURCE_SCREENSHARE", - Self::SourceScreenshareAudio => "SOURCE_SCREENSHARE_AUDIO", + TrackSource::SourceUnknown => "SOURCE_UNKNOWN", + TrackSource::SourceCamera => "SOURCE_CAMERA", + TrackSource::SourceMicrophone => "SOURCE_MICROPHONE", + TrackSource::SourceScreenshare => "SOURCE_SCREENSHARE", + TrackSource::SourceScreenshareAudio => "SOURCE_SCREENSHARE_AUDIO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1451,9 +1532,9 @@ impl StreamState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::StateUnknown => "STATE_UNKNOWN", - Self::StateActive => "STATE_ACTIVE", - Self::StatePaused => "STATE_PAUSED", + StreamState::StateUnknown => "STATE_UNKNOWN", + StreamState::StateActive => "STATE_ACTIVE", + StreamState::StatePaused => "STATE_PAUSED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1467,18 +1548,21 @@ impl StreamState { } } /// Enable/Disable a remote track publication -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackPublicationRequest { #[prost(uint64, required, tag="1")] pub track_publication_handle: u64, #[prost(bool, required, tag="2")] pub enabled: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackPublicationResponse { } /// update a remote track publication dimension -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateRemoteTrackPublicationDimensionRequest { #[prost(uint64, required, tag="1")] pub track_publication_handle: u64, @@ -1487,9 +1571,11 @@ pub struct UpdateRemoteTrackPublicationDimensionRequest { #[prost(uint32, required, tag="3")] pub height: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateRemoteTrackPublicationDimensionResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantInfo { #[prost(string, required, tag="1")] @@ -1504,7 +1590,10 @@ pub struct ParticipantInfo { pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, #[prost(enumeration="ParticipantKind", required, tag="6")] pub kind: i32, + #[prost(enumeration="DisconnectReason", required, tag="7")] + pub disconnect_reason: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedParticipant { #[prost(message, required, tag="1")] @@ -1528,11 +1617,11 @@ impl ParticipantKind { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Standard => "PARTICIPANT_KIND_STANDARD", - Self::Ingress => "PARTICIPANT_KIND_INGRESS", - Self::Egress => "PARTICIPANT_KIND_EGRESS", - Self::Sip => "PARTICIPANT_KIND_SIP", - Self::Agent => "PARTICIPANT_KIND_AGENT", + ParticipantKind::Standard => "PARTICIPANT_KIND_STANDARD", + ParticipantKind::Ingress => "PARTICIPANT_KIND_INGRESS", + ParticipantKind::Egress => "PARTICIPANT_KIND_EGRESS", + ParticipantKind::Sip => "PARTICIPANT_KIND_SIP", + ParticipantKind::Agent => "PARTICIPANT_KIND_AGENT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1547,9 +1636,85 @@ impl ParticipantKind { } } } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DisconnectReason { + UnknownReason = 0, + /// the client initiated the disconnect + ClientInitiated = 1, + /// another participant with the same identity has joined the room + DuplicateIdentity = 2, + /// the server instance is shutting down + ServerShutdown = 3, + /// RoomService.RemoveParticipant was called + ParticipantRemoved = 4, + /// RoomService.DeleteRoom was called + RoomDeleted = 5, + /// the client is attempting to resume a session, but server is not aware of it + StateMismatch = 6, + /// client was unable to connect fully + JoinFailure = 7, + /// Cloud-only, the server requested Participant to migrate the connection elsewhere + Migration = 8, + /// the signal websocket was closed unexpectedly + SignalClose = 9, + /// the room was closed, due to all Standard and Ingress participants having left + RoomClosed = 10, + /// SIP callee did not respond in time + UserUnavailable = 11, + /// SIP callee rejected the call (busy) + UserRejected = 12, + /// SIP protocol failure or unexpected response + SipTrunkFailure = 13, +} +impl DisconnectReason { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DisconnectReason::UnknownReason => "UNKNOWN_REASON", + DisconnectReason::ClientInitiated => "CLIENT_INITIATED", + DisconnectReason::DuplicateIdentity => "DUPLICATE_IDENTITY", + DisconnectReason::ServerShutdown => "SERVER_SHUTDOWN", + DisconnectReason::ParticipantRemoved => "PARTICIPANT_REMOVED", + DisconnectReason::RoomDeleted => "ROOM_DELETED", + DisconnectReason::StateMismatch => "STATE_MISMATCH", + DisconnectReason::JoinFailure => "JOIN_FAILURE", + DisconnectReason::Migration => "MIGRATION", + DisconnectReason::SignalClose => "SIGNAL_CLOSE", + DisconnectReason::RoomClosed => "ROOM_CLOSED", + DisconnectReason::UserUnavailable => "USER_UNAVAILABLE", + DisconnectReason::UserRejected => "USER_REJECTED", + DisconnectReason::SipTrunkFailure => "SIP_TRUNK_FAILURE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN_REASON" => Some(Self::UnknownReason), + "CLIENT_INITIATED" => Some(Self::ClientInitiated), + "DUPLICATE_IDENTITY" => Some(Self::DuplicateIdentity), + "SERVER_SHUTDOWN" => Some(Self::ServerShutdown), + "PARTICIPANT_REMOVED" => Some(Self::ParticipantRemoved), + "ROOM_DELETED" => Some(Self::RoomDeleted), + "STATE_MISMATCH" => Some(Self::StateMismatch), + "JOIN_FAILURE" => Some(Self::JoinFailure), + "MIGRATION" => Some(Self::Migration), + "SIGNAL_CLOSE" => Some(Self::SignalClose), + "ROOM_CLOSED" => Some(Self::RoomClosed), + "USER_UNAVAILABLE" => Some(Self::UserUnavailable), + "USER_REJECTED" => Some(Self::UserRejected), + "SIP_TRUNK_FAILURE" => Some(Self::SipTrunkFailure), + _ => None, + } + } +} /// Create a new VideoStream /// VideoStream is used to receive video frames from a track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewVideoStreamRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, @@ -1562,13 +1727,15 @@ pub struct NewVideoStreamRequest { #[prost(bool, optional, tag="4")] pub normalize_stride: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewVideoStreamResponse { #[prost(message, required, tag="1")] pub stream: OwnedVideoStream, } /// Request a video stream from a participant -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoStreamFromParticipantRequest { #[prost(uint64, required, tag="1")] pub participant_handle: u64, @@ -1581,14 +1748,16 @@ pub struct VideoStreamFromParticipantRequest { #[prost(bool, optional, tag="5")] pub normalize_stride: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoStreamFromParticipantResponse { #[prost(message, required, tag="1")] pub stream: OwnedVideoStream, } /// Create a new VideoSource /// VideoSource is used to send video frame to a track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewVideoSourceRequest { #[prost(enumeration="VideoSourceType", required, tag="1")] pub r#type: i32, @@ -1597,12 +1766,14 @@ pub struct NewVideoSourceRequest { #[prost(message, required, tag="2")] pub resolution: VideoSourceResolution, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewVideoSourceResponse { #[prost(message, required, tag="1")] pub source: OwnedVideoSource, } /// Push a frame to a VideoSource +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureVideoFrameRequest { #[prost(uint64, required, tag="1")] @@ -1615,9 +1786,11 @@ pub struct CaptureVideoFrameRequest { #[prost(enumeration="VideoRotation", required, tag="4")] pub rotation: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureVideoFrameResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoConvertRequest { #[prost(bool, optional, tag="1")] @@ -1627,6 +1800,7 @@ pub struct VideoConvertRequest { #[prost(enumeration="VideoBufferType", required, tag="3")] pub dst_type: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoConvertResponse { #[prost(oneof="video_convert_response::Message", tags="1, 2")] @@ -1634,7 +1808,8 @@ pub struct VideoConvertResponse { } /// Nested message and enum types in `VideoConvertResponse`. pub mod video_convert_response { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="1")] Error(::prost::alloc::string::String), @@ -1646,7 +1821,8 @@ pub mod video_convert_response { // VideoFrame buffers // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoResolution { #[prost(uint32, required, tag="1")] pub width: u32, @@ -1655,6 +1831,7 @@ pub struct VideoResolution { #[prost(double, required, tag="3")] pub frame_rate: f64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoBufferInfo { #[prost(enumeration="VideoBufferType", required, tag="1")] @@ -1673,7 +1850,8 @@ pub struct VideoBufferInfo { } /// Nested message and enum types in `VideoBufferInfo`. pub mod video_buffer_info { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ComponentInfo { #[prost(uint64, required, tag="1")] pub data_ptr: u64, @@ -1683,6 +1861,7 @@ pub mod video_buffer_info { pub size: u32, } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedVideoBuffer { #[prost(message, required, tag="1")] @@ -1690,18 +1869,21 @@ pub struct OwnedVideoBuffer { #[prost(message, required, tag="2")] pub info: VideoBufferInfo, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoStreamInfo { #[prost(enumeration="VideoStreamType", required, tag="1")] pub r#type: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedVideoStream { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub info: VideoStreamInfo, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoStreamEvent { #[prost(uint64, required, tag="1")] @@ -1711,7 +1893,8 @@ pub struct VideoStreamEvent { } /// Nested message and enum types in `VideoStreamEvent`. pub mod video_stream_event { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] FrameReceived(super::VideoFrameReceived), @@ -1719,6 +1902,7 @@ pub mod video_stream_event { Eos(super::VideoStreamEos), } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoFrameReceived { #[prost(message, required, tag="1")] @@ -1729,26 +1913,30 @@ pub struct VideoFrameReceived { #[prost(enumeration="VideoRotation", required, tag="3")] pub rotation: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoStreamEos { } // // VideoSource // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoSourceResolution { #[prost(uint32, required, tag="1")] pub width: u32, #[prost(uint32, required, tag="2")] pub height: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoSourceInfo { #[prost(enumeration="VideoSourceType", required, tag="1")] pub r#type: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedVideoSource { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -1770,10 +1958,10 @@ impl VideoCodec { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Vp8 => "VP8", - Self::H264 => "H264", - Self::Av1 => "AV1", - Self::Vp9 => "VP9", + VideoCodec::Vp8 => "VP8", + VideoCodec::H264 => "H264", + VideoCodec::Av1 => "AV1", + VideoCodec::Vp9 => "VP9", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1802,10 +1990,10 @@ impl VideoRotation { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::VideoRotation0 => "VIDEO_ROTATION_0", - Self::VideoRotation90 => "VIDEO_ROTATION_90", - Self::VideoRotation180 => "VIDEO_ROTATION_180", - Self::VideoRotation270 => "VIDEO_ROTATION_270", + VideoRotation::VideoRotation0 => "VIDEO_ROTATION_0", + VideoRotation::VideoRotation90 => "VIDEO_ROTATION_90", + VideoRotation::VideoRotation180 => "VIDEO_ROTATION_180", + VideoRotation::VideoRotation270 => "VIDEO_ROTATION_270", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1841,17 +2029,17 @@ impl VideoBufferType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Rgba => "RGBA", - Self::Abgr => "ABGR", - Self::Argb => "ARGB", - Self::Bgra => "BGRA", - Self::Rgb24 => "RGB24", - Self::I420 => "I420", - Self::I420a => "I420A", - Self::I422 => "I422", - Self::I444 => "I444", - Self::I010 => "I010", - Self::Nv12 => "NV12", + VideoBufferType::Rgba => "RGBA", + VideoBufferType::Abgr => "ABGR", + VideoBufferType::Argb => "ARGB", + VideoBufferType::Bgra => "BGRA", + VideoBufferType::Rgb24 => "RGB24", + VideoBufferType::I420 => "I420", + VideoBufferType::I420a => "I420A", + VideoBufferType::I422 => "I422", + VideoBufferType::I444 => "I444", + VideoBufferType::I010 => "I010", + VideoBufferType::Nv12 => "NV12", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1890,9 +2078,9 @@ impl VideoStreamType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::VideoStreamNative => "VIDEO_STREAM_NATIVE", - Self::VideoStreamWebgl => "VIDEO_STREAM_WEBGL", - Self::VideoStreamHtml => "VIDEO_STREAM_HTML", + VideoStreamType::VideoStreamNative => "VIDEO_STREAM_NATIVE", + VideoStreamType::VideoStreamWebgl => "VIDEO_STREAM_WEBGL", + VideoStreamType::VideoStreamHtml => "VIDEO_STREAM_HTML", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1917,7 +2105,7 @@ impl VideoSourceType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::VideoSourceNative => "VIDEO_SOURCE_NATIVE", + VideoSourceType::VideoSourceNative => "VIDEO_SOURCE_NATIVE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1929,6 +2117,7 @@ impl VideoSourceType { } } /// Connect to a new LiveKit room +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectRequest { #[prost(string, required, tag="1")] @@ -1938,11 +2127,13 @@ pub struct ConnectRequest { #[prost(message, required, tag="3")] pub options: RoomOptions, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectCallback { #[prost(uint64, required, tag="1")] @@ -1952,7 +2143,8 @@ pub struct ConnectCallback { } /// Nested message and enum types in `ConnectCallback`. pub mod connect_callback { - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantWithTracks { #[prost(message, required, tag="1")] pub participant: super::OwnedParticipant, @@ -1961,7 +2153,8 @@ pub mod connect_callback { #[prost(message, repeated, tag="2")] pub publications: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, required, tag="1")] pub room: super::OwnedRoom, @@ -1970,7 +2163,8 @@ pub mod connect_callback { #[prost(message, repeated, tag="3")] pub participants: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -1979,22 +2173,26 @@ pub mod connect_callback { } } /// Disconnect from the a room -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisconnectRequest { #[prost(uint64, required, tag="1")] pub room_handle: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisconnectResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisconnectCallback { #[prost(uint64, required, tag="1")] pub async_id: u64, } /// Publish a track to the room +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTrackRequest { #[prost(uint64, required, tag="1")] @@ -2004,11 +2202,13 @@ pub struct PublishTrackRequest { #[prost(message, required, tag="3")] pub options: TrackPublishOptions, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTrackResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTrackCallback { #[prost(uint64, required, tag="1")] @@ -2018,7 +2218,8 @@ pub struct PublishTrackCallback { } /// Nested message and enum types in `PublishTrackCallback`. pub mod publish_track_callback { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2027,6 +2228,7 @@ pub mod publish_track_callback { } } /// Unpublish a track from the room +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnpublishTrackRequest { #[prost(uint64, required, tag="1")] @@ -2036,11 +2238,13 @@ pub struct UnpublishTrackRequest { #[prost(bool, required, tag="3")] pub stop_on_unpublish: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct UnpublishTrackResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnpublishTrackCallback { #[prost(uint64, required, tag="1")] @@ -2049,6 +2253,7 @@ pub struct UnpublishTrackCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Publish data to other participants +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishDataRequest { #[prost(uint64, required, tag="1")] @@ -2067,11 +2272,13 @@ pub struct PublishDataRequest { #[prost(string, repeated, tag="7")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishDataResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishDataCallback { #[prost(uint64, required, tag="1")] @@ -2080,6 +2287,7 @@ pub struct PublishDataCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Publish transcription messages to room +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTranscriptionRequest { #[prost(uint64, required, tag="1")] @@ -2091,11 +2299,13 @@ pub struct PublishTranscriptionRequest { #[prost(message, repeated, tag="4")] pub segments: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTranscriptionResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishTranscriptionCallback { #[prost(uint64, required, tag="1")] @@ -2104,6 +2314,7 @@ pub struct PublishTranscriptionCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Publish Sip DTMF messages to other participants +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishSipDtmfRequest { #[prost(uint64, required, tag="1")] @@ -2115,11 +2326,13 @@ pub struct PublishSipDtmfRequest { #[prost(string, repeated, tag="4")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishSipDtmfResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PublishSipDtmfCallback { #[prost(uint64, required, tag="1")] @@ -2128,6 +2341,7 @@ pub struct PublishSipDtmfCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Change the local participant's metadata +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalMetadataRequest { #[prost(uint64, required, tag="1")] @@ -2135,11 +2349,13 @@ pub struct SetLocalMetadataRequest { #[prost(string, required, tag="2")] pub metadata: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalMetadataResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalMetadataCallback { #[prost(uint64, required, tag="1")] @@ -2147,6 +2363,7 @@ pub struct SetLocalMetadataCallback { #[prost(string, optional, tag="2")] pub error: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendChatMessageRequest { #[prost(uint64, required, tag="1")] @@ -2158,6 +2375,7 @@ pub struct SendChatMessageRequest { #[prost(string, optional, tag="4")] pub sender_identity: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EditChatMessageRequest { #[prost(uint64, required, tag="1")] @@ -2171,11 +2389,13 @@ pub struct EditChatMessageRequest { #[prost(string, optional, tag="5")] pub sender_identity: ::core::option::Option<::prost::alloc::string::String>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SendChatMessageResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendChatMessageCallback { #[prost(uint64, required, tag="1")] @@ -2185,7 +2405,8 @@ pub struct SendChatMessageCallback { } /// Nested message and enum types in `SendChatMessageCallback`. pub mod send_chat_message_callback { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2194,6 +2415,7 @@ pub mod send_chat_message_callback { } } /// Change the local participant's attributes +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalAttributesRequest { #[prost(uint64, required, tag="1")] @@ -2201,6 +2423,7 @@ pub struct SetLocalAttributesRequest { #[prost(message, repeated, tag="2")] pub attributes: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AttributesEntry { #[prost(string, required, tag="1")] @@ -2208,11 +2431,13 @@ pub struct AttributesEntry { #[prost(string, required, tag="2")] pub value: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalAttributesResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalAttributesCallback { #[prost(uint64, required, tag="1")] @@ -2221,6 +2446,7 @@ pub struct SetLocalAttributesCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Change the local participant's name +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalNameRequest { #[prost(uint64, required, tag="1")] @@ -2228,11 +2454,13 @@ pub struct SetLocalNameRequest { #[prost(string, required, tag="2")] pub name: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalNameResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SetLocalNameCallback { #[prost(uint64, required, tag="1")] @@ -2241,26 +2469,31 @@ pub struct SetLocalNameCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Change the "desire" to subs2ribe to a track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetSubscribedRequest { #[prost(bool, required, tag="1")] pub subscribe: bool, #[prost(uint64, required, tag="2")] pub publication_handle: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SetSubscribedResponse { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSessionStatsRequest { #[prost(uint64, required, tag="1")] pub room_handle: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSessionStatsResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSessionStatsCallback { #[prost(uint64, required, tag="1")] @@ -2270,14 +2503,16 @@ pub struct GetSessionStatsCallback { } /// Nested message and enum types in `GetSessionStatsCallback`. pub mod get_session_stats_callback { - #[derive(Clone, PartialEq, ::prost::Message)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, repeated, tag="1")] pub publisher_stats: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="2")] pub subscriber_stats: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2289,18 +2524,21 @@ pub mod get_session_stats_callback { // Options // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct VideoEncoding { #[prost(uint64, required, tag="1")] pub max_bitrate: u64, #[prost(double, required, tag="2")] pub max_framerate: f64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioEncoding { #[prost(uint64, required, tag="1")] pub max_bitrate: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackPublishOptions { /// encodings are optional @@ -2321,6 +2559,7 @@ pub struct TrackPublishOptions { #[prost(string, optional, tag="8")] pub stream: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IceServer { #[prost(string, repeated, tag="1")] @@ -2330,6 +2569,7 @@ pub struct IceServer { #[prost(string, optional, tag="3")] pub password: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RtcConfig { #[prost(enumeration="IceTransportType", optional, tag="1")] @@ -2340,6 +2580,7 @@ pub struct RtcConfig { #[prost(message, repeated, tag="3")] pub ice_servers: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomOptions { #[prost(bool, optional, tag="1")] @@ -2356,6 +2597,7 @@ pub struct RoomOptions { #[prost(uint32, optional, tag="6")] pub join_retries: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TranscriptionSegment { #[prost(string, required, tag="1")] @@ -2371,20 +2613,23 @@ pub struct TranscriptionSegment { #[prost(string, required, tag="6")] pub language: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct BufferInfo { #[prost(uint64, required, tag="1")] pub data_ptr: u64, #[prost(uint64, required, tag="2")] pub data_len: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedBuffer { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub data: BufferInfo, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomEvent { #[prost(uint64, required, tag="1")] @@ -2394,7 +2639,8 @@ pub struct RoomEvent { } /// Nested message and enum types in `RoomEvent`. pub mod room_event { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] ParticipantConnected(super::ParticipantConnected), @@ -2456,6 +2702,7 @@ pub mod room_event { ChatMessage(super::ChatMessageReceived), } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomInfo { #[prost(string, optional, tag="1")] @@ -2465,6 +2712,7 @@ pub struct RoomInfo { #[prost(string, required, tag="3")] pub metadata: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedRoom { #[prost(message, required, tag="1")] @@ -2472,16 +2720,19 @@ pub struct OwnedRoom { #[prost(message, required, tag="2")] pub info: RoomInfo, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantConnected { #[prost(message, required, tag="1")] pub info: OwnedParticipant, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantDisconnected { #[prost(string, required, tag="1")] pub participant_identity: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalTrackPublished { /// The TrackPublicationInfo comes from the PublishTrack response @@ -2489,16 +2740,19 @@ pub struct LocalTrackPublished { #[prost(string, required, tag="1")] pub track_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalTrackUnpublished { #[prost(string, required, tag="1")] pub publication_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalTrackSubscribed { #[prost(string, required, tag="2")] pub track_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackPublished { #[prost(string, required, tag="1")] @@ -2506,6 +2760,7 @@ pub struct TrackPublished { #[prost(message, required, tag="2")] pub publication: OwnedTrackPublication, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackUnpublished { #[prost(string, required, tag="1")] @@ -2515,6 +2770,7 @@ pub struct TrackUnpublished { } /// Publication isn't needed for subscription events on the FFI /// The FFI will retrieve the publication using the Track sid +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackSubscribed { #[prost(string, required, tag="1")] @@ -2522,6 +2778,7 @@ pub struct TrackSubscribed { #[prost(message, required, tag="2")] pub track: OwnedTrack, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackUnsubscribed { /// The FFI language can dispose/remove the VideoSink here @@ -2530,6 +2787,7 @@ pub struct TrackUnsubscribed { #[prost(string, required, tag="2")] pub track_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackSubscriptionFailed { #[prost(string, required, tag="1")] @@ -2539,6 +2797,7 @@ pub struct TrackSubscriptionFailed { #[prost(string, required, tag="3")] pub error: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackMuted { #[prost(string, required, tag="1")] @@ -2546,6 +2805,7 @@ pub struct TrackMuted { #[prost(string, required, tag="2")] pub track_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrackUnmuted { #[prost(string, required, tag="1")] @@ -2553,6 +2813,7 @@ pub struct TrackUnmuted { #[prost(string, required, tag="2")] pub track_sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct E2eeStateChanged { /// Using sid instead of identity for ffi communication @@ -2561,21 +2822,25 @@ pub struct E2eeStateChanged { #[prost(enumeration="EncryptionState", required, tag="2")] pub state: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ActiveSpeakersChanged { #[prost(string, repeated, tag="1")] pub participant_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomMetadataChanged { #[prost(string, required, tag="1")] pub metadata: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomSidChanged { #[prost(string, required, tag="1")] pub sid: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantMetadataChanged { #[prost(string, required, tag="1")] @@ -2583,6 +2848,7 @@ pub struct ParticipantMetadataChanged { #[prost(string, required, tag="2")] pub metadata: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantAttributesChanged { #[prost(string, required, tag="1")] @@ -2592,6 +2858,7 @@ pub struct ParticipantAttributesChanged { #[prost(message, repeated, tag="3")] pub changed_attributes: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantNameChanged { #[prost(string, required, tag="1")] @@ -2599,6 +2866,7 @@ pub struct ParticipantNameChanged { #[prost(string, required, tag="2")] pub name: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionQualityChanged { #[prost(string, required, tag="1")] @@ -2606,6 +2874,7 @@ pub struct ConnectionQualityChanged { #[prost(enumeration="ConnectionQuality", required, tag="2")] pub quality: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UserPacket { #[prost(message, required, tag="1")] @@ -2613,6 +2882,7 @@ pub struct UserPacket { #[prost(string, optional, tag="2")] pub topic: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChatMessage { #[prost(string, required, tag="1")] @@ -2628,6 +2898,7 @@ pub struct ChatMessage { #[prost(bool, optional, tag="6")] pub generated: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChatMessageReceived { #[prost(message, required, tag="1")] @@ -2635,6 +2906,7 @@ pub struct ChatMessageReceived { #[prost(string, required, tag="2")] pub participant_identity: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SipDtmf { #[prost(uint32, required, tag="1")] @@ -2642,6 +2914,7 @@ pub struct SipDtmf { #[prost(string, optional, tag="2")] pub digit: ::core::option::Option<::prost::alloc::string::String>, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataPacketReceived { #[prost(enumeration="DataPacketKind", required, tag="1")] @@ -2654,7 +2927,8 @@ pub struct DataPacketReceived { } /// Nested message and enum types in `DataPacketReceived`. pub mod data_packet_received { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(message, tag="4")] User(super::UserPacket), @@ -2662,6 +2936,7 @@ pub mod data_packet_received { SipDtmf(super::SipDtmf), } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TranscriptionReceived { #[prost(string, optional, tag="1")] @@ -2671,26 +2946,32 @@ pub struct TranscriptionReceived { #[prost(message, repeated, tag="3")] pub segments: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionStateChanged { #[prost(enumeration="ConnectionState", required, tag="1")] pub state: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Connected { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Disconnected { #[prost(enumeration="DisconnectReason", required, tag="1")] pub reason: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Reconnecting { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Reconnected { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomEos { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -2707,9 +2988,9 @@ impl IceTransportType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::TransportRelay => "TRANSPORT_RELAY", - Self::TransportNohost => "TRANSPORT_NOHOST", - Self::TransportAll => "TRANSPORT_ALL", + IceTransportType::TransportRelay => "TRANSPORT_RELAY", + IceTransportType::TransportNohost => "TRANSPORT_NOHOST", + IceTransportType::TransportAll => "TRANSPORT_ALL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2735,8 +3016,8 @@ impl ContinualGatheringPolicy { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::GatherOnce => "GATHER_ONCE", - Self::GatherContinually => "GATHER_CONTINUALLY", + ContinualGatheringPolicy::GatherOnce => "GATHER_ONCE", + ContinualGatheringPolicy::GatherContinually => "GATHER_CONTINUALLY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2767,10 +3048,10 @@ impl ConnectionQuality { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::QualityPoor => "QUALITY_POOR", - Self::QualityGood => "QUALITY_GOOD", - Self::QualityExcellent => "QUALITY_EXCELLENT", - Self::QualityLost => "QUALITY_LOST", + ConnectionQuality::QualityPoor => "QUALITY_POOR", + ConnectionQuality::QualityGood => "QUALITY_GOOD", + ConnectionQuality::QualityExcellent => "QUALITY_EXCELLENT", + ConnectionQuality::QualityLost => "QUALITY_LOST", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2798,9 +3079,9 @@ impl ConnectionState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::ConnDisconnected => "CONN_DISCONNECTED", - Self::ConnConnected => "CONN_CONNECTED", - Self::ConnReconnecting => "CONN_RECONNECTING", + ConnectionState::ConnDisconnected => "CONN_DISCONNECTED", + ConnectionState::ConnConnected => "CONN_CONNECTED", + ConnectionState::ConnReconnecting => "CONN_RECONNECTING", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2826,8 +3107,8 @@ impl DataPacketKind { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::KindLossy => "KIND_LOSSY", - Self::KindReliable => "KIND_RELIABLE", + DataPacketKind::KindLossy => "KIND_LOSSY", + DataPacketKind::KindReliable => "KIND_RELIABLE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2839,72 +3120,10 @@ impl DataPacketKind { } } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum DisconnectReason { - UnknownReason = 0, - /// the client initiated the disconnect - ClientInitiated = 1, - /// another participant with the same identity has joined the room - DuplicateIdentity = 2, - /// the server instance is shutting down - ServerShutdown = 3, - /// RoomService.RemoveParticipant was called - ParticipantRemoved = 4, - /// RoomService.DeleteRoom was called - RoomDeleted = 5, - /// the client is attempting to resume a session, but server is not aware of it - StateMismatch = 6, - /// client was unable to connect fully - JoinFailure = 7, - /// Cloud-only, the server requested Participant to migrate the connection elsewhere - Migration = 8, - /// the signal websocket was closed unexpectedly - SignalClose = 9, - /// the room was closed, due to all Standard and Ingress participants having left - RoomClosed = 10, -} -impl DisconnectReason { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::UnknownReason => "UNKNOWN_REASON", - Self::ClientInitiated => "CLIENT_INITIATED", - Self::DuplicateIdentity => "DUPLICATE_IDENTITY", - Self::ServerShutdown => "SERVER_SHUTDOWN", - Self::ParticipantRemoved => "PARTICIPANT_REMOVED", - Self::RoomDeleted => "ROOM_DELETED", - Self::StateMismatch => "STATE_MISMATCH", - Self::JoinFailure => "JOIN_FAILURE", - Self::Migration => "MIGRATION", - Self::SignalClose => "SIGNAL_CLOSE", - Self::RoomClosed => "ROOM_CLOSED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN_REASON" => Some(Self::UnknownReason), - "CLIENT_INITIATED" => Some(Self::ClientInitiated), - "DUPLICATE_IDENTITY" => Some(Self::DuplicateIdentity), - "SERVER_SHUTDOWN" => Some(Self::ServerShutdown), - "PARTICIPANT_REMOVED" => Some(Self::ParticipantRemoved), - "ROOM_DELETED" => Some(Self::RoomDeleted), - "STATE_MISMATCH" => Some(Self::StateMismatch), - "JOIN_FAILURE" => Some(Self::JoinFailure), - "MIGRATION" => Some(Self::Migration), - "SIGNAL_CLOSE" => Some(Self::SignalClose), - "ROOM_CLOSED" => Some(Self::RoomClosed), - _ => None, - } - } -} /// Create a new AudioStream /// AudioStream is used to receive audio frames from a track -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioStreamRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, @@ -2915,12 +3134,14 @@ pub struct NewAudioStreamRequest { #[prost(uint32, optional, tag="4")] pub num_channels: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioStreamResponse { #[prost(message, required, tag="1")] pub stream: OwnedAudioStream, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioStreamFromParticipantRequest { #[prost(uint64, required, tag="1")] pub participant_handle: u64, @@ -2933,13 +3154,15 @@ pub struct AudioStreamFromParticipantRequest { #[prost(uint32, optional, tag="6")] pub num_channels: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioStreamFromParticipantResponse { #[prost(message, required, tag="1")] pub stream: OwnedAudioStream, } /// Create a new AudioSource -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioSourceRequest { #[prost(enumeration="AudioSourceType", required, tag="1")] pub r#type: i32, @@ -2952,25 +3175,29 @@ pub struct NewAudioSourceRequest { #[prost(uint32, optional, tag="5")] pub queue_size_ms: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioSourceResponse { #[prost(message, required, tag="1")] pub source: OwnedAudioSource, } /// Push a frame to an AudioSource /// The data provided must be available as long as the client receive the callback. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureAudioFrameRequest { #[prost(uint64, required, tag="1")] pub source_handle: u64, #[prost(message, required, tag="2")] pub buffer: AudioFrameBufferInfo, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureAudioFrameResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CaptureAudioFrameCallback { #[prost(uint64, required, tag="1")] @@ -2978,25 +3205,30 @@ pub struct CaptureAudioFrameCallback { #[prost(string, optional, tag="2")] pub error: ::core::option::Option<::prost::alloc::string::String>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ClearAudioBufferRequest { #[prost(uint64, required, tag="1")] pub source_handle: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ClearAudioBufferResponse { } /// Create a new AudioResampler -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioResamplerRequest { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewAudioResamplerResponse { #[prost(message, required, tag="1")] pub resampler: OwnedAudioResampler, } /// Remix and resample an audio frame -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RemixAndResampleRequest { #[prost(uint64, required, tag="1")] pub resampler_handle: u64, @@ -3007,14 +3239,16 @@ pub struct RemixAndResampleRequest { #[prost(uint32, required, tag="4")] pub sample_rate: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RemixAndResampleResponse { #[prost(message, required, tag="1")] pub buffer: OwnedAudioFrameBuffer, } // New resampler using SoX (much better quality) -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NewSoxResamplerRequest { #[prost(double, required, tag="1")] pub input_rate: f64, @@ -3031,6 +3265,7 @@ pub struct NewSoxResamplerRequest { #[prost(uint32, optional, tag="7")] pub flags: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NewSoxResamplerResponse { #[prost(oneof="new_sox_resampler_response::Message", tags="1, 2")] @@ -3038,7 +3273,8 @@ pub struct NewSoxResamplerResponse { } /// Nested message and enum types in `NewSoxResamplerResponse`. pub mod new_sox_resampler_response { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] Resampler(super::OwnedSoxResampler), @@ -3046,7 +3282,8 @@ pub mod new_sox_resampler_response { Error(::prost::alloc::string::String), } } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PushSoxResamplerRequest { #[prost(uint64, required, tag="1")] pub resampler_handle: u64, @@ -3057,6 +3294,7 @@ pub struct PushSoxResamplerRequest { #[prost(uint32, required, tag="3")] pub size: u32, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PushSoxResamplerResponse { /// *const i16 (could be null) @@ -3068,11 +3306,13 @@ pub struct PushSoxResamplerResponse { #[prost(string, optional, tag="3")] pub error: ::core::option::Option<::prost::alloc::string::String>, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FlushSoxResamplerRequest { #[prost(uint64, required, tag="1")] pub resampler_handle: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlushSoxResamplerResponse { /// *const i16 (could be null) @@ -3088,7 +3328,8 @@ pub struct FlushSoxResamplerResponse { // AudioFrame buffer // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioFrameBufferInfo { /// *const i16 #[prost(uint64, required, tag="1")] @@ -3100,26 +3341,30 @@ pub struct AudioFrameBufferInfo { #[prost(uint32, required, tag="4")] pub samples_per_channel: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedAudioFrameBuffer { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub info: AudioFrameBufferInfo, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioStreamInfo { #[prost(enumeration="AudioStreamType", required, tag="1")] pub r#type: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedAudioStream { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub info: AudioStreamInfo, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioStreamEvent { #[prost(uint64, required, tag="1")] pub stream_handle: u64, @@ -3128,7 +3373,8 @@ pub struct AudioStreamEvent { } /// Nested message and enum types in `AudioStreamEvent`. pub mod audio_stream_event { - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] FrameReceived(super::AudioFrameReceived), @@ -3136,19 +3382,22 @@ pub mod audio_stream_event { Eos(super::AudioStreamEos), } } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioFrameReceived { #[prost(message, required, tag="1")] pub frame: OwnedAudioFrameBuffer, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioStreamEos { } // // AudioSource // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioSourceOptions { #[prost(bool, required, tag="1")] pub echo_cancellation: bool, @@ -3157,12 +3406,14 @@ pub struct AudioSourceOptions { #[prost(bool, required, tag="3")] pub auto_gain_control: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioSourceInfo { #[prost(enumeration="AudioSourceType", required, tag="2")] pub r#type: i32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedAudioSource { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3173,10 +3424,12 @@ pub struct OwnedAudioSource { // AudioResampler // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AudioResamplerInfo { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedAudioResampler { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3187,10 +3440,12 @@ pub struct OwnedAudioResampler { // Sox AudioResampler // -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SoxResamplerInfo { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedSoxResampler { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3211,8 +3466,8 @@ impl SoxResamplerDataType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::SoxrDatatypeInt16i => "SOXR_DATATYPE_INT16I", - Self::SoxrDatatypeInt16s => "SOXR_DATATYPE_INT16S", + SoxResamplerDataType::SoxrDatatypeInt16i => "SOXR_DATATYPE_INT16I", + SoxResamplerDataType::SoxrDatatypeInt16s => "SOXR_DATATYPE_INT16S", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3240,11 +3495,11 @@ impl SoxQualityRecipe { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::SoxrQualityQuick => "SOXR_QUALITY_QUICK", - Self::SoxrQualityLow => "SOXR_QUALITY_LOW", - Self::SoxrQualityMedium => "SOXR_QUALITY_MEDIUM", - Self::SoxrQualityHigh => "SOXR_QUALITY_HIGH", - Self::SoxrQualityVeryhigh => "SOXR_QUALITY_VERYHIGH", + SoxQualityRecipe::SoxrQualityQuick => "SOXR_QUALITY_QUICK", + SoxQualityRecipe::SoxrQualityLow => "SOXR_QUALITY_LOW", + SoxQualityRecipe::SoxrQualityMedium => "SOXR_QUALITY_MEDIUM", + SoxQualityRecipe::SoxrQualityHigh => "SOXR_QUALITY_HIGH", + SoxQualityRecipe::SoxrQualityVeryhigh => "SOXR_QUALITY_VERYHIGH", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3282,12 +3537,12 @@ impl SoxFlagBits { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::SoxrRolloffSmall => "SOXR_ROLLOFF_SMALL", - Self::SoxrRolloffMedium => "SOXR_ROLLOFF_MEDIUM", - Self::SoxrRolloffNone => "SOXR_ROLLOFF_NONE", - Self::SoxrHighPrecClock => "SOXR_HIGH_PREC_CLOCK", - Self::SoxrDoublePrecision => "SOXR_DOUBLE_PRECISION", - Self::SoxrVr => "SOXR_VR", + SoxFlagBits::SoxrRolloffSmall => "SOXR_ROLLOFF_SMALL", + SoxFlagBits::SoxrRolloffMedium => "SOXR_ROLLOFF_MEDIUM", + SoxFlagBits::SoxrRolloffNone => "SOXR_ROLLOFF_NONE", + SoxFlagBits::SoxrHighPrecClock => "SOXR_HIGH_PREC_CLOCK", + SoxFlagBits::SoxrDoublePrecision => "SOXR_DOUBLE_PRECISION", + SoxFlagBits::SoxrVr => "SOXR_VR", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3320,8 +3575,8 @@ impl AudioStreamType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::AudioStreamNative => "AUDIO_STREAM_NATIVE", - Self::AudioStreamHtml => "AUDIO_STREAM_HTML", + AudioStreamType::AudioStreamNative => "AUDIO_STREAM_NATIVE", + AudioStreamType::AudioStreamHtml => "AUDIO_STREAM_HTML", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3345,7 +3600,7 @@ impl AudioSourceType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::AudioSourceNative => "AUDIO_SOURCE_NATIVE", + AudioSourceType::AudioSourceNative => "AUDIO_SOURCE_NATIVE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3356,6 +3611,7 @@ impl AudioSourceType { } } } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcError { #[prost(uint32, required, tag="1")] @@ -3366,6 +3622,7 @@ pub struct RpcError { pub data: ::core::option::Option<::prost::alloc::string::String>, } /// FFI Requests +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerformRpcRequest { #[prost(uint64, required, tag="1")] @@ -3379,6 +3636,7 @@ pub struct PerformRpcRequest { #[prost(uint32, optional, tag="5")] pub response_timeout_ms: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisterRpcMethodRequest { #[prost(uint64, required, tag="1")] @@ -3386,6 +3644,7 @@ pub struct RegisterRpcMethodRequest { #[prost(string, required, tag="2")] pub method: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnregisterRpcMethodRequest { #[prost(uint64, required, tag="1")] @@ -3393,6 +3652,7 @@ pub struct UnregisterRpcMethodRequest { #[prost(string, required, tag="2")] pub method: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcMethodInvocationResponseRequest { #[prost(uint64, required, tag="1")] @@ -3405,23 +3665,28 @@ pub struct RpcMethodInvocationResponseRequest { pub error: ::core::option::Option, } /// FFI Responses -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PerformRpcResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisterRpcMethodResponse { } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct UnregisterRpcMethodResponse { } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcMethodInvocationResponseResponse { #[prost(string, optional, tag="1")] pub error: ::core::option::Option<::prost::alloc::string::String>, } /// FFI Callbacks +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerformRpcCallback { #[prost(uint64, required, tag="1")] @@ -3432,6 +3697,7 @@ pub struct PerformRpcCallback { pub error: ::core::option::Option, } /// FFI Events +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcMethodInvocationEvent { #[prost(uint64, required, tag="1")] @@ -3477,6 +3743,7 @@ pub struct RpcMethodInvocationEvent { /// This is the input of livekit_ffi_request function /// We always expect a response (FFIResponse, even if it's empty) +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FfiRequest { #[prost(oneof="ffi_request::Message", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43")] @@ -3484,7 +3751,8 @@ pub struct FfiRequest { } /// Nested message and enum types in `FfiRequest`. pub mod ffi_request { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] Dispose(super::DisposeRequest), @@ -3579,6 +3847,7 @@ pub mod ffi_request { } } /// This is the output of livekit_ffi_request function. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FfiResponse { #[prost(oneof="ffi_response::Message", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42")] @@ -3586,7 +3855,8 @@ pub struct FfiResponse { } /// Nested message and enum types in `FfiResponse`. pub mod ffi_response { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] Dispose(super::DisposeResponse), @@ -3681,6 +3951,7 @@ pub mod ffi_response { /// To minimize complexity, participant events are not included in the protocol. /// It is easily deducible from the room events and it turned out that is is easier to implement /// on the ffi client side. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FfiEvent { #[prost(oneof="ffi_event::Message", tags="1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24")] @@ -3688,7 +3959,8 @@ pub struct FfiEvent { } /// Nested message and enum types in `FfiEvent`. pub mod ffi_event { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] RoomEvent(super::RoomEvent), @@ -3741,22 +4013,26 @@ pub mod ffi_event { /// Stop all rooms synchronously (Do we need async here?). /// e.g: This is used for the Unity Editor after each assemblies reload. /// TODO(theomonnom): Implement a debug mode where we can find all leaked handles? -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisposeRequest { #[prost(bool, required, tag="1")] pub r#async: bool, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisposeResponse { /// None if sync #[prost(uint64, optional, tag="1")] pub async_id: ::core::option::Option, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DisposeCallback { #[prost(uint64, required, tag="1")] pub async_id: u64, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogRecord { #[prost(enumeration="LogLevel", required, tag="1")] @@ -3773,11 +4049,13 @@ pub struct LogRecord { #[prost(string, required, tag="6")] pub message: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogBatch { #[prost(message, repeated, tag="1")] pub records: ::prost::alloc::vec::Vec, } +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Panic { #[prost(string, required, tag="1")] @@ -3799,11 +4077,11 @@ impl LogLevel { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::LogError => "LOG_ERROR", - Self::LogWarn => "LOG_WARN", - Self::LogInfo => "LOG_INFO", - Self::LogDebug => "LOG_DEBUG", - Self::LogTrace => "LOG_TRACE", + LogLevel::LogError => "LOG_ERROR", + LogLevel::LogWarn => "LOG_WARN", + LogLevel::LogInfo => "LOG_INFO", + LogLevel::LogDebug => "LOG_DEBUG", + LogLevel::LogTrace => "LOG_TRACE", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/livekit/src/prelude.rs b/livekit/src/prelude.rs index d86e328c..1c2eab0f 100644 --- a/livekit/src/prelude.rs +++ b/livekit/src/prelude.rs @@ -15,14 +15,14 @@ pub use crate::{ id::*, participant::{ - ConnectionQuality, LocalParticipant, Participant, PerformRpcData, RemoteParticipant, - RpcError, RpcErrorCode, RpcInvocationData, + ConnectionQuality, DisconnectReason, LocalParticipant, Participant, PerformRpcData, + RemoteParticipant, RpcError, RpcErrorCode, RpcInvocationData, }, publication::{LocalTrackPublication, RemoteTrackPublication, TrackPublication}, track::{ AudioTrack, LocalAudioTrack, LocalTrack, LocalVideoTrack, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, StreamState, Track, TrackDimension, TrackKind, TrackSource, VideoTrack, }, - ConnectionState, DataPacket, DataPacketKind, DisconnectReason, Room, RoomError, RoomEvent, - RoomOptions, RoomResult, RoomSdkOptions, SipDTMF, Transcription, TranscriptionSegment, + ConnectionState, DataPacket, DataPacketKind, Room, RoomError, RoomEvent, RoomOptions, + RoomResult, RoomSdkOptions, SipDTMF, Transcription, TranscriptionSegment, }; diff --git a/livekit/src/proto.rs b/livekit/src/proto.rs index b96ae2c5..b630feb1 100644 --- a/livekit/src/proto.rs +++ b/livekit/src/proto.rs @@ -30,6 +30,27 @@ impl From for participant::ConnectionQuality { } } +impl From for participant::DisconnectReason { + fn from(value: DisconnectReason) -> Self { + match value { + DisconnectReason::UnknownReason => Self::UnknownReason, + DisconnectReason::ClientInitiated => Self::ClientInitiated, + DisconnectReason::DuplicateIdentity => Self::DuplicateIdentity, + DisconnectReason::ServerShutdown => Self::ServerShutdown, + DisconnectReason::ParticipantRemoved => Self::ParticipantRemoved, + DisconnectReason::RoomDeleted => Self::RoomDeleted, + DisconnectReason::StateMismatch => Self::StateMismatch, + DisconnectReason::JoinFailure => Self::JoinFailure, + DisconnectReason::Migration => Self::Migration, + DisconnectReason::SignalClose => Self::SignalClose, + DisconnectReason::RoomClosed => Self::RoomClosed, + DisconnectReason::UserUnavailable => Self::UserUnavailable, + DisconnectReason::UserRejected => Self::UserRejected, + DisconnectReason::SipTrunkFailure => Self::SipTrunkFailure, + } + } +} + impl TryFrom for track::TrackKind { type Error = &'static str; diff --git a/livekit/src/room/mod.rs b/livekit/src/room/mod.rs index 7e38cbff..21e28877 100644 --- a/livekit/src/room/mod.rs +++ b/livekit/src/room/mod.rs @@ -783,6 +783,7 @@ impl RoomSession { let remote_participant = self.get_participant_by_sid(&participant_sid); if pi.state == proto::participant_info::State::Disconnected as i32 { if let Some(remote_participant) = remote_participant { + remote_participant.update_info(pi.clone()); self.clone().handle_participant_disconnect(remote_participant) } else { // Ignore, just received the ParticipantInfo but the participant is already diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index 037c3170..71ff4d77 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -637,6 +637,10 @@ impl LocalParticipant { self.inner.info.read().kind } + pub fn disconnect_reason(&self) -> DisconnectReason { + self.inner.info.read().disconnect_reason + } + pub async fn perform_rpc(&self, data: PerformRpcData) -> Result { let max_round_trip_latency = Duration::from_millis(2000); diff --git a/livekit/src/room/participant/mod.rs b/livekit/src/room/participant/mod.rs index f8f7a746..164c3edd 100644 --- a/livekit/src/room/participant/mod.rs +++ b/livekit/src/room/participant/mod.rs @@ -46,6 +46,24 @@ pub enum ParticipantKind { Agent, } +#[derive(Debug, Clone, Copy, Eq, PartialEq)] +pub enum DisconnectReason { + UnknownReason, + ClientInitiated, + DuplicateIdentity, + ServerShutdown, + ParticipantRemoved, + RoomDeleted, + StateMismatch, + JoinFailure, + Migration, + SignalClose, + RoomClosed, + UserUnavailable, + UserRejected, + SipTrunkFailure, +} + #[derive(Debug, Clone)] pub enum Participant { Local(LocalParticipant), @@ -64,6 +82,7 @@ impl Participant { pub fn audio_level(self: &Self) -> f32; pub fn connection_quality(self: &Self) -> ConnectionQuality; pub fn kind(self: &Self) -> ParticipantKind; + pub fn disconnect_reason(self: &Self) -> DisconnectReason; pub(crate) fn update_info(self: &Self, info: proto::ParticipantInfo) -> (); @@ -93,6 +112,7 @@ struct ParticipantInfo { pub audio_level: f32, pub connection_quality: ConnectionQuality, pub kind: ParticipantKind, + pub disconnect_reason: DisconnectReason, } type TrackMutedHandler = Box; @@ -138,6 +158,7 @@ pub(super) fn new_inner( speaking: false, audio_level: 0.0, connection_quality: ConnectionQuality::Excellent, + disconnect_reason: DisconnectReason::UnknownReason, }), track_publications: Default::default(), events: Default::default(), @@ -150,6 +171,7 @@ pub(super) fn update_info( new_info: proto::ParticipantInfo, ) { let mut info = inner.info.write(); + info.disconnect_reason = new_info.disconnect_reason().into(); info.kind = new_info.kind().into(); info.sid = new_info.sid.try_into().unwrap(); info.identity = new_info.identity.into(); diff --git a/livekit/src/room/participant/remote_participant.rs b/livekit/src/room/participant/remote_participant.rs index e9e61ea0..58a1659e 100644 --- a/livekit/src/room/participant/remote_participant.rs +++ b/livekit/src/room/participant/remote_participant.rs @@ -488,4 +488,8 @@ impl RemoteParticipant { pub fn kind(&self) -> ParticipantKind { self.inner.info.read().kind } + + pub fn disconnect_reason(&self) -> DisconnectReason { + self.inner.info.read().disconnect_reason + } }