Skip to content

Commit

Permalink
fix proto compilation & v0.3.2 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Feb 28, 2024
1 parent 418e67c commit 9f01f47
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 50 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full", "parking_lot"] }
livekit-api = { path = "../../livekit-api", version = "0.3.1", features = ["native-tls"] }
livekit-api = { path = "../../livekit-api", version = "0.3.2", features = ["native-tls"] }
futures = "0.3"

4 changes: 2 additions & 2 deletions examples/basic_room/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
tokio = { version = "1", features = ["full"] }
env_logger = "0.10"
livekit = { path = "../../livekit", version = "0.3.1", features = ["native-tls"]}
livekit-api = { path = "../../livekit-api", version = "0.3.1"}
livekit = { path = "../../livekit", version = "0.3.2", features = ["native-tls"]}
livekit-api = { path = "../../livekit-api", version = "0.3.2"}
log = "0.4"
4 changes: 2 additions & 2 deletions examples/mobile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
lazy_static = "1.4.0"
livekit = { path = "../../livekit", version = "0.3.1", features = ["rustls-tls-webpki-roots"] }
livekit = { path = "../../livekit", version = "0.3.2", features = ["rustls-tls-webpki-roots"] }
log = "0.4.19"
tokio = { version = "1", features = ["full"] }

Expand All @@ -14,7 +14,7 @@ jni = "0.21.1"
android_logger = "0.13.1"

[build-dependencies]
webrtc-sys-build = { path = "../../webrtc-sys/build", version = "0.3.1" }
webrtc-sys-build = { path = "../../webrtc-sys/build", version = "0.3.2" }

[lib]
crate-type = ["cdylib"]
2 changes: 1 addition & 1 deletion examples/play_from_disk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }
livekit = { path = "../../livekit", version = "0.3.1" }
livekit = { path = "../../livekit", version = "0.3.2" }
thiserror = "1.0.47"
log = "0.4.20"
env_logger = "0.10.0"
2 changes: 1 addition & 1 deletion examples/save_to_disk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }
livekit = { path = "../../livekit", version = "0.3.1" }
livekit = { path = "../../livekit", version = "0.3.2" }
bytes = "1.4.0"
tokio-util = "0.7.8"
futures = "0.3.28"
2 changes: 1 addition & 1 deletion examples/webhooks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
livekit-api = { version = "0.3.1", path = "../../livekit-api" }
livekit-api = { version = "0.3.2", path = "../../livekit-api" }
hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1", features = ["full"] }
2 changes: 1 addition & 1 deletion examples/wgpu_room/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tracing = ["console-subscriber", "tokio/tracing"]

[dependencies]
tokio = { version = "1", features = ["full", "parking_lot"] }
livekit = { path = "../../livekit", version = "0.3.1", features = ["native-tls"] }
livekit = { path = "../../livekit", version = "0.3.2", features = ["native-tls"] }
futures = "0.3"
winit = "0.28"
parking_lot = { version = "0.12.1", features = ["deadlock_detection"] }
Expand Down
6 changes: 3 additions & 3 deletions libwebrtc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "libwebrtc"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
homepage = "https://livekit.io"
license = "Apache-2.0"
description = "Livekit safe bindings to libwebrtc"
repository = "https://github.com/livekit/rust-sdks"

[dependencies]
livekit-protocol = { path = "../livekit-protocol", version = "0.3.1" }
livekit-protocol = { path = "../livekit-protocol", version = "0.3.2" }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -18,7 +18,7 @@ thiserror = "1.0"
jni = "0.21"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
webrtc-sys = { path = "../webrtc-sys", version = "0.3.1" }
webrtc-sys = { path = "../webrtc-sys", version = "0.3.2" }
lazy_static = "1.4"
parking_lot = { version = "0.12" }
tokio = { version = "1", features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions livekit-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "livekit-api"
version = "0.3.1"
version = "0.3.2"
license = "Apache-2.0"
description = "Rust Server SDK for LiveKit"
edition = "2021"
Expand All @@ -24,7 +24,7 @@ rustls-tls-webpki-roots = ["tokio-tungstenite?/rustls-tls-webpki-roots", "reqwes
__rustls-tls = ["tokio-tungstenite?/__rustls-tls", "reqwest?/__rustls"]

[dependencies]
livekit-protocol = { path = "../livekit-protocol", version = "0.3.1" }
livekit-protocol = { path = "../livekit-protocol", version = "0.3.2" }
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
sha2 = "0.10"
Expand Down
36 changes: 36 additions & 0 deletions livekit-api/src/services/egress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct WebOptions {
pub await_start_signal: bool,
}

#[derive(Default, Clone, Debug)]
pub struct ParticipantEgressOptions {
pub screenshare: bool,
pub encoding: encoding::EncodingOptions,
}

#[derive(Default, Clone, Debug)]
pub struct TrackCompositeOptions {
pub encoding: encoding::EncodingOptions,
Expand Down Expand Up @@ -152,6 +158,36 @@ impl EgressClient {
.map_err(Into::into)
}

pub async fn start_participant_egress(
&self,
room: &str,
participant_identity: &str,
outputs: Vec<EgressOutput>,
options: ParticipantEgressOptions,
) -> ServiceResult<proto::EgressInfo> {
let (file_outputs, stream_outputs, segment_outputs, image_outputs) = get_outputs(outputs);
self.client
.request(
SVC,
"StartParticipantEgress",
proto::ParticipantEgressRequest {
room_name: room.to_string(),
identity: participant_identity.to_string(),
options: Some(proto::participant_egress_request::Options::Advanced(
options.encoding.into(),
)),
screen_share: options.screenshare,
file_outputs,
stream_outputs,
segment_outputs,
image_outputs,
},
self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?,
)
.await
.map_err(Into::into)
}

pub async fn start_track_composite_egress(
&self,
room: &str,
Expand Down
29 changes: 23 additions & 6 deletions livekit-api/src/services/ingress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,28 @@ use super::{ServiceBase, ServiceResult, LIVEKIT_PACKAGE};
use crate::{access_token::VideoGrants, get_env_keys, services::twirp_client::TwirpClient};

#[derive(Default, Clone, Debug)]
pub struct IngressOptions {
pub struct CreateIngressOptions {
pub name: String,
pub room_name: String,
pub participant_metadata: String,
pub participant_identity: String,
pub participant_name: String,
pub audio: proto::IngressAudioOptions,
pub video: proto::IngressVideoOptions,
pub bypass_transcoding: bool,
pub url: String,
}

#[derive(Default, Clone, Debug)]
pub struct UpdateIngressOptions {
pub name: String,
pub room_name: String,
pub participant_metadata: String,
pub participant_identity: String,
pub participant_name: String,
pub audio: proto::IngressAudioOptions,
pub video: proto::IngressVideoOptions,
pub bypass_transcoding: Option<bool>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -58,7 +73,7 @@ impl IngressClient {
pub async fn create_ingress(
&self,
input_type: proto::IngressInput,
options: IngressOptions,
options: CreateIngressOptions,
) -> ServiceResult<proto::IngressInfo> {
self.client
.request(
Expand All @@ -68,12 +83,13 @@ impl IngressClient {
input_type: input_type as i32,
name: options.name,
room_name: options.room_name,
participant_metadata: options.participant_metadata,
participant_identity: options.participant_identity,
participant_name: options.participant_name,
audio: Some(options.audio),
video: Some(options.video),
bypass_transcoding: false, // TODO Expose
..Default::default()
bypass_transcoding: options.bypass_transcoding,
url: options.url,
},
self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?,
)
Expand All @@ -84,7 +100,7 @@ impl IngressClient {
pub async fn update_ingress(
&self,
ingress_id: &str,
options: IngressOptions,
options: UpdateIngressOptions,
) -> ServiceResult<proto::IngressInfo> {
self.client
.request(
Expand All @@ -94,11 +110,12 @@ impl IngressClient {
ingress_id: ingress_id.to_owned(),
name: options.name,
room_name: options.room_name,
participant_metadata: options.participant_metadata,
participant_identity: options.participant_identity,
participant_name: options.participant_name,
audio: Some(options.audio),
video: Some(options.video),
bypass_transcoding: None, // TODO Expose
bypass_transcoding: options.bypass_transcoding,
},
self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?,
)
Expand Down
8 changes: 4 additions & 4 deletions livekit-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ __rustls-tls = ["livekit/__rustls-tls"]
tracing = ["tokio/tracing", "console-subscriber"]

[dependencies]
livekit = { path = "../livekit", version = "0.3.1" }
livekit-protocol = { path = "../livekit-protocol", version = "0.3.1" }
livekit = { path = "../livekit", version = "0.3.2" }
livekit-protocol = { path = "../livekit-protocol", version = "0.3.2" }
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"] }
Expand All @@ -38,10 +38,10 @@ imgproc = "0.3.11"
jni = "0.21.1"

[build-dependencies]
webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.0" }
webrtc-sys-build = { path = "../webrtc-sys/build", version = "0.3.2" }

[dev-dependencies]
livekit-api = { path = "../livekit-api", version = "0.3.0" }
livekit-api = { path = "../livekit-api", version = "0.3.2" }

[lib]
crate-type = ["lib", "cdylib"]
2 changes: 1 addition & 1 deletion livekit-protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "livekit-protocol"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
license = "Apache-2.0"
description = "Livekit protocol and utilities for the Rust SDK"
Expand Down
Loading

0 comments on commit 9f01f47

Please sign in to comment.