From bc7368477abd3df67e19166a585f8e3ad822c35f Mon Sep 17 00:00:00 2001 From: kbalt Date: Thu, 31 Oct 2024 19:09:58 +0100 Subject: [PATCH 01/51] expose libwebrtc's ProhibitLibsrtpInitialization (#477) --- webrtc-sys/build.rs | 2 ++ .../livekit/prohibit_libsrtp_initialization.h | 21 +++++++++++++++++ webrtc-sys/src/lib.rs | 1 + .../src/prohibit_libsrtp_initialization.cpp | 23 +++++++++++++++++++ .../src/prohibit_libsrtp_initialization.rs | 22 ++++++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 webrtc-sys/include/livekit/prohibit_libsrtp_initialization.h create mode 100644 webrtc-sys/src/prohibit_libsrtp_initialization.cpp create mode 100644 webrtc-sys/src/prohibit_libsrtp_initialization.rs diff --git a/webrtc-sys/build.rs b/webrtc-sys/build.rs index 66380274b..69695330c 100644 --- a/webrtc-sys/build.rs +++ b/webrtc-sys/build.rs @@ -47,6 +47,7 @@ fn main() { "src/yuv_helper.rs", "src/audio_resampler.rs", "src/android.rs", + "src/prohibit_libsrtp_initialization.rs", ]); builder.files(&[ @@ -73,6 +74,7 @@ fn main() { "src/audio_resampler.cpp", "src/frame_cryptor.cpp", "src/global_task_queue.cpp", + "src/prohibit_libsrtp_initialization.cpp", ]); let webrtc_dir = webrtc_sys_build::webrtc_dir(); diff --git a/webrtc-sys/include/livekit/prohibit_libsrtp_initialization.h b/webrtc-sys/include/livekit/prohibit_libsrtp_initialization.h new file mode 100644 index 000000000..9670b161a --- /dev/null +++ b/webrtc-sys/include/livekit/prohibit_libsrtp_initialization.h @@ -0,0 +1,21 @@ +/* + * Copyright 2023 LiveKit + * + * Licensed under the Apache License, Version 2.0 (the “License”); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an “AS IS” BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +namespace livekit { +void ProhibitLibsrtpInitialization(); +} \ No newline at end of file diff --git a/webrtc-sys/src/lib.rs b/webrtc-sys/src/lib.rs index 7a3e19e14..657c2fb55 100644 --- a/webrtc-sys/src/lib.rs +++ b/webrtc-sys/src/lib.rs @@ -25,6 +25,7 @@ pub mod media_stream; pub mod media_stream_track; pub mod peer_connection; pub mod peer_connection_factory; +pub mod prohibit_libsrtp_initialization; pub mod rtc_error; pub mod rtp_parameters; pub mod rtp_receiver; diff --git a/webrtc-sys/src/prohibit_libsrtp_initialization.cpp b/webrtc-sys/src/prohibit_libsrtp_initialization.cpp new file mode 100644 index 000000000..9e26bd998 --- /dev/null +++ b/webrtc-sys/src/prohibit_libsrtp_initialization.cpp @@ -0,0 +1,23 @@ +/* + * Copyright 2023 LiveKit + * + * Licensed under the Apache License, Version 2.0 (the “License”); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an “AS IS” BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pc/srtp_session.h" + +namespace livekit { +void ProhibitLibsrtpInitialization() { + cricket::ProhibitLibsrtpInitialization(); +} +} \ No newline at end of file diff --git a/webrtc-sys/src/prohibit_libsrtp_initialization.rs b/webrtc-sys/src/prohibit_libsrtp_initialization.rs new file mode 100644 index 000000000..8fa9fcca4 --- /dev/null +++ b/webrtc-sys/src/prohibit_libsrtp_initialization.rs @@ -0,0 +1,22 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#[cxx::bridge(namespace = "livekit")] +pub mod ffi { + unsafe extern "C++" { + include!("livekit/prohibit_libsrtp_initialization.h"); + + fn ProhibitLibsrtpInitialization(); + } +} From e9cebf68ec7eba9c7473f08d3d6463d35bffaf73 Mon Sep 17 00:00:00 2001 From: Albrecht Date: Thu, 31 Oct 2024 19:10:47 +0100 Subject: [PATCH 02/51] fix: don't overwrite the url path in twirp-client (#478) --- Cargo.lock | 2 +- livekit-api/src/services/twirp_client.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c109ac0f..31372d3c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1642,7 +1642,7 @@ dependencies = [ [[package]] name = "livekit-ffi" -version = "0.12.0" +version = "0.12.1" dependencies = [ "console-subscriber", "dashmap", diff --git a/livekit-api/src/services/twirp_client.rs b/livekit-api/src/services/twirp_client.rs index 2939cc266..9dd6c5b51 100644 --- a/livekit-api/src/services/twirp_client.rs +++ b/livekit-api/src/services/twirp_client.rs @@ -102,7 +102,10 @@ impl TwirpClient { mut headers: HeaderMap, ) -> TwirpResult { let mut url = url::Url::parse(&self.host)?; - url.set_path(&format!("{}/{}.{}/{}", self.prefix, self.pkg, service, method)); + + if let Ok(mut segs) = url.path_segments_mut() { + segs.push(&format!("{}/{}.{}/{}", self.prefix, self.pkg, service, method)); + } headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/protobuf")); From 91fcf57de20cc63d13e2d11b360fab56b3265e68 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 14:10:26 -0700 Subject: [PATCH 03/51] RPC updates (#476) * Check RPC version * invocation data, duration * Duration * fmt * params * data --- examples/rpc/src/main.rs | 120 +++++++++--------- livekit-ffi/src/server/participant.rs | 67 +++++----- livekit-ffi/src/server/requests.rs | 2 +- livekit/src/prelude.rs | 3 +- livekit/src/room/mod.rs | 7 +- .../src/room/participant/local_participant.rs | 85 ++++++------- livekit/src/room/participant/rpc.rs | 39 ++++++ livekit/src/rtc_engine/mod.rs | 6 +- livekit/src/rtc_engine/rtc_session.rs | 6 +- 9 files changed, 180 insertions(+), 155 deletions(-) diff --git a/examples/rpc/src/main.rs b/examples/rpc/src/main.rs index 152f380e1..11e0694b7 100644 --- a/examples/rpc/src/main.rs +++ b/examples/rpc/src/main.rs @@ -78,71 +78,73 @@ async fn main() -> Result<(), Box> { } async fn register_receiver_methods(greeters_room: &Arc, math_genius_room: &Arc) { - greeters_room.local_participant().register_rpc_method( - "arrival".to_string(), - |_, caller_identity, payload, _| { - Box::pin(async move { - println!( - "[{}] [Greeter] Oh {} arrived and said \"{}\"", - elapsed_time(), - caller_identity, - payload - ); - sleep(Duration::from_secs(2)).await; - Ok("Welcome and have a wonderful day!".to_string()) - }) - }, - ); - - math_genius_room.local_participant().register_rpc_method("square-root".to_string(), |_, caller_identity, payload, response_timeout_ms| { + greeters_room.local_participant().register_rpc_method("arrival".to_string(), |data| { Box::pin(async move { - let json_data: Value = serde_json::from_str(&payload).unwrap(); - let number = json_data["number"].as_f64().unwrap(); println!( - "[{}] [Math Genius] I guess {} wants the square root of {}. I've only got {} seconds to respond but I think I can pull it off.", + "[{}] [Greeter] Oh {} arrived and said \"{}\"", elapsed_time(), - caller_identity, - number, - response_timeout_ms.as_secs() + data.caller_identity, + data.payload ); - - println!("[{}] [Math Genius] *doing math*…", elapsed_time()); sleep(Duration::from_secs(2)).await; - - let result = number.sqrt(); - println!("[{}] [Math Genius] Aha! It's {}", elapsed_time(), result); - Ok(json!({"result": result}).to_string()) + Ok("Welcome and have a wonderful day!".to_string()) }) }); math_genius_room.local_participant().register_rpc_method( - "divide".to_string(), - |_, caller_identity, payload, _| { + "square-root".to_string(), + |data| { Box::pin(async move { - let json_data: Value = serde_json::from_str(&payload).unwrap(); - let dividend = json_data["dividend"].as_i64().unwrap(); - let divisor = json_data["divisor"].as_i64().unwrap(); + let json_data: Value = serde_json::from_str(&data.payload).unwrap(); + let number = json_data["number"].as_f64().unwrap(); println!( - "[{}] [Math Genius] {} wants me to divide {} by {}.", + "[{}] [Math Genius] I guess {} wants the square root of {}. I've only got {} seconds to respond but I think I can pull it off.", elapsed_time(), - caller_identity, - dividend, - divisor + data.caller_identity, + number, + data.response_timeout.as_secs() ); - let result = dividend / divisor; - println!("[{}] [Math Genius] The result is {}", elapsed_time(), result); + println!("[{}] [Math Genius] *doing math*…", elapsed_time()); + sleep(Duration::from_secs(2)).await; + + let result = number.sqrt(); + println!("[{}] [Math Genius] Aha! It's {}", elapsed_time(), result); Ok(json!({"result": result}).to_string()) }) }, ); + + math_genius_room.local_participant().register_rpc_method("divide".to_string(), |data| { + Box::pin(async move { + let json_data: Value = serde_json::from_str(&data.payload).unwrap(); + let dividend = json_data["dividend"].as_i64().unwrap(); + let divisor = json_data["divisor"].as_i64().unwrap(); + println!( + "[{}] [Math Genius] {} wants me to divide {} by {}.", + elapsed_time(), + data.caller_identity, + dividend, + divisor + ); + + let result = dividend / divisor; + println!("[{}] [Math Genius] The result is {}", elapsed_time(), result); + Ok(json!({"result": result}).to_string()) + }) + }); } async fn perform_greeting(room: &Arc) -> Result<(), Box> { println!("[{}] Letting the greeter know that I've arrived", elapsed_time()); match room .local_participant() - .perform_rpc("greeter".to_string(), "arrival".to_string(), "Hello".to_string(), None) + .perform_rpc(PerformRpcData { + destination_identity: "greeter".to_string(), + method: "arrival".to_string(), + payload: "Hello".to_string(), + ..Default::default() + }) .await { Ok(response) => { @@ -157,12 +159,12 @@ async fn perform_square_root(room: &Arc) -> Result<(), Box { @@ -180,12 +182,12 @@ async fn perform_quantum_hypergeometric_series( println!("[{}] What's the quantum hypergeometric series of 42?", elapsed_time()); match room .local_participant() - .perform_rpc( - "math-genius".to_string(), - "quantum-hypergeometric-series".to_string(), - json!({"number": 42}).to_string(), - None, - ) + .perform_rpc(PerformRpcData { + destination_identity: "math-genius".to_string(), + method: "quantum-hypergeometric-series".to_string(), + payload: json!({"number": 42}).to_string(), + ..Default::default() + }) .await { Ok(response) => { @@ -207,12 +209,12 @@ async fn perform_division(room: &Arc) -> Result<(), Box { diff --git a/livekit-ffi/src/server/participant.rs b/livekit-ffi/src/server/participant.rs index fdf54bd60..afa4bade2 100644 --- a/livekit-ffi/src/server/participant.rs +++ b/livekit-ffi/src/server/participant.rs @@ -51,12 +51,15 @@ impl FfiParticipant { let handle = server.async_runtime.spawn(async move { let result = local - .perform_rpc( - request.destination_identity.to_string(), - request.method, - request.payload, - request.response_timeout_ms, - ) + .perform_rpc(PerformRpcData { + destination_identity: request.destination_identity.to_string(), + method: request.method, + payload: request.payload, + response_timeout: request + .response_timeout_ms + .map(|ms| Duration::from_millis(ms as u64)) + .unwrap_or(PerformRpcData::default().response_timeout), + }) .await; let callback = proto::PerformRpcCallback { @@ -91,34 +94,27 @@ impl FfiParticipant { let local_participant_handle = self.handle.clone(); let room: Arc = self.room.clone(); - local.register_rpc_method( - method.clone(), - move |request_id, caller_identity, payload, response_timeout| { - Box::pin({ - let room = room.clone(); - let method = method.clone(); - async move { - forward_rpc_method_invocation( - server, - room, - local_participant_handle, - method, - request_id, - caller_identity, - payload, - response_timeout, - ) - .await - } - }) - }, - ); + local.register_rpc_method(method.clone(), move |data| { + Box::pin({ + let room = room.clone(); + let method = method.clone(); + async move { + forward_rpc_method_invocation( + server, + room, + local_participant_handle, + method, + data, + ) + .await + } + }) + }); Ok(proto::RegisterRpcMethodResponse {}) } pub fn unregister_rpc_method( &self, - server: &'static FfiServer, request: proto::UnregisterRpcMethodRequest, ) -> FfiResult { let local = match &self.participant { @@ -139,10 +135,7 @@ async fn forward_rpc_method_invocation( room: Arc, local_participant_handle: FfiHandleId, method: String, - request_id: String, - caller_identity: ParticipantIdentity, - payload: String, - response_timeout: Duration, + data: RpcInvocationData, ) -> Result { let (tx, rx) = oneshot::channel(); let invocation_id = server.next_id(); @@ -152,10 +145,10 @@ async fn forward_rpc_method_invocation( local_participant_handle: local_participant_handle as u64, invocation_id, method, - request_id, - caller_identity: caller_identity.into(), - payload, - response_timeout_ms: response_timeout.as_millis() as u32, + request_id: data.request_id, + caller_identity: data.caller_identity.into(), + payload: data.payload, + response_timeout_ms: data.response_timeout.as_millis() as u32, }, )); diff --git a/livekit-ffi/src/server/requests.rs b/livekit-ffi/src/server/requests.rs index 6af1fd665..5c4aa32fc 100644 --- a/livekit-ffi/src/server/requests.rs +++ b/livekit-ffi/src/server/requests.rs @@ -815,7 +815,7 @@ fn on_unregister_rpc_method( ) -> FfiResult { let ffi_participant = server.retrieve_handle::(request.local_participant_handle)?.clone(); - return ffi_participant.unregister_rpc_method(server, request); + return ffi_participant.unregister_rpc_method(request); } fn on_rpc_method_invocation_response( diff --git a/livekit/src/prelude.rs b/livekit/src/prelude.rs index a7b86d62a..d86e328c3 100644 --- a/livekit/src/prelude.rs +++ b/livekit/src/prelude.rs @@ -15,7 +15,8 @@ pub use crate::{ id::*, participant::{ - ConnectionQuality, LocalParticipant, Participant, RemoteParticipant, RpcError, RpcErrorCode, + ConnectionQuality, LocalParticipant, Participant, PerformRpcData, RemoteParticipant, + RpcError, RpcErrorCode, RpcInvocationData, }, publication::{LocalTrackPublication, RemoteTrackPublication, TrackPublication}, track::{ diff --git a/livekit/src/room/mod.rs b/livekit/src/room/mod.rs index 28d51902f..7e38cbfff 100644 --- a/livekit/src/room/mod.rs +++ b/livekit/src/room/mod.rs @@ -261,7 +261,7 @@ pub struct RpcRequest { pub id: String, pub method: String, pub payload: String, - pub response_timeout_ms: u32, + pub response_timeout: Duration, pub version: u32, } @@ -689,7 +689,7 @@ impl RoomSession { request_id, method, payload, - response_timeout_ms, + response_timeout, version, } => { if caller_identity.is_none() { @@ -702,7 +702,8 @@ impl RoomSession { request_id, method, payload, - response_timeout_ms, + response_timeout, + version, ) .await; } diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index 8c4596763..037c31709 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -19,7 +19,7 @@ use crate::{ e2ee::EncryptionType, options::{self, compute_video_encodings, video_layers_from_encodings, TrackPublishOptions}, prelude::*, - room::participant::rpc::{RpcError, RpcErrorCode, MAX_PAYLOAD_BYTES}, + room::participant::rpc::{RpcError, RpcErrorCode, RpcInvocationData, MAX_PAYLOAD_BYTES}, rtc_engine::{EngineError, RtcEngine}, ChatMessage, DataPacket, RpcAck, RpcRequest, RpcResponse, SipDTMF, Transcription, }; @@ -36,12 +36,7 @@ use semver::Version; use tokio::sync::oneshot; type RpcHandler = Arc< - dyn Fn( - String, // request_id - ParticipantIdentity, // caller_identity - String, // payload - Duration, // response_timeout_ms - ) -> Pin> + Send>> + dyn Fn(RpcInvocationData) -> Pin> + Send>> + Send + Sync, >; @@ -72,7 +67,6 @@ impl RpcState { } } } - struct LocalInfo { events: LocalEvents, encryption_type: EncryptionType, @@ -517,7 +511,7 @@ impl LocalParticipant { id: rpc_request.id, method: rpc_request.method, payload: rpc_request.payload, - response_timeout_ms: rpc_request.response_timeout_ms, + response_timeout_ms: rpc_request.response_timeout.as_millis() as u32, version: rpc_request.version, ..Default::default() }; @@ -643,17 +637,10 @@ impl LocalParticipant { self.inner.info.read().kind } - pub async fn perform_rpc( - &self, - destination_identity: String, - method: String, - payload: String, - response_timeout_ms: Option, - ) -> Result { - let response_timeout = Duration::from_millis(response_timeout_ms.unwrap_or(10000) as u64); + pub async fn perform_rpc(&self, data: PerformRpcData) -> Result { let max_round_trip_latency = Duration::from_millis(2000); - if payload.len() > MAX_PAYLOAD_BYTES { + if data.payload.len() > MAX_PAYLOAD_BYTES { return Err(RpcError::built_in(RpcErrorCode::RequestPayloadTooLarge, None)); } @@ -675,11 +662,11 @@ impl LocalParticipant { match self .publish_rpc_request(RpcRequest { - destination_identity: destination_identity.clone(), + destination_identity: data.destination_identity.clone(), id: id.clone(), - method: method.clone(), - payload: payload.clone(), - response_timeout_ms: (response_timeout - max_round_trip_latency).as_millis() as u32, + method: data.method.clone(), + payload: data.payload.clone(), + response_timeout: data.response_timeout - max_round_trip_latency, version: 1, }) .await @@ -709,7 +696,7 @@ impl LocalParticipant { } // Wait for response timout - let response = match tokio::time::timeout(response_timeout, response_rx).await { + let response = match tokio::time::timeout(data.response_timeout, response_rx).await { Err(_) => { self.local.rpc_state.lock().pending_responses.remove(&id); return Err(RpcError::built_in(RpcErrorCode::ResponseTimeout, None)); @@ -736,12 +723,7 @@ impl LocalParticipant { pub fn register_rpc_method( &self, method: String, - handler: impl Fn( - String, - ParticipantIdentity, - String, - Duration, - ) -> Pin> + Send>> + handler: impl Fn(RpcInvocationData) -> Pin> + Send>> + Send + Sync + 'static, @@ -785,7 +767,8 @@ impl LocalParticipant { request_id: String, method: String, payload: String, - response_timeout_ms: u32, + response_timeout: Duration, + version: u32, ) { if let Err(e) = self .publish_rpc_ack(RpcAck { @@ -797,32 +780,36 @@ impl LocalParticipant { log::error!("Failed to publish RPC ACK: {:?}", e); } - let handler = self.local.rpc_state.lock().handlers.get(&method).cloned(); - let caller_identity_2 = caller_identity.clone(); let request_id_2 = request_id.clone(); - let response = match handler { - Some(handler) => { - match tokio::task::spawn(async move { - handler( - request_id.clone(), - caller_identity.clone(), - payload.clone(), - Duration::from_millis(response_timeout_ms as u64), - ) + let response = if version != 1 { + Err(RpcError::built_in(RpcErrorCode::UnsupportedVersion, None)) + } else { + let handler = self.local.rpc_state.lock().handlers.get(&method).cloned(); + + match handler { + Some(handler) => { + match tokio::task::spawn(async move { + handler(RpcInvocationData { + request_id: request_id.clone(), + caller_identity: caller_identity.clone(), + payload: payload.clone(), + response_timeout, + }) + .await + }) .await - }) - .await - { - Ok(result) => result, - Err(e) => { - log::error!("RPC method handler returned an error: {:?}", e); - Err(RpcError::built_in(RpcErrorCode::ApplicationError, None)) + { + Ok(result) => result, + Err(e) => { + log::error!("RPC method handler returned an error: {:?}", e); + Err(RpcError::built_in(RpcErrorCode::ApplicationError, None)) + } } } + None => Err(RpcError::built_in(RpcErrorCode::UnsupportedMethod, None)), } - None => Err(RpcError::built_in(RpcErrorCode::UnsupportedMethod, None)), }; let (payload, error) = match response { diff --git a/livekit/src/room/participant/rpc.rs b/livekit/src/room/participant/rpc.rs index 3ddb0f545..34e043efb 100644 --- a/livekit/src/room/participant/rpc.rs +++ b/livekit/src/room/participant/rpc.rs @@ -2,7 +2,44 @@ // // SPDX-License-Identifier: Apache-2.0 +use crate::room::participant::ParticipantIdentity; use livekit_protocol::RpcError as RpcError_Proto; +use std::time::Duration; + +/// Parameters for performing an RPC call +#[derive(Debug, Clone)] +pub struct PerformRpcData { + pub destination_identity: String, + pub method: String, + pub payload: String, + pub response_timeout: Duration, +} + +impl Default for PerformRpcData { + fn default() -> Self { + Self { + destination_identity: Default::default(), + method: Default::default(), + payload: Default::default(), + response_timeout: Duration::from_secs(10), + } + } +} + +/// Data passed to method handler for incoming RPC invocations +/// +/// Attributes: +/// request_id (String): The unique request ID. Will match at both sides of the call, useful for debugging or logging. +/// caller_identity (ParticipantIdentity): The unique participant identity of the caller. +/// payload (String): The payload of the request. User-definable format, typically JSON. +/// response_timeout (Duration): The maximum time the caller will wait for a response. +#[derive(Debug, Clone)] +pub struct RpcInvocationData { + pub request_id: String, + pub caller_identity: ParticipantIdentity, + pub payload: String, + pub response_timeout: Duration, +} /// Specialized error handling for RPC methods. /// @@ -60,6 +97,7 @@ pub enum RpcErrorCode { RecipientNotFound = 1401, RequestPayloadTooLarge = 1402, UnsupportedServer = 1403, + UnsupportedVersion = 1404, } impl RpcErrorCode { @@ -76,6 +114,7 @@ impl RpcErrorCode { Self::RecipientNotFound => "Recipient not found", Self::RequestPayloadTooLarge => "Request payload too large", Self::UnsupportedServer => "RPC not supported by server", + Self::UnsupportedVersion => "Unsupported RPC version", } } } diff --git a/livekit/src/rtc_engine/mod.rs b/livekit/src/rtc_engine/mod.rs index d848571b6..4b3c44933 100644 --- a/livekit/src/rtc_engine/mod.rs +++ b/livekit/src/rtc_engine/mod.rs @@ -118,7 +118,7 @@ pub enum EngineEvent { request_id: String, method: String, payload: String, - response_timeout_ms: u32, + response_timeout: Duration, version: u32, }, RpcResponse { @@ -487,7 +487,7 @@ impl EngineInner { request_id, method, payload, - response_timeout_ms, + response_timeout, version, } => { let _ = self.engine_tx.send(EngineEvent::RpcRequest { @@ -495,7 +495,7 @@ impl EngineInner { request_id, method, payload, - response_timeout_ms, + response_timeout, version, }); } diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index 5377be510..fa01a69fe 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -101,7 +101,7 @@ pub enum SessionEvent { request_id: String, method: String, payload: String, - response_timeout_ms: u32, + response_timeout: Duration, version: u32, }, RpcResponse { @@ -689,7 +689,9 @@ impl SessionInner { request_id: rpc_request.id.clone(), method: rpc_request.method.clone(), payload: rpc_request.payload.clone(), - response_timeout_ms: rpc_request.response_timeout_ms, + response_timeout: Duration::from_millis( + rpc_request.response_timeout_ms as u64, + ), version: rpc_request.version, }); } From 8cb20245841442a7a88766a372002f0eccbf0d58 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 14:27:23 -0700 Subject: [PATCH 04/51] ffi 0.12.2 --- Cargo.lock | 2 +- livekit-ffi/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31372d3c7..b6a1658b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1642,7 +1642,7 @@ dependencies = [ [[package]] name = "livekit-ffi" -version = "0.12.1" +version = "0.12.2" dependencies = [ "console-subscriber", "dashmap", diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index bbe8ed4fa..27992de71 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-ffi" -version = "0.12.1" +version = "0.12.2" edition = "2021" license = "Apache-2.0" description = "FFI interface for bindings in other languages" From a83cb995261141cbafc2bc96e989acf942bc53da Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 15:13:18 -0700 Subject: [PATCH 05/51] 0.7 --- livekit/.nanparc | 2 +- livekit/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/livekit/.nanparc b/livekit/.nanparc index 1cc55e1ba..0841e27c2 100644 --- a/livekit/.nanparc +++ b/livekit/.nanparc @@ -1,2 +1,2 @@ -version 0.6.0 +version 0.7.0 language rust diff --git a/livekit/Cargo.toml b/livekit/Cargo.toml index 6e150330b..7ecbed83c 100644 --- a/livekit/Cargo.toml +++ b/livekit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit" -version = "0.6.0" +version = "0.7.0" edition = "2021" license = "Apache-2.0" description = "Rust Client SDK for LiveKit" From 31979b76aa52db4341bed5142c19dc4b984cb7ed Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 15:25:58 -0700 Subject: [PATCH 06/51] versions --- livekit-api/.nanparc | 2 +- livekit-api/Cargo.toml | 2 +- livekit-ffi/.nanparc | 2 +- livekit-protocol/.nanparc | 2 +- livekit-protocol/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/livekit-api/.nanparc b/livekit-api/.nanparc index f3e92f54e..0dacc3fcf 100644 --- a/livekit-api/.nanparc +++ b/livekit-api/.nanparc @@ -1,2 +1,2 @@ -version 0.4.0 +version 0.4.1 language rust diff --git a/livekit-api/Cargo.toml b/livekit-api/Cargo.toml index 401ec9b61..d1e5bcaba 100644 --- a/livekit-api/Cargo.toml +++ b/livekit-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-api" -version = "0.4.0" +version = "0.4.1" license = "Apache-2.0" description = "Rust Server SDK for LiveKit" edition = "2021" diff --git a/livekit-ffi/.nanparc b/livekit-ffi/.nanparc index 18c96a7ba..37b95fd32 100644 --- a/livekit-ffi/.nanparc +++ b/livekit-ffi/.nanparc @@ -1,2 +1,2 @@ -version 0.10.2 +version 0.12.2 language rust diff --git a/livekit-protocol/.nanparc b/livekit-protocol/.nanparc index d431df850..f3e92f54e 100644 --- a/livekit-protocol/.nanparc +++ b/livekit-protocol/.nanparc @@ -1,2 +1,2 @@ -version 0.3.5 +version 0.4.0 language rust diff --git a/livekit-protocol/Cargo.toml b/livekit-protocol/Cargo.toml index 7d44495a1..e9e931113 100644 --- a/livekit-protocol/Cargo.toml +++ b/livekit-protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-protocol" -version = "0.3.5" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "Livekit protocol and utilities for the Rust SDK" From 49fb3c3d4b0c13a7f465a760521911d0c885e52a Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 15:38:38 -0700 Subject: [PATCH 07/51] Revert "versions" This reverts commit 31979b76aa52db4341bed5142c19dc4b984cb7ed. --- livekit-api/.nanparc | 2 +- livekit-api/Cargo.toml | 2 +- livekit-ffi/.nanparc | 2 +- livekit-protocol/.nanparc | 2 +- livekit-protocol/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/livekit-api/.nanparc b/livekit-api/.nanparc index 0dacc3fcf..f3e92f54e 100644 --- a/livekit-api/.nanparc +++ b/livekit-api/.nanparc @@ -1,2 +1,2 @@ -version 0.4.1 +version 0.4.0 language rust diff --git a/livekit-api/Cargo.toml b/livekit-api/Cargo.toml index d1e5bcaba..401ec9b61 100644 --- a/livekit-api/Cargo.toml +++ b/livekit-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-api" -version = "0.4.1" +version = "0.4.0" license = "Apache-2.0" description = "Rust Server SDK for LiveKit" edition = "2021" diff --git a/livekit-ffi/.nanparc b/livekit-ffi/.nanparc index 37b95fd32..18c96a7ba 100644 --- a/livekit-ffi/.nanparc +++ b/livekit-ffi/.nanparc @@ -1,2 +1,2 @@ -version 0.12.2 +version 0.10.2 language rust diff --git a/livekit-protocol/.nanparc b/livekit-protocol/.nanparc index f3e92f54e..d431df850 100644 --- a/livekit-protocol/.nanparc +++ b/livekit-protocol/.nanparc @@ -1,2 +1,2 @@ -version 0.4.0 +version 0.3.5 language rust diff --git a/livekit-protocol/Cargo.toml b/livekit-protocol/Cargo.toml index e9e931113..7d44495a1 100644 --- a/livekit-protocol/Cargo.toml +++ b/livekit-protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-protocol" -version = "0.4.0" +version = "0.3.5" edition = "2021" license = "Apache-2.0" description = "Livekit protocol and utilities for the Rust SDK" From 718062838f28ddc07026d9516227a4f539b1c015 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 15:38:47 -0700 Subject: [PATCH 08/51] Revert "0.7" This reverts commit a83cb995261141cbafc2bc96e989acf942bc53da. --- livekit/.nanparc | 2 +- livekit/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/livekit/.nanparc b/livekit/.nanparc index 0841e27c2..1cc55e1ba 100644 --- a/livekit/.nanparc +++ b/livekit/.nanparc @@ -1,2 +1,2 @@ -version 0.7.0 +version 0.6.0 language rust diff --git a/livekit/Cargo.toml b/livekit/Cargo.toml index 7ecbed83c..6e150330b 100644 --- a/livekit/Cargo.toml +++ b/livekit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit" -version = "0.7.0" +version = "0.6.0" edition = "2021" license = "Apache-2.0" description = "Rust Client SDK for LiveKit" From 06997356c083b01da766c4c93e8c4e8354d871ce Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 31 Oct 2024 15:55:02 -0700 Subject: [PATCH 09/51] bump rtc 0.7.0, api 0.4.1, proto 0.3.6 (#479) --- Cargo.lock | 8 ++++---- livekit-api/Cargo.toml | 4 ++-- livekit-ffi/Cargo.toml | 6 +++--- livekit-protocol/Cargo.toml | 4 ++-- livekit-runtime/Cargo.toml | 2 +- livekit/Cargo.toml | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6a1658b0..f56302207 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1595,7 +1595,7 @@ checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "livekit" -version = "0.6.0" +version = "0.7.0" dependencies = [ "chrono", "futures-util", @@ -1616,7 +1616,7 @@ dependencies = [ [[package]] name = "livekit-api" -version = "0.4.0" +version = "0.4.1" dependencies = [ "async-tungstenite", "base64", @@ -1667,7 +1667,7 @@ dependencies = [ [[package]] name = "livekit-protocol" -version = "0.3.5" +version = "0.3.6" dependencies = [ "futures-util", "livekit-runtime", @@ -1683,7 +1683,7 @@ dependencies = [ [[package]] name = "livekit-runtime" -version = "0.3.0" +version = "0.3.1" dependencies = [ "async-io 2.3.1", "async-std", diff --git a/livekit-api/Cargo.toml b/livekit-api/Cargo.toml index 401ec9b61..0b50257a2 100644 --- a/livekit-api/Cargo.toml +++ b/livekit-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-api" -version = "0.4.0" +version = "0.4.1" license = "Apache-2.0" description = "Rust Server SDK for LiveKit" edition = "2021" @@ -65,7 +65,7 @@ rustls-tls-webpki-roots = [ __rustls-tls = ["tokio-tungstenite?/__rustls-tls", "reqwest?/__rustls"] [dependencies] -livekit-protocol = { path = "../livekit-protocol", version = "0.3.5" } +livekit-protocol = { path = "../livekit-protocol", version = "0.3.6" } thiserror = "1.0" serde = { version = "1.0", features = ["derive"] } sha2 = "0.10" diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index 27992de71..7d6e8d040 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -18,9 +18,9 @@ __rustls-tls = ["livekit/__rustls-tls"] tracing = ["tokio/tracing", "console-subscriber"] [dependencies] -livekit = { path = "../livekit", version = "0.6.0" } +livekit = { path = "../livekit", version = "0.7.0" } soxr-sys = { path = "../soxr-sys" } -livekit-protocol = { path = "../livekit-protocol", version = "0.3.5" } +livekit-protocol = { path = "../livekit-protocol", version = "0.3.6" } tokio = { version = "1", features = ["full", "parking_lot"] } futures-util = { version = "0.3", default-features = false, features = ["sink"] } parking_lot = { version = "0.12", features = ["deadlock_detection"] } @@ -42,7 +42,7 @@ jni = "0.21.1" webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.2" } [dev-dependencies] -livekit-api = { path = "../livekit-api", version = "0.4.0" } +livekit-api = { path = "../livekit-api", version = "0.4.1" } [lib] crate-type = ["lib", "cdylib"] diff --git a/livekit-protocol/Cargo.toml b/livekit-protocol/Cargo.toml index 7d44495a1..49d2f17b0 100644 --- a/livekit-protocol/Cargo.toml +++ b/livekit-protocol/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "livekit-protocol" -version = "0.3.5" +version = "0.3.6" edition = "2021" license = "Apache-2.0" description = "Livekit protocol and utilities for the Rust SDK" repository = "https://github.com/livekit/rust-sdks" [dependencies] -livekit-runtime = { path = "../livekit-runtime", version = "0.3.0" } +livekit-runtime = { path = "../livekit-runtime", version = "0.3.1" } tokio = { version = "1", default-features = false, features = [ "sync", "macros", diff --git a/livekit-runtime/Cargo.toml b/livekit-runtime/Cargo.toml index b986d4ae9..bb3a283a7 100644 --- a/livekit-runtime/Cargo.toml +++ b/livekit-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-runtime" -version = "0.3.0" +version = "0.3.1" license = "Apache-2.0" description = "Async runtime compatibility layer for LiveKit" edition = "2021" diff --git a/livekit/Cargo.toml b/livekit/Cargo.toml index 6e150330b..4f5a9cac6 100644 --- a/livekit/Cargo.toml +++ b/livekit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit" -version = "0.6.0" +version = "0.7.0" edition = "2021" license = "Apache-2.0" description = "Rust Client SDK for LiveKit" @@ -27,10 +27,10 @@ __rustls-tls = ["livekit-api/__rustls-tls"] __lk-internal = [] [dependencies] -livekit-runtime = { path = "../livekit-runtime", version = "0.3.0", default-features = false } -livekit-api = { path = "../livekit-api", version = "0.4.0", default-features = false } +livekit-runtime = { path = "../livekit-runtime", version = "0.3.1", default-features = false } +livekit-api = { path = "../livekit-api", version = "0.4.1", default-features = false } libwebrtc = { path = "../libwebrtc", version = "0.3.7" } -livekit-protocol = { path = "../livekit-protocol", version = "0.3.5" } +livekit-protocol = { path = "../livekit-protocol", version = "0.3.6" } prost = "0.12" serde = { version = "1", features = ["derive"] } serde_json = "1.0" From 80a36c2754a77b3e00e128529173020f4da181b7 Mon Sep 17 00:00:00 2001 From: Mervs Date: Mon, 11 Nov 2024 17:21:34 +0100 Subject: [PATCH 10/51] fix: re-export twirp error types (#480) --- livekit-api/src/services/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/livekit-api/src/services/mod.rs b/livekit-api/src/services/mod.rs index d983c39b2..cc47aefad 100644 --- a/livekit-api/src/services/mod.rs +++ b/livekit-api/src/services/mod.rs @@ -19,6 +19,8 @@ use thiserror::Error; use crate::access_token::{AccessToken, AccessTokenError, SIPGrants, VideoGrants}; +pub use twirp_client::{TwirpError, TwirpErrorCode, TwirpResult}; + pub mod egress; pub mod ingress; pub mod room; @@ -35,7 +37,7 @@ pub enum ServiceError { #[error("invalid access token: {0}")] AccessToken(#[from] AccessTokenError), #[error("twirp error: {0}")] - Twirp(#[from] twirp_client::TwirpError), + Twirp(#[from] TwirpError), } pub type ServiceResult = Result; From ee5076baf83bfe9e8100fb7c78757db746ee4c70 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Tue, 12 Nov 2024 19:51:53 -0700 Subject: [PATCH 11/51] Use rust::String::lossy for stringification to avoid crashing due to non-utf8 content (#485) --- webrtc-sys/src/jsep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc-sys/src/jsep.cpp b/webrtc-sys/src/jsep.cpp index 0dcc9f0fb..a1283229e 100644 --- a/webrtc-sys/src/jsep.cpp +++ b/webrtc-sys/src/jsep.cpp @@ -53,7 +53,7 @@ rust::String IceCandidate::candidate() const { rust::String IceCandidate::stringify() const { std::string str; ice_candidate_->ToString(&str); - return rust::String{str}; + return rust::String::lossy(str); } std::unique_ptr IceCandidate::release() { @@ -85,7 +85,7 @@ SdpType SessionDescription::sdp_type() const { rust::String SessionDescription::stringify() const { std::string str; session_description_->ToString(&str); - return rust::String{str}; + return rust::String::lossy(str); } std::unique_ptr SessionDescription::clone() const { From 3c70895941d6de6d28adfd69eea4e5f09336e5db Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 12 Nov 2024 18:53:03 -0800 Subject: [PATCH 12/51] Fix dispatcher example (#484) Co-authored-by: Kirill Bulatov --- examples/basic_room_dispatcher/Cargo.lock | 85 ++++++++++++++++------ examples/basic_room_dispatcher/Cargo.toml | 2 +- examples/basic_room_dispatcher/src/main.rs | 3 +- examples/wgpu_room/src/video_renderer.rs | 63 ++++++---------- livekit-api/Cargo.toml | 2 +- 5 files changed, 89 insertions(+), 66 deletions(-) diff --git a/examples/basic_room_dispatcher/Cargo.lock b/examples/basic_room_dispatcher/Cargo.lock index f43f54d98..c86a54912 100644 --- a/examples/basic_room_dispatcher/Cargo.lock +++ b/examples/basic_room_dispatcher/Cargo.lock @@ -37,6 +37,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" version = "1.0.80" @@ -429,11 +444,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", ] [[package]] @@ -1115,6 +1135,29 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -1301,7 +1344,7 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libwebrtc" -version = "0.3.2" +version = "0.3.7" dependencies = [ "cxx", "jni", @@ -1315,7 +1358,6 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-stream", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1357,8 +1399,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "livekit" -version = "0.3.2" +version = "0.7.0" dependencies = [ + "chrono", "futures-util", "lazy_static", "libwebrtc", @@ -1368,6 +1411,7 @@ dependencies = [ "log", "parking_lot", "prost", + "semver", "serde", "serde_json", "thiserror", @@ -1376,7 +1420,7 @@ dependencies = [ [[package]] name = "livekit-api" -version = "0.3.2" +version = "0.4.1" dependencies = [ "async-tungstenite", "base64", @@ -1402,7 +1446,7 @@ dependencies = [ [[package]] name = "livekit-protocol" -version = "0.3.2" +version = "0.3.6" dependencies = [ "futures-util", "livekit-runtime", @@ -1418,7 +1462,7 @@ dependencies = [ [[package]] name = "livekit-runtime" -version = "0.3.0" +version = "0.3.1" dependencies = [ "async-io 2.3.1", "async-std", @@ -2415,6 +2459,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "signal-hook-registry", "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", @@ -2451,17 +2496,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-tungstenite" version = "0.20.1" @@ -2767,7 +2801,7 @@ dependencies = [ [[package]] name = "webrtc-sys" -version = "0.3.2" +version = "0.3.5" dependencies = [ "cc", "cxx", @@ -2779,7 +2813,7 @@ dependencies = [ [[package]] name = "webrtc-sys-build" -version = "0.3.2" +version = "0.3.5" dependencies = [ "fs2", "regex", @@ -2832,6 +2866,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.45.0" diff --git a/examples/basic_room_dispatcher/Cargo.toml b/examples/basic_room_dispatcher/Cargo.toml index 291bea2f7..eef4d7a8a 100644 --- a/examples/basic_room_dispatcher/Cargo.toml +++ b/examples/basic_room_dispatcher/Cargo.toml @@ -11,4 +11,4 @@ livekit = { path = "../../livekit", default-features = false, features = ["nativ livekit-api = { path = "../../livekit-api" } log = "0.4" -[workspace] \ No newline at end of file +[workspace] diff --git a/examples/basic_room_dispatcher/src/main.rs b/examples/basic_room_dispatcher/src/main.rs index e61c182e6..7f05acbaa 100644 --- a/examples/basic_room_dispatcher/src/main.rs +++ b/examples/basic_room_dispatcher/src/main.rs @@ -47,12 +47,11 @@ fn main() { .unwrap(); let (room, mut rx) = Room::connect(&url, &token, RoomOptions::default()).await.unwrap(); - log::info!("Connected to room: {} - {}", room.name(), room.sid()); + log::info!("Connected to room: {} - {}", room.name(), room.sid().await); room.local_participant() .publish_data(DataPacket { payload: "Hello world".to_owned().into_bytes(), - kind: DataPacketKind::Reliable, ..Default::default() }) .await diff --git a/examples/wgpu_room/src/video_renderer.rs b/examples/wgpu_room/src/video_renderer.rs index 1c052f675..b45e615c7 100644 --- a/examples/wgpu_room/src/video_renderer.rs +++ b/examples/wgpu_room/src/video_renderer.rs @@ -86,20 +86,13 @@ impl VideoRenderer { bytes_per_row: Some(width * 4), ..Default::default() }, - wgpu::Extent3d { - width, - height, - ..Default::default() - }, + wgpu::Extent3d { width, height, ..Default::default() }, ); } } }); - Self { - rtc_track, - internal, - } + Self { rtc_track, internal } } // Returns the last frame resolution @@ -124,47 +117,35 @@ impl RendererInternal { self.height = height; self.rgba_data.resize((width * height * 4) as usize, 0); - self.texture = Some( - self.render_state - .device - .create_texture(&wgpu::TextureDescriptor { - label: Some("lk-videotexture"), - usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, - dimension: wgpu::TextureDimension::D2, - size: wgpu::Extent3d { - width, - height, - ..Default::default() - }, - sample_count: 1, - mip_level_count: 1, - format: wgpu::TextureFormat::Rgba8UnormSrgb, - view_formats: &[wgpu::TextureFormat::Rgba8UnormSrgb], - }), - ); - - self.texture_view = Some(self.texture.as_mut().unwrap().create_view( - &wgpu::TextureViewDescriptor { + self.texture = Some(self.render_state.device.create_texture(&wgpu::TextureDescriptor { + label: Some("lk-videotexture"), + usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, + dimension: wgpu::TextureDimension::D2, + size: wgpu::Extent3d { width, height, ..Default::default() }, + sample_count: 1, + mip_level_count: 1, + format: wgpu::TextureFormat::Rgba8UnormSrgb, + view_formats: &[wgpu::TextureFormat::Rgba8UnormSrgb], + })); + + self.texture_view = + Some(self.texture.as_mut().unwrap().create_view(&wgpu::TextureViewDescriptor { label: Some("lk-videotexture-view"), format: Some(wgpu::TextureFormat::Rgba8UnormSrgb), dimension: Some(wgpu::TextureViewDimension::D2), mip_level_count: Some(1), array_layer_count: Some(1), ..Default::default() - }, - )); + })); if let Some(texture_id) = self.egui_texture { // Update the existing texture - self.render_state - .renderer - .write() - .update_egui_texture_from_wgpu_texture( - &self.render_state.device, - self.texture_view.as_ref().unwrap(), - wgpu::FilterMode::Linear, - texture_id, - ); + self.render_state.renderer.write().update_egui_texture_from_wgpu_texture( + &self.render_state.device, + self.texture_view.as_ref().unwrap(), + wgpu::FilterMode::Linear, + texture_id, + ); } else { self.egui_texture = Some(self.render_state.renderer.write().register_native_texture( &self.render_state.device, diff --git a/livekit-api/Cargo.toml b/livekit-api/Cargo.toml index 0b50257a2..99538ca4a 100644 --- a/livekit-api/Cargo.toml +++ b/livekit-api/Cargo.toml @@ -85,7 +85,7 @@ jsonwebtoken = { version = "9", default-features = false, optional = true } livekit-runtime = { path = "../livekit-runtime", version = "0.3.0", optional = true} tokio-tungstenite = { version = "0.20", optional = true } async-tungstenite = { version = "0.25.0", features = [ "async-std-runtime", "async-native-tls"], optional = true } -tokio = { version = "1", default-features = false, features = ["sync", "macros"], optional = true } +tokio = { version = "1", default-features = false, features = ["sync", "macros", "signal"], optional = true } futures-util = { version = "0.3", default-features = false, features = [ "sink" ], optional = true } # This dependency must be kept in sync with reqwest's version From c48f892fb444433beed2ca4fe5e73c0c32de516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Thu, 14 Nov 2024 16:51:27 +0100 Subject: [PATCH 13/51] soxr: fix segfault when pushing after a flush (#486) --- livekit-ffi/src/server/resampler.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/livekit-ffi/src/server/resampler.rs b/livekit-ffi/src/server/resampler.rs index ad2eaa753..6faa68b02 100644 --- a/livekit-ffi/src/server/resampler.rs +++ b/livekit-ffi/src/server/resampler.rs @@ -127,6 +127,13 @@ impl SoxResampler { return Err(error_msg.to_string_lossy().to_string()); } + let error = unsafe { soxr_sys::soxr_clear(self.soxr_ptr) }; + + if !error.is_null() { + let error_msg = unsafe { std::ffi::CStr::from_ptr(error) }; + return Err(error_msg.to_string_lossy().to_string()); + } + Ok(&self.out_buf[..odone]) } } From b41861c7b71762d5d85b3de07ae67ffcae7c3fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Thu, 14 Nov 2024 21:34:07 +0100 Subject: [PATCH 14/51] ffi v0.12.3 --- livekit-ffi/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index 7d6e8d040..7109c2541 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-ffi" -version = "0.12.2" +version = "0.12.3" edition = "2021" license = "Apache-2.0" description = "FFI interface for bindings in other languages" From fe8037ab6ff22e2f424148ed1d93ed7e4f9b116e Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Thu, 21 Nov 2024 00:11:18 +0200 Subject: [PATCH 15/51] simplify version cascading by using workspaces (#483) --- .github/workflows/format.yml | 8 ++++++++ Cargo.toml | 12 ++++++++++++ libwebrtc/Cargo.toml | 2 +- livekit-api/.nanparc | 2 +- livekit-ffi/.nanparc | 2 +- livekit-ffi/Cargo.toml | 4 ++-- livekit-protocol/.nanparc | 2 +- livekit-protocol/Cargo.toml | 2 +- livekit-runtime/.nanparc | 2 +- livekit/.nanparc | 2 +- livekit/Cargo.toml | 8 ++++---- webrtc-sys/Cargo.toml | 2 +- 12 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d990bb829..0e6bbb498 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -31,6 +31,14 @@ jobs: toolchain: nightly-2023-12-30 components: rustfmt + - name: Check workspace versions match + run: | + cargo metadata --format-version=1 --no-deps | + jq -e -r '.packages[] | "\(.name) \(.version)"' | + sort | xargs -l bash -c \ + 'grep "$0 = { version = \"$1\"" -q Cargo.toml && printf "version %-7s %-27s $0\n" $1 "matches package" || printf "version %-7s is not reflected on package $0\n" "$1" | false'; + if [ $? -eq 0 ]; then exit 0; else exit 1; fi + - name: Cargo fmt run: | cargo fmt -- --check diff --git a/Cargo.toml b/Cargo.toml index 47c7ce8f7..42a408a4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,20 @@ members = [ "livekit-api", "livekit-protocol", "livekit-ffi", + "livekit-runtime", "libwebrtc", "soxr-sys", "webrtc-sys", "webrtc-sys/build", ] + +[workspace.dependencies] +libwebrtc = { version = "0.3.7", path = "libwebrtc" } +livekit-api = { version = "0.4.1", path = "livekit-api" } +livekit-ffi = { version = "0.12.2", path = "livekit-ffi" } +livekit-protocol = { version = "0.3.6", path = "livekit-protocol" } +livekit-runtime = { version = "0.3.1", path = "livekit-runtime" } +livekit = { version = "0.7.0", path = "livekit" } +soxr-sys = { version = "0.1.0", path = "soxr-sys" } +webrtc-sys-build = { version = "0.3.5", path = "webrtc-sys/build" } +webrtc-sys = { version = "0.3.5", path = "webrtc-sys" } diff --git a/libwebrtc/Cargo.toml b/libwebrtc/Cargo.toml index 28d7ad5f8..1f8f0c988 100644 --- a/libwebrtc/Cargo.toml +++ b/libwebrtc/Cargo.toml @@ -8,7 +8,7 @@ description = "Livekit safe bindings to libwebrtc" repository = "https://github.com/livekit/rust-sdks" [dependencies] -livekit-protocol = { path = "../livekit-protocol", version = "0.3.5" } +livekit-protocol = { workspace = true } log = "0.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/livekit-api/.nanparc b/livekit-api/.nanparc index f3e92f54e..0dacc3fcf 100644 --- a/livekit-api/.nanparc +++ b/livekit-api/.nanparc @@ -1,2 +1,2 @@ -version 0.4.0 +version 0.4.1 language rust diff --git a/livekit-ffi/.nanparc b/livekit-ffi/.nanparc index 18c96a7ba..37b95fd32 100644 --- a/livekit-ffi/.nanparc +++ b/livekit-ffi/.nanparc @@ -1,2 +1,2 @@ -version 0.10.2 +version 0.12.2 language rust diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index 7109c2541..8ec2ea3c1 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -18,9 +18,9 @@ __rustls-tls = ["livekit/__rustls-tls"] tracing = ["tokio/tracing", "console-subscriber"] [dependencies] -livekit = { path = "../livekit", version = "0.7.0" } +livekit = { workspace = true } soxr-sys = { path = "../soxr-sys" } -livekit-protocol = { path = "../livekit-protocol", version = "0.3.6" } +livekit-protocol = { workspace = true } tokio = { version = "1", features = ["full", "parking_lot"] } futures-util = { version = "0.3", default-features = false, features = ["sink"] } parking_lot = { version = "0.12", features = ["deadlock_detection"] } diff --git a/livekit-protocol/.nanparc b/livekit-protocol/.nanparc index d431df850..10b95b2c7 100644 --- a/livekit-protocol/.nanparc +++ b/livekit-protocol/.nanparc @@ -1,2 +1,2 @@ -version 0.3.5 +version 0.3.6 language rust diff --git a/livekit-protocol/Cargo.toml b/livekit-protocol/Cargo.toml index 49d2f17b0..bc65d15d4 100644 --- a/livekit-protocol/Cargo.toml +++ b/livekit-protocol/Cargo.toml @@ -7,7 +7,7 @@ description = "Livekit protocol and utilities for the Rust SDK" repository = "https://github.com/livekit/rust-sdks" [dependencies] -livekit-runtime = { path = "../livekit-runtime", version = "0.3.1" } +livekit-runtime = { workspace = true } tokio = { version = "1", default-features = false, features = [ "sync", "macros", diff --git a/livekit-runtime/.nanparc b/livekit-runtime/.nanparc index 80b849a2a..4efcdcec5 100644 --- a/livekit-runtime/.nanparc +++ b/livekit-runtime/.nanparc @@ -1,2 +1,2 @@ -version 0.3.0 +version 0.3.1 language rust diff --git a/livekit/.nanparc b/livekit/.nanparc index 1cc55e1ba..0841e27c2 100644 --- a/livekit/.nanparc +++ b/livekit/.nanparc @@ -1,2 +1,2 @@ -version 0.6.0 +version 0.7.0 language rust diff --git a/livekit/Cargo.toml b/livekit/Cargo.toml index 4f5a9cac6..29113321a 100644 --- a/livekit/Cargo.toml +++ b/livekit/Cargo.toml @@ -27,10 +27,10 @@ __rustls-tls = ["livekit-api/__rustls-tls"] __lk-internal = [] [dependencies] -livekit-runtime = { path = "../livekit-runtime", version = "0.3.1", default-features = false } -livekit-api = { path = "../livekit-api", version = "0.4.1", default-features = false } -libwebrtc = { path = "../libwebrtc", version = "0.3.7" } -livekit-protocol = { path = "../livekit-protocol", version = "0.3.6" } +livekit-runtime = { workspace = true, default-features = false } +livekit-api = { workspace = true, default-features = false } +libwebrtc = { workspace = true } +livekit-protocol = { workspace = true } prost = "0.12" serde = { version = "1", features = ["derive"] } serde_json = "1.0" diff --git a/webrtc-sys/Cargo.toml b/webrtc-sys/Cargo.toml index 5b249ca33..7c5e9b173 100644 --- a/webrtc-sys/Cargo.toml +++ b/webrtc-sys/Cargo.toml @@ -12,7 +12,7 @@ cxx = "1.0" log = "0.4" [build-dependencies] -webrtc-sys-build = { version = "0.3.5", path = "./build" } +webrtc-sys-build = { workspace = true } cxx-build = "1.0" glob = "0.3" cc = "1.0" From 15a5a7f8708d4fb93c0bb5bd56b0cf3696409beb Mon Sep 17 00:00:00 2001 From: zesun96 Date: Fri, 22 Nov 2024 21:19:36 +0800 Subject: [PATCH 16/51] Fix carah error of get session stats request (#490) --- libwebrtc/src/stats.rs | 19 +++++++++++++++++++ livekit-ffi/protocol/stats.proto | 14 +++++++++++++- livekit-ffi/src/conversion/stats.rs | 13 +++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/libwebrtc/src/stats.rs b/libwebrtc/src/stats.rs index dae455e4a..23a64edc1 100644 --- a/libwebrtc/src/stats.rs +++ b/libwebrtc/src/stats.rs @@ -28,6 +28,7 @@ pub enum RtcStats { LocalCandidate(LocalCandidateStats), RemoteCandidate(RemoteCandidateStats), Certificate(CertificateStats), + Stream(StreamStats), Track, // Deprecated } @@ -272,6 +273,15 @@ pub struct CertificateStats { pub certificate: dictionaries::CertificateStats, } +#[derive(Debug, Default, Clone, Deserialize)] +pub struct StreamStats { + #[serde(flatten)] + pub rtc: dictionaries::RtcStats, + + #[serde(flatten)] + pub stream: dictionaries::StreamStats, +} + #[derive(Debug, Default, Clone, Deserialize)] pub struct TrackStats {} @@ -588,4 +598,13 @@ pub mod dictionaries { pub base64_certificate: String, pub issuer_certificate_id: String, } + + #[derive(Debug, Default, Clone, Deserialize)] + #[serde(rename_all = "camelCase")] + #[serde(default)] + pub struct StreamStats { + pub id: String, + pub stream_identifier: String, + // pub timestamp: i64, + } } diff --git a/livekit-ffi/protocol/stats.proto b/livekit-ffi/protocol/stats.proto index f4771f3e1..103981aed 100644 --- a/livekit-ffi/protocol/stats.proto +++ b/livekit-ffi/protocol/stats.proto @@ -170,6 +170,11 @@ message RtcStats { required CertificateStats certificate = 2; } + message Stream { + required RtcStatsData rtc = 1; + required StreamStats stream = 2; + } + message Track { // Deprecated } @@ -189,7 +194,8 @@ message RtcStats { LocalCandidate local_candidate = 14; RemoteCandidate remote_candidate = 15; Certificate certificate = 16; - Track track = 17; + Stream stream = 17; + Track track = 18; } } @@ -447,3 +453,9 @@ message CertificateStats { required string issuer_certificate_id = 4; } +message StreamStats { + required string id = 1; + required string stream_identifier = 2; + // required int64 timestamp = 3; +} + diff --git a/livekit-ffi/src/conversion/stats.rs b/livekit-ffi/src/conversion/stats.rs index 0ee214958..4b2d56e5b 100644 --- a/livekit-ffi/src/conversion/stats.rs +++ b/livekit-ffi/src/conversion/stats.rs @@ -164,6 +164,7 @@ impl From for proto::RtcStats { rtc::RtcStats::Certificate(certificate) => { proto::rtc_stats::Stats::Certificate(certificate.into()) } + rtc::RtcStats::Stream(stream) => proto::rtc_stats::Stats::Stream(stream.into()), rtc::RtcStats::Track {} => { proto::rtc_stats::Stats::Track(proto::rtc_stats::Track {}) } @@ -281,6 +282,12 @@ impl From for proto::rtc_stats::Certificate { } } +impl From for proto::rtc_stats::Stream { + fn from(value: rtc::StreamStats) -> Self { + Self { rtc: value.rtc.into(), stream: value.stream.into() } + } +} + // Dictionaries impl From for proto::RtcStatsData { @@ -289,6 +296,12 @@ impl From for proto::RtcStatsData { } } +impl From for proto::StreamStats { + fn from(value: rtc::dictionaries::StreamStats) -> Self { + Self { id: value.id, stream_identifier: value.stream_identifier } + } +} + impl From for proto::CodecStats { fn from(value: rtc::dictionaries::CodecStats) -> Self { Self { From 979d0c55c442b24c83850f64890056ea2baefcba Mon Sep 17 00:00:00 2001 From: zesun96 Date: Wed, 27 Nov 2024 00:27:36 +0800 Subject: [PATCH 17/51] add adaptive streaming; (#488) --- livekit-ffi/generate_proto.sh | 1 + livekit-ffi/protocol/ffi.proto | 8 ++++ livekit-ffi/protocol/track_publication.proto | 38 +++++++++++++++++ livekit-ffi/src/livekit.proto.rs | 42 ++++++++++++++++++- livekit-ffi/src/server/requests.rs | 40 ++++++++++++++++++ .../room/participant/remote_participant.rs | 27 +++++++++++- livekit/src/room/publication/remote.rs | 27 ++++++++++++ 7 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 livekit-ffi/protocol/track_publication.proto diff --git a/livekit-ffi/generate_proto.sh b/livekit-ffi/generate_proto.sh index b1d5e9d6a..029ccd3d9 100755 --- a/livekit-ffi/generate_proto.sh +++ b/livekit-ffi/generate_proto.sh @@ -24,6 +24,7 @@ protoc \ $PROTOCOL/handle.proto \ $PROTOCOL/room.proto \ $PROTOCOL/track.proto \ + $PROTOCOL/track_publication.proto \ $PROTOCOL/participant.proto \ $PROTOCOL/video_frame.proto \ $PROTOCOL/audio_frame.proto \ diff --git a/livekit-ffi/protocol/ffi.proto b/livekit-ffi/protocol/ffi.proto index e8c1fda4a..4ff6df53c 100644 --- a/livekit-ffi/protocol/ffi.proto +++ b/livekit-ffi/protocol/ffi.proto @@ -20,6 +20,7 @@ option csharp_namespace = "LiveKit.Proto"; // import "handle.proto"; import "e2ee.proto"; import "track.proto"; +import "track_publication.proto"; import "room.proto"; import "video_frame.proto"; import "audio_frame.proto"; @@ -106,6 +107,10 @@ message FfiRequest { RegisterRpcMethodRequest register_rpc_method = 39; UnregisterRpcMethodRequest unregister_rpc_method = 40; RpcMethodInvocationResponseRequest rpc_method_invocation_response = 41; + + // Track Publication + EnableRemoteTrackPublicationRequest enable_remote_track_publication = 42; + UpdateRemoteTrackPublicationDimensionRequest update_remote_track_publication_dimension = 43; } } @@ -160,6 +165,9 @@ message FfiResponse { RegisterRpcMethodResponse register_rpc_method = 38; UnregisterRpcMethodResponse unregister_rpc_method = 39; RpcMethodInvocationResponseResponse rpc_method_invocation_response = 40; + // Track Publication + EnableRemoteTrackPublicationResponse enable_remote_track_publication = 41; + UpdateRemoteTrackPublicationDimensionResponse update_remote_track_publication_dimension = 42; } } diff --git a/livekit-ffi/protocol/track_publication.proto b/livekit-ffi/protocol/track_publication.proto new file mode 100644 index 000000000..44f0b681f --- /dev/null +++ b/livekit-ffi/protocol/track_publication.proto @@ -0,0 +1,38 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto2"; + +package livekit.proto; +option csharp_namespace = "LiveKit.Proto"; + +// Enable/Disable a remote track publication +message EnableRemoteTrackPublicationRequest { + required uint64 track_publication_handle = 1; + required bool enabled = 2; +} + +message EnableRemoteTrackPublicationResponse {} + +// update a remote track publication dimension +message UpdateRemoteTrackPublicationDimensionRequest { + required uint64 track_publication_handle = 1; + required uint32 width = 2; + required uint32 height = 3; +} + +message UpdateRemoteTrackPublicationDimensionResponse {} + + + diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index 620588fcd..d5b75fede 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -1529,6 +1529,34 @@ impl StreamState { } } } +/// Enable/Disable a remote track publication +#[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, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EnableRemoteTrackPublicationResponse { +} +/// update a remote track publication dimension +#[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, + #[prost(uint32, required, tag="2")] + pub width: u32, + #[prost(uint32, required, tag="3")] + pub height: u32, +} +#[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 { @@ -3686,7 +3714,7 @@ pub struct RpcMethodInvocationEvent { #[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")] + #[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")] pub message: ::core::option::Option, } /// Nested message and enum types in `FfiRequest`. @@ -3779,13 +3807,18 @@ pub mod ffi_request { UnregisterRpcMethod(super::UnregisterRpcMethodRequest), #[prost(message, tag="41")] RpcMethodInvocationResponse(super::RpcMethodInvocationResponseRequest), + /// Track Publication + #[prost(message, tag="42")] + EnableRemoteTrackPublication(super::EnableRemoteTrackPublicationRequest), + #[prost(message, tag="43")] + UpdateRemoteTrackPublicationDimension(super::UpdateRemoteTrackPublicationDimensionRequest), } } /// 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")] + #[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")] pub message: ::core::option::Option, } /// Nested message and enum types in `FfiResponse`. @@ -3876,6 +3909,11 @@ pub mod ffi_response { UnregisterRpcMethod(super::UnregisterRpcMethodResponse), #[prost(message, tag="40")] RpcMethodInvocationResponse(super::RpcMethodInvocationResponseResponse), + /// Track Publication + #[prost(message, tag="41")] + EnableRemoteTrackPublication(super::EnableRemoteTrackPublicationResponse), + #[prost(message, tag="42")] + UpdateRemoteTrackPublicationDimension(super::UpdateRemoteTrackPublicationDimensionResponse), } } /// To minimize complexity, participant events are not included in the protocol. diff --git a/livekit-ffi/src/server/requests.rs b/livekit-ffi/src/server/requests.rs index 5c4aa32fc..f14ab0d75 100644 --- a/livekit-ffi/src/server/requests.rs +++ b/livekit-ffi/src/server/requests.rs @@ -152,6 +152,36 @@ fn on_set_subscribed( Ok(proto::SetSubscribedResponse {}) } +fn on_enable_remote_track_publication( + server: &'static FfiServer, + request: proto::EnableRemoteTrackPublicationRequest, +) -> FfiResult { + let ffi_publication = + server.retrieve_handle::(request.track_publication_handle)?; + + let TrackPublication::Remote(publication) = &ffi_publication.publication else { + return Err(FfiError::InvalidRequest("publication is not a RemotePublication".into())); + }; + + publication.set_enabled(request.enabled); + Ok(proto::EnableRemoteTrackPublicationResponse {}) +} + +fn on_update_remote_track_publication_dimension( + server: &'static FfiServer, + request: proto::UpdateRemoteTrackPublicationDimensionRequest, +) -> FfiResult { + let ffi_publication = + server.retrieve_handle::(request.track_publication_handle)?; + + let TrackPublication::Remote(publication) = &ffi_publication.publication else { + return Err(FfiError::InvalidRequest("publication is not a RemotePublication".into())); + }; + let dimension = TrackDimension(request.width, request.height); + publication.update_video_dimensions(dimension); + Ok(proto::UpdateRemoteTrackPublicationDimensionResponse {}) +} + fn on_set_local_metadata( server: &'static FfiServer, set_local_metadata: proto::SetLocalMetadataRequest, @@ -995,6 +1025,16 @@ pub fn handle_request( on_rpc_method_invocation_response(server, request)?, ) } + proto::ffi_request::Message::EnableRemoteTrackPublication(request) => { + proto::ffi_response::Message::EnableRemoteTrackPublication( + on_enable_remote_track_publication(server, request)?, + ) + } + proto::ffi_request::Message::UpdateRemoteTrackPublicationDimension(request) => { + proto::ffi_response::Message::UpdateRemoteTrackPublicationDimension( + on_update_remote_track_publication_dimension(server, request)?, + ) + } }); Ok(res) diff --git a/livekit/src/room/participant/remote_participant.rs b/livekit/src/room/participant/remote_participant.rs index 7ca6e6bd5..e9e61ea07 100644 --- a/livekit/src/room/participant/remote_participant.rs +++ b/livekit/src/room/participant/remote_participant.rs @@ -384,7 +384,32 @@ impl RemoteParticipant { .await }); } - }) + }); + + publication.on_video_dimensions_changed({ + let rtc_engine = self.inner.rtc_engine.clone(); + move |publication, dimension| { + let rtc_engine = rtc_engine.clone(); + livekit_runtime::spawn(async move { + let tsid: String = publication.sid().into(); + let TrackDimension(width, height) = dimension; + let enabled = publication.is_enabled(); + let update_track_settings = proto::UpdateTrackSettings { + track_sids: vec![tsid.clone()], + disabled: !enabled, + width, + height, + ..Default::default() + }; + + rtc_engine + .send_request(proto::signal_request::Message::TrackSetting( + update_track_settings, + )) + .await + }); + } + }); } pub(crate) fn remove_publication(&self, sid: &TrackSid) -> Option { diff --git a/livekit/src/room/publication/remote.rs b/livekit/src/room/publication/remote.rs index dff2d6705..fe86ebf1f 100644 --- a/livekit/src/room/publication/remote.rs +++ b/livekit/src/room/publication/remote.rs @@ -28,6 +28,7 @@ type PermissionStatusChangedHandler = Box; // old_status, new_status type SubscriptionUpdateNeededHandler = Box; type EnabledStatusChangedHandler = Box; +type VideoDimensionsChangedHandler = Box; #[derive(Default)] struct RemoteEvents { @@ -37,6 +38,7 @@ struct RemoteEvents { permission_status_changed: Mutex>, subscription_update_needed: Mutex>, enabled_status_changed: Mutex>, + video_dimensions_changed: Mutex>, } #[derive(Debug)] @@ -215,6 +217,13 @@ impl RemoteTrackPublication { *self.remote.events.enabled_status_changed.lock() = Some(Box::new(f)); } + pub(crate) fn on_video_dimensions_changed( + &self, + f: impl Fn(RemoteTrackPublication, TrackDimension) + Send + 'static, + ) { + *self.remote.events.video_dimensions_changed.lock() = Some(Box::new(f)); + } + pub fn set_subscribed(&self, subscribed: bool) { let old_subscription_state = self.subscription_status(); let old_permission_state = self.permission_status(); @@ -262,6 +271,24 @@ impl RemoteTrackPublication { } } + pub fn update_video_dimensions(&self, dimension: TrackDimension) { + if self.is_subscribed() { + if dimension != self.dimension() { + let TrackDimension(width, height) = dimension; + let mut new_info = self.proto_info(); + new_info.width = width; + new_info.height = height; + self.update_info(new_info); + } + // Request to send an update to the SFU + if let Some(video_dimensions_changed) = + self.remote.events.video_dimensions_changed.lock().as_ref() + { + video_dimensions_changed(self.clone(), dimension) + } + } + } + pub fn subscription_status(&self) -> SubscriptionStatus { if !self.remote.info.read().subscribed { return SubscriptionStatus::Unsubscribed; From 21bdee20612ce2cbb1f0902881447d25f9a6dcda Mon Sep 17 00:00:00 2001 From: Iason Paraskevopoulos Date: Tue, 26 Nov 2024 16:37:42 +0000 Subject: [PATCH 18/51] Fix enconding presets (#464) --- livekit/src/room/options.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/livekit/src/room/options.rs b/livekit/src/room/options.rs index 76577e14c..e17ac2145 100644 --- a/livekit/src/room/options.rs +++ b/livekit/src/room/options.rs @@ -179,7 +179,7 @@ pub fn compute_appropriate_encoding( for preset in presets { encoding = preset.encoding.clone(); - if preset.width >= size { + if preset.width > size { break; } } @@ -257,6 +257,7 @@ pub fn into_rtp_encodings( }) } + encodings.reverse(); encodings } From 0d92f49a4583d064b4957ac89feebb99d1b2ee54 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Sat, 30 Nov 2024 00:00:56 -0700 Subject: [PATCH 19/51] Add license to `soxr-sys/Cargo.toml` (#498) Motivation for this is a bit of a corner case: * Including a local checkout of livekit rust-sdks as a package * Installing Zed from source. This requires licenses specified by all packages. --- soxr-sys/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/soxr-sys/Cargo.toml b/soxr-sys/Cargo.toml index 6661f1e24..fde7a4c42 100644 --- a/soxr-sys/Cargo.toml +++ b/soxr-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "soxr-sys" version = "0.1.0" authors = ["Theo Monnom Date: Sat, 30 Nov 2024 00:01:40 -0700 Subject: [PATCH 20/51] Add libwebrtc/README.md explaining how to build and use it (#499) --- webrtc-sys/libwebrtc/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 webrtc-sys/libwebrtc/README.md diff --git a/webrtc-sys/libwebrtc/README.md b/webrtc-sys/libwebrtc/README.md new file mode 100644 index 000000000..222db6317 --- /dev/null +++ b/webrtc-sys/libwebrtc/README.md @@ -0,0 +1,28 @@ +This directory can contain a checkout of WebRTC. The build scripts +here will install dependencies, checkout the version that LiveKit +currently uses, apply some patches to it, and build it. For example to +do a Linux debug build on x64: + +```sh +$ ./build-linux.sh --arch x64 --profile release +``` + +After running this, `linux-x64-debug/lib/libwebrtc.a` should +exist. This can be rerun to rebuild it, but will complain about +patches not applying as they have already been applied. + +If something goes wrong it may be helpful to consult the [WebRTC native +development documentation](https://webrtc.googlesource.com/src/+/main/docs/native-code/development/). + +# Building LiveKit Rust SDK with custom WebRTC checkout + +Add the following environment variable to `/.config/config.toml`, to +specify use of a custom WebRTC build: + +```toml +[env] +LK_CUSTOM_WEBRTC = { value = "webrtc-sys/libwebrtc/linux-x64-release", relative = true } +``` + +Note that `linux-x64-debug` should be replaced with the artifact +directory appropriate for your configuration. From 154555bfb9c6aee6f4e5c57874826bb1d5b23a04 Mon Sep 17 00:00:00 2001 From: zesun96 Date: Sat, 30 Nov 2024 20:08:29 +0800 Subject: [PATCH 21/51] add livekit-ffi generate proto script in windows (#494) --- livekit-ffi/generate_proto_win.bat | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 livekit-ffi/generate_proto_win.bat diff --git a/livekit-ffi/generate_proto_win.bat b/livekit-ffi/generate_proto_win.bat new file mode 100644 index 000000000..303cf3056 --- /dev/null +++ b/livekit-ffi/generate_proto_win.bat @@ -0,0 +1,33 @@ +@echo off + +rem Copyright 2023 LiveKit, Inc. +rem +rem Licensed under the Apache License, Version 2.0 (the "License"); +rem you may not use this file except in compliance with the License. +rem You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +set PROTOCOL=protocol +set OUT_RUST=src + +protoc.exe ^ + -I=%PROTOCOL% ^ + --prost_out=%OUT_RUST% ^ + %PROTOCOL%/ffi.proto ^ + %PROTOCOL%/handle.proto ^ + %PROTOCOL%/room.proto ^ + %PROTOCOL%/track.proto ^ + %PROTOCOL%/track_publication.proto ^ + %PROTOCOL%/participant.proto ^ + %PROTOCOL%/video_frame.proto ^ + %PROTOCOL%/audio_frame.proto ^ + %PROTOCOL%/e2ee.proto ^ + %PROTOCOL%/stats.proto ^ + %PROTOCOL%/rpc.proto From 9d68b19c90363e5a75c3b11a4ee07f7f7a5afaa8 Mon Sep 17 00:00:00 2001 From: tommady Date: Sat, 30 Nov 2024 20:09:16 +0800 Subject: [PATCH 22/51] fix: Doc.rs Build Fails For livekit-api = 0.4.1 (#495) --- .github/workflows/tests.yml | 6 +- Cargo.lock | 2 +- Cargo.toml | 3 +- livekit-ffi/Cargo.toml | 2 +- livekit-ffi/build.rs | 36 +- livekit-ffi/src/livekit.proto.rs | 832 +++++++++++-------------------- livekit-runtime/Cargo.toml | 1 + 7 files changed, 326 insertions(+), 556 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e0f696ef5..2b159c66f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,8 +43,8 @@ jobs: steps: - name: Install Rust toolchain run: | - rustup update --no-self-update stable - rustup target add ${{ matrix.target }} + rustup update --no-self-update nightly + rustup target add ${{ matrix.target }} --toolchain nightly - name: Install linux dependencies if: ${{ matrix.os == 'ubuntu-20.04' }} @@ -57,6 +57,6 @@ jobs: submodules: true - name: Test - run: cargo test --release --verbose --target ${{ matrix.target }} -- --nocapture + run: cargo +nightly test --release --verbose --target ${{ matrix.target }} -- --nocapture diff --git a/Cargo.lock b/Cargo.lock index f56302207..d907dc782 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1642,7 +1642,7 @@ dependencies = [ [[package]] name = "livekit-ffi" -version = "0.12.2" +version = "0.12.3" dependencies = [ "console-subscriber", "dashmap", diff --git a/Cargo.toml b/Cargo.toml index 42a408a4b..52650e01e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "livekit", "livekit-api", @@ -14,7 +15,7 @@ members = [ [workspace.dependencies] libwebrtc = { version = "0.3.7", path = "libwebrtc" } livekit-api = { version = "0.4.1", path = "livekit-api" } -livekit-ffi = { version = "0.12.2", path = "livekit-ffi" } +livekit-ffi = { version = "0.12.3", path = "livekit-ffi" } livekit-protocol = { version = "0.3.6", path = "livekit-protocol" } livekit-runtime = { version = "0.3.1", path = "livekit-runtime" } livekit = { version = "0.7.0", path = "livekit" } diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index 8ec2ea3c1..01d743237 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -39,7 +39,7 @@ imgproc = "0.3.11" jni = "0.21.1" [build-dependencies] -webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.2" } +webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.5" } [dev-dependencies] livekit-api = { path = "../livekit-api", version = "0.4.1" } diff --git a/livekit-ffi/build.rs b/livekit-ffi/build.rs index 92af1ff61..28afe0d05 100644 --- a/livekit-ffi/build.rs +++ b/livekit-ffi/build.rs @@ -19,20 +19,34 @@ fn main() { return; } - webrtc_sys_build::download_webrtc().unwrap(); - if env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" { - webrtc_sys_build::configure_jni_symbols().unwrap(); + let webrtc_dir = webrtc_sys_build::webrtc_dir(); + if !webrtc_dir.exists() { + webrtc_sys_build::download_webrtc().unwrap(); } - { - // Copy the webrtc license to CARGO_MANIFEST_DIR - // (used by the ffi release action) - let webrtc_dir = webrtc_sys_build::webrtc_dir(); - let license = webrtc_dir.join("LICENSE.md"); - let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); + match target_os.as_str() { + "windows" => {} + "linux" => { + // Link webrtc library + println!("cargo:rustc-link-lib=static=webrtc"); + } + "android" => { + webrtc_sys_build::configure_jni_symbols().unwrap(); + // Copy the webrtc license to CARGO_MANIFEST_DIR + // (used by the ffi release action) + let license = webrtc_dir.join("LICENSE.md"); + let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md"); + let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md"); - std::fs::copy(license, out_file).unwrap(); + std::fs::copy(license, out_file).unwrap(); + } + "macos" => { + println!("cargo:rustc-link-arg=-ObjC"); + } + _ => { + panic!("Unsupported target, {}", target_os); + } } } diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index d5b75fede..077dc4aeb 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -1,6 +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")] @@ -12,7 +11,6 @@ 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 @@ -26,7 +24,6 @@ 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")] @@ -34,27 +31,22 @@ pub struct E2eeOptions { #[prost(message, required, tag="2")] pub key_provider_options: KeyProviderOptions, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct E2eeManagerSetEnabledRequest { #[prost(bool, required, tag="1")] pub enabled: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct E2eeManagerSetEnabledResponse { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -64,11 +56,9 @@ pub struct FrameCryptorSetEnabledRequest { #[prost(bool, required, tag="3")] pub enabled: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -78,11 +68,9 @@ pub struct FrameCryptorSetKeyIndexRequest { #[prost(int32, required, tag="3")] pub key_index: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -90,35 +78,29 @@ pub struct SetSharedKeyRequest { #[prost(int32, required, tag="2")] pub key_index: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SetSharedKeyResponse { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -128,11 +110,9 @@ pub struct SetKeyRequest { #[prost(int32, required, tag="3")] pub key_index: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -140,13 +120,11 @@ 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")] @@ -154,13 +132,11 @@ 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")] @@ -170,8 +146,7 @@ pub struct E2eeRequest { } /// Nested message and enum types in `E2eeRequest`. pub mod e2ee_request { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] ManagerSetEnabled(super::E2eeManagerSetEnabledRequest), @@ -195,7 +170,6 @@ 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")] @@ -203,8 +177,7 @@ pub struct E2eeResponse { } /// Nested message and enum types in `E2eeResponse`. pub mod e2ee_response { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] ManagerSetEnabled(super::E2eeManagerSetEnabledResponse), @@ -244,9 +217,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 { - EncryptionType::None => "NONE", - EncryptionType::Gcm => "GCM", - EncryptionType::Custom => "CUSTOM", + Self::None => "NONE", + Self::Gcm => "GCM", + Self::Custom => "CUSTOM", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -277,13 +250,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -309,30 +282,26 @@ 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") -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] + #[prost(oneof="rtc_stats::Stats", tags="3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18")] pub stats: ::core::option::Option, } /// Nested message and enum types in `RtcStats`. pub mod rtc_stats { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct InboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -343,8 +312,7 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub inbound: super::InboundRtpStreamStats, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -355,8 +323,7 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub outbound: super::OutboundRtpStreamStats, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteInboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -367,8 +334,7 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub remote_inbound: super::RemoteInboundRtpStreamStats, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoteOutboundRtp { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -379,8 +345,7 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub remote_outbound: super::RemoteOutboundRtpStreamStats, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct MediaSource { #[prost(message, required, tag="1")] pub rtc: super::RtcStatsData, @@ -391,77 +356,74 @@ pub mod rtc_stats { #[prost(message, required, tag="4")] pub video: super::VideoSourceStats, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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)] + pub struct Stream { + #[prost(message, required, tag="1")] + pub rtc: super::RtcStatsData, + #[prost(message, required, tag="2")] + pub stream: super::StreamStats, + } /// Deprecated - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Track { } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Stats { #[prost(message, tag="3")] Codec(Codec), @@ -492,10 +454,11 @@ pub mod rtc_stats { #[prost(message, tag="16")] Certificate(Certificate), #[prost(message, tag="17")] + Stream(Stream), + #[prost(message, tag="18")] Track(Track), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RtcStatsData { #[prost(string, required, tag="1")] @@ -503,7 +466,6 @@ 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")] @@ -519,7 +481,6 @@ 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")] @@ -531,8 +492,7 @@ pub struct RtpStreamStats { #[prost(string, required, tag="4")] pub codec_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ReceivedRtpStreamStats { #[prost(uint64, required, tag="1")] pub packets_received: u64, @@ -541,7 +501,6 @@ 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")] @@ -651,15 +610,13 @@ pub struct InboundRtpStreamStats { #[prost(uint32, required, tag="53")] pub fec_ssrc: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -723,7 +680,6 @@ 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")] @@ -737,7 +693,6 @@ 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")] @@ -753,7 +708,6 @@ 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")] @@ -761,8 +715,7 @@ pub struct MediaSourceStats { #[prost(string, required, tag="2")] pub kind: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioSourceStats { #[prost(double, required, tag="1")] pub audio_level: f64, @@ -783,8 +736,7 @@ pub struct AudioSourceStats { #[prost(uint64, required, tag="9")] pub total_samples_captured: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoSourceStats { #[prost(uint32, required, tag="1")] pub width: u32, @@ -795,7 +747,6 @@ 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")] @@ -811,15 +762,13 @@ pub struct AudioPlayoutStats { #[prost(uint64, required, tag="6")] pub total_samples_count: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -839,7 +788,6 @@ 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")] @@ -875,7 +823,6 @@ 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")] @@ -923,7 +870,6 @@ 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")] @@ -953,7 +899,6 @@ 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")] @@ -965,6 +910,14 @@ pub struct CertificateStats { #[prost(string, required, tag="4")] pub issuer_certificate_id: ::prost::alloc::string::String, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamStats { + #[prost(string, required, tag="1")] + pub id: ::prost::alloc::string::String, + /// required int64 timestamp = 3; + #[prost(string, required, tag="2")] + pub stream_identifier: ::prost::alloc::string::String, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum DataChannelState { @@ -980,10 +933,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 { - DataChannelState::DcConnecting => "DC_CONNECTING", - DataChannelState::DcOpen => "DC_OPEN", - DataChannelState::DcClosing => "DC_CLOSING", - DataChannelState::DcClosed => "DC_CLOSED", + Self::DcConnecting => "DC_CONNECTING", + Self::DcOpen => "DC_OPEN", + Self::DcClosing => "DC_CLOSING", + Self::DcClosed => "DC_CLOSED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1012,10 +965,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 { - QualityLimitationReason::LimitationNone => "LIMITATION_NONE", - QualityLimitationReason::LimitationCpu => "LIMITATION_CPU", - QualityLimitationReason::LimitationBandwidth => "LIMITATION_BANDWIDTH", - QualityLimitationReason::LimitationOther => "LIMITATION_OTHER", + Self::LimitationNone => "LIMITATION_NONE", + Self::LimitationCpu => "LIMITATION_CPU", + Self::LimitationBandwidth => "LIMITATION_BANDWIDTH", + Self::LimitationOther => "LIMITATION_OTHER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1043,9 +996,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 { - IceRole::IceUnknown => "ICE_UNKNOWN", - IceRole::IceControlling => "ICE_CONTROLLING", - IceRole::IceControlled => "ICE_CONTROLLED", + Self::IceUnknown => "ICE_UNKNOWN", + Self::IceControlling => "ICE_CONTROLLING", + Self::IceControlled => "ICE_CONTROLLED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1074,11 +1027,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1111,13 +1064,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1148,9 +1101,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 { - DtlsRole::DtlsClient => "DTLS_CLIENT", - DtlsRole::DtlsServer => "DTLS_SERVER", - DtlsRole::DtlsUnknown => "DTLS_UNKNOWN", + Self::DtlsClient => "DTLS_CLIENT", + Self::DtlsServer => "DTLS_SERVER", + Self::DtlsUnknown => "DTLS_UNKNOWN", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1179,11 +1132,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 { - IceCandidatePairState::PairFrozen => "PAIR_FROZEN", - IceCandidatePairState::PairWaiting => "PAIR_WAITING", - IceCandidatePairState::PairInProgress => "PAIR_IN_PROGRESS", - IceCandidatePairState::PairFailed => "PAIR_FAILED", - IceCandidatePairState::PairSucceeded => "PAIR_SUCCEEDED", + Self::PairFrozen => "PAIR_FROZEN", + Self::PairWaiting => "PAIR_WAITING", + Self::PairInProgress => "PAIR_IN_PROGRESS", + Self::PairFailed => "PAIR_FAILED", + Self::PairSucceeded => "PAIR_SUCCEEDED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1213,10 +1166,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 { - IceCandidateType::Host => "HOST", - IceCandidateType::Srflx => "SRFLX", - IceCandidateType::Prflx => "PRFLX", - IceCandidateType::Relay => "RELAY", + Self::Host => "HOST", + Self::Srflx => "SRFLX", + Self::Prflx => "PRFLX", + Self::Relay => "RELAY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1244,9 +1197,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 { - IceServerTransportProtocol::TransportUdp => "TRANSPORT_UDP", - IceServerTransportProtocol::TransportTcp => "TRANSPORT_TCP", - IceServerTransportProtocol::TransportTls => "TRANSPORT_TLS", + Self::TransportUdp => "TRANSPORT_UDP", + Self::TransportTcp => "TRANSPORT_TCP", + Self::TransportTls => "TRANSPORT_TLS", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1273,9 +1226,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 { - IceTcpCandidateType::CandidateActive => "CANDIDATE_ACTIVE", - IceTcpCandidateType::CandidatePassive => "CANDIDATE_PASSIVE", - IceTcpCandidateType::CandidateSo => "CANDIDATE_SO", + Self::CandidateActive => "CANDIDATE_ACTIVE", + Self::CandidatePassive => "CANDIDATE_PASSIVE", + Self::CandidateSo => "CANDIDATE_SO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1289,7 +1242,6 @@ 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")] @@ -1297,14 +1249,12 @@ 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")] @@ -1312,25 +1262,21 @@ 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, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GetStatsRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1344,11 +1290,9 @@ pub struct GetStatsCallback { // Track // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1374,7 +1318,6 @@ 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")] @@ -1382,7 +1325,6 @@ 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")] @@ -1398,7 +1340,6 @@ 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")] @@ -1407,31 +1348,27 @@ pub struct OwnedTrack { pub info: TrackInfo, } /// Mute/UnMute a track -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LocalTrackMuteRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, #[prost(bool, required, tag="2")] pub mute: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LocalTrackMuteResponse { #[prost(bool, required, tag="1")] pub muted: bool, } /// Enable/Disable a remote track -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, #[prost(bool, required, tag="2")] pub enabled: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackResponse { #[prost(bool, required, tag="1")] pub enabled: bool, @@ -1450,9 +1387,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 { - TrackKind::KindUnknown => "KIND_UNKNOWN", - TrackKind::KindAudio => "KIND_AUDIO", - TrackKind::KindVideo => "KIND_VIDEO", + Self::KindUnknown => "KIND_UNKNOWN", + Self::KindAudio => "KIND_AUDIO", + Self::KindVideo => "KIND_VIDEO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1481,11 +1418,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 { - TrackSource::SourceUnknown => "SOURCE_UNKNOWN", - TrackSource::SourceCamera => "SOURCE_CAMERA", - TrackSource::SourceMicrophone => "SOURCE_MICROPHONE", - TrackSource::SourceScreenshare => "SOURCE_SCREENSHARE", - TrackSource::SourceScreenshareAudio => "SOURCE_SCREENSHARE_AUDIO", + Self::SourceUnknown => "SOURCE_UNKNOWN", + Self::SourceCamera => "SOURCE_CAMERA", + Self::SourceMicrophone => "SOURCE_MICROPHONE", + Self::SourceScreenshare => "SOURCE_SCREENSHARE", + Self::SourceScreenshareAudio => "SOURCE_SCREENSHARE_AUDIO", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1514,9 +1451,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 { - StreamState::StateUnknown => "STATE_UNKNOWN", - StreamState::StateActive => "STATE_ACTIVE", - StreamState::StatePaused => "STATE_PAUSED", + Self::StateUnknown => "STATE_UNKNOWN", + Self::StateActive => "STATE_ACTIVE", + Self::StatePaused => "STATE_PAUSED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1530,21 +1467,18 @@ impl StreamState { } } /// Enable/Disable a remote track publication -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackPublicationRequest { #[prost(uint64, required, tag="1")] pub track_publication_handle: u64, #[prost(bool, required, tag="2")] pub enabled: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableRemoteTrackPublicationResponse { } /// update a remote track publication dimension -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateRemoteTrackPublicationDimensionRequest { #[prost(uint64, required, tag="1")] pub track_publication_handle: u64, @@ -1553,11 +1487,9 @@ pub struct UpdateRemoteTrackPublicationDimensionRequest { #[prost(uint32, required, tag="3")] pub height: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1573,7 +1505,6 @@ pub struct ParticipantInfo { #[prost(enumeration="ParticipantKind", required, tag="6")] pub kind: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OwnedParticipant { #[prost(message, required, tag="1")] @@ -1597,11 +1528,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1618,8 +1549,7 @@ impl ParticipantKind { } /// Create a new VideoStream /// VideoStream is used to receive video frames from a track -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewVideoStreamRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, @@ -1632,15 +1562,13 @@ pub struct NewVideoStreamRequest { #[prost(bool, optional, tag="4")] pub normalize_stride: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewVideoStreamResponse { #[prost(message, required, tag="1")] pub stream: OwnedVideoStream, } /// Request a video stream from a participant -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoStreamFromParticipantRequest { #[prost(uint64, required, tag="1")] pub participant_handle: u64, @@ -1653,16 +1581,14 @@ pub struct VideoStreamFromParticipantRequest { #[prost(bool, optional, tag="5")] pub normalize_stride: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewVideoSourceRequest { #[prost(enumeration="VideoSourceType", required, tag="1")] pub r#type: i32, @@ -1671,14 +1597,12 @@ pub struct NewVideoSourceRequest { #[prost(message, required, tag="2")] pub resolution: VideoSourceResolution, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1691,11 +1615,9 @@ pub struct CaptureVideoFrameRequest { #[prost(enumeration="VideoRotation", required, tag="4")] pub rotation: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1705,7 +1627,6 @@ 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")] @@ -1713,8 +1634,7 @@ pub struct VideoConvertResponse { } /// Nested message and enum types in `VideoConvertResponse`. pub mod video_convert_response { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="1")] Error(::prost::alloc::string::String), @@ -1726,8 +1646,7 @@ pub mod video_convert_response { // VideoFrame buffers // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoResolution { #[prost(uint32, required, tag="1")] pub width: u32, @@ -1736,7 +1655,6 @@ 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")] @@ -1755,8 +1673,7 @@ pub struct VideoBufferInfo { } /// Nested message and enum types in `VideoBufferInfo`. pub mod video_buffer_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ComponentInfo { #[prost(uint64, required, tag="1")] pub data_ptr: u64, @@ -1766,7 +1683,6 @@ 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")] @@ -1774,21 +1690,18 @@ pub struct OwnedVideoBuffer { #[prost(message, required, tag="2")] pub info: VideoBufferInfo, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoStreamInfo { #[prost(enumeration="VideoStreamType", required, tag="1")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -1798,8 +1711,7 @@ pub struct VideoStreamEvent { } /// Nested message and enum types in `VideoStreamEvent`. pub mod video_stream_event { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] FrameReceived(super::VideoFrameReceived), @@ -1807,7 +1719,6 @@ 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")] @@ -1818,30 +1729,26 @@ pub struct VideoFrameReceived { #[prost(enumeration="VideoRotation", required, tag="3")] pub rotation: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoStreamEos { } // // VideoSource // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoSourceResolution { #[prost(uint32, required, tag="1")] pub width: u32, #[prost(uint32, required, tag="2")] pub height: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoSourceInfo { #[prost(enumeration="VideoSourceType", required, tag="1")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedVideoSource { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -1863,10 +1770,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 { - VideoCodec::Vp8 => "VP8", - VideoCodec::H264 => "H264", - VideoCodec::Av1 => "AV1", - VideoCodec::Vp9 => "VP9", + Self::Vp8 => "VP8", + Self::H264 => "H264", + Self::Av1 => "AV1", + Self::Vp9 => "VP9", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1895,10 +1802,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 { - VideoRotation::VideoRotation0 => "VIDEO_ROTATION_0", - VideoRotation::VideoRotation90 => "VIDEO_ROTATION_90", - VideoRotation::VideoRotation180 => "VIDEO_ROTATION_180", - VideoRotation::VideoRotation270 => "VIDEO_ROTATION_270", + Self::VideoRotation0 => "VIDEO_ROTATION_0", + Self::VideoRotation90 => "VIDEO_ROTATION_90", + Self::VideoRotation180 => "VIDEO_ROTATION_180", + Self::VideoRotation270 => "VIDEO_ROTATION_270", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1934,17 +1841,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1983,9 +1890,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 { - VideoStreamType::VideoStreamNative => "VIDEO_STREAM_NATIVE", - VideoStreamType::VideoStreamWebgl => "VIDEO_STREAM_WEBGL", - VideoStreamType::VideoStreamHtml => "VIDEO_STREAM_HTML", + Self::VideoStreamNative => "VIDEO_STREAM_NATIVE", + Self::VideoStreamWebgl => "VIDEO_STREAM_WEBGL", + Self::VideoStreamHtml => "VIDEO_STREAM_HTML", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2010,7 +1917,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 { - VideoSourceType::VideoSourceNative => "VIDEO_SOURCE_NATIVE", + Self::VideoSourceNative => "VIDEO_SOURCE_NATIVE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2022,7 +1929,6 @@ 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")] @@ -2032,13 +1938,11 @@ pub struct ConnectRequest { #[prost(message, required, tag="3")] pub options: RoomOptions, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2048,8 +1952,7 @@ pub struct ConnectCallback { } /// Nested message and enum types in `ConnectCallback`. pub mod connect_callback { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantWithTracks { #[prost(message, required, tag="1")] pub participant: super::OwnedParticipant, @@ -2058,8 +1961,7 @@ pub mod connect_callback { #[prost(message, repeated, tag="2")] pub publications: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(message, required, tag="1")] pub room: super::OwnedRoom, @@ -2068,8 +1970,7 @@ pub mod connect_callback { #[prost(message, repeated, tag="3")] pub participants: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2078,26 +1979,22 @@ pub mod connect_callback { } } /// Disconnect from the a room -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisconnectRequest { #[prost(uint64, required, tag="1")] pub room_handle: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisconnectResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2107,13 +2004,11 @@ pub struct PublishTrackRequest { #[prost(message, required, tag="3")] pub options: TrackPublishOptions, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2123,8 +2018,7 @@ pub struct PublishTrackCallback { } /// Nested message and enum types in `PublishTrackCallback`. pub mod publish_track_callback { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2133,7 +2027,6 @@ 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")] @@ -2143,13 +2036,11 @@ pub struct UnpublishTrackRequest { #[prost(bool, required, tag="3")] pub stop_on_unpublish: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2158,7 +2049,6 @@ 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")] @@ -2177,13 +2067,11 @@ pub struct PublishDataRequest { #[prost(string, repeated, tag="7")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2192,7 +2080,6 @@ 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")] @@ -2204,13 +2091,11 @@ pub struct PublishTranscriptionRequest { #[prost(message, repeated, tag="4")] pub segments: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2219,7 +2104,6 @@ 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")] @@ -2231,13 +2115,11 @@ pub struct PublishSipDtmfRequest { #[prost(string, repeated, tag="4")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2246,7 +2128,6 @@ 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")] @@ -2254,13 +2135,11 @@ pub struct SetLocalMetadataRequest { #[prost(string, required, tag="2")] pub metadata: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2268,7 +2147,6 @@ 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")] @@ -2280,7 +2158,6 @@ 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")] @@ -2294,13 +2171,11 @@ pub struct EditChatMessageRequest { #[prost(string, optional, tag="5")] pub sender_identity: ::core::option::Option<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2310,8 +2185,7 @@ pub struct SendChatMessageCallback { } /// Nested message and enum types in `SendChatMessageCallback`. pub mod send_chat_message_callback { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2320,7 +2194,6 @@ 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")] @@ -2328,7 +2201,6 @@ 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")] @@ -2336,13 +2208,11 @@ pub struct AttributesEntry { #[prost(string, required, tag="2")] pub value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2351,7 +2221,6 @@ 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")] @@ -2359,13 +2228,11 @@ pub struct SetLocalNameRequest { #[prost(string, required, tag="2")] pub name: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2374,31 +2241,26 @@ pub struct SetLocalNameCallback { pub error: ::core::option::Option<::prost::alloc::string::String>, } /// Change the "desire" to subs2ribe to a track -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SetSubscribedRequest { #[prost(bool, required, tag="1")] pub subscribe: bool, #[prost(uint64, required, tag="2")] pub publication_handle: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SetSubscribedResponse { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GetSessionStatsRequest { #[prost(uint64, required, tag="1")] pub room_handle: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2408,16 +2270,14 @@ pub struct GetSessionStatsCallback { } /// Nested message and enum types in `GetSessionStatsCallback`. pub mod get_session_stats_callback { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] + #[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, } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(string, tag="2")] Error(::prost::alloc::string::String), @@ -2429,21 +2289,18 @@ pub mod get_session_stats_callback { // Options // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct VideoEncoding { #[prost(uint64, required, tag="1")] pub max_bitrate: u64, #[prost(double, required, tag="2")] pub max_framerate: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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 @@ -2464,7 +2321,6 @@ 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")] @@ -2474,7 +2330,6 @@ 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")] @@ -2485,7 +2340,6 @@ 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")] @@ -2502,7 +2356,6 @@ 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")] @@ -2518,23 +2371,20 @@ pub struct TranscriptionSegment { #[prost(string, required, tag="6")] pub language: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BufferInfo { #[prost(uint64, required, tag="1")] pub data_ptr: u64, #[prost(uint64, required, tag="2")] pub data_len: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -2544,8 +2394,7 @@ pub struct RoomEvent { } /// Nested message and enum types in `RoomEvent`. pub mod room_event { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] ParticipantConnected(super::ParticipantConnected), @@ -2607,7 +2456,6 @@ 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")] @@ -2617,7 +2465,6 @@ 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")] @@ -2625,19 +2472,16 @@ 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 @@ -2645,19 +2489,16 @@ 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")] @@ -2665,7 +2506,6 @@ 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")] @@ -2675,7 +2515,6 @@ 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")] @@ -2683,7 +2522,6 @@ 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 @@ -2692,7 +2530,6 @@ 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")] @@ -2702,7 +2539,6 @@ 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")] @@ -2710,7 +2546,6 @@ 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")] @@ -2718,7 +2553,6 @@ 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 @@ -2727,25 +2561,21 @@ 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")] @@ -2753,7 +2583,6 @@ 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")] @@ -2763,7 +2592,6 @@ 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")] @@ -2771,7 +2599,6 @@ 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")] @@ -2779,7 +2606,6 @@ 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")] @@ -2787,7 +2613,6 @@ 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")] @@ -2803,7 +2628,6 @@ 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")] @@ -2811,7 +2635,6 @@ 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")] @@ -2819,7 +2642,6 @@ 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")] @@ -2832,8 +2654,7 @@ pub struct DataPacketReceived { } /// Nested message and enum types in `DataPacketReceived`. pub mod data_packet_received { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(message, tag="4")] User(super::UserPacket), @@ -2841,7 +2662,6 @@ 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")] @@ -2851,32 +2671,26 @@ pub struct TranscriptionReceived { #[prost(message, repeated, tag="3")] pub segments: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ConnectionStateChanged { #[prost(enumeration="ConnectionState", required, tag="1")] pub state: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Connected { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Disconnected { #[prost(enumeration="DisconnectReason", required, tag="1")] pub reason: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Reconnecting { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Reconnected { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RoomEos { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -2893,9 +2707,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 { - IceTransportType::TransportRelay => "TRANSPORT_RELAY", - IceTransportType::TransportNohost => "TRANSPORT_NOHOST", - IceTransportType::TransportAll => "TRANSPORT_ALL", + Self::TransportRelay => "TRANSPORT_RELAY", + Self::TransportNohost => "TRANSPORT_NOHOST", + Self::TransportAll => "TRANSPORT_ALL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2921,8 +2735,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 { - ContinualGatheringPolicy::GatherOnce => "GATHER_ONCE", - ContinualGatheringPolicy::GatherContinually => "GATHER_CONTINUALLY", + Self::GatherOnce => "GATHER_ONCE", + Self::GatherContinually => "GATHER_CONTINUALLY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2953,10 +2767,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 { - ConnectionQuality::QualityPoor => "QUALITY_POOR", - ConnectionQuality::QualityGood => "QUALITY_GOOD", - ConnectionQuality::QualityExcellent => "QUALITY_EXCELLENT", - ConnectionQuality::QualityLost => "QUALITY_LOST", + Self::QualityPoor => "QUALITY_POOR", + Self::QualityGood => "QUALITY_GOOD", + Self::QualityExcellent => "QUALITY_EXCELLENT", + Self::QualityLost => "QUALITY_LOST", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2984,9 +2798,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 { - ConnectionState::ConnDisconnected => "CONN_DISCONNECTED", - ConnectionState::ConnConnected => "CONN_CONNECTED", - ConnectionState::ConnReconnecting => "CONN_RECONNECTING", + Self::ConnDisconnected => "CONN_DISCONNECTED", + Self::ConnConnected => "CONN_CONNECTED", + Self::ConnReconnecting => "CONN_RECONNECTING", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3012,8 +2826,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 { - DataPacketKind::KindLossy => "KIND_LOSSY", - DataPacketKind::KindReliable => "KIND_RELIABLE", + Self::KindLossy => "KIND_LOSSY", + Self::KindReliable => "KIND_RELIABLE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3057,17 +2871,17 @@ impl DisconnectReason { /// (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", + 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. @@ -3090,8 +2904,7 @@ impl DisconnectReason { } /// Create a new AudioStream /// AudioStream is used to receive audio frames from a track -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewAudioStreamRequest { #[prost(uint64, required, tag="1")] pub track_handle: u64, @@ -3102,14 +2915,12 @@ pub struct NewAudioStreamRequest { #[prost(uint32, optional, tag="4")] pub num_channels: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewAudioStreamResponse { #[prost(message, required, tag="1")] pub stream: OwnedAudioStream, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioStreamFromParticipantRequest { #[prost(uint64, required, tag="1")] pub participant_handle: u64, @@ -3122,15 +2933,13 @@ pub struct AudioStreamFromParticipantRequest { #[prost(uint32, optional, tag="6")] pub num_channels: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioStreamFromParticipantResponse { #[prost(message, required, tag="1")] pub stream: OwnedAudioStream, } /// Create a new AudioSource -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewAudioSourceRequest { #[prost(enumeration="AudioSourceType", required, tag="1")] pub r#type: i32, @@ -3143,29 +2952,25 @@ pub struct NewAudioSourceRequest { #[prost(uint32, optional, tag="5")] pub queue_size_ms: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CaptureAudioFrameRequest { #[prost(uint64, required, tag="1")] pub source_handle: u64, #[prost(message, required, tag="2")] pub buffer: AudioFrameBufferInfo, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -3173,30 +2978,25 @@ pub struct CaptureAudioFrameCallback { #[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)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ClearAudioBufferRequest { #[prost(uint64, required, tag="1")] pub source_handle: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ClearAudioBufferResponse { } /// Create a new AudioResampler -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewAudioResamplerRequest { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewAudioResamplerResponse { #[prost(message, required, tag="1")] pub resampler: OwnedAudioResampler, } /// Remix and resample an audio frame -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RemixAndResampleRequest { #[prost(uint64, required, tag="1")] pub resampler_handle: u64, @@ -3207,16 +3007,14 @@ pub struct RemixAndResampleRequest { #[prost(uint32, required, tag="4")] pub sample_rate: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RemixAndResampleResponse { #[prost(message, required, tag="1")] pub buffer: OwnedAudioFrameBuffer, } // New resampler using SoX (much better quality) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NewSoxResamplerRequest { #[prost(double, required, tag="1")] pub input_rate: f64, @@ -3233,7 +3031,6 @@ 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")] @@ -3241,8 +3038,7 @@ pub struct NewSoxResamplerResponse { } /// Nested message and enum types in `NewSoxResamplerResponse`. pub mod new_sox_resampler_response { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] Resampler(super::OwnedSoxResampler), @@ -3250,8 +3046,7 @@ pub mod new_sox_resampler_response { Error(::prost::alloc::string::String), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PushSoxResamplerRequest { #[prost(uint64, required, tag="1")] pub resampler_handle: u64, @@ -3262,7 +3057,6 @@ 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) @@ -3274,13 +3068,11 @@ pub struct PushSoxResamplerResponse { #[prost(string, optional, tag="3")] pub error: ::core::option::Option<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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) @@ -3296,8 +3088,7 @@ pub struct FlushSoxResamplerResponse { // AudioFrame buffer // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioFrameBufferInfo { /// *const i16 #[prost(uint64, required, tag="1")] @@ -3309,30 +3100,26 @@ pub struct AudioFrameBufferInfo { #[prost(uint32, required, tag="4")] pub samples_per_channel: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedAudioFrameBuffer { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub info: AudioFrameBufferInfo, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioStreamInfo { #[prost(enumeration="AudioStreamType", required, tag="1")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedAudioStream { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, #[prost(message, required, tag="2")] pub info: AudioStreamInfo, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioStreamEvent { #[prost(uint64, required, tag="1")] pub stream_handle: u64, @@ -3341,8 +3128,7 @@ pub struct AudioStreamEvent { } /// Nested message and enum types in `AudioStreamEvent`. pub mod audio_stream_event { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] FrameReceived(super::AudioFrameReceived), @@ -3350,22 +3136,19 @@ pub mod audio_stream_event { Eos(super::AudioStreamEos), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioFrameReceived { #[prost(message, required, tag="1")] pub frame: OwnedAudioFrameBuffer, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioStreamEos { } // // AudioSource // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioSourceOptions { #[prost(bool, required, tag="1")] pub echo_cancellation: bool, @@ -3374,14 +3157,12 @@ pub struct AudioSourceOptions { #[prost(bool, required, tag="3")] pub auto_gain_control: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioSourceInfo { #[prost(enumeration="AudioSourceType", required, tag="2")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedAudioSource { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3392,12 +3173,10 @@ pub struct OwnedAudioSource { // AudioResampler // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AudioResamplerInfo { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedAudioResampler { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3408,12 +3187,10 @@ pub struct OwnedAudioResampler { // Sox AudioResampler // -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SoxResamplerInfo { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OwnedSoxResampler { #[prost(message, required, tag="1")] pub handle: FfiOwnedHandle, @@ -3434,8 +3211,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 { - SoxResamplerDataType::SoxrDatatypeInt16i => "SOXR_DATATYPE_INT16I", - SoxResamplerDataType::SoxrDatatypeInt16s => "SOXR_DATATYPE_INT16S", + Self::SoxrDatatypeInt16i => "SOXR_DATATYPE_INT16I", + Self::SoxrDatatypeInt16s => "SOXR_DATATYPE_INT16S", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3463,11 +3240,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3505,12 +3282,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 { - 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", + 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", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3543,8 +3320,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 { - AudioStreamType::AudioStreamNative => "AUDIO_STREAM_NATIVE", - AudioStreamType::AudioStreamHtml => "AUDIO_STREAM_HTML", + Self::AudioStreamNative => "AUDIO_STREAM_NATIVE", + Self::AudioStreamHtml => "AUDIO_STREAM_HTML", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3568,7 +3345,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 { - AudioSourceType::AudioSourceNative => "AUDIO_SOURCE_NATIVE", + Self::AudioSourceNative => "AUDIO_SOURCE_NATIVE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -3579,7 +3356,6 @@ impl AudioSourceType { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcError { #[prost(uint32, required, tag="1")] @@ -3590,7 +3366,6 @@ 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")] @@ -3604,7 +3379,6 @@ 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")] @@ -3612,7 +3386,6 @@ 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")] @@ -3620,7 +3393,6 @@ 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")] @@ -3633,28 +3405,23 @@ pub struct RpcMethodInvocationResponseRequest { pub error: ::core::option::Option, } /// FFI Responses -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PerformRpcResponse { #[prost(uint64, required, tag="1")] pub async_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RegisterRpcMethodResponse { } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -3665,7 +3432,6 @@ 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")] @@ -3711,7 +3477,6 @@ 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")] @@ -3719,8 +3484,7 @@ pub struct FfiRequest { } /// Nested message and enum types in `FfiRequest`. pub mod ffi_request { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] Dispose(super::DisposeRequest), @@ -3815,7 +3579,6 @@ 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")] @@ -3823,8 +3586,7 @@ pub struct FfiResponse { } /// Nested message and enum types in `FfiResponse`. pub mod ffi_response { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="2")] Dispose(super::DisposeResponse), @@ -3919,7 +3681,6 @@ 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")] @@ -3927,8 +3688,7 @@ pub struct FfiEvent { } /// Nested message and enum types in `FfiEvent`. pub mod ffi_event { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Message { #[prost(message, tag="1")] RoomEvent(super::RoomEvent), @@ -3981,26 +3741,22 @@ 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? -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisposeRequest { #[prost(bool, required, tag="1")] pub r#async: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisposeResponse { /// None if sync #[prost(uint64, optional, tag="1")] pub async_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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")] @@ -4017,13 +3773,11 @@ 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")] @@ -4045,11 +3799,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 { - LogLevel::LogError => "LOG_ERROR", - LogLevel::LogWarn => "LOG_WARN", - LogLevel::LogInfo => "LOG_INFO", - LogLevel::LogDebug => "LOG_DEBUG", - LogLevel::LogTrace => "LOG_TRACE", + Self::LogError => "LOG_ERROR", + Self::LogWarn => "LOG_WARN", + Self::LogInfo => "LOG_INFO", + Self::LogDebug => "LOG_DEBUG", + Self::LogTrace => "LOG_TRACE", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/livekit-runtime/Cargo.toml b/livekit-runtime/Cargo.toml index bb3a283a7..2ec822ae4 100644 --- a/livekit-runtime/Cargo.toml +++ b/livekit-runtime/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" repository = "https://github.com/livekit/rust-sdks" [features] +default = ["tokio"] tokio = ["dep:tokio", "dep:tokio-stream"] async = [ "dep:async-std", From 5a3a8eae0db1d0ab04149a1d98f754354bed7b41 Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Sat, 30 Nov 2024 21:49:21 +0800 Subject: [PATCH 23/51] fixed ffi build for android. (#409) fixed ffi build for android. --- .github/workflows/builds.yml | 4 +++ .github/workflows/ffi-builds.yml | 47 +++++++++++++++++--------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 48403b16b..4940634da 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -54,10 +54,13 @@ jobs: target: aarch64-unknown-linux-gnu - os: ubuntu-20.04 target: aarch64-linux-android + ndk_arch: aarch64-unknown-linux-musl - os: ubuntu-20.04 target: armv7-linux-androideabi + ndk_arch: arm-unknown-linux-musleabihf - os: ubuntu-20.04 target: x86_64-linux-android + ndk_arch: x86_64-unknown-linux-musl name: Build (${{ matrix.target }}) runs-on: ${{ matrix.os }} @@ -85,5 +88,6 @@ jobs: - name: Build (Android) if: ${{ contains(matrix.target, 'android') }} run: | + ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/ cargo install cargo-ndk cargo ndk --target ${{ matrix.target }} build --release -p livekit --workspace -vv diff --git a/.github/workflows/ffi-builds.yml b/.github/workflows/ffi-builds.yml index 34a2ea8e4..ccba91f91 100644 --- a/.github/workflows/ffi-builds.yml +++ b/.github/workflows/ffi-builds.yml @@ -78,28 +78,30 @@ jobs: dylib: liblivekit_ffi.so target: aarch64-unknown-linux-gnu name: ffi-linux-arm64 - ## android builds broke - # - os: ubuntu-20.04 - # platform: android - # dylib: liblivekit_ffi.so - # jar: libwebrtc.jar - # target: aarch64-linux-android - # name: ffi-android-arm64 - # buildargs: --no-default-features --features "rustls-tls-webpki-roots" - # - os: ubuntu-20.04 - # platform: android - # dylib: liblivekit_ffi.so - # jar: libwebrtc.jar - # target: armv7-linux-androideabi - # name: ffi-android-armv7 - # buildargs: --no-default-features --features "rustls-tls-webpki-roots" - # - os: ubuntu-20.04 - # platform: android - # dylib: liblivekit_ffi.so - # jar: libwebrtc.jar - # target: x86_64-linux-android - # name: ffi-android-x86_64 - # buildargs: --no-default-features --features "rustls-tls-webpki-roots" + - os: ubuntu-20.04 + platform: android + dylib: liblivekit_ffi.so + jar: libwebrtc.jar + target: aarch64-linux-android + ndk_arch: aarch64-unknown-linux-musl + name: ffi-android-arm64 + buildargs: --no-default-features --features "rustls-tls-webpki-roots" + - os: ubuntu-20.04 + platform: android + dylib: liblivekit_ffi.so + jar: libwebrtc.jar + target: armv7-linux-androideabi + ndk_arch: arm-unknown-linux-musleabihf + name: ffi-android-armv7 + buildargs: --no-default-features --features "rustls-tls-webpki-roots" + - os: ubuntu-20.04 + platform: android + dylib: liblivekit_ffi.so + jar: libwebrtc.jar + target: x86_64-linux-android + ndk_arch: x86_64-unknown-linux-musl + name: ffi-android-x86_64 + buildargs: --no-default-features --features "rustls-tls-webpki-roots" name: Build (${{ matrix.target }}) runs-on: ${{ matrix.os }} @@ -157,6 +159,7 @@ jobs: if: ${{ matrix.platform == 'android' }} run: | cd livekit-ffi/ + ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/ cargo install cargo-ndk cargo ndk --bindgen --target ${{ matrix.target }} build --release ${{ matrix.buildargs }} From fb1efb03ff5109120ac639946c2ea3364c969aa9 Mon Sep 17 00:00:00 2001 From: tommady Date: Mon, 2 Dec 2024 15:22:27 +0800 Subject: [PATCH 24/51] fix-livekit-ffi-build-on-ios-failure (#502) Signed-off-by: tommady --- livekit-ffi/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/livekit-ffi/build.rs b/livekit-ffi/build.rs index 28afe0d05..75432fdb5 100644 --- a/livekit-ffi/build.rs +++ b/livekit-ffi/build.rs @@ -42,7 +42,7 @@ fn main() { std::fs::copy(license, out_file).unwrap(); } - "macos" => { + "macos" | "ios" => { println!("cargo:rustc-link-arg=-ObjC"); } _ => { From 65a1b02a2806547fa1f77a55bab1e24eef194880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Mon, 2 Dec 2024 14:58:17 +0100 Subject: [PATCH 25/51] Update lib.rs --- webrtc-sys/build/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc-sys/build/src/lib.rs b/webrtc-sys/build/src/lib.rs index f3eb2a5ea..cb137c799 100644 --- a/webrtc-sys/build/src/lib.rs +++ b/webrtc-sys/build/src/lib.rs @@ -26,7 +26,7 @@ use regex::Regex; use reqwest::StatusCode; pub const SCRATH_PATH: &str = "livekit_webrtc"; -pub const WEBRTC_TAG: &str = "webrtc-dac8015-5"; +pub const WEBRTC_TAG: &str = "webrtc-dac8015-6"; pub const IGNORE_DEFINES: [&str; 2] = ["CR_CLANG_REVISION", "CR_XCODE_VERSION"]; pub fn target_os() -> String { From c86758be9897bd3aedbfad4b1a5d06936bfca69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Tue, 10 Dec 2024 21:01:31 +0100 Subject: [PATCH 26/51] move libyuv/imgproc from theomonnom/mikado (#508) --- .gitmodules | 3 + Cargo.toml | 4 + imgproc/Cargo.lock | 442 ++++++++++++ imgproc/Cargo.toml | 10 + imgproc/rustfmt.toml | 10 + imgproc/src/colorcvt/assert.rs | 164 +++++ imgproc/src/colorcvt/mod.rs | 1101 +++++++++++++++++++++++++++++ imgproc/src/lib.rs | 1 + livekit-ffi/Cargo.toml | 2 +- yuv-sys/Cargo.lock | 479 +++++++++++++ yuv-sys/Cargo.toml | 13 + yuv-sys/build.rs | 143 ++++ yuv-sys/libyuv | 1 + yuv-sys/src/lib.rs | 6 + yuv-sys/yuv_functions.txt | 1193 ++++++++++++++++++++++++++++++++ 15 files changed, 3571 insertions(+), 1 deletion(-) create mode 100644 imgproc/Cargo.lock create mode 100644 imgproc/Cargo.toml create mode 100644 imgproc/rustfmt.toml create mode 100644 imgproc/src/colorcvt/assert.rs create mode 100644 imgproc/src/colorcvt/mod.rs create mode 100644 imgproc/src/lib.rs create mode 100644 yuv-sys/Cargo.lock create mode 100644 yuv-sys/Cargo.toml create mode 100644 yuv-sys/build.rs create mode 160000 yuv-sys/libyuv create mode 100644 yuv-sys/src/lib.rs create mode 100644 yuv-sys/yuv_functions.txt diff --git a/.gitmodules b/.gitmodules index f13ae2153..b70842c2a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "livekit/protocol"] path = livekit-protocol/protocol url = https://github.com/livekit/protocol +[submodule "yuv-sys/libyuv"] + path = yuv-sys/libyuv + url = https://chromium.googlesource.com/libyuv/libyuv diff --git a/Cargo.toml b/Cargo.toml index 52650e01e..c0a232a25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,11 +8,15 @@ members = [ "livekit-runtime", "libwebrtc", "soxr-sys", + "yuv-sys", + "imgproc", "webrtc-sys", "webrtc-sys/build", ] [workspace.dependencies] +imgproc = { version = "0.3.11", path = "imgproc" } +yuv-sys = { version = "0.3.6", path = "yuv-sys" } libwebrtc = { version = "0.3.7", path = "libwebrtc" } livekit-api = { version = "0.4.1", path = "livekit-api" } livekit-ffi = { version = "0.12.3", path = "livekit-ffi" } diff --git a/imgproc/Cargo.lock b/imgproc/Cargo.lock new file mode 100644 index 000000000..6bf8e288a --- /dev/null +++ b/imgproc/Cargo.lock @@ -0,0 +1,442 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "bindgen" +version = "0.69.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "imgproc" +version = "0.3.6" +dependencies = [ + "yuv-sys", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "yuv-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9a8a1a93479f1701a725ffeaaa0dc03d8096387490e820a12daf3f302065fe" +dependencies = [ + "bindgen", + "cc", + "regex", +] diff --git a/imgproc/Cargo.toml b/imgproc/Cargo.toml new file mode 100644 index 000000000..6f49dccd6 --- /dev/null +++ b/imgproc/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "imgproc" +version = "0.3.11" +edition = "2021" +authors = ["Theo Monnom "] +license = "MIT OR Apache-2.0" +description = "image processing library" + +[dependencies] +yuv-sys = { path = "../yuv-sys" } diff --git a/imgproc/rustfmt.toml b/imgproc/rustfmt.toml new file mode 100644 index 000000000..18a73acec --- /dev/null +++ b/imgproc/rustfmt.toml @@ -0,0 +1,10 @@ +comment_width = 100 +doc_comment_code_block_width = 100 +format_code_in_doc_comments = true +group_imports = "StdExternalCrate" +imports_granularity = "Crate" +max_width = 100 +use_small_heuristics = "Max" +wrap_comments = true +# Workaround for https://github.com/rust-lang/rust.vim/issues/464 +edition = "2021" diff --git a/imgproc/src/colorcvt/assert.rs b/imgproc/src/colorcvt/assert.rs new file mode 100644 index 000000000..0d184b442 --- /dev/null +++ b/imgproc/src/colorcvt/assert.rs @@ -0,0 +1,164 @@ +#[inline] +pub fn valid_420( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + width: u32, + height: u32, +) { + assert!(width > 0); + assert!(height > 0); + + let chroma_width = (width + 1) / 2; + let chroma_height = (height + 1) / 2; + + assert!(src_stride_y >= width); + assert!(src_stride_u >= chroma_width); + assert!(src_stride_v >= chroma_width); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_u.len() >= (src_stride_u * chroma_height) as usize); + assert!(src_v.len() >= (src_stride_v * chroma_height) as usize); +} + +#[inline] +pub fn valid_420a( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + src_a: &[u8], + src_stride_a: u32, + width: u32, + height: u32, +) { + assert!(width > 0); + assert!(height > 0); + + let chroma_width = (width + 1) / 2; + let chroma_height = (height + 1) / 2; + + assert!(src_stride_y >= width); + assert!(src_stride_u >= chroma_width); + assert!(src_stride_v >= chroma_width); + assert!(src_stride_a >= width); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_u.len() >= (src_stride_u * chroma_height) as usize); + assert!(src_v.len() >= (src_stride_v * chroma_height) as usize); + assert!(src_a.len() >= (src_stride_a * height) as usize); +} + +#[inline] +pub fn valid_422( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + width: u32, + height: u32, +) { + assert!(width > 0); + assert!(height > 0); + + let chroma_width = (width + 1) / 2; + let chroma_height = height; + + assert!(src_stride_y >= width); + assert!(src_stride_u >= chroma_width); + assert!(src_stride_v >= chroma_width); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_u.len() >= (src_stride_u * chroma_height) as usize); + assert!(src_v.len() >= (src_stride_v * chroma_height) as usize); +} + +#[inline] +pub fn valid_444( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + width: u32, + height: u32, +) { + assert!(height > 0); + assert!(width > 0); + + let chroma_width = width; + let chroma_height = height; + + assert!(src_stride_y >= width); + assert!(src_stride_u >= chroma_width); + assert!(src_stride_v >= chroma_width); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_u.len() >= (src_stride_u * chroma_height) as usize); + assert!(src_v.len() >= (src_stride_v * chroma_height) as usize); +} + +#[inline] +pub fn valid_010( + src_y: &[u16], + src_stride_y: u32, + src_u: &[u16], + src_stride_u: u32, + src_v: &[u16], + src_stride_v: u32, + width: u32, + height: u32, +) { + assert!(height > 0); + assert!(width > 0); + + let chroma_width = (width + 1) / 2; + let chroma_height = (height + 1) / 2; + + assert!(src_stride_y >= width); + assert!(src_stride_u >= chroma_width); + assert!(src_stride_v >= chroma_width); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_u.len() >= (src_stride_u * chroma_height) as usize); + assert!(src_v.len() >= (src_stride_v * chroma_height) as usize); +} + +#[inline] +pub fn valid_nv12( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + width: u32, + height: u32, +) { + assert!(width > 0); + assert!(height > 0); + + let chroma_height = (height + 1) / 2; + + assert!(src_stride_y >= width); + assert!(src_stride_uv >= width + width % 2); + assert!(src_y.len() >= (src_stride_y * height) as usize); + assert!(src_uv.len() >= (src_stride_uv * chroma_height) as usize); +} + +#[inline] +pub fn valid_rgba(src_rgba: &[u8], src_stride_rgba: u32, width: u32, height: u32) { + assert!(width > 0); + assert!(height > 0); + assert!(src_stride_rgba >= width * 4); + assert!(src_rgba.len() >= (src_stride_rgba * height) as usize); +} + +#[inline] +pub fn valid_rgb(src_rgb: &[u8], src_stride_rgb: u32, width: u32, height: u32) { + assert!(width > 0); + assert!(height > 0); + assert!(src_stride_rgb >= width * 3); + assert!(src_rgb.len() >= (src_stride_rgb * height) as usize); +} diff --git a/imgproc/src/colorcvt/mod.rs b/imgproc/src/colorcvt/mod.rs new file mode 100644 index 000000000..5c192ee8f --- /dev/null +++ b/imgproc/src/colorcvt/mod.rs @@ -0,0 +1,1101 @@ +mod assert; + +macro_rules! x420_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_y: &[u8], + stride_y: u32, + src_u: &[u8], + stride_u: u32, + src_v: &[u8], + stride_v: u32, + dst_rgba: &mut [u8], + dst_stride_rgba: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_420(src_y, stride_y, src_u, stride_u, src_v, stride_v, width, height); + assert::valid_rgba(dst_rgba, dst_stride_rgba, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_y.as_ptr(), + stride_y as i32, + src_u.as_ptr(), + stride_u as i32, + src_v.as_ptr(), + stride_v as i32, + dst_rgba.as_mut_ptr(), + dst_stride_rgba as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +x420_to_rgba!(i420_to_rgba, rs_I420ToRGBA); +x420_to_rgba!(i420_to_abgr, rs_I420ToABGR); +x420_to_rgba!(i420_to_bgra, rs_I420ToBGRA); +x420_to_rgba!(i420_to_argb, rs_I420ToARGB); +x420_to_rgba!(j420_to_argb, rs_J420ToARGB); +x420_to_rgba!(j420_to_abgr, rs_J420ToABGR); +x420_to_rgba!(h420_to_argb, rs_H420ToARGB); +x420_to_rgba!(h420_to_abgr, rs_H420ToABGR); +x420_to_rgba!(u420_to_argb, rs_U420ToARGB); +x420_to_rgba!(u420_to_abgr, rs_U420ToABGR); + +pub fn i420_to_rgb24( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_rgb24: &mut [u8], + dst_stride_rgb24: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_rgb24, dst_stride_rgb24, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I420ToRGB24( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_rgb24.as_mut_ptr(), + dst_stride_rgb24 as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i420_to_raw( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_raw: &mut [u8], + dst_stride_raw: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_raw, dst_stride_raw, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I420ToRAW( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_raw.as_mut_ptr(), + dst_stride_raw as i32, + width as i32, + height, + ) == 0 + }); +} + +macro_rules! rgba_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_abgr: &[u8], + src_stride_abgr: u32, + dst_argb: &mut [u8], + dst_stride_argb: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_rgba(src_abgr, src_stride_abgr, width, height); + assert::valid_rgba(dst_argb, dst_stride_argb, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_abgr.as_ptr(), + src_stride_abgr as i32, + dst_argb.as_mut_ptr(), + dst_stride_argb as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +rgba_to_rgba!(abgr_to_argb, rs_ABGRToARGB); +rgba_to_rgba!(argb_to_abgr, rs_ARGBToABGR); +rgba_to_rgba!(rgba_to_argb, rs_RGBAToARGB); +rgba_to_rgba!(bgra_to_argb, rs_BGRAToARGB); + +macro_rules! rgba_to_420 { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_rgba: &[u8], + src_stride_rgba: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_rgba(src_rgba, src_stride_rgba, width, height); + assert::valid_420( + dst_y, + dst_stride_y, + dst_u, + dst_stride_u, + dst_v, + dst_stride_v, + width, + height, + ); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_rgba.as_ptr(), + src_stride_rgba as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +rgba_to_420!(rgba_to_i420, rs_RGBAToI420); +rgba_to_420!(bgra_to_i420, rs_BGRAToI420); +rgba_to_420!(argb_to_i420, rs_ARGBToI420); +rgba_to_420!(abgr_to_i420, rs_ABGRToI420); + +pub fn raw_to_i420( + src_raw: &[u8], + src_stride_raw: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_rgb(src_raw, src_stride_raw, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + unsafe { + yuv_sys::rs_RAWToI420( + src_raw.as_ptr(), + src_stride_raw as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) + }; +} + +pub fn i422_to_i420( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_422(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I422ToI420( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i444_to_i420( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_444(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I444ToI420( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i010_to_i420( + src_y: &[u16], + src_stride_y: u32, + src_u: &[u16], + src_stride_u: u32, + src_v: &[u16], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_010(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I010ToI420( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn nv12_to_i420( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_nv12(src_y, src_stride_y, src_uv, src_stride_uv, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_NV12ToI420( + src_y.as_ptr(), + src_stride_y as i32, + src_uv.as_ptr(), + src_stride_uv as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i422_to_raw( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_raw: &mut [u8], + dst_stride_raw: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_422(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_raw, dst_stride_raw, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I422ToRAW( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_raw.as_mut_ptr(), + dst_stride_raw as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i422_to_rgb24( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_rgb24: &mut [u8], + dst_stride_rgb24: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_422(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_rgb24, dst_stride_rgb24, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I422ToRGB24( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_rgb24.as_mut_ptr(), + dst_stride_rgb24 as i32, + width as i32, + height, + ) == 0 + }); +} + +macro_rules! x422_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_rgba: &mut [u8], + dst_stride_rgba: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_422( + src_y, + src_stride_y, + src_u, + src_stride_u, + src_v, + src_stride_v, + width, + height, + ); + assert::valid_rgba(dst_rgba, dst_stride_rgba, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_rgba.as_mut_ptr(), + dst_stride_rgba as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +x422_to_rgba!(i422_to_abgr, rs_I422ToABGR); +x422_to_rgba!(j422_to_argb, rs_J422ToARGB); +x422_to_rgba!(i422_to_bgra, rs_I422ToBGRA); +x422_to_rgba!(i422_to_rgba, rs_I422ToRGBA); + +pub fn i444_to_raw( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_raw: &mut [u8], + dst_stride_raw: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_444(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_raw, dst_stride_raw, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I444ToRAW( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_raw.as_mut_ptr(), + dst_stride_raw as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i444_to_rgb24( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_rgb24: &mut [u8], + dst_stride_rgb24: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_444(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_rgb(dst_rgb24, dst_stride_rgb24, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I444ToRGB24( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_rgb24.as_mut_ptr(), + dst_stride_rgb24 as i32, + width as i32, + height, + ) == 0 + }); +} + +macro_rules! x444_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_rgba: &mut [u8], + dst_stride_rgba: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_444( + src_y, + src_stride_y, + src_u, + src_stride_u, + src_v, + src_stride_v, + width, + height, + ); + assert::valid_rgba(dst_rgba, dst_stride_rgba, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_rgba.as_mut_ptr(), + dst_stride_rgba as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +x444_to_rgba!(i444_to_abgr, rs_I444ToABGR); +x444_to_rgba!(i444_to_argb, rs_I444ToARGB); + +macro_rules! x010_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_y: &[u16], + src_stride_y: u32, + src_u: &[u16], + src_stride_u: u32, + src_v: &[u16], + src_stride_v: u32, + dst_abgr: &mut [u8], + dst_stride_abgr: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_010( + src_y, + src_stride_y, + src_u, + src_stride_u, + src_v, + src_stride_v, + width, + height, + ); + assert::valid_rgba(dst_abgr, dst_stride_abgr, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_abgr.as_mut_ptr(), + dst_stride_abgr as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +x010_to_rgba!(i010_to_abgr, rs_I010ToABGR); +x010_to_rgba!(i010_to_argb, rs_I010ToARGB); + +pub fn nv12_to_raw( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + dst_raw: &mut [u8], + dst_stride_raw: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_nv12(src_y, src_stride_y, src_uv, src_stride_uv, width, height); + assert::valid_rgb(dst_raw, dst_stride_raw, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_NV12ToRAW( + src_y.as_ptr(), + src_stride_y as i32, + src_uv.as_ptr(), + src_stride_uv as i32, + dst_raw.as_mut_ptr(), + dst_stride_raw as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn nv12_to_rgb24( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + dst_rgb24: &mut [u8], + dst_stride_rgb24: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_nv12(src_y, src_stride_y, src_uv, src_stride_uv, width, height); + assert::valid_rgb(dst_rgb24, dst_stride_rgb24, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_NV12ToRGB24( + src_y.as_ptr(), + src_stride_y as i32, + src_uv.as_ptr(), + src_stride_uv as i32, + dst_rgb24.as_mut_ptr(), + dst_stride_rgb24 as i32, + width as i32, + height, + ) == 0 + }); +} + +macro_rules! nv12_to_rgba { + ($rust_fnc:ident, $yuv_sys_fnc:ident) => { + pub fn $rust_fnc( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + dst_rgba: &mut [u8], + dst_stride_rgba: u32, + width: u32, + height: u32, + flip_y: bool, + ) { + assert::valid_nv12(src_y, src_stride_y, src_uv, src_stride_uv, width, height); + assert::valid_rgba(dst_rgba, dst_stride_rgba, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::$yuv_sys_fnc( + src_y.as_ptr(), + src_stride_y as i32, + src_uv.as_ptr(), + src_stride_uv as i32, + dst_rgba.as_mut_ptr(), + dst_stride_rgba as i32, + width as i32, + height, + ) == 0 + }); + } + }; +} + +nv12_to_rgba!(nv12_to_abgr, rs_NV12ToABGR); +nv12_to_rgba!(nv12_to_argb, rs_NV12ToARGB); + +pub fn i420_copy( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_420(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I420Copy( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i420a_copy( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + src_a: &[u8], + src_stride_a: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + dst_a: &mut [u8], + dst_stride_a: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_420a( + src_y, + src_stride_y, + src_u, + src_stride_u, + src_v, + src_stride_v, + src_a, + src_stride_a, + width, + height, + ); + + assert::valid_420a( + dst_y, + dst_stride_y, + dst_u, + dst_stride_u, + dst_v, + dst_stride_v, + dst_a, + dst_stride_a, + width, + height, + ); + + i420_copy( + src_y, + src_stride_y, + src_u, + src_stride_u, + src_v, + src_stride_v, + dst_y, + dst_stride_y, + dst_u, + dst_stride_u, + dst_v, + dst_stride_v, + width, + height, + flip_y, + ); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + unsafe { + yuv_sys::rs_CopyPlane( + src_a.as_ptr(), + src_stride_a as i32, + dst_a.as_mut_ptr(), + dst_stride_a as i32, + width as i32, + height, + ) + } +} + +pub fn i422_copy( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_422(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_422(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I422Copy( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i444_copy( + src_y: &[u8], + src_stride_y: u32, + src_u: &[u8], + src_stride_u: u32, + src_v: &[u8], + src_stride_v: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_u: &mut [u8], + dst_stride_u: u32, + dst_v: &mut [u8], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_444(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_444(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I444Copy( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn i010_copy( + src_y: &[u16], + src_stride_y: u32, + src_u: &[u16], + src_stride_u: u32, + src_v: &[u16], + src_stride_v: u32, + dst_y: &mut [u16], + dst_stride_y: u32, + dst_u: &mut [u16], + dst_stride_u: u32, + dst_v: &mut [u16], + dst_stride_v: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_010(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, width, height); + assert::valid_010(dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v, dst_stride_v, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!(unsafe { + yuv_sys::rs_I010Copy( + src_y.as_ptr(), + src_stride_y as i32, + src_u.as_ptr(), + src_stride_u as i32, + src_v.as_ptr(), + src_stride_v as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_u.as_mut_ptr(), + dst_stride_u as i32, + dst_v.as_mut_ptr(), + dst_stride_v as i32, + width as i32, + height, + ) == 0 + }); +} + +pub fn nv12_copy( + src_y: &[u8], + src_stride_y: u32, + src_uv: &[u8], + src_stride_uv: u32, + dst_y: &mut [u8], + dst_stride_y: u32, + dst_uv: &mut [u8], + dst_stride_uv: u32, + width: u32, + height: u32, + flip_y: bool, +) { + assert::valid_nv12(src_y, src_stride_y, src_uv, src_stride_uv, width, height); + assert::valid_nv12(dst_y, dst_stride_y, dst_uv, dst_stride_uv, width, height); + + let height = height as i32 * if flip_y { -1 } else { 1 }; + + assert!( + unsafe { + yuv_sys::rs_NV12Copy( + src_y.as_ptr(), + src_stride_y as i32, + src_uv.as_ptr(), + src_stride_uv as i32, + dst_y.as_mut_ptr(), + dst_stride_y as i32, + dst_uv.as_mut_ptr(), + dst_stride_uv as i32, + width as i32, + height, + ) + } == 0 + ); +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_data() { + const WIDTH: usize = 160; + const HEIGHT: usize = 90; + + let dst_abgr = &mut [0u8; WIDTH * HEIGHT * 4]; + let src_y = &[0u8; WIDTH * HEIGHT]; + let src_u = &[0u8; WIDTH * HEIGHT + 1 / 2]; + let src_v = &[0u8; WIDTH * HEIGHT + 1 / 2]; + + i420_to_abgr( + src_y, + WIDTH as u32, + src_u, + WIDTH as u32 + 1 / 2, + src_v, + WIDTH as u32 + 1 / 2, + dst_abgr, + WIDTH as u32 * 4, + WIDTH as u32, + HEIGHT as u32, + false, + ); + } +} diff --git a/imgproc/src/lib.rs b/imgproc/src/lib.rs new file mode 100644 index 000000000..68b896203 --- /dev/null +++ b/imgproc/src/lib.rs @@ -0,0 +1 @@ +pub mod colorcvt; diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index 01d743237..b7cab7fda 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -20,6 +20,7 @@ tracing = ["tokio/tracing", "console-subscriber"] [dependencies] livekit = { workspace = true } soxr-sys = { path = "../soxr-sys" } +imgproc = { path = "../imgproc" } livekit-protocol = { workspace = true } tokio = { version = "1", features = ["full", "parking_lot"] } futures-util = { version = "0.3", default-features = false, features = ["sink"] } @@ -33,7 +34,6 @@ dashmap = "5.4" env_logger = "0.10" downcast-rs = "1.2" console-subscriber = { version = "0.1", features = ["parking_lot"], optional = true } -imgproc = "0.3.11" [target.'cfg(target_os = "android")'.dependencies] jni = "0.21.1" diff --git a/yuv-sys/Cargo.lock b/yuv-sys/Cargo.lock new file mode 100644 index 000000000..2cda4831d --- /dev/null +++ b/yuv-sys/Cargo.lock @@ -0,0 +1,479 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "bindgen" +version = "0.69.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "yuv-sys" +version = "0.3.5" +dependencies = [ + "bindgen", + "cc", + "rayon", + "regex", +] diff --git a/yuv-sys/Cargo.toml b/yuv-sys/Cargo.toml new file mode 100644 index 000000000..384815730 --- /dev/null +++ b/yuv-sys/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "yuv-sys" +version = "0.3.6" +edition = "2021" +authors = ["Theo Monnom "] +license = "MIT OR Apache-2.0" +description = "libyuv bindings" + +[build-dependencies] +bindgen = "0.69" +cc = "1.0" +regex = "1" +rayon = "1.8" diff --git a/yuv-sys/build.rs b/yuv-sys/build.rs new file mode 100644 index 000000000..34a936108 --- /dev/null +++ b/yuv-sys/build.rs @@ -0,0 +1,143 @@ +use cc; +use rayon::prelude::*; +use regex::Regex; +use std::borrow::Cow; +use std::path::Path; +use std::{env, path::PathBuf}; +use std::{fs, io}; + +//const LIBYUV_REPO: &str = "https://chromium.googlesource.com/libyuv/libyuv"; +//const LIBYUV_COMMIT: &str = "af6ac82"; +const FNC_PREFIX: &str = "rs_"; + +/*fn run_git_cmd(current_dir: &PathBuf, args: &[&str]) -> ExitStatus { + Command::new("git") + .current_dir(current_dir) + .args(args) + .status() + .unwrap() +}*/ + +fn rename_symbols( + fnc_list: &[&str], + include_files: &[fs::DirEntry], + source_files: &[fs::DirEntry], +) { + // Find all occurences of the function in every header and source files + // and prefix it with FNC_PREFIX + include_files.par_iter().chain(source_files).for_each(|file| { + let mut content = fs::read_to_string(&file.path()).unwrap(); + for line in fnc_list { + let fnc = line.trim(); + if fnc.is_empty() { + continue; + } + + // Split line using space as delimiter (If there is two words, the second word is the new name instead of using prefix) + let split: Vec<&str> = fnc.split_whitespace().collect(); + let fnc = split[0]; + + let new_name = if split.len() > 1 { + split[1].to_owned() + } else { + format!("{}{}", FNC_PREFIX, fnc) + }; + + let re = Regex::new(&format!(r"\b{}\b", fnc)).unwrap(); + if let Cow::Owned(c) = re.replace_all(&content, &new_name) { + content = c + } + } + + fs::write(&file.path(), content.to_string()).unwrap(); + }); +} + +fn copy_dir(source: impl AsRef, destination: impl AsRef) -> io::Result<()> { + fs::create_dir_all(&destination)?; + for entry in fs::read_dir(source)? { + let entry = entry?; + if entry.file_type()?.is_dir() { + copy_dir(entry.path(), destination.as_ref().join(entry.file_name()))?; + } else { + fs::copy(entry.path(), destination.as_ref().join(entry.file_name()))?; + } + } + Ok(()) +} + +fn clone_if_needed(_output_dir: &PathBuf, libyuv_dir: &PathBuf) -> bool { + if libyuv_dir.exists() { + return false; // Already cloned + } + + /*let status = run_git_cmd(output_dir, &["clone", LIBYUV_REPO]); + if !status.success() { + fs::remove_dir_all(&libyuv_dir).unwrap(); + panic!("failed to clone libyuv, is git installed?"); + } + + let status = run_git_cmd(&libyuv_dir, &["checkout", LIBYUV_COMMIT]); + if !status.success() { + fs::remove_dir_all(&libyuv_dir).unwrap(); + panic!("failed to checkout to {}", LIBYUV_COMMIT); + }*/ + + if let Err(err) = copy_dir("libyuv", libyuv_dir) { + fs::remove_dir_all(&libyuv_dir).unwrap(); + panic!("failed to copy libyuv: {:?}", err); + } + + true +} + +fn main() { + let output_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + let libyuv_dir = output_dir.join("libyuv"); + let include_dir = libyuv_dir.join("include"); + let source_dir = libyuv_dir.join("source"); + + let cloned = clone_if_needed(&output_dir, &libyuv_dir); + + let include_files = fs::read_dir(include_dir.join("libyuv")) + .unwrap() + .map(Result::unwrap) + .filter(|f| f.path().extension().unwrap() == "h") + .collect::>(); + + let source_files = fs::read_dir(source_dir) + .unwrap() + .map(Result::unwrap) + .filter(|f| f.path().extension().unwrap() == "cc") + .collect::>(); + + let fnc_content = fs::read_to_string("yuv_functions.txt").unwrap(); + let fnc_list = fnc_content.lines().collect::>(); + + if cloned { + // Rename symbols to avoid conflicts with other libraries + // that have libyuv statically linked (e.g libwebrtc). + rename_symbols(&fnc_list, &include_files, &source_files); + } + + cc::Build::new() + .warnings(false) + .include(libyuv_dir.join("include")) + .files(source_files.iter().map(|f| f.path())) + .compile("yuv"); + + let mut bindgen = bindgen::Builder::default() + .header(include_dir.join("libyuv.h").to_string_lossy()) + .clang_arg(format!("-I{}", include_dir.to_str().unwrap())); + + for fnc in fnc_list { + let new_name = format!("{}{}", FNC_PREFIX, fnc); + bindgen = bindgen.allowlist_function(&new_name); + } + + let output = bindgen.generate().unwrap(); + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("yuv.rs"); + output.write_to_file(out_path).unwrap(); + + println!("cargo:rerun-if-changed=yuv_functions.txt"); +} diff --git a/yuv-sys/libyuv b/yuv-sys/libyuv new file mode 160000 index 000000000..3a0ad00ed --- /dev/null +++ b/yuv-sys/libyuv @@ -0,0 +1 @@ +Subproject commit 3a0ad00ed34afe3a43eb742579d53e9e7c597ae3 diff --git a/yuv-sys/src/lib.rs b/yuv-sys/src/lib.rs new file mode 100644 index 000000000..6839d5eae --- /dev/null +++ b/yuv-sys/src/lib.rs @@ -0,0 +1,6 @@ +#![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] +#![allow(non_snake_case)] +#![allow(dead_code)] + +include!(concat!(env!("OUT_DIR"), "/yuv.rs")); diff --git a/yuv-sys/yuv_functions.txt b/yuv-sys/yuv_functions.txt new file mode 100644 index 000000000..cecd256ba --- /dev/null +++ b/yuv-sys/yuv_functions.txt @@ -0,0 +1,1193 @@ +NAME##ToYRow_C rs_##NAME##ToYRow_C +NAME##ToYJRow_C rs_##NAME##ToYJRow_C +NAME##ToUVRow_C rs_##NAME##ToUVRow_C +NAME##ToUVJRow_C rs_##NAME##ToUVJRow_C +kYuv##name##Constants +kYvu##name##Constants +ScalePlane +ScalePlane_16 +ScalePlane_12 +I420Scale +I420Scale_16 +I420Scale_12 +I444Scale +I444Scale_16 +I444Scale_12 +I422Scale +I422Scale_16 +I422Scale_12 +NV12Scale +Scale +CopyPlane +CopyPlane_16 +Convert16To8Plane +Convert8To16Plane +SetPlane +DetilePlane +DetilePlane_16 +DetileSplitUVPlane +DetileToYUY2 +SplitUVPlane +MergeUVPlane +SplitUVPlane_16 +MergeUVPlane_16 +ConvertToMSBPlane_16 +ConvertToLSBPlane_16 +HalfMergeUVPlane +SwapUVPlane +SplitRGBPlane +MergeRGBPlane +SplitARGBPlane +MergeARGBPlane +MergeXR30Plane +MergeAR64Plane +MergeARGB16To8Plane +I400ToI400 +I422Copy +I444Copy +I210Copy +I410Copy +NV12Copy +NV21Copy +YUY2ToI422 +UYVYToI422 +YUY2ToNV12 +UYVYToNV12 +NV21ToNV12 +YUY2ToY +UYVYToY +I420ToI400 +I420Mirror +I400Mirror +NV12Mirror +ARGBMirror +RGB24Mirror +MirrorPlane +MirrorUVPlane +RAWToRGB24 +I420Rect +ARGBRect +ARGBGrayTo +ARGBGray +ARGBSepia +ARGBColorMatrix +RGBColorMatrix +ARGBColorTable +RGBColorTable +ARGBLumaColorTable +ARGBPolynomial +HalfFloatPlane +ByteToFloat +ARGBQuantize +ARGBCopy +ARGBCopyAlpha +ARGBExtractAlpha +ARGBCopyYToAlpha +ARGBBlend +BlendPlane +I420Blend +ARGBMultiply +ARGBAdd +ARGBSubtract +I422ToYUY2 +I422ToUYVY +ARGBAttenuate +ARGBUnattenuate +ARGBComputeCumulativeSum +ARGBBlur +GaussPlane_F32 +ARGBShade +InterpolatePlane +InterpolatePlane_16 +ARGBInterpolate +I420Interpolate +ARGBAffineRow_C +ARGBAffineRow_SSE2 +ARGBShuffle +AR64Shuffle +ARGBSobelToPlane +ARGBSobel +ARGBSobelXY +ARGBScale +ARGBScaleClip +YUVToARGBScaleClip +HashDjb2 +ComputeHammingDistance +ARGBDetect +ComputeSumSquareError +ComputeSumSquareErrorPlane +SumSquareErrorToPsnr +CalcFramePsnr +I420Psnr +CalcFrameSsim +I420Ssim +I420ToARGB +I420ToABGR +J420ToARGB +J420ToABGR +H420ToARGB +H420ToABGR +U420ToARGB +U420ToABGR +I422ToARGB +I422ToABGR +J422ToARGB +J422ToABGR +H422ToARGB +H422ToABGR +U422ToARGB +U422ToABGR +I444ToARGB +I444ToABGR +J444ToARGB +J444ToABGR +H444ToARGB +H444ToABGR +U444ToARGB +U444ToABGR +I444ToRGB24 +I444ToRAW +I010ToARGB +I010ToABGR +H010ToARGB +H010ToABGR +U010ToARGB +U010ToABGR +I210ToARGB +I210ToABGR +H210ToARGB +H210ToABGR +U210ToARGB +U210ToABGR +I420AlphaToARGB +I420AlphaToABGR +I422AlphaToARGB +I422AlphaToABGR +I444AlphaToARGB +I444AlphaToABGR +I400ToARGB +J400ToARGB +NV12ToARGB +NV21ToARGB +NV12ToABGR +NV21ToABGR +NV12ToRGB24 +NV21ToRGB24 +NV21ToYUV24 +NV12ToRAW +NV21ToRAW +YUY2ToARGB +UYVYToARGB +I010ToAR30 +H010ToAR30 +I010ToAB30 +H010ToAB30 +U010ToAR30 +U010ToAB30 +I210ToAR30 +I210ToAB30 +H210ToAR30 +H210ToAB30 +U210ToAR30 +U210ToAB30 +BGRAToARGB +ABGRToARGB +RGBAToARGB +RGB24ToARGB +RAWToARGB +RAWToRGBA +RGB565ToARGB +ARGB1555ToARGB +ARGB4444ToARGB +AR30ToARGB +AR30ToABGR +AR30ToAB30 +AR64ToARGB +AB64ToARGB +AR64ToAB64 +MJPGToARGB +Android420ToARGB +Android420ToABGR +NV12ToRGB565 +I422ToBGRA +I422ToRGBA +I420ToBGRA +I420ToRGBA +I420ToRGB24 +I420ToRAW +H420ToRGB24 +H420ToRAW +J420ToRGB24 +J420ToRAW +I422ToRGB24 +I422ToRAW +I420ToRGB565 +J420ToRGB565 +H420ToRGB565 +I422ToRGB565 +I420ToRGB565Dither +I420ToARGB1555 +I420ToARGB4444 +I420ToAR30 +I420ToAB30 +H420ToAR30 +H420ToAB30 +I420ToARGBMatrix +I422ToARGBMatrix +I444ToARGBMatrix +I444ToRGB24Matrix +I010ToAR30Matrix +I210ToAR30Matrix +I410ToAR30Matrix +I010ToARGBMatrix +I012ToAR30Matrix +I012ToARGBMatrix +I210ToARGBMatrix +I410ToARGBMatrix +P010ToARGBMatrix +P210ToARGBMatrix +P010ToAR30Matrix +P210ToAR30Matrix +I420AlphaToARGBMatrix +I422AlphaToARGBMatrix +I444AlphaToARGBMatrix +I010AlphaToARGBMatrix +I210AlphaToARGBMatrix +I410AlphaToARGBMatrix +NV12ToARGBMatrix +NV21ToARGBMatrix +NV12ToRGB565Matrix +NV12ToRGB24Matrix +NV21ToRGB24Matrix +Android420ToARGBMatrix +I422ToRGBAMatrix +I420ToRGBAMatrix +I420ToRGB24Matrix +I422ToRGB24Matrix +I420ToRGB565Matrix +I422ToRGB565Matrix +I420ToAR30Matrix +I400ToARGBMatrix +I420ToARGBMatrixFilter +I422ToARGBMatrixFilter +I422ToRGB24MatrixFilter +I420ToRGB24MatrixFilter +I010ToAR30MatrixFilter +I210ToAR30MatrixFilter +I010ToARGBMatrixFilter +I210ToARGBMatrixFilter +I420AlphaToARGBMatrixFilter +I422AlphaToARGBMatrixFilter +I010AlphaToARGBMatrixFilter +I210AlphaToARGBMatrixFilter +P010ToARGBMatrixFilter +P210ToARGBMatrixFilter +P010ToAR30MatrixFilter +P210ToAR30MatrixFilter +ConvertToARGB +I420Rotate +I422Rotate +I444Rotate +I010Rotate +I210Rotate +I410Rotate +NV12ToI420Rotate +Android420ToI420Rotate +RotatePlane +RotatePlane90 +RotatePlane180 +RotatePlane270 +RotatePlane_16 +SplitRotateUV +SplitRotateUV90 +SplitRotateUV180 +SplitRotateUV270 +TransposePlane +SplitTransposeUV +ARGBToBGRA +ARGBToABGR +ARGBToRGBA +ABGRToAR30 +ARGBToAR30 +ARGBToRGB24 +ARGBToRAW +ARGBToRGB565 +ARGBToRGB565Dither +ARGBToARGB1555 +ARGBToARGB4444 +ARGBToI444 +ARGBToAR64 +ARGBToAB64 +ARGBToI422 +ARGBToJ420 +ARGBToJ422 +ARGBToJ400 +ABGRToJ420 +ABGRToJ422 +ABGRToJ400 +RGBAToJ400 +ARGBToI400 +ARGBToG +ARGBToNV12 +ARGBToNV21 +ABGRToNV12 +ABGRToNV21 +ARGBToYUY2 +ARGBToUYVY +RAWToJNV21 +UVScale +UVScale_16 +I420ToI010 +I420ToI012 +I420ToI422 +I420ToI444 +I400Copy +I420ToNV12 +I420ToNV21 +I420ToYUY2 +I420ToUYVY +ConvertFromI420 +I444ToI420 +I444ToNV12 +I444ToNV21 +I422ToI420 +I422ToI444 +I422ToI210 +MM21ToNV12 +MM21ToI420 +MM21ToYUY2 +MT2TToP010 +I422ToNV21 +I420Copy +I010Copy +I010ToI420 +I210ToI420 +I210ToI422 +I410ToI420 +I410ToI444 +I012ToI420 +I212ToI422 +I212ToI420 +I412ToI444 +I412ToI420 +I410ToI010 +I210ToI010 +I010ToI410 +I210ToI410 +I010ToP010 +I210ToP210 +I012ToP012 +I212ToP212 +I400ToI420 +I400ToNV21 +NV12ToI420 +NV21ToI420 +NV12ToNV24 +NV16ToNV24 +P010ToI010 +P012ToI012 +P010ToP410 +P210ToP410 +YUY2ToI420 +UYVYToI420 +AYUVToNV12 +AYUVToNV21 +Android420ToI420 +ARGBToI420 +ARGBToI420Alpha +BGRAToI420 +ABGRToI420 +RGBAToI420 +RGB24ToI420 +RGB24ToJ420 +RAWToI420 +RAWToJ420 +RGB565ToI420 +ARGB1555ToI420 +ARGB4444ToI420 +RGB24ToJ400 +RAWToJ400 +MJPGToI420 +MJPGToNV21 +MJPGToNV12 +MJPGSize +ConvertToI420 +ARGBRotate +RGBScale +DetileToYUY2_Any_SSE2 +DetileSplitUVRow_Any_SSSE3 +DetileRow_16_Any_AVX +DetileRow_16_Any_SSE2 +DetileRow_Any_SSE2 +UYVYToUVRow_Any_SSE2 +YUY2ToUVRow_Any_SSE2 +UYVYToUVRow_Any_AVX2 +RGBAToUVRow_Any_SSSE3 +ABGRToUVRow_Any_SSSE3 +BGRAToUVRow_Any_SSSE3 +ARGBToUVRow_Any_SSSE3 +ABGRToUVJRow_Any_SSSE3 +ARGBToUVJRow_Any_SSSE3 +ABGRToUVJRow_Any_AVX2 +ARGBToUVJRow_Any_AVX2 +ABGRToUVRow_Any_AVX2 +ARGBToUVRow_Any_AVX2 +SplitARGBRow_Any_AVX2 +SplitARGBRow_Any_SSSE3 +SplitARGBRow_Any_SSE2 +SplitXRGBRow_Any_AVX2 +SplitXRGBRow_Any_SSSE3 +SplitXRGBRow_Any_SSE2 +SplitRGBRow_Any_SSSE3 +SplitUVRow_16_Any_AVX2 +UYVYToUV422Row_Any_SSE2 +YUY2ToUV422Row_Any_SSE2 +UYVYToUV422Row_Any_AVX2 +YUY2ToUV422Row_Any_AVX2 +ARGBToUV444Row_Any_SSSE3 +SplitUVRow_Any_AVX2 +SplitUVRow_Any_SSE2 +SetRow_Any_X86 +RGB24MirrorRow_Any_SSSE3 +ARGBMirrorRow_Any_SSE2 +ARGBMirrorRow_Any_AVX2 +MirrorUVRow_Any_SSSE3 +MirrorUVRow_Any_AVX2 +MirrorRow_Any_SSSE3 +MirrorRow_Any_AVX2 +InterpolateRow_16To8_Any_AVX2 +InterpolateRow_Any_SSSE3 +InterpolateRow_Any_AVX2 +UYVYToARGBRow_Any_AVX2 +ScalePlaneDown2_16To8 +J400ToARGBRow_SSE2 +RGB24ToARGBRow_SSSE3 +RAWToARGBRow_SSSE3 +RAWToRGBARow_SSSE3 +RAWToRGB24Row_SSSE3 +RGB565ToARGBRow_SSE2 +ARGB1555ToARGBRow_SSE2 +ARGB4444ToARGBRow_SSE2 +ARGBToRGB24Row_SSSE3 +ARGBToRAWRow_SSSE3 +ARGBToRGB24Row_AVX2 +ARGBToRAWRow_AVX2 +ARGBToRGB565Row_SSE2 +ARGBToRGB565DitherRow_SSE2 +ARGBToRGB565DitherRow_AVX2 +ARGBToARGB1555Row_SSE2 +ARGBToARGB4444Row_SSE2 +ARGBToAR30Row_SSSE3 +ABGRToAR30Row_SSSE3 +ARGBToAR30Row_AVX2 +ABGRToAR30Row_AVX2 +ARGBToAR64Row_SSSE3 +ARGBToAB64Row_SSSE3 +AR64ToARGBRow_SSSE3 +AB64ToARGBRow_SSSE3 +ARGBToAR64Row_AVX2 +ARGBToAB64Row_AVX2 +AR64ToARGBRow_AVX2 +AB64ToARGBRow_AVX2 +ARGBToYRow_SSSE3 +ARGBToYJRow_SSSE3 +ABGRToYJRow_SSSE3 +RGBAToYJRow_SSSE3 +ARGBToYRow_AVX2 +ABGRToYRow_AVX2 +ARGBToYJRow_AVX2 +ABGRToYJRow_AVX2 +RGBAToYJRow_AVX2 +ARGBToUVRow_SSSE3 +ARGBToUVRow_AVX2 +ABGRToUVRow_AVX2 +ARGBToUVJRow_AVX2 +ABGRToUVJRow_AVX2 +ARGBToUVJRow_SSSE3 +ABGRToUVJRow_SSSE3 +ARGBToUV444Row_SSSE3 +BGRAToYRow_SSSE3 +BGRAToUVRow_SSSE3 +ABGRToYRow_SSSE3 +RGBAToYRow_SSSE3 +ABGRToUVRow_SSSE3 +RGBAToUVRow_SSSE3 +I444ToARGBRow_SSSE3 +I444AlphaToARGBRow_SSSE3 +I422ToRGB24Row_SSSE3 +I444ToRGB24Row_SSSE3 +I422ToARGBRow_SSSE3 +I422ToAR30Row_SSSE3 +I210ToARGBRow_SSSE3 +I212ToARGBRow_SSSE3 +I210ToAR30Row_SSSE3 +I212ToAR30Row_SSSE3 +I410ToARGBRow_SSSE3 +I210AlphaToARGBRow_SSSE3 +I410AlphaToARGBRow_SSSE3 +I410ToAR30Row_SSSE3 +I422AlphaToARGBRow_SSSE3 +NV12ToARGBRow_SSSE3 +NV21ToARGBRow_SSSE3 +YUY2ToARGBRow_SSSE3 +UYVYToARGBRow_SSSE3 +P210ToARGBRow_SSSE3 +P410ToARGBRow_SSSE3 +P210ToAR30Row_SSSE3 +P410ToAR30Row_SSSE3 +I422ToRGBARow_SSSE3 +I444ToARGBRow_AVX2 +I422ToARGBRow_AVX2 +I422ToAR30Row_AVX2 +I210ToARGBRow_AVX2 +I212ToARGBRow_AVX2 +I210ToAR30Row_AVX2 +I212ToAR30Row_AVX2 +I410ToARGBRow_AVX2 +I210AlphaToARGBRow_AVX2 +I410AlphaToARGBRow_AVX2 +I410ToAR30Row_AVX2 +I444AlphaToARGBRow_AVX2 +I422AlphaToARGBRow_AVX2 +I422ToRGBARow_AVX2 +NV12ToARGBRow_AVX2 +NV21ToARGBRow_AVX2 +YUY2ToARGBRow_AVX2 +UYVYToARGBRow_AVX2 +P210ToARGBRow_AVX2 +P410ToARGBRow_AVX2 +P210ToAR30Row_AVX2 +P410ToAR30Row_AVX2 +I400ToARGBRow_SSE2 +I400ToARGBRow_AVX2 +MirrorRow_SSSE3 +MirrorRow_AVX2 +MirrorUVRow_SSSE3 +MirrorUVRow_AVX2 +MirrorSplitUVRow_SSSE3 +RGB24MirrorRow_SSSE3 +ARGBMirrorRow_SSE2 +ARGBMirrorRow_AVX2 +SplitUVRow_AVX2 +SplitUVRow_SSE2 +DetileRow_SSE2 +DetileRow_16_SSE2 +DetileRow_16_AVX +DetileToYUY2_SSE2 +DetileSplitUVRow_SSSE3 +MergeUVRow_AVX2 +MergeUVRow_SSE2 +MergeUVRow_16_AVX2 +SplitUVRow_16_AVX2 +MultiplyRow_16_AVX2 +DivideRow_16_AVX2 +Convert16To8Row_SSSE3 +Convert16To8Row_AVX2 +Convert8To16Row_SSE2 +Convert8To16Row_AVX2 +SplitRGBRow_SSSE3 +MergeRGBRow_SSSE3 +MergeARGBRow_SSE2 +MergeXRGBRow_SSE2 +MergeARGBRow_AVX2 +MergeXRGBRow_AVX2 +SplitARGBRow_SSE2 +SplitXRGBRow_SSE2 +SplitARGBRow_SSSE3 +SplitXRGBRow_SSSE3 +SplitARGBRow_AVX2 +SplitXRGBRow_AVX2 +MergeXR30Row_AVX2 +MergeAR64Row_AVX2 +MergeXR64Row_AVX2 +MergeARGB16To8Row_AVX2 +MergeXRGB16To8Row_AVX2 +CopyRow_SSE2 +CopyRow_AVX +CopyRow_ERMS +ARGBCopyAlphaRow_SSE2 +ARGBCopyAlphaRow_AVX2 +ARGBExtractAlphaRow_SSE2 +ARGBExtractAlphaRow_AVX2 +ARGBCopyYToAlphaRow_SSE2 +ARGBCopyYToAlphaRow_AVX2 +SetRow_X86 +SetRow_ERMS +ARGBSetRow_X86 +YUY2ToYRow_SSE2 +YUY2ToNVUVRow_SSE2 +YUY2ToUVRow_SSE2 +YUY2ToUV422Row_SSE2 +UYVYToYRow_SSE2 +UYVYToUVRow_SSE2 +UYVYToUV422Row_SSE2 +YUY2ToYRow_AVX2 +YUY2ToNVUVRow_AVX2 +YUY2ToUVRow_AVX2 +YUY2ToUV422Row_AVX2 +UYVYToYRow_AVX2 +UYVYToUVRow_AVX2 +UYVYToUV422Row_AVX2 +ARGBBlendRow_SSSE3 +BlendPlaneRow_SSSE3 +BlendPlaneRow_AVX2 +ARGBAttenuateRow_SSSE3 +ARGBAttenuateRow_AVX2 +ARGBUnattenuateRow_SSE2 +ARGBUnattenuateRow_AVX2 +ARGBGrayRow_SSSE3 +ARGBSepiaRow_SSSE3 +ARGBColorMatrixRow_SSSE3 +ARGBQuantizeRow_SSE2 +ARGBShadeRow_SSE2 +ARGBMultiplyRow_SSE2 +ARGBMultiplyRow_AVX2 +ARGBAddRow_SSE2 +ARGBAddRow_AVX2 +ARGBSubtractRow_SSE2 +ARGBSubtractRow_AVX2 +SobelXRow_SSE2 +SobelYRow_SSE2 +SobelRow_SSE2 +SobelToPlaneRow_SSE2 +SobelXYRow_SSE2 +ComputeCumulativeSumRow_SSE2 +CumulativeSumToAverageRow_SSE2 +InterpolateRow_SSSE3 +InterpolateRow_AVX2 +ARGBShuffleRow_SSSE3 +ARGBShuffleRow_AVX2 +I422ToYUY2Row_SSE2 +I422ToUYVYRow_SSE2 +I422ToYUY2Row_AVX2 +I422ToUYVYRow_AVX2 +ARGBPolynomialRow_SSE2 +ARGBPolynomialRow_AVX2 +HalfFloatRow_SSE2 +HalfFloatRow_AVX2 +ARGBColorTableRow_X86 +RGBColorTableRow_X86 +ARGBLumaColorTableRow_SSSE3 +NV21ToYUV24Row_SSSE3 +NV21ToYUV24Row_AVX2 +SwapUVRow_SSSE3 +SwapUVRow_AVX2 +HalfMergeUVRow_SSSE3 +HalfMergeUVRow_AVX2 +ClampFloatToZero_SSE2 +MergeARGBRow_Any_SSE2 +MergeARGBRow_Any_AVX2 +I444AlphaToARGBRow_Any_SSSE3 +I444AlphaToARGBRow_Any_AVX2 +I422AlphaToARGBRow_Any_SSSE3 +I422AlphaToARGBRow_Any_AVX2 +I210AlphaToARGBRow_Any_SSSE3 +I210AlphaToARGBRow_Any_AVX2 +I410AlphaToARGBRow_Any_SSSE3 +I410AlphaToARGBRow_Any_AVX2 +MergeAR64Row_Any_AVX2 +MergeARGB16To8Row_Any_AVX2 +MergeRGBRow_Any_SSSE3 +MergeXRGBRow_Any_SSE2 +MergeXRGBRow_Any_AVX2 +I422ToYUY2Row_Any_SSE2 +I422ToUYVYRow_Any_SSE2 +I422ToYUY2Row_Any_AVX2 +I422ToUYVYRow_Any_AVX2 +BlendPlaneRow_Any_AVX2 +BlendPlaneRow_Any_SSSE3 +I422ToARGBRow_Any_SSSE3 +I422ToRGBARow_Any_SSSE3 +I422ToARGB4444Row_Any_SSSE3 +I422ToARGB1555Row_Any_SSSE3 +I422ToRGB565Row_Any_SSSE3 +I422ToRGB24Row_Any_SSSE3 +I422ToAR30Row_Any_SSSE3 +I422ToAR30Row_Any_AVX2 +I444ToARGBRow_Any_SSSE3 +I444ToRGB24Row_Any_SSSE3 +I422ToRGB24Row_Any_AVX2 +I422ToARGBRow_Any_AVX2 +I422ToRGBARow_Any_AVX2 +I444ToARGBRow_Any_AVX2 +I444ToRGB24Row_Any_AVX2 +I422ToARGB4444Row_Any_AVX2 +I422ToARGB1555Row_Any_AVX2 +I422ToRGB565Row_Any_AVX2 +I210ToAR30Row_Any_SSSE3 +I210ToARGBRow_Any_SSSE3 +I210ToARGBRow_Any_AVX2 +I210ToAR30Row_Any_AVX2 +I410ToAR30Row_Any_SSSE3 +I410ToARGBRow_Any_SSSE3 +I410ToARGBRow_Any_AVX2 +I410ToAR30Row_Any_AVX2 +I212ToAR30Row_Any_SSSE3 +I212ToARGBRow_Any_SSSE3 +I212ToARGBRow_Any_AVX2 +I212ToAR30Row_Any_AVX2 +MergeXR30Row_Any_AVX2 +MergeXR64Row_Any_AVX2 +MergeXRGB16To8Row_Any_AVX2 +MergeUVRow_Any_SSE2 +MergeUVRow_Any_AVX2 +NV21ToYUV24Row_Any_SSSE3 +NV21ToYUV24Row_Any_AVX2 +ARGBMultiplyRow_Any_SSE2 +ARGBAddRow_Any_SSE2 +ARGBSubtractRow_Any_SSE2 +ARGBMultiplyRow_Any_AVX2 +ARGBAddRow_Any_AVX2 +ARGBSubtractRow_Any_AVX2 +SobelRow_Any_SSE2 +SobelToPlaneRow_Any_SSE2 +SobelXYRow_Any_SSE2 +YUY2ToNVUVRow_Any_SSE2 +YUY2ToNVUVRow_Any_AVX2 +NV12ToARGBRow_Any_SSSE3 +NV12ToARGBRow_Any_AVX2 +NV21ToARGBRow_Any_SSSE3 +NV21ToARGBRow_Any_AVX2 +NV12ToRGB24Row_Any_SSSE3 +NV21ToRGB24Row_Any_SSSE3 +NV12ToRGB24Row_Any_AVX2 +NV21ToRGB24Row_Any_AVX2 +NV12ToRGB565Row_Any_SSSE3 +NV12ToRGB565Row_Any_AVX2 +P210ToAR30Row_Any_SSSE3 +P210ToARGBRow_Any_SSSE3 +P210ToARGBRow_Any_AVX2 +P210ToAR30Row_Any_AVX2 +P410ToAR30Row_Any_SSSE3 +P410ToARGBRow_Any_SSSE3 +P410ToARGBRow_Any_AVX2 +P410ToAR30Row_Any_AVX2 +MergeUVRow_16_Any_AVX2 +CopyRow_Any_AVX +CopyRow_Any_SSE2 +ARGBToRGB24Row_Any_SSSE3 +ARGBToRAWRow_Any_SSSE3 +ARGBToRGB565Row_Any_SSE2 +ARGBToARGB1555Row_Any_SSE2 +ARGBToARGB4444Row_Any_SSE2 +ARGBToRGB24Row_Any_AVX2 +ARGBToRAWRow_Any_AVX2 +ABGRToAR30Row_Any_SSSE3 +ARGBToAR30Row_Any_SSSE3 +ABGRToAR30Row_Any_AVX2 +ARGBToAR30Row_Any_AVX2 +J400ToARGBRow_Any_SSE2 +RGB24ToARGBRow_Any_SSSE3 +RAWToARGBRow_Any_SSSE3 +RGB565ToARGBRow_Any_SSE2 +ARGB1555ToARGBRow_Any_SSE2 +ARGB4444ToARGBRow_Any_SSE2 +RAWToRGBARow_Any_SSSE3 +RAWToRGB24Row_Any_SSSE3 +ARGBToYRow_Any_AVX2 +ABGRToYRow_Any_AVX2 +ARGBToYJRow_Any_AVX2 +ABGRToYJRow_Any_AVX2 +RGBAToYJRow_Any_AVX2 +UYVYToYRow_Any_AVX2 +YUY2ToYRow_Any_AVX2 +ARGBToYRow_Any_SSSE3 +BGRAToYRow_Any_SSSE3 +ABGRToYRow_Any_SSSE3 +RGBAToYRow_Any_SSSE3 +YUY2ToYRow_Any_SSE2 +UYVYToYRow_Any_SSE2 +ARGBToYJRow_Any_SSSE3 +ABGRToYJRow_Any_SSSE3 +RGBAToYJRow_Any_SSSE3 +RGB24ToYJRow_Any_AVX2 +RGB24ToYJRow_Any_SSSE3 +RAWToYJRow_Any_AVX2 +RAWToYJRow_Any_SSSE3 +SwapUVRow_Any_SSSE3 +SwapUVRow_Any_AVX2 +ARGBAttenuateRow_Any_SSSE3 +ARGBUnattenuateRow_Any_SSE2 +ARGBAttenuateRow_Any_AVX2 +ARGBUnattenuateRow_Any_AVX2 +ARGBExtractAlphaRow_Any_SSE2 +ARGBExtractAlphaRow_Any_AVX2 +ARGBCopyAlphaRow_Any_AVX2 +ARGBCopyAlphaRow_Any_SSE2 +ARGBCopyYToAlphaRow_Any_AVX2 +ARGBCopyYToAlphaRow_Any_SSE2 +I400ToARGBRow_Any_SSE2 +I400ToARGBRow_Any_AVX2 +ARGBToRGB565DitherRow_Any_SSE2 +ARGBToRGB565DitherRow_Any_AVX2 +ARGBShuffleRow_Any_SSSE3 +ARGBShuffleRow_Any_AVX2 +ARGBToAR64Row_Any_SSSE3 +ARGBToAB64Row_Any_SSSE3 +AR64ToARGBRow_Any_SSSE3 +AB64ToARGBRow_Any_SSSE3 +ARGBToAR64Row_Any_AVX2 +ARGBToAB64Row_Any_AVX2 +AR64ToARGBRow_Any_AVX2 +AB64ToARGBRow_Any_AVX2 +Convert16To8Row_Any_SSSE3 +Convert16To8Row_Any_AVX2 +Convert8To16Row_Any_SSE2 +Convert8To16Row_Any_AVX2 +MultiplyRow_16_Any_AVX2 +DivideRow_16_Any_AVX2 +HalfFloatRow_Any_SSE2 +HalfFloatRow_Any_AVX2 +YUY2ToARGBRow_Any_SSSE3 +UYVYToARGBRow_Any_SSSE3 +YUY2ToARGBRow_Any_AVX2 +ScaleRowUp2_Linear_Any_C +ScaleRowUp2_Linear_16_Any_C +ScaleRowUp2_Bilinear_Any_C +ScaleRowUp2_Bilinear_16_Any_C +ScaleUVRowUp2_Linear_Any_C +ScaleUVRowUp2_Linear_16_Any_C +ScaleUVRowUp2_Bilinear_Any_C +ScaleUVRowUp2_Bilinear_16_Any_C +RGB24ToARGBRow_C +RAWToARGBRow_C +RAWToRGBARow_C +RAWToRGB24Row_C +RGB565ToARGBRow_C +ARGB1555ToARGBRow_C +ARGB4444ToARGBRow_C +AR30ToARGBRow_C +AR30ToABGRRow_C +AR30ToAB30Row_C +ARGBToRGB24Row_C +ARGBToRAWRow_C +ARGBToRGB565Row_C +ARGBToRGB565DitherRow_C +ARGBToARGB1555Row_C +ARGBToARGB4444Row_C +ABGRToAR30Row_C +ARGBToAR30Row_C +ARGBToAR64Row_C +ARGBToAB64Row_C +AR64ToARGBRow_C +AB64ToARGBRow_C +AR64ShuffleRow_C +ARGBToYRow_C +ARGBToUVRow_C +BGRAToYRow_C +BGRAToUVRow_C +ABGRToYRow_C +ABGRToUVRow_C +RGBAToYRow_C +RGBAToUVRow_C +RGB24ToYRow_C +RGB24ToUVRow_C +RAWToYRow_C +RAWToUVRow_C +ARGBToYJRow_C +ARGBToUVJRow_C +ABGRToYJRow_C +ABGRToUVJRow_C +RGBAToYJRow_C +RGBAToUVJRow_C +RGB24ToYJRow_C +RGB24ToUVJRow_C +RAWToYJRow_C +RAWToUVJRow_C +RGB565ToYRow_C +ARGB1555ToYRow_C +ARGB4444ToYRow_C +RGB565ToUVRow_C +ARGB1555ToUVRow_C +ARGB4444ToUVRow_C +ARGBToUV444Row_C +ARGBGrayRow_C +ARGBSepiaRow_C +ARGBColorMatrixRow_C +ARGBColorTableRow_C +RGBColorTableRow_C +ARGBQuantizeRow_C +ARGBShadeRow_C +ARGBMultiplyRow_C +ARGBAddRow_C +ARGBSubtractRow_C +SobelXRow_C +SobelYRow_C +SobelRow_C +SobelToPlaneRow_C +SobelXYRow_C +J400ToARGBRow_C +I444ToARGBRow_C +I444ToRGB24Row_C +I422ToARGBRow_C +I210ToARGBRow_C +I410ToARGBRow_C +I210AlphaToARGBRow_C +I410AlphaToARGBRow_C +I212ToARGBRow_C +I210ToAR30Row_C +I212ToAR30Row_C +I410ToAR30Row_C +P210ToARGBRow_C +P410ToARGBRow_C +P210ToAR30Row_C +P410ToAR30Row_C +I422ToAR30Row_C +I444AlphaToARGBRow_C +I422AlphaToARGBRow_C +I422ToRGB24Row_C +I422ToARGB4444Row_C +I422ToARGB1555Row_C +I422ToRGB565Row_C +NV12ToARGBRow_C +NV21ToARGBRow_C +NV12ToRGB24Row_C +NV21ToRGB24Row_C +NV12ToRGB565Row_C +YUY2ToARGBRow_C +UYVYToARGBRow_C +I422ToRGBARow_C +I400ToARGBRow_C +MirrorRow_C +MirrorRow_16_C +MirrorUVRow_C +MirrorSplitUVRow_C +ARGBMirrorRow_C +RGB24MirrorRow_C +SplitUVRow_C +MergeUVRow_C +DetileRow_C +DetileRow_16_C +DetileSplitUVRow_C +DetileToYUY2_C +UnpackMT2T_C +SplitRGBRow_C +MergeRGBRow_C +SplitARGBRow_C +MergeARGBRow_C +MergeXR30Row_C +MergeAR64Row_C +MergeARGB16To8Row_C +MergeXR64Row_C +MergeXRGB16To8Row_C +SplitXRGBRow_C +MergeXRGBRow_C +MergeUVRow_16_C +SplitUVRow_16_C +MultiplyRow_16_C +DivideRow_16_C +Convert16To8Row_C +Convert8To16Row_C +CopyRow_C +CopyRow_16_C +SetRow_C +ARGBSetRow_C +YUY2ToUVRow_C +YUY2ToNVUVRow_C +YUY2ToUV422Row_C +YUY2ToYRow_C +UYVYToUVRow_C +UYVYToUV422Row_C +UYVYToYRow_C +ARGBBlendRow_C +BlendPlaneRow_C +ARGBAttenuateRow_C +ARGBUnattenuateRow_C +ComputeCumulativeSumRow_C +CumulativeSumToAverageRow_C +InterpolateRow_C +InterpolateRow_16_C +InterpolateRow_16To8_C +ARGBShuffleRow_C +I422ToYUY2Row_C +I422ToUYVYRow_C +ARGBPolynomialRow_C +HalfFloatRow_C +ByteToFloatRow_C +ARGBLumaColorTableRow_C +ARGBCopyAlphaRow_C +ARGBExtractAlphaRow_C +ARGBCopyYToAlphaRow_C +ScaleSumSamples_C +ScaleMaxSamples_C +ScaleSamples_C +GaussRow_C +GaussCol_C +GaussRow_F32_C +GaussCol_F32_C +NV21ToYUV24Row_C +AYUVToUVRow_C +AYUVToVURow_C +AYUVToYRow_C +SwapUVRow_C +HalfMergeUVRow_C +kYuvI601Constants +kYvuI601Constants +kYuvJPEGConstants +kYvuJPEGConstants +kYuvH709Constants +kYvuH709Constants +kYuvF709Constants +kYvuF709Constants +kYuv2020Constants +kYvu2020Constants +kYuvV2020Constants +kYvuV2020Constants +fixed_invtbl8 +YUY2ToUVRow_Any_AVX2 +ScaleRowDown2_Any_SSSE3 +ScaleRowDown2Linear_Any_SSSE3 +ScaleRowDown2Box_Any_SSSE3 +ScaleRowDown2Box_Odd_SSSE3 +ScaleUVRowDown2Box_Any_SSSE3 +ScaleUVRowDown2Box_Any_AVX2 +ScaleRowDown2_Any_AVX2 +ScaleRowDown2Linear_Any_AVX2 +ScaleRowDown2Box_Any_AVX2 +ScaleRowDown2Box_Odd_AVX2 +ScaleRowDown4_Any_SSSE3 +ScaleRowDown4Box_Any_SSSE3 +ScaleRowDown4_Any_AVX2 +ScaleRowDown4Box_Any_AVX2 +ScaleRowDown34_Any_SSSE3 +ScaleRowDown34_0_Box_Any_SSSE3 +ScaleRowDown34_1_Box_Any_SSSE3 +ScaleRowDown38_Any_SSSE3 +ScaleRowDown38_3_Box_Any_SSSE3 +ScaleRowDown38_2_Box_Any_SSSE3 +ScaleARGBRowDown2_Any_SSE2 +ScaleARGBRowDown2Linear_Any_SSE2 +ScaleARGBRowDown2Box_Any_SSE2 +ScaleARGBRowDownEven_Any_SSE2 +ScaleARGBRowDownEvenBox_Any_SSE2 +ScaleAddRow_Any_SSE2 +ScaleAddRow_Any_AVX2 +ScaleRowUp2_Linear_Any_SSE2 +ScaleRowUp2_Linear_Any_SSSE3 +ScaleRowUp2_Linear_12_Any_SSSE3 +ScaleRowUp2_Linear_16_Any_SSE2 +ScaleRowUp2_Linear_Any_AVX2 +ScaleRowUp2_Linear_12_Any_AVX2 +ScaleRowUp2_Linear_16_Any_AVX2 +ScaleRowUp2_Bilinear_Any_SSE2 +ScaleRowUp2_Bilinear_12_Any_SSSE3 +ScaleRowUp2_Bilinear_16_Any_SSE2 +ScaleRowUp2_Bilinear_Any_SSSE3 +ScaleRowUp2_Bilinear_Any_AVX2 +ScaleRowUp2_Bilinear_12_Any_AVX2 +ScaleRowUp2_Bilinear_16_Any_AVX2 +ScaleUVRowUp2_Linear_Any_SSSE3 +ScaleUVRowUp2_Linear_Any_AVX2 +ScaleUVRowUp2_Linear_16_Any_SSE41 +ScaleUVRowUp2_Linear_16_Any_AVX2 +ScaleUVRowUp2_Bilinear_Any_SSSE3 +ScaleUVRowUp2_Bilinear_Any_AVX2 +ScaleUVRowUp2_Bilinear_16_Any_SSE41 +ScaleUVRowUp2_Bilinear_16_Any_AVX2 +ScaleRowDown2_Any_NEON +ScaleRowDown2Linear_Any_NEON +ScaleRowDown2Box_Any_NEON +ScaleRowDown2Box_Odd_NEON +ScaleUVRowDown2_Any_NEON +ScaleUVRowDown2Linear_Any_NEON +ScaleUVRowDown2Box_Any_NEON +ScaleRowDown4_Any_NEON +ScaleRowDown4Box_Any_NEON +ScaleRowDown34_Any_NEON +ScaleRowDown34_0_Box_Any_NEON +ScaleRowDown34_1_Box_Any_NEON +ScaleRowDown38_Any_NEON +ScaleRowDown38_3_Box_Any_NEON +ScaleRowDown38_2_Box_Any_NEON +ScaleARGBRowDown2_Any_NEON +ScaleARGBRowDown2Linear_Any_NEON +ScaleARGBRowDown2Box_Any_NEON +ScaleARGBRowDownEven_Any_NEON +ScaleARGBRowDownEvenBox_Any_NEON +ScaleRowDown2_Any_NEON +ScaleRowDown2Linear_Any_NEON +ScaleRowDown2Box_Any_NEON +ScaleRowDown2Box_Odd_NEON +ScaleUVRowDown2_Any_NEON +ScaleUVRowDown2Linear_Any_NEON +ScaleUVRowDown2Box_Any_NEON +ScaleRowDown4_Any_NEON +ScaleRowDown4Box_Any_NEON +ScaleRowDown34_Any_NEON +ScaleRowDown34_0_Box_Any_NEON +ScaleRowDown34_1_Box_Any_NEON +ScaleRowDown38_Any_NEON +ScaleRowDown38_3_Box_Any_NEON +ScaleRowDown38_2_Box_Any_NEON +ScaleARGBRowDown2_Any_NEON +ScaleARGBRowDown2Linear_Any_NEON +ScaleARGBRowDown2Box_Any_NEON +ScaleARGBRowDownEven_Any_NEON +ScaleARGBRowDownEvenBox_Any_NEON +ScaleUVRowDownEven_Any_NEON +ScaleAddRow_Any_NEON +ScaleFilterCols_Any_NEON +ScaleARGBCols_Any_NEON +ScaleARGBFilterCols_Any_NEON +ScaleRowUp2_Linear_Any_NEON +ScaleRowUp2_Linear_12_Any_NEON +ScaleRowUp2_Linear_16_Any_NEON +ScaleRowUp2_Bilinear_Any_NEON +ScaleRowUp2_Bilinear_12_Any_NEON +ScaleRowUp2_Bilinear_16_Any_NEON +ScaleUVRowUp2_Linear_Any_NEON +ScaleUVRowUp2_Linear_16_Any_NEON +ScaleUVRowUp2_Bilinear_Any_NEON +ScaleUVRowUp2_Bilinear_16_Any_NEON +I422ToARGBRow_Any_AVX512BWa +MergeUVRow_Any_AVX512BW +ARGBToRGB24Row_Any_AVX512VBMI +YUY2ToUVRow_Any_AVX2 +I422ToRGB565Row_SSSE3 +I422ToARGB1555Row_SSSE3 +I422ToARGB4444Row_SSSE3 +NV12ToRGB565Row_SSSE3 +NV12ToRGB24Row_SSSE3 +NV21ToRGB24Row_SSSE3 +NV12ToRGB24Row_AVX2 +NV21ToRGB24Row_AVX2 +I422ToARGB1555Row_AVX2 +I422ToARGB4444Row_AVX2 +I422ToRGB24Row_AVX2 +I444ToRGB24Row_AVX2 +NV12ToRGB565Row_AVX2 +RGB24ToYJRow_AVX2 +RAWToYJRow_AVX2 +RGB24ToYJRow_SSSE3 +RAWToYJRow_SSSE3 +InterpolateRow_16To8_AVX2 +I422ToARGBRow_Any_AVX512BW +I422ToRGB565Row_SSSE3 +I422ToARGB1555Row_SSSE3 +I422ToARGB4444Row_SSSE3 +NV12ToRGB565Row_SSSE3 +NV12ToRGB24Row_SSSE3 +NV21ToRGB24Row_SSSE3 +NV12ToRGB24Row_AVX2 +NV21ToRGB24Row_AVX2 +I422ToRGB565Row_AVX2 +I422ToARGB1555Row_AVX2 +I422ToARGB4444Row_AVX2 +I422ToRGB24Row_AVX2 +I444ToRGB24Row_AVX2 +NV12ToRGB565Row_AVX2 +RGB24ToYJRow_AVX2 +RAWToYJRow_AVX2 +RGB24ToYJRow_SSSE3 +RAWToYJRow_SSSE3 +InterpolateRow_16To8_AVX2 +ARGBToRGB24Row_AVX512VBMI +I422ToARGBRow_AVX512BW +MergeUVRow_AVX512BW +ARGBToABGRRow_C +ARGBToBGRARow_C +ARGBToRGBARow_C +RGBAToARGBRow_C +AR64ToAB64Row_C +YUY2ToARGBMatrix +UYVYToARGBMatrix From 2ba0a2e7e976f86a5e3f1aeb66685f419741efef Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 10 Dec 2024 13:01:23 -0800 Subject: [PATCH 27/51] Adding disconnect reason (#507) * Update protocol to v1.29.3 * generated protobuf * adding disconnect reason, pass through to FFI used for `ParticipantDisconnected` events --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- 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-protocol/protocol | 2 +- livekit-protocol/src/livekit.rs | 342 +- livekit-protocol/src/livekit.serde.rs | 2966 +++++++++++++---- 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 + 17 files changed, 3520 insertions(+), 1007 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d907dc782..6154cfb8b 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 99538ca4a..cca769851 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 e2517be9d..aca2d11e9 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 c0a480f2a..3f1e2720c 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 edae5c007..4d0f3d92d 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 755f0bd06..c80453cd9 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 2dc32170d..dac00067d 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 077dc4aeb..700666903 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-protocol/protocol b/livekit-protocol/protocol index a601adc5e..095606bc8 160000 --- a/livekit-protocol/protocol +++ b/livekit-protocol/protocol @@ -1 +1 @@ -Subproject commit a601adc5e9027820857a6d445b32a868b19d4184 +Subproject commit 095606bc8e0e73535c6bf4867645dfff0825f121 diff --git a/livekit-protocol/src/livekit.rs b/livekit-protocol/src/livekit.rs index 19181c255..9c3107e4a 100644 --- a/livekit-protocol/src/livekit.rs +++ b/livekit-protocol/src/livekit.rs @@ -124,6 +124,12 @@ pub enum MetricLabel { ClientVideoPublisherQualityLimitationDurationCpu = 15, /// total duration spent in other quality limitation ClientVideoPublisherQualityLimitationDurationOther = 16, + /// Publisher RTT (participant -> server) + PublisherRtt = 17, + /// RTT between publisher node and subscriber node (could involve intermedia node(s)) + ServerMeshRtt = 18, + /// Subscribe RTT (server -> participant) + SubscriberRtt = 19, PredefinedMaxValue = 4096, } impl MetricLabel { @@ -150,6 +156,9 @@ impl MetricLabel { MetricLabel::ClientVideoPublisherQualityLimitationDurationBandwidth => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", MetricLabel::ClientVideoPublisherQualityLimitationDurationCpu => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", MetricLabel::ClientVideoPublisherQualityLimitationDurationOther => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + MetricLabel::PublisherRtt => "PUBLISHER_RTT", + MetricLabel::ServerMeshRtt => "SERVER_MESH_RTT", + MetricLabel::SubscriberRtt => "SUBSCRIBER_RTT", MetricLabel::PredefinedMaxValue => "METRIC_LABEL_PREDEFINED_MAX_VALUE", } } @@ -173,6 +182,9 @@ impl MetricLabel { "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH" => Some(Self::ClientVideoPublisherQualityLimitationDurationBandwidth), "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU" => Some(Self::ClientVideoPublisherQualityLimitationDurationCpu), "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER" => Some(Self::ClientVideoPublisherQualityLimitationDurationOther), + "PUBLISHER_RTT" => Some(Self::PublisherRtt), + "SERVER_MESH_RTT" => Some(Self::ServerMeshRtt), + "SUBSCRIBER_RTT" => Some(Self::SubscriberRtt), "METRIC_LABEL_PREDEFINED_MAX_VALUE" => Some(Self::PredefinedMaxValue), _ => None, } @@ -503,7 +515,7 @@ pub struct DataPacket { /// identities of participants who will receive the message (sent to all by default) #[prost(string, repeated, tag="5")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(oneof="data_packet::Value", tags="2, 3, 6, 7, 8, 9, 10, 11, 12")] + #[prost(oneof="data_packet::Value", tags="2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14")] pub value: ::core::option::Option, } /// Nested message and enum types in `DataPacket`. @@ -555,6 +567,10 @@ pub mod data_packet { RpcAck(super::RpcAck), #[prost(message, tag="12")] RpcResponse(super::RpcResponse), + #[prost(message, tag="13")] + StreamHeader(super::data_stream::Header), + #[prost(message, tag="14")] + StreamChunk(super::data_stream::Chunk), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -1100,6 +1116,136 @@ pub struct TimedVersion { #[prost(int32, tag="2")] pub ticks: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DataStream { +} +/// Nested message and enum types in `DataStream`. +pub mod data_stream { + /// header properties specific to text streams + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct TextHeader { + #[prost(enumeration="OperationType", tag="1")] + pub operation_type: i32, + /// Optional: Version for updates/edits + #[prost(int32, tag="2")] + pub version: i32, + /// Optional: Reply to specific message + #[prost(string, tag="3")] + pub reply_to_stream_id: ::prost::alloc::string::String, + /// file attachments for text streams + #[prost(string, repeated, tag="4")] + pub attached_stream_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// true if the text has been generated by an agent from a participant's audio transcription + #[prost(bool, tag="5")] + pub generated: bool, + } + /// header properties specific to file or image streams + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct FileHeader { + /// name of the file + #[prost(string, tag="1")] + pub file_name: ::prost::alloc::string::String, + } + /// main DataStream.Header that contains a oneof for specific headers + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Header { + /// unique identifier for this data stream + #[prost(string, tag="1")] + pub stream_id: ::prost::alloc::string::String, + /// using int64 for Unix timestamp + #[prost(int64, tag="2")] + pub timestamp: i64, + #[prost(string, tag="3")] + pub topic: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub mime_type: ::prost::alloc::string::String, + /// only populated for finite streams, if it's a stream of unknown size this stays empty + #[prost(uint64, optional, tag="5")] + pub total_length: ::core::option::Option, + /// only populated for finite streams, if it's a stream of unknown size this stays empty + #[prost(uint64, optional, tag="6")] + pub total_chunks: ::core::option::Option, + /// defaults to NONE + #[prost(enumeration="super::encryption::Type", tag="7")] + pub encryption_type: i32, + /// user defined extensions map that can carry additional info + #[prost(map="string, string", tag="8")] + pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// oneof to choose between specific header types + #[prost(oneof="header::ContentHeader", tags="9, 10")] + pub content_header: ::core::option::Option, + } + /// Nested message and enum types in `Header`. + pub mod header { + /// oneof to choose between specific header types + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum ContentHeader { + #[prost(message, tag="9")] + TextHeader(super::TextHeader), + #[prost(message, tag="10")] + FileHeader(super::FileHeader), + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Chunk { + /// unique identifier for this data stream to map it to the correct header + #[prost(string, tag="1")] + pub stream_id: ::prost::alloc::string::String, + #[prost(uint64, tag="2")] + pub chunk_index: u64, + /// content as binary (bytes) + #[prost(bytes="vec", tag="3")] + pub content: ::prost::alloc::vec::Vec, + /// true only if this is the last chunk of this stream - can also be sent with empty content + #[prost(bool, tag="4")] + pub complete: bool, + /// a version indicating that this chunk_index has been retroactively modified and the original one needs to be replaced + #[prost(int32, tag="5")] + pub version: i32, + /// optional, initialization vector for AES-GCM encryption + #[prost(bytes="vec", optional, tag="6")] + pub iv: ::core::option::Option<::prost::alloc::vec::Vec>, + } + /// enum for operation types (specific to TextHeader) + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum OperationType { + Create = 0, + Update = 1, + Delete = 2, + Reaction = 3, + } + impl OperationType { + /// 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 { + OperationType::Create => "CREATE", + OperationType::Update => "UPDATE", + OperationType::Delete => "DELETE", + OperationType::Reaction => "REACTION", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CREATE" => Some(Self::Create), + "UPDATE" => Some(Self::Update), + "DELETE" => Some(Self::Delete), + "REACTION" => Some(Self::Reaction), + _ => None, + } + } + } +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AudioCodec { @@ -1371,6 +1517,12 @@ pub enum DisconnectReason { 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. @@ -1390,6 +1542,9 @@ impl DisconnectReason { 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. @@ -1406,6 +1561,9 @@ impl DisconnectReason { "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, } } @@ -2073,6 +2231,11 @@ pub struct EgressInfo { pub segment_results: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="20")] pub image_results: ::prost::alloc::vec::Vec, + #[prost(string, tag="23")] + pub manifest_location: ::prost::alloc::string::String, + /// next ID: 26 + #[prost(bool, tag="25")] + pub backup_storage_used: bool, #[prost(oneof="egress_info::Request", tags="4, 14, 19, 5, 6")] pub request: ::core::option::Option, /// deprecated (use _result fields) @@ -3471,8 +3634,8 @@ pub struct UpdateWorkerStatus { /// optional string metadata = 2 \[deprecated=true\]; #[prost(float, tag="3")] pub load: f32, - #[prost(int32, tag="4")] - pub job_count: i32, + #[prost(uint32, tag="4")] + pub job_count: u32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3650,7 +3813,7 @@ pub struct CreateRoomRequest { pub name: ::prost::alloc::string::String, /// configuration to use for this room parameters. Setting parameters below override the config defaults. #[prost(string, tag="12")] - pub config_name: ::prost::alloc::string::String, + pub room_preset: ::prost::alloc::string::String, /// number of seconds to keep the room open if no one joins #[prost(uint32, tag="2")] pub empty_timeout: u32, @@ -3666,12 +3829,9 @@ pub struct CreateRoomRequest { /// metadata of room #[prost(string, tag="5")] pub metadata: ::prost::alloc::string::String, - /// egress + /// auto-egress configurations #[prost(message, optional, tag="6")] pub egress: ::core::option::Option, - /// agent - #[prost(message, optional, tag="11")] - pub agent: ::core::option::Option, /// playout delay of subscriber #[prost(uint32, tag="7")] pub min_playout_delay: u32, @@ -3682,10 +3842,13 @@ pub struct CreateRoomRequest { #[prost(bool, tag="9")] pub sync_streams: bool, /// replay - /// - /// NEXT-ID: 14 #[prost(bool, tag="13")] pub replay_enabled: bool, + /// Define agents that should be dispatched to this room + /// + /// NEXT-ID: 15 + #[prost(message, repeated, tag="14")] + pub agents: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3863,15 +4026,12 @@ pub struct RoomConfiguration { /// number of seconds to keep the room open after everyone leaves #[prost(uint32, tag="3")] pub departure_timeout: u32, - /// limit number of participants that can be in a room + /// limit number of participants that can be in a room, excluding Egress and Ingress participants #[prost(uint32, tag="4")] pub max_participants: u32, /// egress #[prost(message, optional, tag="5")] pub egress: ::core::option::Option, - /// agent - #[prost(message, optional, tag="6")] - pub agent: ::core::option::Option, /// playout delay of subscriber #[prost(uint32, tag="7")] pub min_playout_delay: u32, @@ -3881,6 +4041,9 @@ pub struct RoomConfiguration { /// so not recommended for rooms with frequent subscription changes #[prost(bool, tag="9")] pub sync_streams: bool, + /// Define agents that should be dispatched to this room + #[prost(message, repeated, tag="10")] + pub agents: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4469,6 +4632,18 @@ pub struct SipInboundTrunkInfo { /// Map SIP X-* headers from INVITE to SIP participant attributes. #[prost(map="string, string", tag="10")] pub headers_to_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests. + /// Keys are the names of attributes and values are the names of X-* headers they will be mapped to. + #[prost(map="string, string", tag="14")] + pub attributes_to_headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Max time for the caller to wait for track subscription. + #[prost(message, optional, tag="11")] + pub ringing_timeout: ::core::option::Option<::pbjson_types::Duration>, + /// Max call duration. + #[prost(message, optional, tag="12")] + pub max_call_duration: ::core::option::Option<::pbjson_types::Duration>, + #[prost(bool, tag="13")] + pub krisp_enabled: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4512,6 +4687,10 @@ pub struct SipOutboundTrunkInfo { /// Keys are the names of X-* headers and values are the names of attributes they will be mapped to. #[prost(map="string, string", tag="10")] pub headers_to_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests. + /// Keys are the names of attributes and values are the names of X-* headers they will be mapped to. + #[prost(map="string, string", tag="11")] + pub attributes_to_headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4711,6 +4890,9 @@ pub struct CreateSipParticipantRequest { /// What number should be dialed via SIP #[prost(string, tag="2")] pub sip_call_to: ::prost::alloc::string::String, + /// Optional SIP From number to use. If empty, trunk number is used. + #[prost(string, tag="15")] + pub sip_number: ::prost::alloc::string::String, /// What LiveKit room should this participant be connected too #[prost(string, tag="3")] pub room_name: ::prost::alloc::string::String, @@ -4730,13 +4912,27 @@ pub struct CreateSipParticipantRequest { /// Character 'w' can be used to add a 0.5 sec delay. #[prost(string, tag="5")] pub dtmf: ::prost::alloc::string::String, - /// Optionally play ringtone in the room as an audible indicator for existing participants + /// Optionally play dialtone in the room as an audible indicator for existing participants. The `play_ringtone` option is deprectated but has the same effect. + #[deprecated] #[prost(bool, tag="6")] pub play_ringtone: bool, + #[prost(bool, tag="13")] + pub play_dialtone: bool, /// By default the From value (Phone number) is used for participant name/identity (if not set) and added to attributes. /// If true, a random value for identity will be used and numbers will be omitted from attributes. #[prost(bool, tag="10")] pub hide_phone_number: bool, + /// Max time for the callee to answer the call. + #[prost(message, optional, tag="11")] + pub ringing_timeout: ::core::option::Option<::pbjson_types::Duration>, + /// Max call duration. + #[prost(message, optional, tag="12")] + pub max_call_duration: ::core::option::Option<::pbjson_types::Duration>, + /// Enable voice isolation for the callee. + /// + /// NEXT ID: 16 + #[prost(bool, tag="14")] + pub enable_krisp: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4759,6 +4955,56 @@ pub struct TransferSipParticipantRequest { pub room_name: ::prost::alloc::string::String, #[prost(string, tag="3")] pub transfer_to: ::prost::alloc::string::String, + /// Optionally play dialtone to the SIP participant as an audible indicator of being transferred + #[prost(bool, tag="4")] + pub play_dialtone: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SipCallInfo { + #[prost(string, tag="1")] + pub call_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub trunk_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub room_name: ::prost::alloc::string::String, + /// ID of the current/previous room published to + #[prost(string, tag="4")] + pub room_id: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub participant_identity: ::prost::alloc::string::String, + #[prost(message, optional, tag="6")] + pub from_uri: ::core::option::Option, + #[prost(message, optional, tag="7")] + pub to_uri: ::core::option::Option, + #[prost(enumeration="SipFeature", repeated, tag="14")] + pub enabled_features: ::prost::alloc::vec::Vec, + #[prost(enumeration="SipCallStatus", tag="8")] + pub call_status: i32, + #[prost(int64, tag="9")] + pub created_at: i64, + #[prost(int64, tag="10")] + pub started_at: i64, + #[prost(int64, tag="11")] + pub ended_at: i64, + #[prost(enumeration="DisconnectReason", tag="12")] + pub disconnect_reason: i32, + #[prost(string, tag="13")] + pub error: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SipUri { + #[prost(string, tag="1")] + pub user: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub host: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub ip: ::prost::alloc::string::String, + #[prost(uint32, tag="4")] + pub port: u32, + #[prost(enumeration="SipTransport", tag="5")] + pub transport: i32, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -4792,5 +5038,71 @@ impl SipTransport { } } } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SipCallStatus { + /// Incoming call is being handled by the SIP service. The SIP participant hasn't joined a LiveKit room yet + ScsCallIncoming = 0, + /// SIP participant for outgoing call has been created. The SIP outgoing call is being established + ScsParticipantJoined = 1, + /// Call is ongoing. SIP participant is active in the LiveKit room + ScsActive = 2, + /// Call has ended + ScsDisconnected = 3, + /// Call has ended or never succeeded because of an error + ScsError = 4, +} +impl SipCallStatus { + /// 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 { + SipCallStatus::ScsCallIncoming => "SCS_CALL_INCOMING", + SipCallStatus::ScsParticipantJoined => "SCS_PARTICIPANT_JOINED", + SipCallStatus::ScsActive => "SCS_ACTIVE", + SipCallStatus::ScsDisconnected => "SCS_DISCONNECTED", + SipCallStatus::ScsError => "SCS_ERROR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCS_CALL_INCOMING" => Some(Self::ScsCallIncoming), + "SCS_PARTICIPANT_JOINED" => Some(Self::ScsParticipantJoined), + "SCS_ACTIVE" => Some(Self::ScsActive), + "SCS_DISCONNECTED" => Some(Self::ScsDisconnected), + "SCS_ERROR" => Some(Self::ScsError), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SipFeature { + None = 0, + KrispEnabled = 1, +} +impl SipFeature { + /// 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 { + SipFeature::None => "NONE", + SipFeature::KrispEnabled => "KRISP_ENABLED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NONE" => Some(Self::None), + "KRISP_ENABLED" => Some(Self::KrispEnabled), + _ => None, + } + } +} include!("livekit.serde.rs"); // @@protoc_insertion_point(module) diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 4e6a0fb03..5da36416c 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -3555,7 +3555,7 @@ impl serde::Serialize for CreateRoomRequest { if !self.name.is_empty() { len += 1; } - if !self.config_name.is_empty() { + if !self.room_preset.is_empty() { len += 1; } if self.empty_timeout != 0 { @@ -3576,9 +3576,6 @@ impl serde::Serialize for CreateRoomRequest { if self.egress.is_some() { len += 1; } - if self.agent.is_some() { - len += 1; - } if self.min_playout_delay != 0 { len += 1; } @@ -3591,12 +3588,15 @@ impl serde::Serialize for CreateRoomRequest { if self.replay_enabled { len += 1; } + if !self.agents.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.CreateRoomRequest", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } - if !self.config_name.is_empty() { - struct_ser.serialize_field("configName", &self.config_name)?; + if !self.room_preset.is_empty() { + struct_ser.serialize_field("roomPreset", &self.room_preset)?; } if self.empty_timeout != 0 { struct_ser.serialize_field("emptyTimeout", &self.empty_timeout)?; @@ -3616,9 +3616,6 @@ impl serde::Serialize for CreateRoomRequest { if let Some(v) = self.egress.as_ref() { struct_ser.serialize_field("egress", v)?; } - if let Some(v) = self.agent.as_ref() { - struct_ser.serialize_field("agent", v)?; - } if self.min_playout_delay != 0 { struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; } @@ -3631,6 +3628,9 @@ impl serde::Serialize for CreateRoomRequest { if self.replay_enabled { struct_ser.serialize_field("replayEnabled", &self.replay_enabled)?; } + if !self.agents.is_empty() { + struct_ser.serialize_field("agents", &self.agents)?; + } struct_ser.end() } } @@ -3642,8 +3642,8 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { { const FIELDS: &[&str] = &[ "name", - "config_name", - "configName", + "room_preset", + "roomPreset", "empty_timeout", "emptyTimeout", "departure_timeout", @@ -3654,7 +3654,6 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { "nodeId", "metadata", "egress", - "agent", "min_playout_delay", "minPlayoutDelay", "max_playout_delay", @@ -3663,23 +3662,24 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { "syncStreams", "replay_enabled", "replayEnabled", + "agents", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Name, - ConfigName, + RoomPreset, EmptyTimeout, DepartureTimeout, MaxParticipants, NodeId, Metadata, Egress, - Agent, MinPlayoutDelay, MaxPlayoutDelay, SyncStreams, ReplayEnabled, + Agents, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3703,18 +3703,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { { match value { "name" => Ok(GeneratedField::Name), - "configName" | "config_name" => Ok(GeneratedField::ConfigName), + "roomPreset" | "room_preset" => Ok(GeneratedField::RoomPreset), "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), "nodeId" | "node_id" => Ok(GeneratedField::NodeId), "metadata" => Ok(GeneratedField::Metadata), "egress" => Ok(GeneratedField::Egress), - "agent" => Ok(GeneratedField::Agent), "minPlayoutDelay" | "min_playout_delay" => Ok(GeneratedField::MinPlayoutDelay), "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), "syncStreams" | "sync_streams" => Ok(GeneratedField::SyncStreams), "replayEnabled" | "replay_enabled" => Ok(GeneratedField::ReplayEnabled), + "agents" => Ok(GeneratedField::Agents), _ => Ok(GeneratedField::__SkipField__), } } @@ -3735,18 +3735,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { V: serde::de::MapAccess<'de>, { let mut name__ = None; - let mut config_name__ = None; + let mut room_preset__ = None; let mut empty_timeout__ = None; let mut departure_timeout__ = None; let mut max_participants__ = None; let mut node_id__ = None; let mut metadata__ = None; let mut egress__ = None; - let mut agent__ = None; let mut min_playout_delay__ = None; let mut max_playout_delay__ = None; let mut sync_streams__ = None; let mut replay_enabled__ = None; + let mut agents__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -3755,11 +3755,11 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } name__ = Some(map_.next_value()?); } - GeneratedField::ConfigName => { - if config_name__.is_some() { - return Err(serde::de::Error::duplicate_field("configName")); + GeneratedField::RoomPreset => { + if room_preset__.is_some() { + return Err(serde::de::Error::duplicate_field("roomPreset")); } - config_name__ = Some(map_.next_value()?); + room_preset__ = Some(map_.next_value()?); } GeneratedField::EmptyTimeout => { if empty_timeout__.is_some() { @@ -3803,12 +3803,6 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } egress__ = map_.next_value()?; } - GeneratedField::Agent => { - if agent__.is_some() { - return Err(serde::de::Error::duplicate_field("agent")); - } - agent__ = map_.next_value()?; - } GeneratedField::MinPlayoutDelay => { if min_playout_delay__.is_some() { return Err(serde::de::Error::duplicate_field("minPlayoutDelay")); @@ -3837,6 +3831,12 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } replay_enabled__ = Some(map_.next_value()?); } + GeneratedField::Agents => { + if agents__.is_some() { + return Err(serde::de::Error::duplicate_field("agents")); + } + agents__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -3844,18 +3844,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } Ok(CreateRoomRequest { name: name__.unwrap_or_default(), - config_name: config_name__.unwrap_or_default(), + room_preset: room_preset__.unwrap_or_default(), empty_timeout: empty_timeout__.unwrap_or_default(), departure_timeout: departure_timeout__.unwrap_or_default(), max_participants: max_participants__.unwrap_or_default(), node_id: node_id__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), egress: egress__, - agent: agent__, min_playout_delay: min_playout_delay__.unwrap_or_default(), max_playout_delay: max_playout_delay__.unwrap_or_default(), sync_streams: sync_streams__.unwrap_or_default(), replay_enabled: replay_enabled__.unwrap_or_default(), + agents: agents__.unwrap_or_default(), }) } } @@ -4268,6 +4268,9 @@ impl serde::Serialize for CreateSipParticipantRequest { if !self.sip_call_to.is_empty() { len += 1; } + if !self.sip_number.is_empty() { + len += 1; + } if !self.room_name.is_empty() { len += 1; } @@ -4289,9 +4292,21 @@ impl serde::Serialize for CreateSipParticipantRequest { if self.play_ringtone { len += 1; } + if self.play_dialtone { + len += 1; + } if self.hide_phone_number { len += 1; } + if self.ringing_timeout.is_some() { + len += 1; + } + if self.max_call_duration.is_some() { + len += 1; + } + if self.enable_krisp { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.CreateSIPParticipantRequest", len)?; if !self.sip_trunk_id.is_empty() { struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; @@ -4299,6 +4314,9 @@ impl serde::Serialize for CreateSipParticipantRequest { if !self.sip_call_to.is_empty() { struct_ser.serialize_field("sipCallTo", &self.sip_call_to)?; } + if !self.sip_number.is_empty() { + struct_ser.serialize_field("sipNumber", &self.sip_number)?; + } if !self.room_name.is_empty() { struct_ser.serialize_field("roomName", &self.room_name)?; } @@ -4320,9 +4338,21 @@ impl serde::Serialize for CreateSipParticipantRequest { if self.play_ringtone { struct_ser.serialize_field("playRingtone", &self.play_ringtone)?; } + if self.play_dialtone { + struct_ser.serialize_field("playDialtone", &self.play_dialtone)?; + } if self.hide_phone_number { struct_ser.serialize_field("hidePhoneNumber", &self.hide_phone_number)?; } + if let Some(v) = self.ringing_timeout.as_ref() { + struct_ser.serialize_field("ringingTimeout", v)?; + } + if let Some(v) = self.max_call_duration.as_ref() { + struct_ser.serialize_field("maxCallDuration", v)?; + } + if self.enable_krisp { + struct_ser.serialize_field("enableKrisp", &self.enable_krisp)?; + } struct_ser.end() } } @@ -4337,6 +4367,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { "sipTrunkId", "sip_call_to", "sipCallTo", + "sip_number", + "sipNumber", "room_name", "roomName", "participant_identity", @@ -4350,14 +4382,23 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { "dtmf", "play_ringtone", "playRingtone", + "play_dialtone", + "playDialtone", "hide_phone_number", "hidePhoneNumber", + "ringing_timeout", + "ringingTimeout", + "max_call_duration", + "maxCallDuration", + "enable_krisp", + "enableKrisp", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { SipTrunkId, SipCallTo, + SipNumber, RoomName, ParticipantIdentity, ParticipantName, @@ -4365,7 +4406,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { ParticipantAttributes, Dtmf, PlayRingtone, + PlayDialtone, HidePhoneNumber, + RingingTimeout, + MaxCallDuration, + EnableKrisp, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4390,6 +4435,7 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { match value { "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), "sipCallTo" | "sip_call_to" => Ok(GeneratedField::SipCallTo), + "sipNumber" | "sip_number" => Ok(GeneratedField::SipNumber), "roomName" | "room_name" => Ok(GeneratedField::RoomName), "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), @@ -4397,7 +4443,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { "participantAttributes" | "participant_attributes" => Ok(GeneratedField::ParticipantAttributes), "dtmf" => Ok(GeneratedField::Dtmf), "playRingtone" | "play_ringtone" => Ok(GeneratedField::PlayRingtone), + "playDialtone" | "play_dialtone" => Ok(GeneratedField::PlayDialtone), "hidePhoneNumber" | "hide_phone_number" => Ok(GeneratedField::HidePhoneNumber), + "ringingTimeout" | "ringing_timeout" => Ok(GeneratedField::RingingTimeout), + "maxCallDuration" | "max_call_duration" => Ok(GeneratedField::MaxCallDuration), + "enableKrisp" | "enable_krisp" => Ok(GeneratedField::EnableKrisp), _ => Ok(GeneratedField::__SkipField__), } } @@ -4419,6 +4469,7 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { { let mut sip_trunk_id__ = None; let mut sip_call_to__ = None; + let mut sip_number__ = None; let mut room_name__ = None; let mut participant_identity__ = None; let mut participant_name__ = None; @@ -4426,7 +4477,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { let mut participant_attributes__ = None; let mut dtmf__ = None; let mut play_ringtone__ = None; + let mut play_dialtone__ = None; let mut hide_phone_number__ = None; + let mut ringing_timeout__ = None; + let mut max_call_duration__ = None; + let mut enable_krisp__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -4441,6 +4496,12 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { } sip_call_to__ = Some(map_.next_value()?); } + GeneratedField::SipNumber => { + if sip_number__.is_some() { + return Err(serde::de::Error::duplicate_field("sipNumber")); + } + sip_number__ = Some(map_.next_value()?); + } GeneratedField::RoomName => { if room_name__.is_some() { return Err(serde::de::Error::duplicate_field("roomName")); @@ -4485,12 +4546,36 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { } play_ringtone__ = Some(map_.next_value()?); } + GeneratedField::PlayDialtone => { + if play_dialtone__.is_some() { + return Err(serde::de::Error::duplicate_field("playDialtone")); + } + play_dialtone__ = Some(map_.next_value()?); + } GeneratedField::HidePhoneNumber => { if hide_phone_number__.is_some() { return Err(serde::de::Error::duplicate_field("hidePhoneNumber")); } hide_phone_number__ = Some(map_.next_value()?); } + GeneratedField::RingingTimeout => { + if ringing_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("ringingTimeout")); + } + ringing_timeout__ = map_.next_value()?; + } + GeneratedField::MaxCallDuration => { + if max_call_duration__.is_some() { + return Err(serde::de::Error::duplicate_field("maxCallDuration")); + } + max_call_duration__ = map_.next_value()?; + } + GeneratedField::EnableKrisp => { + if enable_krisp__.is_some() { + return Err(serde::de::Error::duplicate_field("enableKrisp")); + } + enable_krisp__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -4499,6 +4584,7 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { Ok(CreateSipParticipantRequest { sip_trunk_id: sip_trunk_id__.unwrap_or_default(), sip_call_to: sip_call_to__.unwrap_or_default(), + sip_number: sip_number__.unwrap_or_default(), room_name: room_name__.unwrap_or_default(), participant_identity: participant_identity__.unwrap_or_default(), participant_name: participant_name__.unwrap_or_default(), @@ -4506,7 +4592,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { participant_attributes: participant_attributes__.unwrap_or_default(), dtmf: dtmf__.unwrap_or_default(), play_ringtone: play_ringtone__.unwrap_or_default(), + play_dialtone: play_dialtone__.unwrap_or_default(), hide_phone_number: hide_phone_number__.unwrap_or_default(), + ringing_timeout: ringing_timeout__, + max_call_duration: max_call_duration__, + enable_krisp: enable_krisp__.unwrap_or_default(), }) } } @@ -4981,6 +5071,12 @@ impl serde::Serialize for DataPacket { data_packet::Value::RpcResponse(v) => { struct_ser.serialize_field("rpcResponse", v)?; } + data_packet::Value::StreamHeader(v) => { + struct_ser.serialize_field("streamHeader", v)?; + } + data_packet::Value::StreamChunk(v) => { + struct_ser.serialize_field("streamChunk", v)?; + } } } struct_ser.end() @@ -5012,6 +5108,10 @@ impl<'de> serde::Deserialize<'de> for DataPacket { "rpcAck", "rpc_response", "rpcResponse", + "stream_header", + "streamHeader", + "stream_chunk", + "streamChunk", ]; #[allow(clippy::enum_variant_names)] @@ -5028,6 +5128,8 @@ impl<'de> serde::Deserialize<'de> for DataPacket { RpcRequest, RpcAck, RpcResponse, + StreamHeader, + StreamChunk, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5062,6 +5164,8 @@ impl<'de> serde::Deserialize<'de> for DataPacket { "rpcRequest" | "rpc_request" => Ok(GeneratedField::RpcRequest), "rpcAck" | "rpc_ack" => Ok(GeneratedField::RpcAck), "rpcResponse" | "rpc_response" => Ok(GeneratedField::RpcResponse), + "streamHeader" | "stream_header" => Ok(GeneratedField::StreamHeader), + "streamChunk" | "stream_chunk" => Ok(GeneratedField::StreamChunk), _ => Ok(GeneratedField::__SkipField__), } } @@ -5166,6 +5270,20 @@ impl<'de> serde::Deserialize<'de> for DataPacket { return Err(serde::de::Error::duplicate_field("rpcResponse")); } value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::RpcResponse) +; + } + GeneratedField::StreamHeader => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("streamHeader")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::StreamHeader) +; + } + GeneratedField::StreamChunk => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("streamChunk")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::StreamChunk) ; } GeneratedField::__SkipField__ => { @@ -5255,46 +5373,29 @@ impl<'de> serde::Deserialize<'de> for data_packet::Kind { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for DeleteAgentDispatchRequest { +impl serde::Serialize for DataStream { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.dispatch_id.is_empty() { - len += 1; - } - if !self.room.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.DeleteAgentDispatchRequest", len)?; - if !self.dispatch_id.is_empty() { - struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; - } - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.DataStream", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteAgentDispatchRequest { +impl<'de> serde::Deserialize<'de> for DataStream { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "dispatch_id", - "dispatchId", - "room", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - DispatchId, - Room, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5316,11 +5417,7 @@ impl<'de> serde::Deserialize<'de> for DeleteAgentDispatchRequest { where E: serde::de::Error, { - match value { - "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), - "room" => Ok(GeneratedField::Room), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -5328,47 +5425,27 @@ impl<'de> serde::Deserialize<'de> for DeleteAgentDispatchRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteAgentDispatchRequest; + type Value = DataStream; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteAgentDispatchRequest") + formatter.write_str("struct livekit.DataStream") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut dispatch_id__ = None; - let mut room__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::DispatchId => { - if dispatch_id__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchId")); - } - dispatch_id__ = Some(map_.next_value()?); - } - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(DeleteAgentDispatchRequest { - dispatch_id: dispatch_id__.unwrap_or_default(), - room: room__.unwrap_or_default(), + Ok(DataStream { }) } } - deserializer.deserialize_struct("livekit.DeleteAgentDispatchRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DataStream", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DeleteIngressRequest { +impl serde::Serialize for data_stream::Chunk { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5376,30 +5453,77 @@ impl serde::Serialize for DeleteIngressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.ingress_id.is_empty() { + if !self.stream_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DeleteIngressRequest", len)?; - if !self.ingress_id.is_empty() { - struct_ser.serialize_field("ingressId", &self.ingress_id)?; + if self.chunk_index != 0 { + len += 1; + } + if !self.content.is_empty() { + len += 1; + } + if self.complete { + len += 1; + } + if self.version != 0 { + len += 1; + } + if self.iv.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DataStream.Chunk", len)?; + if !self.stream_id.is_empty() { + struct_ser.serialize_field("streamId", &self.stream_id)?; + } + if self.chunk_index != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("chunkIndex", ToString::to_string(&self.chunk_index).as_str())?; + } + if !self.content.is_empty() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("content", pbjson::private::base64::encode(&self.content).as_str())?; + } + if self.complete { + struct_ser.serialize_field("complete", &self.complete)?; + } + if self.version != 0 { + struct_ser.serialize_field("version", &self.version)?; + } + if let Some(v) = self.iv.as_ref() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("iv", pbjson::private::base64::encode(&v).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteIngressRequest { +impl<'de> serde::Deserialize<'de> for data_stream::Chunk { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "ingress_id", - "ingressId", + "stream_id", + "streamId", + "chunk_index", + "chunkIndex", + "content", + "complete", + "version", + "iv", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - IngressId, + StreamId, + ChunkIndex, + Content, + Complete, + Version, + Iv, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5422,7 +5546,12 @@ impl<'de> serde::Deserialize<'de> for DeleteIngressRequest { E: serde::de::Error, { match value { - "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), + "streamId" | "stream_id" => Ok(GeneratedField::StreamId), + "chunkIndex" | "chunk_index" => Ok(GeneratedField::ChunkIndex), + "content" => Ok(GeneratedField::Content), + "complete" => Ok(GeneratedField::Complete), + "version" => Ok(GeneratedField::Version), + "iv" => Ok(GeneratedField::Iv), _ => Ok(GeneratedField::__SkipField__), } } @@ -5432,39 +5561,87 @@ impl<'de> serde::Deserialize<'de> for DeleteIngressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteIngressRequest; + type Value = data_stream::Chunk; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteIngressRequest") + formatter.write_str("struct livekit.DataStream.Chunk") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut ingress_id__ = None; + let mut stream_id__ = None; + let mut chunk_index__ = None; + let mut content__ = None; + let mut complete__ = None; + let mut version__ = None; + let mut iv__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::IngressId => { - if ingress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("ingressId")); + GeneratedField::StreamId => { + if stream_id__.is_some() { + return Err(serde::de::Error::duplicate_field("streamId")); } - ingress_id__ = Some(map_.next_value()?); + stream_id__ = Some(map_.next_value()?); + } + GeneratedField::ChunkIndex => { + if chunk_index__.is_some() { + return Err(serde::de::Error::duplicate_field("chunkIndex")); + } + chunk_index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Content => { + if content__.is_some() { + return Err(serde::de::Error::duplicate_field("content")); + } + content__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Complete => { + if complete__.is_some() { + return Err(serde::de::Error::duplicate_field("complete")); + } + complete__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Iv => { + if iv__.is_some() { + return Err(serde::de::Error::duplicate_field("iv")); + } + iv__ = + map_.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| x.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DeleteIngressRequest { - ingress_id: ingress_id__.unwrap_or_default(), + Ok(data_stream::Chunk { + stream_id: stream_id__.unwrap_or_default(), + chunk_index: chunk_index__.unwrap_or_default(), + content: content__.unwrap_or_default(), + complete: complete__.unwrap_or_default(), + version: version__.unwrap_or_default(), + iv: iv__, }) } } - deserializer.deserialize_struct("livekit.DeleteIngressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DataStream.Chunk", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DeleteRoomRequest { +impl serde::Serialize for data_stream::FileHeader { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5472,29 +5649,30 @@ impl serde::Serialize for DeleteRoomRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { + if !self.file_name.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DeleteRoomRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; + let mut struct_ser = serializer.serialize_struct("livekit.DataStream.FileHeader", len)?; + if !self.file_name.is_empty() { + struct_ser.serialize_field("fileName", &self.file_name)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteRoomRequest { +impl<'de> serde::Deserialize<'de> for data_stream::FileHeader { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", + "file_name", + "fileName", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, + FileName, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5517,7 +5695,7 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomRequest { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), + "fileName" | "file_name" => Ok(GeneratedField::FileName), _ => Ok(GeneratedField::__SkipField__), } } @@ -5527,61 +5705,157 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteRoomRequest; + type Value = data_stream::FileHeader; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteRoomRequest") + formatter.write_str("struct livekit.DataStream.FileHeader") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut room__ = None; + let mut file_name__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); + GeneratedField::FileName => { + if file_name__.is_some() { + return Err(serde::de::Error::duplicate_field("fileName")); } - room__ = Some(map_.next_value()?); + file_name__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DeleteRoomRequest { - room: room__.unwrap_or_default(), + Ok(data_stream::FileHeader { + file_name: file_name__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.DeleteRoomRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DataStream.FileHeader", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DeleteRoomResponse { +impl serde::Serialize for data_stream::Header { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("livekit.DeleteRoomResponse", len)?; + let mut len = 0; + if !self.stream_id.is_empty() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + if !self.topic.is_empty() { + len += 1; + } + if !self.mime_type.is_empty() { + len += 1; + } + if self.total_length.is_some() { + len += 1; + } + if self.total_chunks.is_some() { + len += 1; + } + if self.encryption_type != 0 { + len += 1; + } + if !self.extensions.is_empty() { + len += 1; + } + if self.content_header.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DataStream.Header", len)?; + if !self.stream_id.is_empty() { + struct_ser.serialize_field("streamId", &self.stream_id)?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + if !self.topic.is_empty() { + struct_ser.serialize_field("topic", &self.topic)?; + } + if !self.mime_type.is_empty() { + struct_ser.serialize_field("mimeType", &self.mime_type)?; + } + if let Some(v) = self.total_length.as_ref() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("totalLength", ToString::to_string(&v).as_str())?; + } + if let Some(v) = self.total_chunks.as_ref() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("totalChunks", ToString::to_string(&v).as_str())?; + } + if self.encryption_type != 0 { + let v = encryption::Type::try_from(self.encryption_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption_type)))?; + struct_ser.serialize_field("encryptionType", &v)?; + } + if !self.extensions.is_empty() { + struct_ser.serialize_field("extensions", &self.extensions)?; + } + if let Some(v) = self.content_header.as_ref() { + match v { + data_stream::header::ContentHeader::TextHeader(v) => { + struct_ser.serialize_field("textHeader", v)?; + } + data_stream::header::ContentHeader::FileHeader(v) => { + struct_ser.serialize_field("fileHeader", v)?; + } + } + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteRoomResponse { +impl<'de> serde::Deserialize<'de> for data_stream::Header { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "stream_id", + "streamId", + "timestamp", + "topic", + "mime_type", + "mimeType", + "total_length", + "totalLength", + "total_chunks", + "totalChunks", + "encryption_type", + "encryptionType", + "extensions", + "text_header", + "textHeader", + "file_header", + "fileHeader", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + StreamId, + Timestamp, + Topic, + MimeType, + TotalLength, + TotalChunks, + EncryptionType, + Extensions, + TextHeader, + FileHeader, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5603,7 +5877,19 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomResponse { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "streamId" | "stream_id" => Ok(GeneratedField::StreamId), + "timestamp" => Ok(GeneratedField::Timestamp), + "topic" => Ok(GeneratedField::Topic), + "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), + "totalLength" | "total_length" => Ok(GeneratedField::TotalLength), + "totalChunks" | "total_chunks" => Ok(GeneratedField::TotalChunks), + "encryptionType" | "encryption_type" => Ok(GeneratedField::EncryptionType), + "extensions" => Ok(GeneratedField::Extensions), + "textHeader" | "text_header" => Ok(GeneratedField::TextHeader), + "fileHeader" | "file_header" => Ok(GeneratedField::FileHeader), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -5611,27 +5897,196 @@ impl<'de> serde::Deserialize<'de> for DeleteRoomResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteRoomResponse; + type Value = data_stream::Header; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteRoomResponse") + formatter.write_str("struct livekit.DataStream.Header") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; + let mut stream_id__ = None; + let mut timestamp__ = None; + let mut topic__ = None; + let mut mime_type__ = None; + let mut total_length__ = None; + let mut total_chunks__ = None; + let mut encryption_type__ = None; + let mut extensions__ = None; + let mut content_header__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::StreamId => { + if stream_id__.is_some() { + return Err(serde::de::Error::duplicate_field("streamId")); + } + stream_id__ = Some(map_.next_value()?); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Topic => { + if topic__.is_some() { + return Err(serde::de::Error::duplicate_field("topic")); + } + topic__ = Some(map_.next_value()?); + } + GeneratedField::MimeType => { + if mime_type__.is_some() { + return Err(serde::de::Error::duplicate_field("mimeType")); + } + mime_type__ = Some(map_.next_value()?); + } + GeneratedField::TotalLength => { + if total_length__.is_some() { + return Err(serde::de::Error::duplicate_field("totalLength")); + } + total_length__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::TotalChunks => { + if total_chunks__.is_some() { + return Err(serde::de::Error::duplicate_field("totalChunks")); + } + total_chunks__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::EncryptionType => { + if encryption_type__.is_some() { + return Err(serde::de::Error::duplicate_field("encryptionType")); + } + encryption_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Extensions => { + if extensions__.is_some() { + return Err(serde::de::Error::duplicate_field("extensions")); + } + extensions__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::TextHeader => { + if content_header__.is_some() { + return Err(serde::de::Error::duplicate_field("textHeader")); + } + content_header__ = map_.next_value::<::std::option::Option<_>>()?.map(data_stream::header::ContentHeader::TextHeader) +; + } + GeneratedField::FileHeader => { + if content_header__.is_some() { + return Err(serde::de::Error::duplicate_field("fileHeader")); + } + content_header__ = map_.next_value::<::std::option::Option<_>>()?.map(data_stream::header::ContentHeader::FileHeader) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(DeleteRoomResponse { + Ok(data_stream::Header { + stream_id: stream_id__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + topic: topic__.unwrap_or_default(), + mime_type: mime_type__.unwrap_or_default(), + total_length: total_length__, + total_chunks: total_chunks__, + encryption_type: encryption_type__.unwrap_or_default(), + extensions: extensions__.unwrap_or_default(), + content_header: content_header__, }) } } - deserializer.deserialize_struct("livekit.DeleteRoomResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DataStream.Header", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DeleteSipDispatchRuleRequest { +impl serde::Serialize for data_stream::OperationType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Create => "CREATE", + Self::Update => "UPDATE", + Self::Delete => "DELETE", + Self::Reaction => "REACTION", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for data_stream::OperationType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "CREATE", + "UPDATE", + "DELETE", + "REACTION", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = data_stream::OperationType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "CREATE" => Ok(data_stream::OperationType::Create), + "UPDATE" => Ok(data_stream::OperationType::Update), + "DELETE" => Ok(data_stream::OperationType::Delete), + "REACTION" => Ok(data_stream::OperationType::Reaction), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for data_stream::TextHeader { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5639,30 +6094,66 @@ impl serde::Serialize for DeleteSipDispatchRuleRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_dispatch_rule_id.is_empty() { + if self.operation_type != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DeleteSIPDispatchRuleRequest", len)?; - if !self.sip_dispatch_rule_id.is_empty() { - struct_ser.serialize_field("sipDispatchRuleId", &self.sip_dispatch_rule_id)?; + if self.version != 0 { + len += 1; + } + if !self.reply_to_stream_id.is_empty() { + len += 1; + } + if !self.attached_stream_ids.is_empty() { + len += 1; + } + if self.generated { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DataStream.TextHeader", len)?; + if self.operation_type != 0 { + let v = data_stream::OperationType::try_from(self.operation_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.operation_type)))?; + struct_ser.serialize_field("operationType", &v)?; + } + if self.version != 0 { + struct_ser.serialize_field("version", &self.version)?; + } + if !self.reply_to_stream_id.is_empty() { + struct_ser.serialize_field("replyToStreamId", &self.reply_to_stream_id)?; + } + if !self.attached_stream_ids.is_empty() { + struct_ser.serialize_field("attachedStreamIds", &self.attached_stream_ids)?; + } + if self.generated { + struct_ser.serialize_field("generated", &self.generated)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteSipDispatchRuleRequest { +impl<'de> serde::Deserialize<'de> for data_stream::TextHeader { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_dispatch_rule_id", - "sipDispatchRuleId", + "operation_type", + "operationType", + "version", + "reply_to_stream_id", + "replyToStreamId", + "attached_stream_ids", + "attachedStreamIds", + "generated", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipDispatchRuleId, + OperationType, + Version, + ReplyToStreamId, + AttachedStreamIds, + Generated, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5685,7 +6176,11 @@ impl<'de> serde::Deserialize<'de> for DeleteSipDispatchRuleRequest { E: serde::de::Error, { match value { - "sipDispatchRuleId" | "sip_dispatch_rule_id" => Ok(GeneratedField::SipDispatchRuleId), + "operationType" | "operation_type" => Ok(GeneratedField::OperationType), + "version" => Ok(GeneratedField::Version), + "replyToStreamId" | "reply_to_stream_id" => Ok(GeneratedField::ReplyToStreamId), + "attachedStreamIds" | "attached_stream_ids" => Ok(GeneratedField::AttachedStreamIds), + "generated" => Ok(GeneratedField::Generated), _ => Ok(GeneratedField::__SkipField__), } } @@ -5695,39 +6190,73 @@ impl<'de> serde::Deserialize<'de> for DeleteSipDispatchRuleRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteSipDispatchRuleRequest; + type Value = data_stream::TextHeader; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteSIPDispatchRuleRequest") + formatter.write_str("struct livekit.DataStream.TextHeader") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sip_dispatch_rule_id__ = None; + let mut operation_type__ = None; + let mut version__ = None; + let mut reply_to_stream_id__ = None; + let mut attached_stream_ids__ = None; + let mut generated__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SipDispatchRuleId => { - if sip_dispatch_rule_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sipDispatchRuleId")); + GeneratedField::OperationType => { + if operation_type__.is_some() { + return Err(serde::de::Error::duplicate_field("operationType")); } - sip_dispatch_rule_id__ = Some(map_.next_value()?); + operation_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ReplyToStreamId => { + if reply_to_stream_id__.is_some() { + return Err(serde::de::Error::duplicate_field("replyToStreamId")); + } + reply_to_stream_id__ = Some(map_.next_value()?); + } + GeneratedField::AttachedStreamIds => { + if attached_stream_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("attachedStreamIds")); + } + attached_stream_ids__ = Some(map_.next_value()?); + } + GeneratedField::Generated => { + if generated__.is_some() { + return Err(serde::de::Error::duplicate_field("generated")); + } + generated__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DeleteSipDispatchRuleRequest { - sip_dispatch_rule_id: sip_dispatch_rule_id__.unwrap_or_default(), + Ok(data_stream::TextHeader { + operation_type: operation_type__.unwrap_or_default(), + version: version__.unwrap_or_default(), + reply_to_stream_id: reply_to_stream_id__.unwrap_or_default(), + attached_stream_ids: attached_stream_ids__.unwrap_or_default(), + generated: generated__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.DeleteSIPDispatchRuleRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DataStream.TextHeader", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DeleteSipTrunkRequest { +impl serde::Serialize for DeleteAgentDispatchRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5735,30 +6264,38 @@ impl serde::Serialize for DeleteSipTrunkRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_trunk_id.is_empty() { + if !self.dispatch_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DeleteSIPTrunkRequest", len)?; - if !self.sip_trunk_id.is_empty() { - struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; + if !self.room.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DeleteAgentDispatchRequest", len)?; + if !self.dispatch_id.is_empty() { + struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; + } + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DeleteSipTrunkRequest { +impl<'de> serde::Deserialize<'de> for DeleteAgentDispatchRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_trunk_id", - "sipTrunkId", + "dispatch_id", + "dispatchId", + "room", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipTrunkId, + DispatchId, + Room, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5781,7 +6318,8 @@ impl<'de> serde::Deserialize<'de> for DeleteSipTrunkRequest { E: serde::de::Error, { match value { - "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), + "room" => Ok(GeneratedField::Room), _ => Ok(GeneratedField::__SkipField__), } } @@ -5791,39 +6329,47 @@ impl<'de> serde::Deserialize<'de> for DeleteSipTrunkRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DeleteSipTrunkRequest; + type Value = DeleteAgentDispatchRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DeleteSIPTrunkRequest") + formatter.write_str("struct livekit.DeleteAgentDispatchRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sip_trunk_id__ = None; + let mut dispatch_id__ = None; + let mut room__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SipTrunkId => { - if sip_trunk_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sipTrunkId")); + GeneratedField::DispatchId => { + if dispatch_id__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchId")); } - sip_trunk_id__ = Some(map_.next_value()?); + dispatch_id__ = Some(map_.next_value()?); + } + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DeleteSipTrunkRequest { - sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + Ok(DeleteAgentDispatchRequest { + dispatch_id: dispatch_id__.unwrap_or_default(), + room: room__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.DeleteSIPTrunkRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DeleteAgentDispatchRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DirectFileOutput { +impl serde::Serialize for DeleteIngressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5831,65 +6377,30 @@ impl serde::Serialize for DirectFileOutput { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.filepath.is_empty() { - len += 1; - } - if self.disable_manifest { - len += 1; - } - if self.output.is_some() { + if !self.ingress_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DirectFileOutput", len)?; - if !self.filepath.is_empty() { - struct_ser.serialize_field("filepath", &self.filepath)?; - } - if self.disable_manifest { - struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; - } - if let Some(v) = self.output.as_ref() { - match v { - direct_file_output::Output::S3(v) => { - struct_ser.serialize_field("s3", v)?; - } - direct_file_output::Output::Gcp(v) => { - struct_ser.serialize_field("gcp", v)?; - } - direct_file_output::Output::Azure(v) => { - struct_ser.serialize_field("azure", v)?; - } - direct_file_output::Output::AliOss(v) => { - struct_ser.serialize_field("aliOSS", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.DeleteIngressRequest", len)?; + if !self.ingress_id.is_empty() { + struct_ser.serialize_field("ingressId", &self.ingress_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DirectFileOutput { +impl<'de> serde::Deserialize<'de> for DeleteIngressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "filepath", - "disable_manifest", - "disableManifest", - "s3", - "gcp", - "azure", - "aliOSS", + "ingress_id", + "ingressId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Filepath, - DisableManifest, - S3, - Gcp, - Azure, - AliOss, + IngressId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5912,12 +6423,7 @@ impl<'de> serde::Deserialize<'de> for DirectFileOutput { E: serde::de::Error, { match value { - "filepath" => Ok(GeneratedField::Filepath), - "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), - "s3" => Ok(GeneratedField::S3), - "gcp" => Ok(GeneratedField::Gcp), - "azure" => Ok(GeneratedField::Azure), - "aliOSS" => Ok(GeneratedField::AliOss), + "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), _ => Ok(GeneratedField::__SkipField__), } } @@ -5927,77 +6433,39 @@ impl<'de> serde::Deserialize<'de> for DirectFileOutput { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DirectFileOutput; + type Value = DeleteIngressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DirectFileOutput") + formatter.write_str("struct livekit.DeleteIngressRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut filepath__ = None; - let mut disable_manifest__ = None; - let mut output__ = None; + let mut ingress_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Filepath => { - if filepath__.is_some() { - return Err(serde::de::Error::duplicate_field("filepath")); - } - filepath__ = Some(map_.next_value()?); - } - GeneratedField::DisableManifest => { - if disable_manifest__.is_some() { - return Err(serde::de::Error::duplicate_field("disableManifest")); - } - disable_manifest__ = Some(map_.next_value()?); - } - GeneratedField::S3 => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("s3")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::S3) -; - } - GeneratedField::Gcp => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("gcp")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Gcp) -; - } - GeneratedField::Azure => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("azure")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Azure) -; - } - GeneratedField::AliOss => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("aliOSS")); + GeneratedField::IngressId => { + if ingress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("ingressId")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::AliOss) -; + ingress_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DirectFileOutput { - filepath: filepath__.unwrap_or_default(), - disable_manifest: disable_manifest__.unwrap_or_default(), - output: output__, + Ok(DeleteIngressRequest { + ingress_id: ingress_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.DirectFileOutput", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DeleteIngressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DisabledCodecs { +impl serde::Serialize for DeleteRoomRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6005,37 +6473,29 @@ impl serde::Serialize for DisabledCodecs { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.codecs.is_empty() { - len += 1; - } - if !self.publish.is_empty() { + if !self.room.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.DisabledCodecs", len)?; - if !self.codecs.is_empty() { - struct_ser.serialize_field("codecs", &self.codecs)?; - } - if !self.publish.is_empty() { - struct_ser.serialize_field("publish", &self.publish)?; + let mut struct_ser = serializer.serialize_struct("livekit.DeleteRoomRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DisabledCodecs { +impl<'de> serde::Deserialize<'de> for DeleteRoomRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "codecs", - "publish", + "room", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Codecs, - Publish, + Room, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6058,8 +6518,7 @@ impl<'de> serde::Deserialize<'de> for DisabledCodecs { E: serde::de::Error, { match value { - "codecs" => Ok(GeneratedField::Codecs), - "publish" => Ok(GeneratedField::Publish), + "room" => Ok(GeneratedField::Room), _ => Ok(GeneratedField::__SkipField__), } } @@ -6069,110 +6528,658 @@ impl<'de> serde::Deserialize<'de> for DisabledCodecs { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DisabledCodecs; + type Value = DeleteRoomRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DisabledCodecs") + formatter.write_str("struct livekit.DeleteRoomRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut codecs__ = None; - let mut publish__ = None; + let mut room__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Codecs => { - if codecs__.is_some() { - return Err(serde::de::Error::duplicate_field("codecs")); - } - codecs__ = Some(map_.next_value()?); - } - GeneratedField::Publish => { - if publish__.is_some() { - return Err(serde::de::Error::duplicate_field("publish")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - publish__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(DisabledCodecs { - codecs: codecs__.unwrap_or_default(), - publish: publish__.unwrap_or_default(), + Ok(DeleteRoomRequest { + room: room__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.DisabledCodecs", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.DeleteRoomRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for DisconnectReason { +impl serde::Serialize for DeleteRoomResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = 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", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.DeleteRoomResponse", len)?; + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for DisconnectReason { +impl<'de> serde::Deserialize<'de> for DeleteRoomResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "UNKNOWN_REASON", - "CLIENT_INITIATED", - "DUPLICATE_IDENTITY", - "SERVER_SHUTDOWN", - "PARTICIPANT_REMOVED", - "ROOM_DELETED", - "STATE_MISMATCH", - "JOIN_FAILURE", - "MIGRATION", - "SIGNAL_CLOSE", - "ROOM_CLOSED", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DisconnectReason; + type Value = DeleteRoomResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) + formatter.write_str("struct livekit.DeleteRoomResponse") } - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(DeleteRoomResponse { + }) + } + } + deserializer.deserialize_struct("livekit.DeleteRoomResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DeleteSipDispatchRuleRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sip_dispatch_rule_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DeleteSIPDispatchRuleRequest", len)?; + if !self.sip_dispatch_rule_id.is_empty() { + struct_ser.serialize_field("sipDispatchRuleId", &self.sip_dispatch_rule_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DeleteSipDispatchRuleRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sip_dispatch_rule_id", + "sipDispatchRuleId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SipDispatchRuleId, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sipDispatchRuleId" | "sip_dispatch_rule_id" => Ok(GeneratedField::SipDispatchRuleId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DeleteSipDispatchRuleRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DeleteSIPDispatchRuleRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sip_dispatch_rule_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SipDispatchRuleId => { + if sip_dispatch_rule_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipDispatchRuleId")); + } + sip_dispatch_rule_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DeleteSipDispatchRuleRequest { + sip_dispatch_rule_id: sip_dispatch_rule_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.DeleteSIPDispatchRuleRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DeleteSipTrunkRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sip_trunk_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DeleteSIPTrunkRequest", len)?; + if !self.sip_trunk_id.is_empty() { + struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DeleteSipTrunkRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sip_trunk_id", + "sipTrunkId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SipTrunkId, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DeleteSipTrunkRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DeleteSIPTrunkRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sip_trunk_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); + } + sip_trunk_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DeleteSipTrunkRequest { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.DeleteSIPTrunkRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DirectFileOutput { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.filepath.is_empty() { + len += 1; + } + if self.disable_manifest { + len += 1; + } + if self.output.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DirectFileOutput", len)?; + if !self.filepath.is_empty() { + struct_ser.serialize_field("filepath", &self.filepath)?; + } + if self.disable_manifest { + struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; + } + if let Some(v) = self.output.as_ref() { + match v { + direct_file_output::Output::S3(v) => { + struct_ser.serialize_field("s3", v)?; + } + direct_file_output::Output::Gcp(v) => { + struct_ser.serialize_field("gcp", v)?; + } + direct_file_output::Output::Azure(v) => { + struct_ser.serialize_field("azure", v)?; + } + direct_file_output::Output::AliOss(v) => { + struct_ser.serialize_field("aliOSS", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DirectFileOutput { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "filepath", + "disable_manifest", + "disableManifest", + "s3", + "gcp", + "azure", + "aliOSS", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Filepath, + DisableManifest, + S3, + Gcp, + Azure, + AliOss, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "filepath" => Ok(GeneratedField::Filepath), + "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), + "s3" => Ok(GeneratedField::S3), + "gcp" => Ok(GeneratedField::Gcp), + "azure" => Ok(GeneratedField::Azure), + "aliOSS" => Ok(GeneratedField::AliOss), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DirectFileOutput; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DirectFileOutput") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut filepath__ = None; + let mut disable_manifest__ = None; + let mut output__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Filepath => { + if filepath__.is_some() { + return Err(serde::de::Error::duplicate_field("filepath")); + } + filepath__ = Some(map_.next_value()?); + } + GeneratedField::DisableManifest => { + if disable_manifest__.is_some() { + return Err(serde::de::Error::duplicate_field("disableManifest")); + } + disable_manifest__ = Some(map_.next_value()?); + } + GeneratedField::S3 => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("s3")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::S3) +; + } + GeneratedField::Gcp => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("gcp")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Gcp) +; + } + GeneratedField::Azure => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("azure")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::Azure) +; + } + GeneratedField::AliOss => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("aliOSS")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(direct_file_output::Output::AliOss) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DirectFileOutput { + filepath: filepath__.unwrap_or_default(), + disable_manifest: disable_manifest__.unwrap_or_default(), + output: output__, + }) + } + } + deserializer.deserialize_struct("livekit.DirectFileOutput", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DisabledCodecs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.codecs.is_empty() { + len += 1; + } + if !self.publish.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DisabledCodecs", len)?; + if !self.codecs.is_empty() { + struct_ser.serialize_field("codecs", &self.codecs)?; + } + if !self.publish.is_empty() { + struct_ser.serialize_field("publish", &self.publish)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DisabledCodecs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "codecs", + "publish", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Codecs, + Publish, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "codecs" => Ok(GeneratedField::Codecs), + "publish" => Ok(GeneratedField::Publish), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DisabledCodecs; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DisabledCodecs") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut codecs__ = None; + let mut publish__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Codecs => { + if codecs__.is_some() { + return Err(serde::de::Error::duplicate_field("codecs")); + } + codecs__ = Some(map_.next_value()?); + } + GeneratedField::Publish => { + if publish__.is_some() { + return Err(serde::de::Error::duplicate_field("publish")); + } + publish__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DisabledCodecs { + codecs: codecs__.unwrap_or_default(), + publish: publish__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.DisabledCodecs", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DisconnectReason { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = 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", + Self::UserUnavailable => "USER_UNAVAILABLE", + Self::UserRejected => "USER_REJECTED", + Self::SipTrunkFailure => "SIP_TRUNK_FAILURE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for DisconnectReason { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UNKNOWN_REASON", + "CLIENT_INITIATED", + "DUPLICATE_IDENTITY", + "SERVER_SHUTDOWN", + "PARTICIPANT_REMOVED", + "ROOM_DELETED", + "STATE_MISMATCH", + "JOIN_FAILURE", + "MIGRATION", + "SIGNAL_CLOSE", + "ROOM_CLOSED", + "USER_UNAVAILABLE", + "USER_REJECTED", + "SIP_TRUNK_FAILURE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DisconnectReason; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result where E: serde::de::Error, { @@ -6200,6 +7207,9 @@ impl<'de> serde::Deserialize<'de> for DisconnectReason { "MIGRATION" => Ok(DisconnectReason::Migration), "SIGNAL_CLOSE" => Ok(DisconnectReason::SignalClose), "ROOM_CLOSED" => Ok(DisconnectReason::RoomClosed), + "USER_UNAVAILABLE" => Ok(DisconnectReason::UserUnavailable), + "USER_REJECTED" => Ok(DisconnectReason::UserRejected), + "SIP_TRUNK_FAILURE" => Ok(DisconnectReason::SipTrunkFailure), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -6257,6 +7267,12 @@ impl serde::Serialize for EgressInfo { if !self.image_results.is_empty() { len += 1; } + if !self.manifest_location.is_empty() { + len += 1; + } + if self.backup_storage_used { + len += 1; + } if self.request.is_some() { len += 1; } @@ -6314,6 +7330,12 @@ impl serde::Serialize for EgressInfo { if !self.image_results.is_empty() { struct_ser.serialize_field("imageResults", &self.image_results)?; } + if !self.manifest_location.is_empty() { + struct_ser.serialize_field("manifestLocation", &self.manifest_location)?; + } + if self.backup_storage_used { + struct_ser.serialize_field("backupStorageUsed", &self.backup_storage_used)?; + } if let Some(v) = self.request.as_ref() { match v { egress_info::Request::RoomComposite(v) => { @@ -6381,6 +7403,10 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "segmentResults", "image_results", "imageResults", + "manifest_location", + "manifestLocation", + "backup_storage_used", + "backupStorageUsed", "room_composite", "roomComposite", "web", @@ -6409,6 +7435,8 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { FileResults, SegmentResults, ImageResults, + ManifestLocation, + BackupStorageUsed, RoomComposite, Web, Participant, @@ -6453,6 +7481,8 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "fileResults" | "file_results" => Ok(GeneratedField::FileResults), "segmentResults" | "segment_results" => Ok(GeneratedField::SegmentResults), "imageResults" | "image_results" => Ok(GeneratedField::ImageResults), + "manifestLocation" | "manifest_location" => Ok(GeneratedField::ManifestLocation), + "backupStorageUsed" | "backup_storage_used" => Ok(GeneratedField::BackupStorageUsed), "roomComposite" | "room_composite" => Ok(GeneratedField::RoomComposite), "web" => Ok(GeneratedField::Web), "participant" => Ok(GeneratedField::Participant), @@ -6494,6 +7524,8 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { let mut file_results__ = None; let mut segment_results__ = None; let mut image_results__ = None; + let mut manifest_location__ = None; + let mut backup_storage_used__ = None; let mut request__ = None; let mut result__ = None; while let Some(k) = map_.next_key()? { @@ -6590,6 +7622,18 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { } image_results__ = Some(map_.next_value()?); } + GeneratedField::ManifestLocation => { + if manifest_location__.is_some() { + return Err(serde::de::Error::duplicate_field("manifestLocation")); + } + manifest_location__ = Some(map_.next_value()?); + } + GeneratedField::BackupStorageUsed => { + if backup_storage_used__.is_some() { + return Err(serde::de::Error::duplicate_field("backupStorageUsed")); + } + backup_storage_used__ = Some(map_.next_value()?); + } GeneratedField::RoomComposite => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("roomComposite")); @@ -6666,6 +7710,8 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { file_results: file_results__.unwrap_or_default(), segment_results: segment_results__.unwrap_or_default(), image_results: image_results__.unwrap_or_default(), + manifest_location: manifest_location__.unwrap_or_default(), + backup_storage_used: backup_storage_used__.unwrap_or_default(), request: request__, result: result__, }) @@ -14194,6 +15240,9 @@ impl serde::Serialize for MetricLabel { Self::ClientVideoPublisherQualityLimitationDurationBandwidth => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", Self::ClientVideoPublisherQualityLimitationDurationCpu => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", Self::ClientVideoPublisherQualityLimitationDurationOther => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + Self::PublisherRtt => "PUBLISHER_RTT", + Self::ServerMeshRtt => "SERVER_MESH_RTT", + Self::SubscriberRtt => "SUBSCRIBER_RTT", Self::PredefinedMaxValue => "METRIC_LABEL_PREDEFINED_MAX_VALUE", }; serializer.serialize_str(variant) @@ -14223,6 +15272,9 @@ impl<'de> serde::Deserialize<'de> for MetricLabel { "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + "PUBLISHER_RTT", + "SERVER_MESH_RTT", + "SUBSCRIBER_RTT", "METRIC_LABEL_PREDEFINED_MAX_VALUE", ]; @@ -14281,6 +15333,9 @@ impl<'de> serde::Deserialize<'de> for MetricLabel { "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationBandwidth), "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationCpu), "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationOther), + "PUBLISHER_RTT" => Ok(MetricLabel::PublisherRtt), + "SERVER_MESH_RTT" => Ok(MetricLabel::ServerMeshRtt), + "SUBSCRIBER_RTT" => Ok(MetricLabel::SubscriberRtt), "METRIC_LABEL_PREDEFINED_MAX_VALUE" => Ok(MetricLabel::PredefinedMaxValue), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } @@ -20502,9 +21557,6 @@ impl serde::Serialize for RoomConfiguration { if self.egress.is_some() { len += 1; } - if self.agent.is_some() { - len += 1; - } if self.min_playout_delay != 0 { len += 1; } @@ -20514,6 +21566,9 @@ impl serde::Serialize for RoomConfiguration { if self.sync_streams { len += 1; } + if !self.agents.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.RoomConfiguration", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; @@ -20530,9 +21585,6 @@ impl serde::Serialize for RoomConfiguration { if let Some(v) = self.egress.as_ref() { struct_ser.serialize_field("egress", v)?; } - if let Some(v) = self.agent.as_ref() { - struct_ser.serialize_field("agent", v)?; - } if self.min_playout_delay != 0 { struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; } @@ -20542,6 +21594,9 @@ impl serde::Serialize for RoomConfiguration { if self.sync_streams { struct_ser.serialize_field("syncStreams", &self.sync_streams)?; } + if !self.agents.is_empty() { + struct_ser.serialize_field("agents", &self.agents)?; + } struct_ser.end() } } @@ -20560,13 +21615,13 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { "max_participants", "maxParticipants", "egress", - "agent", "min_playout_delay", "minPlayoutDelay", "max_playout_delay", "maxPlayoutDelay", "sync_streams", "syncStreams", + "agents", ]; #[allow(clippy::enum_variant_names)] @@ -20576,10 +21631,10 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { DepartureTimeout, MaxParticipants, Egress, - Agent, MinPlayoutDelay, MaxPlayoutDelay, SyncStreams, + Agents, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20607,10 +21662,10 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), "egress" => Ok(GeneratedField::Egress), - "agent" => Ok(GeneratedField::Agent), "minPlayoutDelay" | "min_playout_delay" => Ok(GeneratedField::MinPlayoutDelay), "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), "syncStreams" | "sync_streams" => Ok(GeneratedField::SyncStreams), + "agents" => Ok(GeneratedField::Agents), _ => Ok(GeneratedField::__SkipField__), } } @@ -20635,10 +21690,10 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { let mut departure_timeout__ = None; let mut max_participants__ = None; let mut egress__ = None; - let mut agent__ = None; let mut min_playout_delay__ = None; let mut max_playout_delay__ = None; let mut sync_streams__ = None; + let mut agents__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -20677,12 +21732,6 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { } egress__ = map_.next_value()?; } - GeneratedField::Agent => { - if agent__.is_some() { - return Err(serde::de::Error::duplicate_field("agent")); - } - agent__ = map_.next_value()?; - } GeneratedField::MinPlayoutDelay => { if min_playout_delay__.is_some() { return Err(serde::de::Error::duplicate_field("minPlayoutDelay")); @@ -20705,6 +21754,12 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { } sync_streams__ = Some(map_.next_value()?); } + GeneratedField::Agents => { + if agents__.is_some() { + return Err(serde::de::Error::duplicate_field("agents")); + } + agents__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -20716,10 +21771,10 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { departure_timeout: departure_timeout__.unwrap_or_default(), max_participants: max_participants__.unwrap_or_default(), egress: egress__, - agent: agent__, min_playout_delay: min_playout_delay__.unwrap_or_default(), max_playout_delay: max_playout_delay__.unwrap_or_default(), sync_streams: sync_streams__.unwrap_or_default(), + agents: agents__.unwrap_or_default(), }) } } @@ -21468,44 +22523,240 @@ impl serde::Serialize for RpcResponse { if !self.request_id.is_empty() { len += 1; } - if self.value.is_some() { + if self.value.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RpcResponse", len)?; + if !self.request_id.is_empty() { + struct_ser.serialize_field("requestId", &self.request_id)?; + } + if let Some(v) = self.value.as_ref() { + match v { + rpc_response::Value::Payload(v) => { + struct_ser.serialize_field("payload", v)?; + } + rpc_response::Value::Error(v) => { + struct_ser.serialize_field("error", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RpcResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "request_id", + "requestId", + "payload", + "error", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RequestId, + Payload, + Error, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "requestId" | "request_id" => Ok(GeneratedField::RequestId), + "payload" => Ok(GeneratedField::Payload), + "error" => Ok(GeneratedField::Error), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RpcResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RpcResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut request_id__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); + } + request_id__ = Some(map_.next_value()?); + } + GeneratedField::Payload => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("payload")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Payload); + } + GeneratedField::Error => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Error) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RpcResponse { + request_id: request_id__.unwrap_or_default(), + value: value__, + }) + } + } + deserializer.deserialize_struct("livekit.RpcResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for S3Upload { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.access_key.is_empty() { + len += 1; + } + if !self.secret.is_empty() { + len += 1; + } + if !self.session_token.is_empty() { + len += 1; + } + if !self.region.is_empty() { + len += 1; + } + if !self.endpoint.is_empty() { + len += 1; + } + if !self.bucket.is_empty() { + len += 1; + } + if self.force_path_style { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.tagging.is_empty() { + len += 1; + } + if !self.content_disposition.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RpcResponse", len)?; - if !self.request_id.is_empty() { - struct_ser.serialize_field("requestId", &self.request_id)?; + if self.proxy.is_some() { + len += 1; } - if let Some(v) = self.value.as_ref() { - match v { - rpc_response::Value::Payload(v) => { - struct_ser.serialize_field("payload", v)?; - } - rpc_response::Value::Error(v) => { - struct_ser.serialize_field("error", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.S3Upload", len)?; + if !self.access_key.is_empty() { + struct_ser.serialize_field("accessKey", &self.access_key)?; + } + if !self.secret.is_empty() { + struct_ser.serialize_field("secret", &self.secret)?; + } + if !self.session_token.is_empty() { + struct_ser.serialize_field("sessionToken", &self.session_token)?; + } + if !self.region.is_empty() { + struct_ser.serialize_field("region", &self.region)?; + } + if !self.endpoint.is_empty() { + struct_ser.serialize_field("endpoint", &self.endpoint)?; + } + if !self.bucket.is_empty() { + struct_ser.serialize_field("bucket", &self.bucket)?; + } + if self.force_path_style { + struct_ser.serialize_field("forcePathStyle", &self.force_path_style)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.tagging.is_empty() { + struct_ser.serialize_field("tagging", &self.tagging)?; + } + if !self.content_disposition.is_empty() { + struct_ser.serialize_field("contentDisposition", &self.content_disposition)?; + } + if let Some(v) = self.proxy.as_ref() { + struct_ser.serialize_field("proxy", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RpcResponse { +impl<'de> serde::Deserialize<'de> for S3Upload { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "request_id", - "requestId", - "payload", - "error", + "access_key", + "accessKey", + "secret", + "session_token", + "sessionToken", + "region", + "endpoint", + "bucket", + "force_path_style", + "forcePathStyle", + "metadata", + "tagging", + "content_disposition", + "contentDisposition", + "proxy", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RequestId, - Payload, - Error, + AccessKey, + Secret, + SessionToken, + Region, + Endpoint, + Bucket, + ForcePathStyle, + Metadata, + Tagging, + ContentDisposition, + Proxy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21528,9 +22779,17 @@ impl<'de> serde::Deserialize<'de> for RpcResponse { E: serde::de::Error, { match value { - "requestId" | "request_id" => Ok(GeneratedField::RequestId), - "payload" => Ok(GeneratedField::Payload), - "error" => Ok(GeneratedField::Error), + "accessKey" | "access_key" => Ok(GeneratedField::AccessKey), + "secret" => Ok(GeneratedField::Secret), + "sessionToken" | "session_token" => Ok(GeneratedField::SessionToken), + "region" => Ok(GeneratedField::Region), + "endpoint" => Ok(GeneratedField::Endpoint), + "bucket" => Ok(GeneratedField::Bucket), + "forcePathStyle" | "force_path_style" => Ok(GeneratedField::ForcePathStyle), + "metadata" => Ok(GeneratedField::Metadata), + "tagging" => Ok(GeneratedField::Tagging), + "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), + "proxy" => Ok(GeneratedField::Proxy), _ => Ok(GeneratedField::__SkipField__), } } @@ -21540,54 +22799,121 @@ impl<'de> serde::Deserialize<'de> for RpcResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RpcResponse; + type Value = S3Upload; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RpcResponse") + formatter.write_str("struct livekit.S3Upload") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut request_id__ = None; - let mut value__ = None; + let mut access_key__ = None; + let mut secret__ = None; + let mut session_token__ = None; + let mut region__ = None; + let mut endpoint__ = None; + let mut bucket__ = None; + let mut force_path_style__ = None; + let mut metadata__ = None; + let mut tagging__ = None; + let mut content_disposition__ = None; + let mut proxy__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::RequestId => { - if request_id__.is_some() { - return Err(serde::de::Error::duplicate_field("requestId")); + GeneratedField::AccessKey => { + if access_key__.is_some() { + return Err(serde::de::Error::duplicate_field("accessKey")); } - request_id__ = Some(map_.next_value()?); + access_key__ = Some(map_.next_value()?); } - GeneratedField::Payload => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("payload")); + GeneratedField::Secret => { + if secret__.is_some() { + return Err(serde::de::Error::duplicate_field("secret")); } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Payload); + secret__ = Some(map_.next_value()?); } - GeneratedField::Error => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); + GeneratedField::SessionToken => { + if session_token__.is_some() { + return Err(serde::de::Error::duplicate_field("sessionToken")); } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Error) -; + session_token__ = Some(map_.next_value()?); + } + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); + } + region__ = Some(map_.next_value()?); + } + GeneratedField::Endpoint => { + if endpoint__.is_some() { + return Err(serde::de::Error::duplicate_field("endpoint")); + } + endpoint__ = Some(map_.next_value()?); + } + GeneratedField::Bucket => { + if bucket__.is_some() { + return Err(serde::de::Error::duplicate_field("bucket")); + } + bucket__ = Some(map_.next_value()?); + } + GeneratedField::ForcePathStyle => { + if force_path_style__.is_some() { + return Err(serde::de::Error::duplicate_field("forcePathStyle")); + } + force_path_style__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::Tagging => { + if tagging__.is_some() { + return Err(serde::de::Error::duplicate_field("tagging")); + } + tagging__ = Some(map_.next_value()?); + } + GeneratedField::ContentDisposition => { + if content_disposition__.is_some() { + return Err(serde::de::Error::duplicate_field("contentDisposition")); + } + content_disposition__ = Some(map_.next_value()?); + } + GeneratedField::Proxy => { + if proxy__.is_some() { + return Err(serde::de::Error::duplicate_field("proxy")); + } + proxy__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RpcResponse { - request_id: request_id__.unwrap_or_default(), - value: value__, + Ok(S3Upload { + access_key: access_key__.unwrap_or_default(), + secret: secret__.unwrap_or_default(), + session_token: session_token__.unwrap_or_default(), + region: region__.unwrap_or_default(), + endpoint: endpoint__.unwrap_or_default(), + bucket: bucket__.unwrap_or_default(), + force_path_style: force_path_style__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + tagging: tagging__.unwrap_or_default(), + content_disposition: content_disposition__.unwrap_or_default(), + proxy: proxy__, }) } } - deserializer.deserialize_struct("livekit.RpcResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for S3Upload { +impl serde::Serialize for SipCallInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21595,113 +22921,160 @@ impl serde::Serialize for S3Upload { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.access_key.is_empty() { + if !self.call_id.is_empty() { len += 1; } - if !self.secret.is_empty() { + if !self.trunk_id.is_empty() { len += 1; } - if !self.session_token.is_empty() { + if !self.room_name.is_empty() { len += 1; } - if !self.region.is_empty() { + if !self.room_id.is_empty() { len += 1; } - if !self.endpoint.is_empty() { + if !self.participant_identity.is_empty() { len += 1; } - if !self.bucket.is_empty() { + if self.from_uri.is_some() { len += 1; } - if self.force_path_style { + if self.to_uri.is_some() { len += 1; } - if !self.metadata.is_empty() { + if !self.enabled_features.is_empty() { len += 1; } - if !self.tagging.is_empty() { + if self.call_status != 0 { len += 1; } - if !self.content_disposition.is_empty() { + if self.created_at != 0 { len += 1; } - if self.proxy.is_some() { + if self.started_at != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.S3Upload", len)?; - if !self.access_key.is_empty() { - struct_ser.serialize_field("accessKey", &self.access_key)?; + if self.ended_at != 0 { + len += 1; } - if !self.secret.is_empty() { - struct_ser.serialize_field("secret", &self.secret)?; + if self.disconnect_reason != 0 { + len += 1; } - if !self.session_token.is_empty() { - struct_ser.serialize_field("sessionToken", &self.session_token)?; + if !self.error.is_empty() { + len += 1; } - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; + let mut struct_ser = serializer.serialize_struct("livekit.SIPCallInfo", len)?; + if !self.call_id.is_empty() { + struct_ser.serialize_field("callId", &self.call_id)?; } - if !self.endpoint.is_empty() { - struct_ser.serialize_field("endpoint", &self.endpoint)?; + if !self.trunk_id.is_empty() { + struct_ser.serialize_field("trunkId", &self.trunk_id)?; + } + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.room_id.is_empty() { + struct_ser.serialize_field("roomId", &self.room_id)?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if let Some(v) = self.from_uri.as_ref() { + struct_ser.serialize_field("fromUri", v)?; + } + if let Some(v) = self.to_uri.as_ref() { + struct_ser.serialize_field("toUri", v)?; + } + if !self.enabled_features.is_empty() { + let v = self.enabled_features.iter().cloned().map(|v| { + SipFeature::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("enabledFeatures", &v)?; } - if !self.bucket.is_empty() { - struct_ser.serialize_field("bucket", &self.bucket)?; + if self.call_status != 0 { + let v = SipCallStatus::try_from(self.call_status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.call_status)))?; + struct_ser.serialize_field("callStatus", &v)?; } - if self.force_path_style { - struct_ser.serialize_field("forcePathStyle", &self.force_path_style)?; + if self.created_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } - if !self.tagging.is_empty() { - struct_ser.serialize_field("tagging", &self.tagging)?; + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } - if !self.content_disposition.is_empty() { - struct_ser.serialize_field("contentDisposition", &self.content_disposition)?; + if self.disconnect_reason != 0 { + let v = DisconnectReason::try_from(self.disconnect_reason) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.disconnect_reason)))?; + struct_ser.serialize_field("disconnectReason", &v)?; } - if let Some(v) = self.proxy.as_ref() { - struct_ser.serialize_field("proxy", v)?; + if !self.error.is_empty() { + struct_ser.serialize_field("error", &self.error)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for S3Upload { +impl<'de> serde::Deserialize<'de> for SipCallInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "access_key", - "accessKey", - "secret", - "session_token", - "sessionToken", - "region", - "endpoint", - "bucket", - "force_path_style", - "forcePathStyle", - "metadata", - "tagging", - "content_disposition", - "contentDisposition", - "proxy", + "call_id", + "callId", + "trunk_id", + "trunkId", + "room_name", + "roomName", + "room_id", + "roomId", + "participant_identity", + "participantIdentity", + "from_uri", + "fromUri", + "to_uri", + "toUri", + "enabled_features", + "enabledFeatures", + "call_status", + "callStatus", + "created_at", + "createdAt", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "disconnect_reason", + "disconnectReason", + "error", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AccessKey, - Secret, - SessionToken, - Region, - Endpoint, - Bucket, - ForcePathStyle, - Metadata, - Tagging, - ContentDisposition, - Proxy, + CallId, + TrunkId, + RoomName, + RoomId, + ParticipantIdentity, + FromUri, + ToUri, + EnabledFeatures, + CallStatus, + CreatedAt, + StartedAt, + EndedAt, + DisconnectReason, + Error, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21724,17 +23097,20 @@ impl<'de> serde::Deserialize<'de> for S3Upload { E: serde::de::Error, { match value { - "accessKey" | "access_key" => Ok(GeneratedField::AccessKey), - "secret" => Ok(GeneratedField::Secret), - "sessionToken" | "session_token" => Ok(GeneratedField::SessionToken), - "region" => Ok(GeneratedField::Region), - "endpoint" => Ok(GeneratedField::Endpoint), - "bucket" => Ok(GeneratedField::Bucket), - "forcePathStyle" | "force_path_style" => Ok(GeneratedField::ForcePathStyle), - "metadata" => Ok(GeneratedField::Metadata), - "tagging" => Ok(GeneratedField::Tagging), - "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), - "proxy" => Ok(GeneratedField::Proxy), + "callId" | "call_id" => Ok(GeneratedField::CallId), + "trunkId" | "trunk_id" => Ok(GeneratedField::TrunkId), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "roomId" | "room_id" => Ok(GeneratedField::RoomId), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "fromUri" | "from_uri" => Ok(GeneratedField::FromUri), + "toUri" | "to_uri" => Ok(GeneratedField::ToUri), + "enabledFeatures" | "enabled_features" => Ok(GeneratedField::EnabledFeatures), + "callStatus" | "call_status" => Ok(GeneratedField::CallStatus), + "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "disconnectReason" | "disconnect_reason" => Ok(GeneratedField::DisconnectReason), + "error" => Ok(GeneratedField::Error), _ => Ok(GeneratedField::__SkipField__), } } @@ -21744,118 +23120,226 @@ impl<'de> serde::Deserialize<'de> for S3Upload { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = S3Upload; + type Value = SipCallInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.S3Upload") + formatter.write_str("struct livekit.SIPCallInfo") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut access_key__ = None; - let mut secret__ = None; - let mut session_token__ = None; - let mut region__ = None; - let mut endpoint__ = None; - let mut bucket__ = None; - let mut force_path_style__ = None; - let mut metadata__ = None; - let mut tagging__ = None; - let mut content_disposition__ = None; - let mut proxy__ = None; + let mut call_id__ = None; + let mut trunk_id__ = None; + let mut room_name__ = None; + let mut room_id__ = None; + let mut participant_identity__ = None; + let mut from_uri__ = None; + let mut to_uri__ = None; + let mut enabled_features__ = None; + let mut call_status__ = None; + let mut created_at__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut disconnect_reason__ = None; + let mut error__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::AccessKey => { - if access_key__.is_some() { - return Err(serde::de::Error::duplicate_field("accessKey")); + GeneratedField::CallId => { + if call_id__.is_some() { + return Err(serde::de::Error::duplicate_field("callId")); } - access_key__ = Some(map_.next_value()?); + call_id__ = Some(map_.next_value()?); } - GeneratedField::Secret => { - if secret__.is_some() { - return Err(serde::de::Error::duplicate_field("secret")); + GeneratedField::TrunkId => { + if trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("trunkId")); } - secret__ = Some(map_.next_value()?); + trunk_id__ = Some(map_.next_value()?); } - GeneratedField::SessionToken => { - if session_token__.is_some() { - return Err(serde::de::Error::duplicate_field("sessionToken")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - session_token__ = Some(map_.next_value()?); + room_name__ = Some(map_.next_value()?); } - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); + GeneratedField::RoomId => { + if room_id__.is_some() { + return Err(serde::de::Error::duplicate_field("roomId")); } - region__ = Some(map_.next_value()?); + room_id__ = Some(map_.next_value()?); } - GeneratedField::Endpoint => { - if endpoint__.is_some() { - return Err(serde::de::Error::duplicate_field("endpoint")); + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); } - endpoint__ = Some(map_.next_value()?); + participant_identity__ = Some(map_.next_value()?); } - GeneratedField::Bucket => { - if bucket__.is_some() { - return Err(serde::de::Error::duplicate_field("bucket")); + GeneratedField::FromUri => { + if from_uri__.is_some() { + return Err(serde::de::Error::duplicate_field("fromUri")); } - bucket__ = Some(map_.next_value()?); + from_uri__ = map_.next_value()?; } - GeneratedField::ForcePathStyle => { - if force_path_style__.is_some() { - return Err(serde::de::Error::duplicate_field("forcePathStyle")); + GeneratedField::ToUri => { + if to_uri__.is_some() { + return Err(serde::de::Error::duplicate_field("toUri")); } - force_path_style__ = Some(map_.next_value()?); + to_uri__ = map_.next_value()?; } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::EnabledFeatures => { + if enabled_features__.is_some() { + return Err(serde::de::Error::duplicate_field("enabledFeatures")); } - metadata__ = Some( - map_.next_value::>()? - ); + enabled_features__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); } - GeneratedField::Tagging => { - if tagging__.is_some() { - return Err(serde::de::Error::duplicate_field("tagging")); + GeneratedField::CallStatus => { + if call_status__.is_some() { + return Err(serde::de::Error::duplicate_field("callStatus")); } - tagging__ = Some(map_.next_value()?); + call_status__ = Some(map_.next_value::()? as i32); } - GeneratedField::ContentDisposition => { - if content_disposition__.is_some() { - return Err(serde::de::Error::duplicate_field("contentDisposition")); + GeneratedField::CreatedAt => { + if created_at__.is_some() { + return Err(serde::de::Error::duplicate_field("createdAt")); } - content_disposition__ = Some(map_.next_value()?); + created_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Proxy => { - if proxy__.is_some() { - return Err(serde::de::Error::duplicate_field("proxy")); + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); } - proxy__ = map_.next_value()?; + started_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndedAt => { + if ended_at__.is_some() { + return Err(serde::de::Error::duplicate_field("endedAt")); + } + ended_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::DisconnectReason => { + if disconnect_reason__.is_some() { + return Err(serde::de::Error::duplicate_field("disconnectReason")); + } + disconnect_reason__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Error => { + if error__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + error__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(S3Upload { - access_key: access_key__.unwrap_or_default(), - secret: secret__.unwrap_or_default(), - session_token: session_token__.unwrap_or_default(), - region: region__.unwrap_or_default(), - endpoint: endpoint__.unwrap_or_default(), - bucket: bucket__.unwrap_or_default(), - force_path_style: force_path_style__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - tagging: tagging__.unwrap_or_default(), - content_disposition: content_disposition__.unwrap_or_default(), - proxy: proxy__, - }) + Ok(SipCallInfo { + call_id: call_id__.unwrap_or_default(), + trunk_id: trunk_id__.unwrap_or_default(), + room_name: room_name__.unwrap_or_default(), + room_id: room_id__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + from_uri: from_uri__, + to_uri: to_uri__, + enabled_features: enabled_features__.unwrap_or_default(), + call_status: call_status__.unwrap_or_default(), + created_at: created_at__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), + disconnect_reason: disconnect_reason__.unwrap_or_default(), + error: error__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.SIPCallInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SipCallStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::ScsCallIncoming => "SCS_CALL_INCOMING", + Self::ScsParticipantJoined => "SCS_PARTICIPANT_JOINED", + Self::ScsActive => "SCS_ACTIVE", + Self::ScsDisconnected => "SCS_DISCONNECTED", + Self::ScsError => "SCS_ERROR", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SipCallStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCS_CALL_INCOMING", + "SCS_PARTICIPANT_JOINED", + "SCS_ACTIVE", + "SCS_DISCONNECTED", + "SCS_ERROR", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipCallStatus; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCS_CALL_INCOMING" => Ok(SipCallStatus::ScsCallIncoming), + "SCS_PARTICIPANT_JOINED" => Ok(SipCallStatus::ScsParticipantJoined), + "SCS_ACTIVE" => Ok(SipCallStatus::ScsActive), + "SCS_DISCONNECTED" => Ok(SipCallStatus::ScsDisconnected), + "SCS_ERROR" => Ok(SipCallStatus::ScsError), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } } } - deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } impl serde::Serialize for SipDispatchRule { @@ -22563,6 +24047,77 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { deserializer.deserialize_struct("livekit.SIPDispatchRuleInfo", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for SipFeature { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::None => "NONE", + Self::KrispEnabled => "KRISP_ENABLED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SipFeature { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "NONE", + "KRISP_ENABLED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipFeature; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "NONE" => Ok(SipFeature::None), + "KRISP_ENABLED" => Ok(SipFeature::KrispEnabled), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for SipInboundTrunkInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -22601,6 +24156,18 @@ impl serde::Serialize for SipInboundTrunkInfo { if !self.headers_to_attributes.is_empty() { len += 1; } + if !self.attributes_to_headers.is_empty() { + len += 1; + } + if self.ringing_timeout.is_some() { + len += 1; + } + if self.max_call_duration.is_some() { + len += 1; + } + if self.krisp_enabled { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.SIPInboundTrunkInfo", len)?; if !self.sip_trunk_id.is_empty() { struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; @@ -22632,6 +24199,18 @@ impl serde::Serialize for SipInboundTrunkInfo { if !self.headers_to_attributes.is_empty() { struct_ser.serialize_field("headersToAttributes", &self.headers_to_attributes)?; } + if !self.attributes_to_headers.is_empty() { + struct_ser.serialize_field("attributesToHeaders", &self.attributes_to_headers)?; + } + if let Some(v) = self.ringing_timeout.as_ref() { + struct_ser.serialize_field("ringingTimeout", v)?; + } + if let Some(v) = self.max_call_duration.as_ref() { + struct_ser.serialize_field("maxCallDuration", v)?; + } + if self.krisp_enabled { + struct_ser.serialize_field("krispEnabled", &self.krisp_enabled)?; + } struct_ser.end() } } @@ -22658,6 +24237,14 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { "headers", "headers_to_attributes", "headersToAttributes", + "attributes_to_headers", + "attributesToHeaders", + "ringing_timeout", + "ringingTimeout", + "max_call_duration", + "maxCallDuration", + "krisp_enabled", + "krispEnabled", ]; #[allow(clippy::enum_variant_names)] @@ -22672,6 +24259,10 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { AuthPassword, Headers, HeadersToAttributes, + AttributesToHeaders, + RingingTimeout, + MaxCallDuration, + KrispEnabled, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22704,6 +24295,10 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), "headers" => Ok(GeneratedField::Headers), "headersToAttributes" | "headers_to_attributes" => Ok(GeneratedField::HeadersToAttributes), + "attributesToHeaders" | "attributes_to_headers" => Ok(GeneratedField::AttributesToHeaders), + "ringingTimeout" | "ringing_timeout" => Ok(GeneratedField::RingingTimeout), + "maxCallDuration" | "max_call_duration" => Ok(GeneratedField::MaxCallDuration), + "krispEnabled" | "krisp_enabled" => Ok(GeneratedField::KrispEnabled), _ => Ok(GeneratedField::__SkipField__), } } @@ -22733,6 +24328,10 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { let mut auth_password__ = None; let mut headers__ = None; let mut headers_to_attributes__ = None; + let mut attributes_to_headers__ = None; + let mut ringing_timeout__ = None; + let mut max_call_duration__ = None; + let mut krisp_enabled__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -22799,6 +24398,32 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { map_.next_value::>()? ); } + GeneratedField::AttributesToHeaders => { + if attributes_to_headers__.is_some() { + return Err(serde::de::Error::duplicate_field("attributesToHeaders")); + } + attributes_to_headers__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::RingingTimeout => { + if ringing_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("ringingTimeout")); + } + ringing_timeout__ = map_.next_value()?; + } + GeneratedField::MaxCallDuration => { + if max_call_duration__.is_some() { + return Err(serde::de::Error::duplicate_field("maxCallDuration")); + } + max_call_duration__ = map_.next_value()?; + } + GeneratedField::KrispEnabled => { + if krisp_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("krispEnabled")); + } + krisp_enabled__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -22815,6 +24440,10 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { auth_password: auth_password__.unwrap_or_default(), headers: headers__.unwrap_or_default(), headers_to_attributes: headers_to_attributes__.unwrap_or_default(), + attributes_to_headers: attributes_to_headers__.unwrap_or_default(), + ringing_timeout: ringing_timeout__, + max_call_duration: max_call_duration__, + krisp_enabled: krisp_enabled__.unwrap_or_default(), }) } } @@ -22859,6 +24488,9 @@ impl serde::Serialize for SipOutboundTrunkInfo { if !self.headers_to_attributes.is_empty() { len += 1; } + if !self.attributes_to_headers.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.SIPOutboundTrunkInfo", len)?; if !self.sip_trunk_id.is_empty() { struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; @@ -22892,6 +24524,9 @@ impl serde::Serialize for SipOutboundTrunkInfo { if !self.headers_to_attributes.is_empty() { struct_ser.serialize_field("headersToAttributes", &self.headers_to_attributes)?; } + if !self.attributes_to_headers.is_empty() { + struct_ser.serialize_field("attributesToHeaders", &self.attributes_to_headers)?; + } struct_ser.end() } } @@ -22916,6 +24551,8 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { "headers", "headers_to_attributes", "headersToAttributes", + "attributes_to_headers", + "attributesToHeaders", ]; #[allow(clippy::enum_variant_names)] @@ -22930,6 +24567,7 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { AuthPassword, Headers, HeadersToAttributes, + AttributesToHeaders, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22962,6 +24600,7 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), "headers" => Ok(GeneratedField::Headers), "headersToAttributes" | "headers_to_attributes" => Ok(GeneratedField::HeadersToAttributes), + "attributesToHeaders" | "attributes_to_headers" => Ok(GeneratedField::AttributesToHeaders), _ => Ok(GeneratedField::__SkipField__), } } @@ -22991,6 +24630,7 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { let mut auth_password__ = None; let mut headers__ = None; let mut headers_to_attributes__ = None; + let mut attributes_to_headers__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -23057,6 +24697,14 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { map_.next_value::>()? ); } + GeneratedField::AttributesToHeaders => { + if attributes_to_headers__.is_some() { + return Err(serde::de::Error::duplicate_field("attributesToHeaders")); + } + attributes_to_headers__ = Some( + map_.next_value::>()? + ); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -23073,6 +24721,7 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { auth_password: auth_password__.unwrap_or_default(), headers: headers__.unwrap_or_default(), headers_to_attributes: headers_to_attributes__.unwrap_or_default(), + attributes_to_headers: attributes_to_headers__.unwrap_or_default(), }) } } @@ -23710,6 +25359,173 @@ impl<'de> serde::Deserialize<'de> for sip_trunk_info::TrunkKind { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for SipUri { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.user.is_empty() { + len += 1; + } + if !self.host.is_empty() { + len += 1; + } + if !self.ip.is_empty() { + len += 1; + } + if self.port != 0 { + len += 1; + } + if self.transport != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPUri", len)?; + if !self.user.is_empty() { + struct_ser.serialize_field("user", &self.user)?; + } + if !self.host.is_empty() { + struct_ser.serialize_field("host", &self.host)?; + } + if !self.ip.is_empty() { + struct_ser.serialize_field("ip", &self.ip)?; + } + if self.port != 0 { + struct_ser.serialize_field("port", &self.port)?; + } + if self.transport != 0 { + let v = SipTransport::try_from(self.transport) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport)))?; + struct_ser.serialize_field("transport", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SipUri { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "user", + "host", + "ip", + "port", + "transport", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + User, + Host, + Ip, + Port, + Transport, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "user" => Ok(GeneratedField::User), + "host" => Ok(GeneratedField::Host), + "ip" => Ok(GeneratedField::Ip), + "port" => Ok(GeneratedField::Port), + "transport" => Ok(GeneratedField::Transport), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipUri; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SIPUri") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut user__ = None; + let mut host__ = None; + let mut ip__ = None; + let mut port__ = None; + let mut transport__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::User => { + if user__.is_some() { + return Err(serde::de::Error::duplicate_field("user")); + } + user__ = Some(map_.next_value()?); + } + GeneratedField::Host => { + if host__.is_some() { + return Err(serde::de::Error::duplicate_field("host")); + } + host__ = Some(map_.next_value()?); + } + GeneratedField::Ip => { + if ip__.is_some() { + return Err(serde::de::Error::duplicate_field("ip")); + } + ip__ = Some(map_.next_value()?); + } + GeneratedField::Port => { + if port__.is_some() { + return Err(serde::de::Error::duplicate_field("port")); + } + port__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Transport => { + if transport__.is_some() { + return Err(serde::de::Error::duplicate_field("transport")); + } + transport__ = Some(map_.next_value::()? as i32); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(SipUri { + user: user__.unwrap_or_default(), + host: host__.unwrap_or_default(), + ip: ip__.unwrap_or_default(), + port: port__.unwrap_or_default(), + transport: transport__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.SIPUri", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for SegmentedFileOutput { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -30911,6 +32727,9 @@ impl serde::Serialize for TransferSipParticipantRequest { if !self.transfer_to.is_empty() { len += 1; } + if self.play_dialtone { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.TransferSIPParticipantRequest", len)?; if !self.participant_identity.is_empty() { struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; @@ -30921,6 +32740,9 @@ impl serde::Serialize for TransferSipParticipantRequest { if !self.transfer_to.is_empty() { struct_ser.serialize_field("transferTo", &self.transfer_to)?; } + if self.play_dialtone { + struct_ser.serialize_field("playDialtone", &self.play_dialtone)?; + } struct_ser.end() } } @@ -30937,6 +32759,8 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { "roomName", "transfer_to", "transferTo", + "play_dialtone", + "playDialtone", ]; #[allow(clippy::enum_variant_names)] @@ -30944,6 +32768,7 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { ParticipantIdentity, RoomName, TransferTo, + PlayDialtone, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -30969,6 +32794,7 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), "roomName" | "room_name" => Ok(GeneratedField::RoomName), "transferTo" | "transfer_to" => Ok(GeneratedField::TransferTo), + "playDialtone" | "play_dialtone" => Ok(GeneratedField::PlayDialtone), _ => Ok(GeneratedField::__SkipField__), } } @@ -30991,6 +32817,7 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { let mut participant_identity__ = None; let mut room_name__ = None; let mut transfer_to__ = None; + let mut play_dialtone__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ParticipantIdentity => { @@ -31011,6 +32838,12 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { } transfer_to__ = Some(map_.next_value()?); } + GeneratedField::PlayDialtone => { + if play_dialtone__.is_some() { + return Err(serde::de::Error::duplicate_field("playDialtone")); + } + play_dialtone__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -31020,6 +32853,7 @@ impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { participant_identity: participant_identity__.unwrap_or_default(), room_name: room_name__.unwrap_or_default(), transfer_to: transfer_to__.unwrap_or_default(), + play_dialtone: play_dialtone__.unwrap_or_default(), }) } } diff --git a/livekit/src/prelude.rs b/livekit/src/prelude.rs index d86e328c3..1c2eab0ff 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 b96ae2c57..b630feb1a 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 7e38cbfff..21e288773 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 037c31709..71ff4d775 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 f8f7a7460..164c3eddf 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 e9e61ea07..58a1659e7 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 + } } From a1b926ece849e45f6a38eb66a2015deaee35f475 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Wed, 11 Dec 2024 19:57:22 +0200 Subject: [PATCH 28/51] chore(webrtc-sys): bump to m125_release (#505) --- .nanpa/bump-webrtc.kdl | 2 ++ webrtc-sys/include/livekit/audio_device.h | 4 +-- webrtc-sys/include/livekit/audio_track.h | 4 +-- .../include/livekit/video_decoder_factory.h | 5 ++-- .../include/livekit/video_encoder_factory.h | 8 +++--- webrtc-sys/libwebrtc/.gclient | 2 +- webrtc-sys/libwebrtc/build_android.sh | 5 ++++ webrtc-sys/libwebrtc/build_ios.sh | 5 ++++ webrtc-sys/libwebrtc/build_linux.sh | 5 ++++ webrtc-sys/libwebrtc/build_macos.sh | 5 ++++ webrtc-sys/libwebrtc/build_windows.cmd | 5 ++++ .../patches/abseil_use_optional.patch | 13 +++++++++ webrtc-sys/src/audio_device.cpp | 6 ++--- webrtc-sys/src/audio_track.cpp | 6 ++--- webrtc-sys/src/peer_connection_factory.cpp | 27 +++++++------------ webrtc-sys/src/video_decoder_factory.cpp | 11 ++++---- webrtc-sys/src/video_encoder_factory.cpp | 15 ++++++----- 17 files changed, 82 insertions(+), 46 deletions(-) create mode 100644 .nanpa/bump-webrtc.kdl create mode 100644 webrtc-sys/libwebrtc/patches/abseil_use_optional.patch diff --git a/.nanpa/bump-webrtc.kdl b/.nanpa/bump-webrtc.kdl new file mode 100644 index 000000000..996bd1e19 --- /dev/null +++ b/.nanpa/bump-webrtc.kdl @@ -0,0 +1,2 @@ +patch package="webrtc-sys/build" type="added" "bump libwebrtc to m125" +patch package="webrtc-sys" type="added" "bump libwebrtc to m125" diff --git a/webrtc-sys/include/livekit/audio_device.h b/webrtc-sys/include/livekit/audio_device.h index 903e22d6e..74d76823a 100644 --- a/webrtc-sys/include/livekit/audio_device.h +++ b/webrtc-sys/include/livekit/audio_device.h @@ -19,9 +19,9 @@ #include #include "api/task_queue/task_queue_factory.h" +#include "api/task_queue/task_queue_base.h" #include "modules/audio_device/include/audio_device.h" #include "rtc_base/synchronization/mutex.h" -#include "rtc_base/task_queue.h" #include "rtc_base/task_utils/repeating_task.h" namespace livekit { @@ -119,7 +119,7 @@ class AudioDevice : public webrtc::AudioDeviceModule { private: mutable webrtc::Mutex mutex_; std::vector data_; - std::unique_ptr audio_queue_; + std::unique_ptr audio_queue_; webrtc::RepeatingTaskHandle audio_task_; webrtc::AudioTransport* audio_transport_; webrtc::TaskQueueFactory* task_queue_factory_; diff --git a/webrtc-sys/include/livekit/audio_track.h b/webrtc-sys/include/livekit/audio_track.h index e7f3e7520..c780b7797 100644 --- a/webrtc-sys/include/livekit/audio_track.h +++ b/webrtc-sys/include/livekit/audio_track.h @@ -27,7 +27,7 @@ #include "livekit/webrtc.h" #include "pc/local_audio_source.h" #include "rtc_base/synchronization/mutex.h" -#include "rtc_base/task_queue.h" +#include "api/task_queue/task_queue_base.h" #include "rtc_base/task_utils/repeating_task.h" #include "rtc_base/thread_annotations.h" #include "rust/cxx.h" @@ -127,7 +127,7 @@ class AudioTrackSource { private: mutable webrtc::Mutex mutex_; - std::unique_ptr audio_queue_; + std::unique_ptr audio_queue_; webrtc::RepeatingTaskHandle audio_task_; std::vector sinks_ RTC_GUARDED_BY(mutex_); diff --git a/webrtc-sys/include/livekit/video_decoder_factory.h b/webrtc-sys/include/livekit/video_decoder_factory.h index 1943601e6..9b2d7030d 100644 --- a/webrtc-sys/include/livekit/video_decoder_factory.h +++ b/webrtc-sys/include/livekit/video_decoder_factory.h @@ -18,6 +18,7 @@ #include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder_factory.h" +#include "absl/strings/match.h" namespace livekit { class VideoDecoderFactory : public webrtc::VideoDecoderFactory { @@ -29,8 +30,8 @@ class VideoDecoderFactory : public webrtc::VideoDecoderFactory { CodecSupport QueryCodecSupport(const webrtc::SdpVideoFormat& format, bool reference_scaling) const override; - std::unique_ptr CreateVideoDecoder( - const webrtc::SdpVideoFormat& format) override; + std::unique_ptr Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override; private: std::vector> factories_; diff --git a/webrtc-sys/include/livekit/video_encoder_factory.h b/webrtc-sys/include/livekit/video_encoder_factory.h index 1d7852f81..f1e8bc84a 100644 --- a/webrtc-sys/include/livekit/video_encoder_factory.h +++ b/webrtc-sys/include/livekit/video_encoder_factory.h @@ -31,8 +31,8 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory { const webrtc::SdpVideoFormat& format, absl::optional scalability_mode) const override; - std::unique_ptr CreateVideoEncoder( - const webrtc::SdpVideoFormat& format) override; + std::unique_ptr Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override; private: std::vector> factories_; @@ -47,8 +47,8 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory { const webrtc::SdpVideoFormat& format, absl::optional scalability_mode) const override; - std::unique_ptr CreateVideoEncoder( - const webrtc::SdpVideoFormat& format) override; + std::unique_ptr Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override; private: std::unique_ptr internal_factory_; diff --git a/webrtc-sys/libwebrtc/.gclient b/webrtc-sys/libwebrtc/.gclient index 5f2dc30af..b4fbb1f00 100644 --- a/webrtc-sys/libwebrtc/.gclient +++ b/webrtc-sys/libwebrtc/.gclient @@ -1,7 +1,7 @@ solutions = [ { "name": 'src', - "url": 'https://github.com/webrtc-sdk/webrtc.git@m114_release', + "url": 'https://github.com/webrtc-sdk/webrtc.git@m125_release', "custom_deps": {}, "deps_file": "DEPS", "managed": False, diff --git a/webrtc-sys/libwebrtc/build_android.sh b/webrtc-sys/libwebrtc/build_android.sh index 01778b206..0b7006fcc 100755 --- a/webrtc-sys/libwebrtc/build_android.sh +++ b/webrtc-sys/libwebrtc/build_android.sh @@ -71,6 +71,11 @@ cd src git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/android_use_libunwind.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd third_party +git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn +cd .. + cd .. mkdir -p "$ARTIFACTS_DIR/lib" diff --git a/webrtc-sys/libwebrtc/build_ios.sh b/webrtc-sys/libwebrtc/build_ios.sh index 3bed8f7f8..94505e8b0 100755 --- a/webrtc-sys/libwebrtc/build_ios.sh +++ b/webrtc-sys/libwebrtc/build_ios.sh @@ -81,6 +81,11 @@ cd src # git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd third_party +git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn +cd .. + cd .. mkdir -p "$ARTIFACTS_DIR/lib" diff --git a/webrtc-sys/libwebrtc/build_linux.sh b/webrtc-sys/libwebrtc/build_linux.sh index 5f1af2212..ef63dc744 100755 --- a/webrtc-sys/libwebrtc/build_linux.sh +++ b/webrtc-sys/libwebrtc/build_linux.sh @@ -70,6 +70,11 @@ cd src git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd third_party +git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn +cd .. + cd .. mkdir -p "$ARTIFACTS_DIR/lib" diff --git a/webrtc-sys/libwebrtc/build_macos.sh b/webrtc-sys/libwebrtc/build_macos.sh index 4498b2eb0..5b07cb1e3 100755 --- a/webrtc-sys/libwebrtc/build_macos.sh +++ b/webrtc-sys/libwebrtc/build_macos.sh @@ -70,6 +70,11 @@ cd src git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd third_party +git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn +cd .. + cd .. mkdir -p "$ARTIFACTS_DIR/lib" diff --git a/webrtc-sys/libwebrtc/build_windows.cmd b/webrtc-sys/libwebrtc/build_windows.cmd index 47ca9845b..249320581 100644 --- a/webrtc-sys/libwebrtc/build_windows.cmd +++ b/webrtc-sys/libwebrtc/build_windows.cmd @@ -54,6 +54,11 @@ call git apply "%COMMAND_DIR%/patches/add_licenses.patch" -v --ignore-space-chan call git apply "%COMMAND_DIR%/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn call git apply "%COMMAND_DIR%/patches/windows_silence_warnings.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn call git apply "%COMMAND_DIR%/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn + +cd third_party +call git apply "%COMMAND_DIR%/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn +cd .. + cd .. mkdir "%ARTIFACTS_DIR%\lib" diff --git a/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch b/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch new file mode 100644 index 000000000..476ad2619 --- /dev/null +++ b/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch @@ -0,0 +1,13 @@ +diff --git a/abseil-cpp/absl/base/options.h b/abseil-cpp/absl/base/options.h +index bd43b6ef0..ab5917e75 100644 +--- a/abseil-cpp/absl/base/options.h ++++ b/abseil-cpp/absl/base/options.h +@@ -121,7 +121,7 @@ + // absl::optional is a typedef of std::optional, use the feature macro + // ABSL_USES_STD_OPTIONAL. + +-#define ABSL_OPTION_USE_STD_OPTIONAL 2 ++#define ABSL_OPTION_USE_STD_OPTIONAL 0 + + + // ABSL_OPTION_USE_STD_STRING_VIEW diff --git a/webrtc-sys/src/audio_device.cpp b/webrtc-sys/src/audio_device.cpp index 75911917a..d146a0c8a 100644 --- a/webrtc-sys/src/audio_device.cpp +++ b/webrtc-sys/src/audio_device.cpp @@ -48,11 +48,11 @@ int32_t AudioDevice::Init() { return 0; audio_queue_ = - std::make_unique(task_queue_factory_->CreateTaskQueue( - "AudioDevice", webrtc::TaskQueueFactory::Priority::NORMAL)); + task_queue_factory_->CreateTaskQueue( + "AudioDevice", webrtc::TaskQueueFactory::Priority::NORMAL); audio_task_ = - webrtc::RepeatingTaskHandle::Start(audio_queue_->Get(), [this]() { + webrtc::RepeatingTaskHandle::Start(audio_queue_.get(), [this]() { webrtc::MutexLock lock(&mutex_); if (playing_) { diff --git a/webrtc-sys/src/audio_track.cpp b/webrtc-sys/src/audio_track.cpp index 8a49c3203..8ca76e801 100644 --- a/webrtc-sys/src/audio_track.cpp +++ b/webrtc-sys/src/audio_track.cpp @@ -153,11 +153,11 @@ AudioTrackSource::InternalSource::InternalSource( buffer_.reserve(queue_size_samples_ + notify_threshold_samples_); audio_queue_ = - std::make_unique(task_queue_factory->CreateTaskQueue( - "AudioSourceCapture", webrtc::TaskQueueFactory::Priority::NORMAL)); + task_queue_factory->CreateTaskQueue( + "AudioSourceCapture", webrtc::TaskQueueFactory::Priority::NORMAL); audio_task_ = webrtc::RepeatingTaskHandle::Start( - audio_queue_->Get(), + audio_queue_.get(), [this, samples10ms]() { webrtc::MutexLock lock(&mutex_); diff --git a/webrtc-sys/src/peer_connection_factory.cpp b/webrtc-sys/src/peer_connection_factory.cpp index bbc73bfdc..31b32729e 100644 --- a/webrtc-sys/src/peer_connection_factory.cpp +++ b/webrtc-sys/src/peer_connection_factory.cpp @@ -23,6 +23,7 @@ #include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/peer_connection_interface.h" #include "api/rtc_error.h" +#include "api/enable_media.h" #include "api/rtc_event_log/rtc_event_log_factory.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h" @@ -35,7 +36,6 @@ #include "livekit/video_decoder_factory.h" #include "livekit/video_encoder_factory.h" #include "livekit/webrtc.h" -#include "media/engine/webrtc_media_engine.h" #include "rtc_base/thread.h" #include "webrtc-sys/src/peer_connection.rs.h" #include "webrtc-sys/src/peer_connection_factory.rs.h" @@ -55,32 +55,25 @@ PeerConnectionFactory::PeerConnectionFactory( dependencies.signaling_thread = rtc_runtime_->signaling_thread(); dependencies.socket_factory = rtc_runtime_->network_thread()->socketserver(); dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - dependencies.event_log_factory = std::make_unique( - dependencies.task_queue_factory.get()); - dependencies.call_factory = webrtc::CreateCallFactory(); + dependencies.event_log_factory = std::make_unique(); dependencies.trials = std::make_unique(); - cricket::MediaEngineDependencies media_deps; - media_deps.task_queue_factory = dependencies.task_queue_factory.get(); - audio_device_ = rtc_runtime_->worker_thread()->BlockingCall([&] { return rtc::make_ref_counted( - media_deps.task_queue_factory); + dependencies.task_queue_factory.get()); }); - media_deps.adm = audio_device_; + dependencies.adm = audio_device_; - media_deps.video_encoder_factory = + dependencies.video_encoder_factory = std::move(std::make_unique()); - media_deps.video_decoder_factory = + dependencies.video_decoder_factory = std::move(std::make_unique()); - media_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); - media_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); - media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create(); - media_deps.trials = dependencies.trials.get(); - - dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps)); + dependencies.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); + dependencies.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); + dependencies.audio_processing = webrtc::AudioProcessingBuilder().Create(); + webrtc::EnableMedia(dependencies); peer_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies)); diff --git a/webrtc-sys/src/video_decoder_factory.cpp b/webrtc-sys/src/video_decoder_factory.cpp index 40e742897..f7e7bb082 100644 --- a/webrtc-sys/src/video_decoder_factory.cpp +++ b/webrtc-sys/src/video_decoder_factory.cpp @@ -16,6 +16,7 @@ #include "livekit/video_decoder_factory.h" +#include "api/environment/environment.h" #include "api/video_codecs/av1_profile.h" #include "api/video_codecs/sdp_video_format.h" #include "livekit/objc_video_factory.h" @@ -69,7 +70,7 @@ std::vector VideoDecoderFactory::GetSupportedFormats() formats.push_back(webrtc::SdpVideoFormat(cricket::kAv1CodecName)); formats.push_back(webrtc::SdpVideoFormat( cricket::kAv1CodecName, - {{webrtc::kAV1FmtpProfile, + {{cricket::kAv1FmtpProfile, AV1ProfileToString(webrtc::AV1Profile::kProfile1).data()}})); #endif @@ -92,17 +93,17 @@ VideoDecoderFactory::CodecSupport VideoDecoderFactory::QueryCodecSupport( return codec_support; } -std::unique_ptr VideoDecoderFactory::CreateVideoDecoder( - const webrtc::SdpVideoFormat& format) { +std::unique_ptr VideoDecoderFactory::Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) { for (const auto& factory : factories_) { for (const auto& supported_format : factory->GetSupportedFormats()) { if (supported_format.IsSameCodec(format)) - return factory->CreateVideoDecoder(format); + return factory->Create(env, format); } } if (absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName)) - return webrtc::VP8Decoder::Create(); + return webrtc::CreateVp8Decoder(env); if (absl::EqualsIgnoreCase(format.name, cricket::kVp9CodecName)) return webrtc::VP9Decoder::Create(); if (absl::EqualsIgnoreCase(format.name, cricket::kH264CodecName)) diff --git a/webrtc-sys/src/video_encoder_factory.cpp b/webrtc-sys/src/video_encoder_factory.cpp index b2005867c..cd362675e 100644 --- a/webrtc-sys/src/video_encoder_factory.cpp +++ b/webrtc-sys/src/video_encoder_factory.cpp @@ -16,6 +16,7 @@ #include "livekit/video_encoder_factory.h" +#include "api/environment/environment_factory.h" #include "api/video_codecs/sdp_video_format.h" #include "api/video_codecs/video_encoder.h" #include "api/video_codecs/video_encoder_factory_template.h" @@ -84,12 +85,12 @@ VideoEncoderFactory::InternalFactory::QueryCodecSupport( } std::unique_ptr -VideoEncoderFactory::InternalFactory::CreateVideoEncoder( - const webrtc::SdpVideoFormat& format) { +VideoEncoderFactory::InternalFactory::Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) { for (const auto& factory : factories_) { for (const auto& supported_format : factory->GetSupportedFormats()) { if (supported_format.IsSameCodec(format)) - return factory->CreateVideoEncoder(format); + return factory->Create(env, format); } } @@ -97,7 +98,7 @@ VideoEncoderFactory::InternalFactory::CreateVideoEncoder( webrtc::FuzzyMatchSdpVideoFormat(Factory().GetSupportedFormats(), format); if (original_format) { - return Factory().CreateVideoEncoder(*original_format); + return Factory().Create(env, *original_format); } RTC_LOG(LS_ERROR) << "No VideoEncoder found for " << format.name; @@ -119,12 +120,12 @@ VideoEncoderFactory::CodecSupport VideoEncoderFactory::QueryCodecSupport( return internal_factory_->QueryCodecSupport(format, scalability_mode); } -std::unique_ptr VideoEncoderFactory::CreateVideoEncoder( - const webrtc::SdpVideoFormat& format) { +std::unique_ptr VideoEncoderFactory::Create( + const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) { std::unique_ptr encoder; if (format.IsCodecInList(internal_factory_->GetSupportedFormats())) { encoder = std::make_unique( - internal_factory_.get(), format); + env, internal_factory_.get(), nullptr, format); } return encoder; From a0a961b9ab9ff075ee85e8dd296caf7dd319c9ef Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Wed, 11 Dec 2024 20:27:42 +0200 Subject: [PATCH 29/51] chore: update webrtc and all dependents (#512) --- .github/workflows/ffi-builds.yml | 4 ++-- .nanpa/bump-webrtc.kdl | 3 +++ download_ffi.py | 2 +- webrtc-sys/build/src/lib.rs | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ffi-builds.yml b/.github/workflows/ffi-builds.yml index ccba91f91..e011092c8 100644 --- a/.github/workflows/ffi-builds.yml +++ b/.github/workflows/ffi-builds.yml @@ -17,7 +17,7 @@ on: push: branches: ["main"] tags: - - "ffi-v*" + - "rust-sdks/livekit-ffi@*" workflow_dispatch: env: @@ -208,7 +208,7 @@ jobs: needs: build permissions: contents: write - if: startsWith(github.ref, 'refs/tags/ffi-v') + if: startsWith(github.ref, 'refs/tags/rust-sdks/livekit-ffi') env: GH_TOKEN: ${{ github.token }} steps: diff --git a/.nanpa/bump-webrtc.kdl b/.nanpa/bump-webrtc.kdl index 996bd1e19..de1db4674 100644 --- a/.nanpa/bump-webrtc.kdl +++ b/.nanpa/bump-webrtc.kdl @@ -1,2 +1,5 @@ patch package="webrtc-sys/build" type="added" "bump libwebrtc to m125" patch package="webrtc-sys" type="added" "bump libwebrtc to m125" +patch package="libwebrtc" type="added" "bump libwebrtc to m125" +patch package="livekit" type="added" "bump libwebrtc to m125" +patch package="livekit-ffi" type="added" "bump libwebrtc to m125" diff --git a/download_ffi.py b/download_ffi.py index 4d100d674..0bb980067 100755 --- a/download_ffi.py +++ b/download_ffi.py @@ -74,7 +74,7 @@ def ffi_version(): def download_ffi(platform, arch, version, output): filename = "ffi-%s-%s.zip" % (platform, arch) - url = "https://github.com/livekit/client-sdk-rust/releases/download/ffi-v%s/%s" + url = "https://github.com/livekit/client-sdk-rust/releases/download/rust-sdks/livekit-ffi@%s/%s" url = url % (version, filename) tmp = os.path.join(tempfile.gettempdir(), filename) diff --git a/webrtc-sys/build/src/lib.rs b/webrtc-sys/build/src/lib.rs index cb137c799..959bdd0c1 100644 --- a/webrtc-sys/build/src/lib.rs +++ b/webrtc-sys/build/src/lib.rs @@ -26,7 +26,7 @@ use regex::Regex; use reqwest::StatusCode; pub const SCRATH_PATH: &str = "livekit_webrtc"; -pub const WEBRTC_TAG: &str = "webrtc-dac8015-6"; +pub const WEBRTC_TAG: &str = "webrtc-b99fd2c"; pub const IGNORE_DEFINES: [&str; 2] = ["CR_CLANG_REVISION", "CR_XCODE_VERSION"]; pub fn target_os() -> String { From 3f2bbb3ecf674c3a585417fbd011d47252c53d37 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Thu, 12 Dec 2024 13:34:14 +0200 Subject: [PATCH 30/51] fix: webrtc builds on macOS, iOS (#514) --- webrtc-sys/libwebrtc/build_ios.sh | 2 +- webrtc-sys/libwebrtc/build_macos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc-sys/libwebrtc/build_ios.sh b/webrtc-sys/libwebrtc/build_ios.sh index 94505e8b0..6db1ce21f 100755 --- a/webrtc-sys/libwebrtc/build_ios.sh +++ b/webrtc-sys/libwebrtc/build_ios.sh @@ -125,7 +125,7 @@ ninja -C "$OUTPUT_DIR" :default \ api/task_queue:default_task_queue_factory \ sdk:native_api \ sdk:default_codec_factory_objc \ - pc:peerconnection \ + pc:peer_connection \ sdk:videocapture_objc \ sdk:framework_objc diff --git a/webrtc-sys/libwebrtc/build_macos.sh b/webrtc-sys/libwebrtc/build_macos.sh index 5b07cb1e3..c4ba72bd6 100755 --- a/webrtc-sys/libwebrtc/build_macos.sh +++ b/webrtc-sys/libwebrtc/build_macos.sh @@ -115,7 +115,7 @@ ninja -C "$OUTPUT_DIR" :default \ api/task_queue:default_task_queue_factory \ sdk:native_api \ sdk:default_codec_factory_objc \ - pc:peerconnection \ + pc:peer_connection \ sdk:videocapture_objc \ sdk:mac_framework_objc From 4a2f352e9ddd833ab404a06569c74668b24d71f4 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Thu, 12 Dec 2024 13:42:30 +0200 Subject: [PATCH 31/51] add changeset files and bump imgproc, yuv-sys (#513) --- .nanpa/add-libyuv.kdl | 2 ++ .nanparc | 2 +- imgproc/.nanparc | 2 ++ yuv-sys/.nanparc | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .nanpa/add-libyuv.kdl create mode 100644 imgproc/.nanparc create mode 100644 yuv-sys/.nanparc diff --git a/.nanpa/add-libyuv.kdl b/.nanpa/add-libyuv.kdl new file mode 100644 index 000000000..0f2f3d75e --- /dev/null +++ b/.nanpa/add-libyuv.kdl @@ -0,0 +1,2 @@ +patch package="yuv-sys" type="added" "move yuv-sys to main rust-sdks monorepo" +patch package="imgproc" type="added" "move imgproc to main rust-sdks monorepo" diff --git a/.nanparc b/.nanparc index 748a8a360..7e9fced1a 100644 --- a/.nanparc +++ b/.nanparc @@ -1 +1 @@ -packages livekit livekit-ffi livekit-protocol livekit-runtime livekit-api libwebrtc webrtc-sys webrtc-sys/build soxr-sys +packages livekit livekit-ffi livekit-protocol livekit-runtime livekit-api libwebrtc webrtc-sys webrtc-sys/build soxr-sys yuv-sys imgproc diff --git a/imgproc/.nanparc b/imgproc/.nanparc new file mode 100644 index 000000000..57ab0be8e --- /dev/null +++ b/imgproc/.nanparc @@ -0,0 +1,2 @@ +version 0.3.11 +language rust diff --git a/yuv-sys/.nanparc b/yuv-sys/.nanparc new file mode 100644 index 000000000..10b95b2c7 --- /dev/null +++ b/yuv-sys/.nanparc @@ -0,0 +1,2 @@ +version 0.3.6 +language rust From d15807d3d8ce04efd0f27ed711201b464fab1e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Thu, 12 Dec 2024 12:55:10 +0100 Subject: [PATCH 32/51] fix yuv simd errors (#515) --- .nanpa/fix-simd.kdl | 1 + Cargo.lock | 4 ---- yuv-sys/libyuv | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 .nanpa/fix-simd.kdl diff --git a/.nanpa/fix-simd.kdl b/.nanpa/fix-simd.kdl new file mode 100644 index 000000000..d90870d8e --- /dev/null +++ b/.nanpa/fix-simd.kdl @@ -0,0 +1 @@ +patch package="yuv-sys" type="fixed" "fix yuv simd errors" diff --git a/Cargo.lock b/Cargo.lock index 6154cfb8b..e915bba8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1322,8 +1322,6 @@ dependencies = [ [[package]] name = "imgproc" version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce22149028888b582c91e56e1d53add9cd42f98d22046618478ef2aadbc9091" dependencies = [ "yuv-sys", ] @@ -3581,8 +3579,6 @@ dependencies = [ [[package]] name = "yuv-sys" version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a3f589776c945135cd8dee6e1e0d6006748f2808e439200cc242f639b07150" dependencies = [ "bindgen", "cc", diff --git a/yuv-sys/libyuv b/yuv-sys/libyuv index 3a0ad00ed..3e435fe6d 160000 --- a/yuv-sys/libyuv +++ b/yuv-sys/libyuv @@ -1 +1 @@ -Subproject commit 3a0ad00ed34afe3a43eb742579d53e9e7c597ae3 +Subproject commit 3e435fe6d4910ae1adbb4e116317072118ff210d From 43933e58c07f66f285a2a02a48ac6f21a0a00b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Thu, 12 Dec 2024 13:45:26 +0100 Subject: [PATCH 33/51] fix unmatched codec (#516) --- livekit/src/rtc_engine/rtc_session.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index fa01a69fe..3b6febb0e 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -821,7 +821,6 @@ impl SessionInner { } matched.append(&mut partial_matched); - matched.append(&mut unmatched); transceiver.set_codec_preferences(matched)?; } From 893fe0f9582bd31c0d73afcf15b7552bf6f69f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Thu, 12 Dec 2024 14:12:46 +0100 Subject: [PATCH 34/51] fix av1 supported formats (#517) --- webrtc-sys/src/video_decoder_factory.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/webrtc-sys/src/video_decoder_factory.cpp b/webrtc-sys/src/video_decoder_factory.cpp index f7e7bb082..d9ea8bae8 100644 --- a/webrtc-sys/src/video_decoder_factory.cpp +++ b/webrtc-sys/src/video_decoder_factory.cpp @@ -16,6 +16,7 @@ #include "livekit/video_decoder_factory.h" +#include #include "api/environment/environment.h" #include "api/video_codecs/av1_profile.h" #include "api/video_codecs/sdp_video_format.h" @@ -66,14 +67,9 @@ std::vector VideoDecoderFactory::GetSupportedFormats() webrtc::SupportedH264DecoderCodecs()) formats.push_back(h264_format); -#if defined(RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY) - formats.push_back(webrtc::SdpVideoFormat(cricket::kAv1CodecName)); formats.push_back(webrtc::SdpVideoFormat( - cricket::kAv1CodecName, - {{cricket::kAv1FmtpProfile, - AV1ProfileToString(webrtc::AV1Profile::kProfile1).data()}})); -#endif - + webrtc::SdpVideoFormat::AV1Profile0(), + webrtc::LibaomAv1EncoderSupportedScalabilityModes())); return formats; } From bcbc7d8b749be3912900abcff5e38da0bd4711cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Thu, 12 Dec 2024 14:34:19 +0100 Subject: [PATCH 35/51] fix ffi license builds (#518) --- livekit-ffi/build.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/livekit-ffi/build.rs b/livekit-ffi/build.rs index 75432fdb5..33a18d772 100644 --- a/livekit-ffi/build.rs +++ b/livekit-ffi/build.rs @@ -24,23 +24,26 @@ fn main() { webrtc_sys_build::download_webrtc().unwrap(); } + { + // Copy the webrtc license to CARGO_MANIFEST_DIR + // (used by the ffi release action) + let webrtc_dir = webrtc_sys_build::webrtc_dir(); + let license = webrtc_dir.join("LICENSE.md"); + let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + + let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md"); + + std::fs::copy(license, out_file).unwrap(); + } + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); match target_os.as_str() { "windows" => {} "linux" => { - // Link webrtc library println!("cargo:rustc-link-lib=static=webrtc"); } "android" => { webrtc_sys_build::configure_jni_symbols().unwrap(); - // Copy the webrtc license to CARGO_MANIFEST_DIR - // (used by the ffi release action) - let license = webrtc_dir.join("LICENSE.md"); - let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - - let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md"); - - std::fs::copy(license, out_file).unwrap(); } "macos" | "ios" => { println!("cargo:rustc-link-arg=-ObjC"); From 7b6141c0007c76bbf480817208b4d35c24bf5d41 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Thu, 12 Dec 2024 16:05:29 +0200 Subject: [PATCH 36/51] chore: bump webrtc-sys for new webrtc tag (#519) --- webrtc-sys/build/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc-sys/build/src/lib.rs b/webrtc-sys/build/src/lib.rs index 959bdd0c1..3ede29dc4 100644 --- a/webrtc-sys/build/src/lib.rs +++ b/webrtc-sys/build/src/lib.rs @@ -26,7 +26,7 @@ use regex::Regex; use reqwest::StatusCode; pub const SCRATH_PATH: &str = "livekit_webrtc"; -pub const WEBRTC_TAG: &str = "webrtc-b99fd2c"; +pub const WEBRTC_TAG: &str = "webrtc-b99fd2c-2"; pub const IGNORE_DEFINES: [&str; 2] = ["CR_CLANG_REVISION", "CR_XCODE_VERSION"]; pub fn target_os() -> String { From b511e559510eb0a0cf762e171c1c5d53f38c88d9 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Sat, 14 Dec 2024 11:01:54 +0100 Subject: [PATCH 37/51] Update gh action versions (#520) --- .github/workflows/ffi-builds.yml | 5 ++--- .github/workflows/webrtc-builds.yml | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ffi-builds.yml b/.github/workflows/ffi-builds.yml index e011092c8..d6b90909c 100644 --- a/.github/workflows/ffi-builds.yml +++ b/.github/workflows/ffi-builds.yml @@ -196,12 +196,11 @@ jobs: Get-ChildItem -Path ${{ matrix.dylib }}, livekit_ffi.h, LICENSE.md | Compress-Archive -DestinationPath ${{ github.workspace }}\${{ matrix.name }}.zip - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ffi-builds path: ${{ matrix.name }}.zip - release: name: Release to GH (Draft) runs-on: ubuntu-latest @@ -215,7 +214,7 @@ jobs: - uses: actions/checkout@v3 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ffi-builds path: ${{ github.workspace }}/ffi-builds diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index cd59f3f04..782daaad6 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -45,7 +45,7 @@ jobs: cmd: ./build_macos.sh arch: arm64 - - name: linux + - name: linux os: buildjet-8vcpu-ubuntu-2004 cmd: ./build_linux.sh arch: x64 @@ -53,8 +53,8 @@ jobs: - name: linux os: buildjet-8vcpu-ubuntu-2004 cmd: ./build_linux.sh - arch: arm64 - + arch: arm64 + - name: android os: buildjet-8vcpu-ubuntu-2004 cmd: ./build_android.sh @@ -81,10 +81,10 @@ jobs: os: macos-13 cmd: ./build_ios.sh arch: arm64 - buildargs: --environment simulator + buildargs: --environment simulator profile: - release -# - debug + # - debug name: Build webrtc (${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.profile }}) ${{ matrix.target.buildargs }} runs-on: ${{ matrix.target.os }} @@ -104,7 +104,7 @@ jobs: echo "OutName: ${{ steps.setup.outputs.OUT }}" echo "OutZip: ${{ steps.setup.outputs.ZIP }}" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true @@ -135,7 +135,7 @@ jobs: run: echo -e "\ntarget_os = [\"${{ matrix.target.name }}\"]" >> .gclient shell: bash working-directory: webrtc-sys/libwebrtc - + - name: Build WebRTC run: ${{ matrix.target.cmd }} --arch ${{ matrix.target.arch }} --profile ${{ matrix.profile }} ${{ matrix.target.buildargs }} working-directory: webrtc-sys/libwebrtc @@ -151,12 +151,11 @@ jobs: run: Compress-Archive -Path .\webrtc-sys\libwebrtc\${{ steps.setup.outputs.OUT }} -DestinationPath ${{ steps.setup.outputs.ZIP }} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: webrtc-builds path: ${{ steps.setup.outputs.ZIP }} - release: name: Release to GH (Draft) runs-on: ubuntu-latest @@ -167,10 +166,10 @@ jobs: env: GH_TOKEN: ${{ github.token }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: webrtc-builds path: ${{ github.workspace }}/webrtc-builds From 20343452a8a638761724b3b91615ebbb8587ac2b Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 17:28:49 +0200 Subject: [PATCH 38/51] ci: attempt to fix windows webrtc builds (#521) --- webrtc-sys/libwebrtc/build_windows.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc-sys/libwebrtc/build_windows.cmd b/webrtc-sys/libwebrtc/build_windows.cmd index 249320581..add24f4e9 100644 --- a/webrtc-sys/libwebrtc/build_windows.cmd +++ b/webrtc-sys/libwebrtc/build_windows.cmd @@ -46,7 +46,7 @@ set ARTIFACTS_DIR=%cd%\win-!arch!-!profile! set vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional if not exist src ( - call gclient.bat sync -D --no-history + call gclient.bat sync -D --with_branch_heads --with_tags ) cd src From 6dbfb96084d58b38ca49d75918214cbd9947dbcc Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 20:00:12 +0200 Subject: [PATCH 39/51] ci: fix FFI and WebRTC builds with artifacts v4 (#522) --- .github/workflows/ffi-builds.yml | 5 +++-- .github/workflows/webrtc-builds.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ffi-builds.yml b/.github/workflows/ffi-builds.yml index d6b90909c..45ef24988 100644 --- a/.github/workflows/ffi-builds.yml +++ b/.github/workflows/ffi-builds.yml @@ -198,7 +198,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: ffi-builds + name: ffi-builds-${{ matrix.target }} path: ${{ matrix.name }}.zip release: @@ -216,7 +216,8 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: ffi-builds + name: ffi-builds-* + merge-multiple: true path: ${{ github.workspace }}/ffi-builds - name: Create draft release diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index 782daaad6..f244eca16 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -153,7 +153,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: webrtc-builds + name: webrtc-builds-${{ matrix.name }}-${{ matrix.arch }} path: ${{ steps.setup.outputs.ZIP }} release: @@ -171,7 +171,8 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: webrtc-builds + name: webrtc-builds-* + merge-multiple: true path: ${{ github.workspace }}/webrtc-builds - name: Create draft release From 627322f845d59e832cae915a9a1edbcf72a85a95 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 20:06:54 +0200 Subject: [PATCH 40/51] ci: fix missed line (#523) --- .github/workflows/ffi-builds.yml | 2 +- .github/workflows/webrtc-builds.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ffi-builds.yml b/.github/workflows/ffi-builds.yml index 45ef24988..3b31ec8c4 100644 --- a/.github/workflows/ffi-builds.yml +++ b/.github/workflows/ffi-builds.yml @@ -216,7 +216,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: ffi-builds-* + pattern: ffi-builds-* merge-multiple: true path: ${{ github.workspace }}/ffi-builds diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index f244eca16..b5a1b6b1d 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -171,7 +171,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: webrtc-builds-* + pattern: webrtc-builds-* merge-multiple: true path: ${{ github.workspace }}/webrtc-builds From 0d777eb924ed91aed6a5d4cbfb2303dda397f854 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 20:19:25 +0200 Subject: [PATCH 41/51] ci: fix builds again (#524) --- .github/workflows/webrtc-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index b5a1b6b1d..9ffc453e4 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -153,7 +153,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: webrtc-builds-${{ matrix.name }}-${{ matrix.arch }} + name: webrtc-builds-${{ matrix.target.name }}-${{ matrix.target.arch }} path: ${{ steps.setup.outputs.ZIP }} release: From 0bdbe698ec2bb12a821213fc38b873d1d9cc66e6 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 21:06:11 +0200 Subject: [PATCH 42/51] ci: use existing OUT variable for iOS simulator (#525) --- .github/workflows/webrtc-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webrtc-builds.yml b/.github/workflows/webrtc-builds.yml index 9ffc453e4..60ebcd68a 100644 --- a/.github/workflows/webrtc-builds.yml +++ b/.github/workflows/webrtc-builds.yml @@ -153,7 +153,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: webrtc-builds-${{ matrix.target.name }}-${{ matrix.target.arch }} + name: webrtc-builds-${{ steps.setup.outputs.OUT }} path: ${{ steps.setup.outputs.ZIP }} release: From d1404e7d25f94269a04a220cb7463f9ad57c4710 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sat, 14 Dec 2024 22:58:28 +0200 Subject: [PATCH 43/51] update webrtc-sys-build/lib.rs (#526) --- webrtc-sys/build/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc-sys/build/src/lib.rs b/webrtc-sys/build/src/lib.rs index 3ede29dc4..a38d740e0 100644 --- a/webrtc-sys/build/src/lib.rs +++ b/webrtc-sys/build/src/lib.rs @@ -26,7 +26,7 @@ use regex::Regex; use reqwest::StatusCode; pub const SCRATH_PATH: &str = "livekit_webrtc"; -pub const WEBRTC_TAG: &str = "webrtc-b99fd2c-2"; +pub const WEBRTC_TAG: &str = "webrtc-b99fd2c-6"; pub const IGNORE_DEFINES: [&str; 2] = ["CR_CLANG_REVISION", "CR_XCODE_VERSION"]; pub fn target_os() -> String { From 32d86183c474206370843e447cc7188becb8a2bf Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sun, 15 Dec 2024 00:09:26 +0200 Subject: [PATCH 44/51] ci: add deploy key to nanpa CI (#527) --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index de50fd655..f90b522d4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ssh-key: ${{ secrets.NANPA_KEY }} - uses: nbsp/ilo@v1 with: packages: ${{ github.event.inputs.packages }} From a5ef23e718628d52e6f745e3c28c8e7dc28d519d Mon Sep 17 00:00:00 2001 From: "ilo-nanpa[bot]" <174912985+ilo-nanpa[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 22:10:08 +0000 Subject: [PATCH 45/51] nanpa: bump --- .nanpa/add-libyuv.kdl | 2 -- .nanpa/bump-webrtc.kdl | 5 ----- .nanpa/fix-simd.kdl | 1 - Cargo.toml | 12 ++++++------ imgproc/.nanparc | 2 +- imgproc/CHANGELOG.md | 7 +++++++ imgproc/Cargo.toml | 2 +- libwebrtc/.nanparc | 2 +- libwebrtc/CHANGELOG.md | 7 +++++++ libwebrtc/Cargo.toml | 2 +- livekit-ffi/.nanparc | 2 +- livekit-ffi/CHANGELOG.md | 7 +++++++ livekit/.nanparc | 2 +- livekit/CHANGELOG.md | 7 +++++++ livekit/Cargo.toml | 2 +- webrtc-sys/.nanparc | 2 +- webrtc-sys/CHANGELOG.md | 7 +++++++ webrtc-sys/Cargo.toml | 2 +- webrtc-sys/build/.nanparc | 2 +- webrtc-sys/build/CHANGELOG.md | 7 +++++++ webrtc-sys/build/Cargo.toml | 2 +- yuv-sys/.nanparc | 2 +- yuv-sys/CHANGELOG.md | 11 +++++++++++ yuv-sys/Cargo.toml | 2 +- 24 files changed, 72 insertions(+), 27 deletions(-) delete mode 100644 .nanpa/add-libyuv.kdl delete mode 100644 .nanpa/bump-webrtc.kdl delete mode 100644 .nanpa/fix-simd.kdl create mode 100644 imgproc/CHANGELOG.md create mode 100644 libwebrtc/CHANGELOG.md create mode 100644 livekit-ffi/CHANGELOG.md create mode 100644 livekit/CHANGELOG.md create mode 100644 webrtc-sys/CHANGELOG.md create mode 100644 webrtc-sys/build/CHANGELOG.md create mode 100644 yuv-sys/CHANGELOG.md diff --git a/.nanpa/add-libyuv.kdl b/.nanpa/add-libyuv.kdl deleted file mode 100644 index 0f2f3d75e..000000000 --- a/.nanpa/add-libyuv.kdl +++ /dev/null @@ -1,2 +0,0 @@ -patch package="yuv-sys" type="added" "move yuv-sys to main rust-sdks monorepo" -patch package="imgproc" type="added" "move imgproc to main rust-sdks monorepo" diff --git a/.nanpa/bump-webrtc.kdl b/.nanpa/bump-webrtc.kdl deleted file mode 100644 index de1db4674..000000000 --- a/.nanpa/bump-webrtc.kdl +++ /dev/null @@ -1,5 +0,0 @@ -patch package="webrtc-sys/build" type="added" "bump libwebrtc to m125" -patch package="webrtc-sys" type="added" "bump libwebrtc to m125" -patch package="libwebrtc" type="added" "bump libwebrtc to m125" -patch package="livekit" type="added" "bump libwebrtc to m125" -patch package="livekit-ffi" type="added" "bump libwebrtc to m125" diff --git a/.nanpa/fix-simd.kdl b/.nanpa/fix-simd.kdl deleted file mode 100644 index d90870d8e..000000000 --- a/.nanpa/fix-simd.kdl +++ /dev/null @@ -1 +0,0 @@ -patch package="yuv-sys" type="fixed" "fix yuv simd errors" diff --git a/Cargo.toml b/Cargo.toml index c0a232a25..35de291b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,14 +15,14 @@ members = [ ] [workspace.dependencies] -imgproc = { version = "0.3.11", path = "imgproc" } -yuv-sys = { version = "0.3.6", path = "yuv-sys" } -libwebrtc = { version = "0.3.7", path = "libwebrtc" } +imgproc = { version = "0.3.12", path = "imgproc" } +yuv-sys = { version = "0.3.7", path = "yuv-sys" } +libwebrtc = { version = "0.3.8", path = "libwebrtc" } livekit-api = { version = "0.4.1", path = "livekit-api" } livekit-ffi = { version = "0.12.3", path = "livekit-ffi" } livekit-protocol = { version = "0.3.6", path = "livekit-protocol" } livekit-runtime = { version = "0.3.1", path = "livekit-runtime" } -livekit = { version = "0.7.0", path = "livekit" } +livekit = { version = "0.7.1", path = "livekit" } soxr-sys = { version = "0.1.0", path = "soxr-sys" } -webrtc-sys-build = { version = "0.3.5", path = "webrtc-sys/build" } -webrtc-sys = { version = "0.3.5", path = "webrtc-sys" } +webrtc-sys-build = { version = "0.3.6", path = "webrtc-sys/build" } +webrtc-sys = { version = "0.3.6", path = "webrtc-sys" } diff --git a/imgproc/.nanparc b/imgproc/.nanparc index 57ab0be8e..4e9ce1ea8 100644 --- a/imgproc/.nanparc +++ b/imgproc/.nanparc @@ -1,2 +1,2 @@ -version 0.3.11 +version 0.3.12 language rust diff --git a/imgproc/CHANGELOG.md b/imgproc/CHANGELOG.md new file mode 100644 index 000000000..a362d251d --- /dev/null +++ b/imgproc/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.3.12] - 2024-12-14 + +### Added + +- move imgproc to main rust-sdks monorepo diff --git a/imgproc/Cargo.toml b/imgproc/Cargo.toml index 6f49dccd6..8356ec8fe 100644 --- a/imgproc/Cargo.toml +++ b/imgproc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imgproc" -version = "0.3.11" +version = "0.3.12" edition = "2021" authors = ["Theo Monnom "] license = "MIT OR Apache-2.0" diff --git a/libwebrtc/.nanparc b/libwebrtc/.nanparc index 5bf971c37..9ad0822e5 100644 --- a/libwebrtc/.nanparc +++ b/libwebrtc/.nanparc @@ -1,2 +1,2 @@ -version 0.3.7 +version 0.3.8 language rust diff --git a/libwebrtc/CHANGELOG.md b/libwebrtc/CHANGELOG.md new file mode 100644 index 000000000..04423d14f --- /dev/null +++ b/libwebrtc/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.3.8] - 2024-12-14 + +### Added + +- bump libwebrtc to m125 diff --git a/libwebrtc/Cargo.toml b/libwebrtc/Cargo.toml index 1f8f0c988..9cd679f3b 100644 --- a/libwebrtc/Cargo.toml +++ b/libwebrtc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libwebrtc" -version = "0.3.7" +version = "0.3.8" edition = "2021" homepage = "https://livekit.io" license = "Apache-2.0" diff --git a/livekit-ffi/.nanparc b/livekit-ffi/.nanparc index 37b95fd32..eb053fb66 100644 --- a/livekit-ffi/.nanparc +++ b/livekit-ffi/.nanparc @@ -1,2 +1,2 @@ -version 0.12.2 +version 0.12.3 language rust diff --git a/livekit-ffi/CHANGELOG.md b/livekit-ffi/CHANGELOG.md new file mode 100644 index 000000000..c0b38a7af --- /dev/null +++ b/livekit-ffi/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.12.3] - 2024-12-14 + +### Added + +- bump libwebrtc to m125 diff --git a/livekit/.nanparc b/livekit/.nanparc index 0841e27c2..29c21da5f 100644 --- a/livekit/.nanparc +++ b/livekit/.nanparc @@ -1,2 +1,2 @@ -version 0.7.0 +version 0.7.1 language rust diff --git a/livekit/CHANGELOG.md b/livekit/CHANGELOG.md new file mode 100644 index 000000000..8e6a78304 --- /dev/null +++ b/livekit/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.7.1] - 2024-12-14 + +### Added + +- bump libwebrtc to m125 diff --git a/livekit/Cargo.toml b/livekit/Cargo.toml index 29113321a..a59ff58c3 100644 --- a/livekit/Cargo.toml +++ b/livekit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit" -version = "0.7.0" +version = "0.7.1" edition = "2021" license = "Apache-2.0" description = "Rust Client SDK for LiveKit" diff --git a/webrtc-sys/.nanparc b/webrtc-sys/.nanparc index d431df850..10b95b2c7 100644 --- a/webrtc-sys/.nanparc +++ b/webrtc-sys/.nanparc @@ -1,2 +1,2 @@ -version 0.3.5 +version 0.3.6 language rust diff --git a/webrtc-sys/CHANGELOG.md b/webrtc-sys/CHANGELOG.md new file mode 100644 index 000000000..215126331 --- /dev/null +++ b/webrtc-sys/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.3.6] - 2024-12-14 + +### Added + +- bump libwebrtc to m125 diff --git a/webrtc-sys/Cargo.toml b/webrtc-sys/Cargo.toml index 7c5e9b173..dfc6c7c6e 100644 --- a/webrtc-sys/Cargo.toml +++ b/webrtc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webrtc-sys" -version = "0.3.5" +version = "0.3.6" edition = "2021" homepage = "https://livekit.io" license = "Apache-2.0" diff --git a/webrtc-sys/build/.nanparc b/webrtc-sys/build/.nanparc index d431df850..10b95b2c7 100644 --- a/webrtc-sys/build/.nanparc +++ b/webrtc-sys/build/.nanparc @@ -1,2 +1,2 @@ -version 0.3.5 +version 0.3.6 language rust diff --git a/webrtc-sys/build/CHANGELOG.md b/webrtc-sys/build/CHANGELOG.md new file mode 100644 index 000000000..215126331 --- /dev/null +++ b/webrtc-sys/build/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.3.6] - 2024-12-14 + +### Added + +- bump libwebrtc to m125 diff --git a/webrtc-sys/build/Cargo.toml b/webrtc-sys/build/Cargo.toml index 7248cd1bb..c12a0acbc 100644 --- a/webrtc-sys/build/Cargo.toml +++ b/webrtc-sys/build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "webrtc-sys-build" -version = "0.3.5" +version = "0.3.6" edition = "2021" license = "Apache-2.0" description = "Build utilities when working with libwebrtc" diff --git a/yuv-sys/.nanparc b/yuv-sys/.nanparc index 10b95b2c7..5bf971c37 100644 --- a/yuv-sys/.nanparc +++ b/yuv-sys/.nanparc @@ -1,2 +1,2 @@ -version 0.3.6 +version 0.3.7 language rust diff --git a/yuv-sys/CHANGELOG.md b/yuv-sys/CHANGELOG.md new file mode 100644 index 000000000..f13664759 --- /dev/null +++ b/yuv-sys/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## [0.3.7] - 2024-12-14 + +### Added + +- move yuv-sys to main rust-sdks monorepo + +### Fixed + +- fix yuv simd errors diff --git a/yuv-sys/Cargo.toml b/yuv-sys/Cargo.toml index 384815730..2bd72148e 100644 --- a/yuv-sys/Cargo.toml +++ b/yuv-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yuv-sys" -version = "0.3.6" +version = "0.3.7" edition = "2021" authors = ["Theo Monnom "] license = "MIT OR Apache-2.0" From 3d9168a840d4f4b4e8b15ec7c70a077860574513 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 16 Dec 2024 13:59:54 +0100 Subject: [PATCH 46/51] Add FFI events for data streams (#510) * update protocol and streams boilerplate * wip filestream reader * text stream reader * finish data stream receiving * cleanup * receiving working * working with mutex * working with RWLock * cleanup * simplify * better lock scope * filestream fixes * add example * remove rust client api and replace with raw events * cleanup imports * more cleanup * ffi imports * implement ffi --- livekit-ffi/protocol/room.proto | 54 +++++++++++ livekit-ffi/src/conversion/room.rs | 48 +++++++++ livekit-ffi/src/livekit.proto.rs | 134 +++++++++++++++++++++++++- livekit-ffi/src/server/room.rs | 6 ++ livekit/src/room/mod.rs | 27 +++++- livekit/src/rtc_engine/mod.rs | 12 +++ livekit/src/rtc_engine/rtc_session.rs | 16 +++ 7 files changed, 292 insertions(+), 5 deletions(-) diff --git a/livekit-ffi/protocol/room.proto b/livekit-ffi/protocol/room.proto index 4d0f3d92d..c6f595699 100644 --- a/livekit-ffi/protocol/room.proto +++ b/livekit-ffi/protocol/room.proto @@ -367,6 +367,8 @@ message RoomEvent { DataPacketReceived data_packet_received = 27; TranscriptionReceived transcription_received = 28; ChatMessageReceived chat_message = 29; + DataStream.Header stream_header = 30; + DataStream.Chunk stream_chunk = 31; } } @@ -526,3 +528,55 @@ message Reconnected {} message RoomEOS {} +message DataStream { + + // enum for operation types (specific to TextHeader) + enum OperationType { + CREATE = 0; + UPDATE = 1; + DELETE = 2; + REACTION = 3; + } + + // header properties specific to text streams + message TextHeader { + required OperationType operation_type = 1; + required int32 version = 2; // Optional: Version for updates/edits + required string reply_to_stream_id = 3; // Optional: Reply to specific message + repeated string attached_stream_ids = 4; // file attachments for text streams + required bool generated = 5; // true if the text has been generated by an agent from a participant's audio transcription + + } + + // header properties specific to file or image streams + message FileHeader { + required string file_name = 1; // name of the file + } + + // main DataStream.Header that contains a oneof for specific headers + message Header { + required string stream_id = 1; // unique identifier for this data stream + required int64 timestamp = 2; // using int64 for Unix timestamp + required string topic = 3; + required string mime_type = 4; + optional uint64 total_length = 5; // only populated for finite streams, if it's a stream of unknown size this stays empty + optional uint64 total_chunks = 6; // only populated for finite streams, if it's a stream of unknown size this stays empty + map extensions = 7; // user defined extensions map that can carry additional info + + // oneof to choose between specific header types + oneof content_header { + TextHeader text_header = 8; + FileHeader file_header = 9; + } + } + + message Chunk { + required string stream_id = 1; // unique identifier for this data stream to map it to the correct header + required uint64 chunk_index = 2; + required bytes content = 3; // content as binary (bytes) + required bool complete = 4; // true only if this is the last chunk of this stream - can also be sent with empty content + required int32 version = 5; // a version indicating that this chunk_index has been retroactively modified and the original one needs to be replaced + optional bytes iv = 6; // optional, initialization vector for AES-GCM encryption + } +} + diff --git a/livekit-ffi/src/conversion/room.rs b/livekit-ffi/src/conversion/room.rs index dac00067d..521c5c8c5 100644 --- a/livekit-ffi/src/conversion/room.rs +++ b/livekit-ffi/src/conversion/room.rs @@ -281,3 +281,51 @@ impl From for proto::ChatMessage { } } } + +impl From for proto::data_stream::Header { + fn from(msg: livekit_protocol::data_stream::Header) -> Self { + let content_header = match msg.content_header { + Some(livekit_protocol::data_stream::header::ContentHeader::TextHeader(text_header)) => { + Some(proto::data_stream::header::ContentHeader::TextHeader( + proto::data_stream::TextHeader { + operation_type: text_header.operation_type, + version: text_header.version, + reply_to_stream_id: text_header.reply_to_stream_id, + attached_stream_ids: text_header.attached_stream_ids, + generated: text_header.generated, + }, + )) + } + Some(livekit_protocol::data_stream::header::ContentHeader::FileHeader(file_header)) => { + Some(proto::data_stream::header::ContentHeader::FileHeader( + proto::data_stream::FileHeader { file_name: file_header.file_name }, + )) + } + None => None, + }; + + proto::data_stream::Header { + stream_id: msg.stream_id, + timestamp: msg.timestamp, + topic: msg.topic, + mime_type: msg.mime_type, + total_chunks: msg.total_chunks, + total_length: msg.total_length, + extensions: msg.extensions, + content_header, + } + } +} + +impl From for proto::data_stream::Chunk { + fn from(msg: livekit_protocol::data_stream::Chunk) -> Self { + proto::data_stream::Chunk { + stream_id: msg.stream_id, + content: msg.content, + complete: msg.complete, + chunk_index: msg.chunk_index, + version: msg.version, + iv: msg.iv, + } + } +} diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index 700666903..c45f678c7 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -1,4 +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 { @@ -2634,7 +2635,7 @@ pub struct OwnedBuffer { pub struct RoomEvent { #[prost(uint64, required, tag="1")] pub room_handle: u64, - #[prost(oneof="room_event::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")] + #[prost(oneof="room_event::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")] pub message: ::core::option::Option, } /// Nested message and enum types in `RoomEvent`. @@ -2700,6 +2701,10 @@ pub mod room_event { TranscriptionReceived(super::TranscriptionReceived), #[prost(message, tag="29")] ChatMessage(super::ChatMessageReceived), + #[prost(message, tag="30")] + StreamHeader(super::data_stream::Header), + #[prost(message, tag="31")] + StreamChunk(super::data_stream::Chunk), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -2974,6 +2979,133 @@ pub struct Reconnected { #[derive(Clone, PartialEq, ::prost::Message)] pub struct RoomEos { } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DataStream { +} +/// Nested message and enum types in `DataStream`. +pub mod data_stream { + /// header properties specific to text streams + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct TextHeader { + #[prost(enumeration="OperationType", required, tag="1")] + pub operation_type: i32, + /// Optional: Version for updates/edits + #[prost(int32, required, tag="2")] + pub version: i32, + /// Optional: Reply to specific message + #[prost(string, required, tag="3")] + pub reply_to_stream_id: ::prost::alloc::string::String, + /// file attachments for text streams + #[prost(string, repeated, tag="4")] + pub attached_stream_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// true if the text has been generated by an agent from a participant's audio transcription + #[prost(bool, required, tag="5")] + pub generated: bool, + } + /// header properties specific to file or image streams + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct FileHeader { + /// name of the file + #[prost(string, required, tag="1")] + pub file_name: ::prost::alloc::string::String, + } + /// main DataStream.Header that contains a oneof for specific headers + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Header { + /// unique identifier for this data stream + #[prost(string, required, tag="1")] + pub stream_id: ::prost::alloc::string::String, + /// using int64 for Unix timestamp + #[prost(int64, required, tag="2")] + pub timestamp: i64, + #[prost(string, required, tag="3")] + pub topic: ::prost::alloc::string::String, + #[prost(string, required, tag="4")] + pub mime_type: ::prost::alloc::string::String, + /// only populated for finite streams, if it's a stream of unknown size this stays empty + #[prost(uint64, optional, tag="5")] + pub total_length: ::core::option::Option, + /// only populated for finite streams, if it's a stream of unknown size this stays empty + #[prost(uint64, optional, tag="6")] + pub total_chunks: ::core::option::Option, + /// user defined extensions map that can carry additional info + #[prost(map="string, string", tag="7")] + pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// oneof to choose between specific header types + #[prost(oneof="header::ContentHeader", tags="8, 9")] + pub content_header: ::core::option::Option, + } + /// Nested message and enum types in `Header`. + pub mod header { + /// oneof to choose between specific header types + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum ContentHeader { + #[prost(message, tag="8")] + TextHeader(super::TextHeader), + #[prost(message, tag="9")] + FileHeader(super::FileHeader), + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Chunk { + /// unique identifier for this data stream to map it to the correct header + #[prost(string, required, tag="1")] + pub stream_id: ::prost::alloc::string::String, + #[prost(uint64, required, tag="2")] + pub chunk_index: u64, + /// content as binary (bytes) + #[prost(bytes="vec", required, tag="3")] + pub content: ::prost::alloc::vec::Vec, + /// true only if this is the last chunk of this stream - can also be sent with empty content + #[prost(bool, required, tag="4")] + pub complete: bool, + /// a version indicating that this chunk_index has been retroactively modified and the original one needs to be replaced + #[prost(int32, required, tag="5")] + pub version: i32, + /// optional, initialization vector for AES-GCM encryption + #[prost(bytes="vec", optional, tag="6")] + pub iv: ::core::option::Option<::prost::alloc::vec::Vec>, + } + /// enum for operation types (specific to TextHeader) + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum OperationType { + Create = 0, + Update = 1, + Delete = 2, + Reaction = 3, + } + impl OperationType { + /// 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 { + OperationType::Create => "CREATE", + OperationType::Update => "UPDATE", + OperationType::Delete => "DELETE", + OperationType::Reaction => "REACTION", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CREATE" => Some(Self::Create), + "UPDATE" => Some(Self::Update), + "DELETE" => Some(Self::Delete), + "REACTION" => Some(Self::Reaction), + _ => None, + } + } + } +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum IceTransportType { diff --git a/livekit-ffi/src/server/room.rs b/livekit-ffi/src/server/room.rs index 1367897e8..ca0d26ac8 100644 --- a/livekit-ffi/src/server/room.rs +++ b/livekit-ffi/src/server/room.rs @@ -1137,6 +1137,12 @@ async fn forward_event( state: proto::EncryptionState::from(state).into(), })); } + RoomEvent::StreamHeaderReceived { header } => { + let _ = send_event(proto::room_event::Message::StreamHeader(header.into())); + } + RoomEvent::StreamChunkReceived { chunk } => { + let _ = send_event(proto::room_event::Message::StreamChunk(chunk.into())); + } _ => { log::warn!("unhandled room event: {:?}", event); } diff --git a/livekit/src/room/mod.rs b/livekit/src/room/mod.rs index 21e288773..502efb2c1 100644 --- a/livekit/src/room/mod.rs +++ b/livekit/src/room/mod.rs @@ -31,10 +31,7 @@ use parking_lot::RwLock; pub use proto::DisconnectReason; use proto::{promise::Promise, SignalTarget}; use thiserror::Error; -use tokio::{ - signal, - sync::{mpsc, oneshot, Mutex as AsyncMutex}, -}; +use tokio::sync::{mpsc, oneshot, Mutex as AsyncMutex}; pub use self::{ e2ee::{manager::E2eeManager, E2eeOptions}, @@ -171,6 +168,12 @@ pub enum RoomEvent { message: ChatMessage, participant: Option, }, + StreamHeaderReceived { + header: proto::data_stream::Header, + }, + StreamChunkReceived { + chunk: proto::data_stream::Chunk, + }, E2eeStateChanged { participant: Participant, state: EncryptionState, @@ -720,6 +723,12 @@ impl RoomSession { EngineEvent::LocalTrackSubscribed { track_sid } => { self.handle_track_subscribed(track_sid) } + EngineEvent::DataStreamHeader { header } => { + self.handle_data_stream_header(header); + } + EngineEvent::DataStreamChunk { chunk } => { + self.handle_data_stream_chunk(chunk); + } _ => {} } @@ -1230,6 +1239,16 @@ impl RoomSession { }); } + fn handle_data_stream_header(&self, header: proto::data_stream::Header) { + let event = RoomEvent::StreamHeaderReceived { header }; + self.dispatcher.dispatch(&event); + } + + fn handle_data_stream_chunk(&self, chunk: proto::data_stream::Chunk) { + let event = RoomEvent::StreamChunkReceived { chunk }; + self.dispatcher.dispatch(&event); + } + /// Create a new participant /// Also add it to the participants list fn create_participant( diff --git a/livekit/src/rtc_engine/mod.rs b/livekit/src/rtc_engine/mod.rs index 4b3c44933..d4f5dec97 100644 --- a/livekit/src/rtc_engine/mod.rs +++ b/livekit/src/rtc_engine/mod.rs @@ -159,6 +159,12 @@ pub enum EngineEvent { LocalTrackSubscribed { track_sid: String, }, + DataStreamHeader { + header: proto::data_stream::Header, + }, + DataStreamChunk { + chunk: proto::data_stream::Chunk, + }, } /// Represents a running RtcSession with the ability to close the session @@ -524,6 +530,12 @@ impl EngineInner { SessionEvent::LocalTrackSubscribed { track_sid } => { let _ = self.engine_tx.send(EngineEvent::LocalTrackSubscribed { track_sid }); } + SessionEvent::DataStreamHeader { header } => { + let _ = self.engine_tx.send(EngineEvent::DataStreamHeader { header }); + } + SessionEvent::DataStreamChunk { chunk } => { + let _ = self.engine_tx.send(EngineEvent::DataStreamChunk { chunk }); + } } Ok(()) } diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index 3b6febb0e..b3cb4f094 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -135,6 +135,12 @@ pub enum SessionEvent { action: proto::leave_request::Action, retry_now: bool, }, + DataStreamHeader { + header: proto::data_stream::Header, + }, + DataStreamChunk { + chunk: proto::data_stream::Chunk, + }, } #[derive(Serialize, Deserialize)] @@ -723,6 +729,16 @@ impl SessionInner { message: ChatMessage::from(message.clone()), }); } + proto::data_packet::Value::StreamHeader(message) => { + let _ = self + .emitter + .send(SessionEvent::DataStreamHeader { header: message.clone() }); + } + proto::data_packet::Value::StreamChunk(message) => { + let _ = self + .emitter + .send(SessionEvent::DataStreamChunk { chunk: message.clone() }); + } _ => {} } } From e04a3cc4e9a43902f9640c628654095f284fd332 Mon Sep 17 00:00:00 2001 From: Daisuke Murase Date: Mon, 16 Dec 2024 21:43:38 -0800 Subject: [PATCH 47/51] Fix `play_from_disk` example to work with recent SDK (#529) * fix compilation error * fix wave header parser to allow other chunks before the data chunk --- examples/play_from_disk/src/main.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/play_from_disk/src/main.rs b/examples/play_from_disk/src/main.rs index b96d4e5c7..21f0de17a 100644 --- a/examples/play_from_disk/src/main.rs +++ b/examples/play_from_disk/src/main.rs @@ -7,10 +7,10 @@ use livekit::{ }, Room, RoomOptions, }; -use std::{env, mem::size_of, sync::Arc, time::Duration}; +use std::{env, io::SeekFrom, mem::size_of, sync::Arc, time::Duration}; use std::{error::Error, io}; use thiserror::Error; -use tokio::io::{AsyncRead, AsyncReadExt, BufReader}; +use tokio::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt, BufReader}; #[derive(Debug, Error)] pub enum WavError { @@ -20,7 +20,7 @@ pub enum WavError { Io(#[from] io::Error), } -pub struct WavReader { +pub struct WavReader { reader: R, } @@ -39,7 +39,7 @@ pub struct WavHeader { bits_per_sample: u16, } -impl WavReader { +impl WavReader { pub fn new(reader: R) -> Self { Self { reader } } @@ -76,8 +76,19 @@ impl WavReader { let byte_rate = self.reader.read_u32_le().await?; let block_align = self.reader.read_u16_le().await?; let bits_per_sample = self.reader.read_u16_le().await?; - self.reader.read_exact(&mut data_chunk).await?; - let data_size = self.reader.read_u32_le().await?; + + let mut data_size = 0; + loop { + self.reader.read_exact(&mut data_chunk).await?; + data_size = self.reader.read_u32_le().await?; + + if &data_chunk == b"data" { + break; + } else { + // skip non data chunks + self.reader.seek(SeekFrom::Current(data_size.into())).await?; + } + } if &data_chunk != b"data" { return Err(WavError::InvalidHeader("Invalid data chunk")); @@ -123,12 +134,13 @@ async fn main() -> Result<(), Box> { .await .unwrap(); let room = Arc::new(room); - log::info!("Connected to room: {} - {}", room.name(), room.sid()); + log::info!("Connected to room: {} - {}", room.name(), room.sid().await); let source = NativeAudioSource::new( AudioSourceOptions::default(), header.sample_rate, header.num_channels as u32, + 1000, ); let track = LocalAudioTrack::create_audio_track("file", RtcAudioSource::Native(source.clone())); From ca95b5440ba9aecb3113c0ab066c6b9159632256 Mon Sep 17 00:00:00 2001 From: Daisuke Murase Date: Mon, 16 Dec 2024 21:46:12 -0800 Subject: [PATCH 48/51] fix compilation error (#528) --- examples/save_to_disk/src/main.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/save_to_disk/src/main.rs b/examples/save_to_disk/src/main.rs index d378dedce..2b68d190d 100644 --- a/examples/save_to_disk/src/main.rs +++ b/examples/save_to_disk/src/main.rs @@ -12,9 +12,9 @@ const FILE_PATH: &str = "record.wav"; #[derive(Debug, Clone, Copy)] pub struct WavHeader { - pub sample_rate: u32, + pub sample_rate: i32, pub bit_depth: u16, - pub num_channels: u32, + pub num_channels: i32, } pub struct WavWriter { @@ -43,8 +43,8 @@ impl WavWriter { fn write_header(&mut self) -> Result<(), std::io::Error> { let byte_rate = self.header.sample_rate - * self.header.bit_depth as u32 - * self.header.num_channels as u32; + * self.header.bit_depth as i32 + * self.header.num_channels; let block_align = byte_rate as u16 / self.header.sample_rate as u16; @@ -55,8 +55,8 @@ impl WavWriter { self.data.put_u32_le(16); // Subchunk1Size (16 for PCM) self.data.put_u16_le(1); // AudioFormat (1 for PCM) self.data.put_u16_le(self.header.num_channels as u16); - self.data.put_u32_le(self.header.sample_rate); - self.data.put_u32_le(byte_rate); + self.data.put_i32_le(self.header.sample_rate); + self.data.put_i32_le(byte_rate); self.data.put_u16_le(block_align); self.data.put_u16_le(self.header.bit_depth); self.data.put_slice(b"data"); @@ -118,15 +118,18 @@ async fn record_track(audio_track: RemoteAudioTrack) -> Result<(), std::io::Erro println!("Recording track {:?}", audio_track.sid()); let rtc_track = audio_track.rtc_track(); + let sample_rate = 48000; + let num_channels = 2; + let header = WavHeader { - sample_rate: 48000, + sample_rate, bit_depth: 16, - num_channels: 2, + num_channels, }; let mut resampler = audio_resampler::AudioResampler::default(); let mut wav_writer = WavWriter::create(FILE_PATH, header).await?; - let mut audio_stream = NativeAudioStream::new(rtc_track); + let mut audio_stream = NativeAudioStream::new(rtc_track, sample_rate, num_channels); let max_record = 5 * header.sample_rate * header.num_channels; let mut sample_count = 0; @@ -136,8 +139,8 @@ async fn record_track(audio_track: RemoteAudioTrack) -> Result<(), std::io::Erro frame.samples_per_channel, frame.num_channels, frame.sample_rate, - header.num_channels, - header.sample_rate, + header.num_channels as u32, + header.sample_rate as u32, ); for sample in data { From 7e01c918546daff87b9f52e39923f7a2c47d2a78 Mon Sep 17 00:00:00 2001 From: Daisuke Murase Date: Mon, 16 Dec 2024 21:47:47 -0800 Subject: [PATCH 49/51] fix compilation error (#530) --- examples/wgpu_room/src/service.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/wgpu_room/src/service.rs b/examples/wgpu_room/src/service.rs index 9d3a26278..a075efb22 100644 --- a/examples/wgpu_room/src/service.rs +++ b/examples/wgpu_room/src/service.rs @@ -122,14 +122,14 @@ async fn service_task(inner: Arc, mut cmd_rx: mpsc::UnboundedRecei key_provider, }); + let mut options = RoomOptions::default(); + options.auto_subscribe = auto_subscribe; + options.e2ee = e2ee; + let res = Room::connect( &url, &token, - RoomOptions { - auto_subscribe, - e2ee, - ..Default::default() - }, + options, ) .await; From 3b1931cdc2cecb412f5760c218f5375f79a6a0d6 Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sun, 22 Dec 2024 22:00:33 +0200 Subject: [PATCH 50/51] bump livekit-ffi to 0.12.4 (#536) --- .nanpa/bump-ffi.kdl | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nanpa/bump-ffi.kdl diff --git a/.nanpa/bump-ffi.kdl b/.nanpa/bump-ffi.kdl new file mode 100644 index 000000000..659633490 --- /dev/null +++ b/.nanpa/bump-ffi.kdl @@ -0,0 +1 @@ +patch type="added" package="livekit-ffi" "bump libwebrtc to m125" From cc889daa26c2ea50258932708a24e095dcc850cc Mon Sep 17 00:00:00 2001 From: "ilo-nanpa[bot]" <174912985+ilo-nanpa[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:02:05 +0000 Subject: [PATCH 51/51] nanpa: bump --- .nanpa/bump-ffi.kdl | 1 - Cargo.toml | 2 +- livekit-ffi/.nanparc | 2 +- livekit-ffi/CHANGELOG.md | 6 ++++++ livekit-ffi/Cargo.toml | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 .nanpa/bump-ffi.kdl diff --git a/.nanpa/bump-ffi.kdl b/.nanpa/bump-ffi.kdl deleted file mode 100644 index 659633490..000000000 --- a/.nanpa/bump-ffi.kdl +++ /dev/null @@ -1 +0,0 @@ -patch type="added" package="livekit-ffi" "bump libwebrtc to m125" diff --git a/Cargo.toml b/Cargo.toml index 35de291b8..60819ca90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ imgproc = { version = "0.3.12", path = "imgproc" } yuv-sys = { version = "0.3.7", path = "yuv-sys" } libwebrtc = { version = "0.3.8", path = "libwebrtc" } livekit-api = { version = "0.4.1", path = "livekit-api" } -livekit-ffi = { version = "0.12.3", path = "livekit-ffi" } +livekit-ffi = { version = "0.12.4", path = "livekit-ffi" } livekit-protocol = { version = "0.3.6", path = "livekit-protocol" } livekit-runtime = { version = "0.3.1", path = "livekit-runtime" } livekit = { version = "0.7.1", path = "livekit" } diff --git a/livekit-ffi/.nanparc b/livekit-ffi/.nanparc index eb053fb66..bfb75eb65 100644 --- a/livekit-ffi/.nanparc +++ b/livekit-ffi/.nanparc @@ -1,2 +1,2 @@ -version 0.12.3 +version 0.12.4 language rust diff --git a/livekit-ffi/CHANGELOG.md b/livekit-ffi/CHANGELOG.md index c0b38a7af..434f26950 100644 --- a/livekit-ffi/CHANGELOG.md +++ b/livekit-ffi/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.12.4] - 2024-12-22 + +### Added + +- bump libwebrtc to m125 + ## [0.12.3] - 2024-12-14 ### Added diff --git a/livekit-ffi/Cargo.toml b/livekit-ffi/Cargo.toml index b7cab7fda..a2bfd9ccc 100644 --- a/livekit-ffi/Cargo.toml +++ b/livekit-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livekit-ffi" -version = "0.12.3" +version = "0.12.4" edition = "2021" license = "Apache-2.0" description = "FFI interface for bindings in other languages"