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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions livekit-api/src/services/egress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl EgressClient {
image_outputs,
output: None, // Deprecated
await_start_signal: options.await_start_signal,
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -184,6 +185,7 @@ impl EgressClient {
stream_outputs,
segment_outputs,
image_outputs,
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -215,6 +217,7 @@ impl EgressClient {
segment_outputs,
image_outputs,
output: None, // Deprecated
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -244,6 +247,7 @@ impl EgressClient {
}
},
track_id: track_id.to_string(),
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down
4 changes: 1 addition & 3 deletions livekit-api/src/services/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,7 @@ impl SIPClient {
hide_phone_number: options.hide_phone_number,
rule: Some(proto::SipDispatchRule { rule: Some(rule.to_owned()) }),

// TODO: support these attributes
room_preset: Default::default(),
room_config: Default::default(),
..Default::default()
},
self.base.auth_header(
Default::default(),
Expand Down
1 change: 1 addition & 0 deletions livekit-ffi/protocol/participant.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ enum DisconnectReason {
USER_REJECTED = 12;
// SIP protocol failure or unexpected response
SIP_TRUNK_FAILURE = 13;
CONNECTION_TIMEOUT = 14;
}
11 changes: 11 additions & 0 deletions livekit-ffi/protocol/track.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ message TrackPublicationInfo {
required bool muted = 9;
required bool remote = 10;
required EncryptionType encryption_type = 11;
repeated AudioTrackFeature audio_features = 12;
}

message OwnedTrackPublication {
Expand Down Expand Up @@ -147,3 +148,13 @@ message ParticipantTrackPermission {

message SetTrackSubscriptionPermissionsResponse {
}

enum AudioTrackFeature {
TF_STEREO = 0;
TF_NO_DTX = 1;
TF_AUTO_GAIN_CONTROL = 2;
TF_ECHO_CANCELLATION = 3;
TF_NOISE_SUPPRESSION = 4;
TF_ENHANCED_NOISE_CANCELLATION = 5;
TF_PRECONNECT_BUFFER = 6; // client will buffer audio once available and send it to the server via bytes stream once connected
}
1 change: 1 addition & 0 deletions livekit-ffi/src/conversion/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ impl From<DisconnectReason> for proto::DisconnectReason {
DisconnectReason::UserUnavailable => proto::DisconnectReason::UserUnavailable,
DisconnectReason::UserRejected => proto::DisconnectReason::UserRejected,
DisconnectReason::SipTrunkFailure => proto::DisconnectReason::SipTrunkFailure,
DisconnectReason::ConnectionTimeout => proto::DisconnectReason::ConnectionTimeout,
}
}
}
1 change: 1 addition & 0 deletions livekit-ffi/src/conversion/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl From<DisconnectReason> for proto::DisconnectReason {
DisconnectReason::UserUnavailable => Self::UserUnavailable,
DisconnectReason::UserRejected => Self::UserRejected,
DisconnectReason::SipTrunkFailure => Self::SipTrunkFailure,
DisconnectReason::ConnectionTimeout => Self::ConnectionTimeout,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a similar conversion for the TrackFeature?
impl From< AudioTrackFeature > for proto:: AudioTrackFeature {

We're currently only relying on the integer, which is unsafe and will panic as soon as the proto adds a new one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theomonnom I added conversions in both directions and added AudioTrackFeature to the rtc prelude

}
}
}
Expand Down
37 changes: 37 additions & 0 deletions livekit-ffi/src/conversion/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ impl From<&FfiPublication> for proto::TrackPublicationInfo {
muted: publication.is_muted(),
remote: publication.is_remote(),
encryption_type: proto::EncryptionType::from(publication.encryption_type()).into(),
audio_features: publication
.audio_features()
.into_iter()
.map(|i| proto::AudioTrackFeature::from(i).into())
.collect(),
}
}
}
Expand Down Expand Up @@ -121,3 +126,35 @@ impl From<proto::ParticipantTrackPermission> for ParticipantTrackPermission {
}
}
}

impl From<proto::AudioTrackFeature> for AudioTrackFeature {
fn from(value: proto::AudioTrackFeature) -> Self {
match value {
proto::AudioTrackFeature::TfStereo => AudioTrackFeature::TfStereo,
proto::AudioTrackFeature::TfNoDtx => AudioTrackFeature::TfNoDtx,
proto::AudioTrackFeature::TfAutoGainControl => AudioTrackFeature::TfAutoGainControl,
proto::AudioTrackFeature::TfEchoCancellation => AudioTrackFeature::TfEchoCancellation,
proto::AudioTrackFeature::TfNoiseSuppression => AudioTrackFeature::TfNoiseSuppression,
proto::AudioTrackFeature::TfEnhancedNoiseCancellation => {
AudioTrackFeature::TfEnhancedNoiseCancellation
}
proto::AudioTrackFeature::TfPreconnectBuffer => AudioTrackFeature::TfPreconnectBuffer,
}
}
}

impl From<AudioTrackFeature> for proto::AudioTrackFeature {
fn from(value: AudioTrackFeature) -> Self {
match value {
AudioTrackFeature::TfStereo => proto::AudioTrackFeature::TfStereo,
AudioTrackFeature::TfNoDtx => proto::AudioTrackFeature::TfNoDtx,
AudioTrackFeature::TfAutoGainControl => proto::AudioTrackFeature::TfAutoGainControl,
AudioTrackFeature::TfEchoCancellation => proto::AudioTrackFeature::TfEchoCancellation,
AudioTrackFeature::TfNoiseSuppression => proto::AudioTrackFeature::TfNoiseSuppression,
AudioTrackFeature::TfEnhancedNoiseCancellation => {
proto::AudioTrackFeature::TfEnhancedNoiseCancellation
}
AudioTrackFeature::TfPreconnectBuffer => proto::AudioTrackFeature::TfPreconnectBuffer,
}
}
}
47 changes: 47 additions & 0 deletions livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,8 @@ pub struct TrackPublicationInfo {
pub remote: bool,
#[prost(enumeration="EncryptionType", required, tag="11")]
pub encryption_type: i32,
#[prost(enumeration="AudioTrackFeature", repeated, packed="false", tag="12")]
pub audio_features: ::prost::alloc::vec::Vec<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1575,6 +1577,48 @@ impl StreamState {
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AudioTrackFeature {
TfStereo = 0,
TfNoDtx = 1,
TfAutoGainControl = 2,
TfEchoCancellation = 3,
TfNoiseSuppression = 4,
TfEnhancedNoiseCancellation = 5,
/// client will buffer audio once available and send it to the server via bytes stream once connected
TfPreconnectBuffer = 6,
}
impl AudioTrackFeature {
/// 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 {
AudioTrackFeature::TfStereo => "TF_STEREO",
AudioTrackFeature::TfNoDtx => "TF_NO_DTX",
AudioTrackFeature::TfAutoGainControl => "TF_AUTO_GAIN_CONTROL",
AudioTrackFeature::TfEchoCancellation => "TF_ECHO_CANCELLATION",
AudioTrackFeature::TfNoiseSuppression => "TF_NOISE_SUPPRESSION",
AudioTrackFeature::TfEnhancedNoiseCancellation => "TF_ENHANCED_NOISE_CANCELLATION",
AudioTrackFeature::TfPreconnectBuffer => "TF_PRECONNECT_BUFFER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TF_STEREO" => Some(Self::TfStereo),
"TF_NO_DTX" => Some(Self::TfNoDtx),
"TF_AUTO_GAIN_CONTROL" => Some(Self::TfAutoGainControl),
"TF_ECHO_CANCELLATION" => Some(Self::TfEchoCancellation),
"TF_NOISE_SUPPRESSION" => Some(Self::TfNoiseSuppression),
"TF_ENHANCED_NOISE_CANCELLATION" => Some(Self::TfEnhancedNoiseCancellation),
"TF_PRECONNECT_BUFFER" => Some(Self::TfPreconnectBuffer),
_ => None,
}
}
}
/// Enable/Disable a remote track publication
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1694,6 +1738,7 @@ pub enum DisconnectReason {
UserRejected = 12,
/// SIP protocol failure or unexpected response
SipTrunkFailure = 13,
ConnectionTimeout = 14,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply add this without breaking users' code?

}
impl DisconnectReason {
/// String value of the enum field names used in the ProtoBuf definition.
Expand All @@ -1716,6 +1761,7 @@ impl DisconnectReason {
DisconnectReason::UserUnavailable => "USER_UNAVAILABLE",
DisconnectReason::UserRejected => "USER_REJECTED",
DisconnectReason::SipTrunkFailure => "SIP_TRUNK_FAILURE",
DisconnectReason::ConnectionTimeout => "CONNECTION_TIMEOUT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -1735,6 +1781,7 @@ impl DisconnectReason {
"USER_UNAVAILABLE" => Some(Self::UserUnavailable),
"USER_REJECTED" => Some(Self::UserRejected),
"SIP_TRUNK_FAILURE" => Some(Self::SipTrunkFailure),
"CONNECTION_TIMEOUT" => Some(Self::ConnectionTimeout),
_ => None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion livekit-protocol/protocol
Submodule protocol updated 95 files
+0 −5 .changeset/chilly-years-obey.md
+0 −5 .changeset/red-dogs-love.md
+0 −6 .changeset/sip-dispatch-info.md
+0 −6 .changeset/sip-domain-attr.md
+0 −5 .changeset/sip-num-norm.md
+0 −6 .changeset/wet-comics-cross.md
+74 −0 CHANGELOG.md
+1 −1 agent/token.go
+5 −0 auth/accesstoken.go
+4 −4 auth/accesstoken_test.go
+33 −0 auth/grants.go
+3 −3 auth/verifier_test.go
+61 −0 egress/notify_options.go
+1 −1 egress/token.go
+31 −59 infra/link.pb.go
+6 −3 ingress/token.go
+4 −0 livekit/attrs.go
+118 −210 livekit/livekit_agent.pb.go
+40 −75 livekit/livekit_agent_dispatch.pb.go
+261 −510 livekit/livekit_analytics.pb.go
+1,824 −0 livekit/livekit_cloud_agent.pb.go
+3,103 −0 livekit/livekit_cloud_agent.twirp.go
+511 −800 livekit/livekit_egress.pb.go
+203 −199 livekit/livekit_egress.twirp.go
+156 −291 livekit/livekit_ingress.pb.go
+512 −354 livekit/livekit_internal.pb.go
+56 −137 livekit/livekit_metrics.pb.go
+1,012 −1,130 livekit/livekit_models.pb.go
+259 −277 livekit/livekit_room.pb.go
+371 −86 livekit/livekit_room.twirp.go
+350 −636 livekit/livekit_rtc.pb.go
+1,323 −1,070 livekit/livekit_sip.pb.go
+1,218 −351 livekit/livekit_sip.twirp.go
+21 −39 livekit/livekit_webhook.pb.go
+308 −1 livekit/sip.go
+135 −0 livekit/sip_test.go
+55 −0 livekit/types.go
+12 −0 logger/logger.go
+11 −25 logger/logger_test.go
+4 −44 logger/medialogutils/cmd.go
+23 −0 logger/testutil/testutil.go
+17 −17 logger/zaputil/deferrer.go
+52 −12 logger/zaputil/deferrer_test.go
+1 −0 magefile.go
+1 −1 package.json
+76 −0 packages/javascript/CHANGELOG.md
+1 −1 packages/javascript/package.json
+190 −0 protobufs/livekit_cloud_agent.proto
+22 −0 protobufs/livekit_egress.proto
+58 −19 protobufs/livekit_internal.proto
+30 −7 protobufs/livekit_models.proto
+17 −0 protobufs/livekit_room.proto
+4 −2 protobufs/livekit_rtc.proto
+73 −10 protobufs/livekit_sip.proto
+1 −1 protobufs/livekit_webhook.proto
+10 −0 protobufs/rpc/participant.proto
+3 −0 protobufs/rpc/sip.proto
+4 −15 psrpc/errors.go
+1 −1 replay/cloud_replay.pb.go
+30 −68 rpc/agent.pb.go
+11 −32 rpc/agent_dispatch.pb.go
+8 −27 rpc/analytics.pb.go
+29 −71 rpc/egress.pb.go
+51 −113 rpc/ingress.pb.go
+136 −298 rpc/io.pb.go
+9 −17 rpc/keepalive.pb.go
+29 −54 rpc/participant.pb.go
+42 −20 rpc/participant.psrpc.go
+12 −29 rpc/room.pb.go
+8 −18 rpc/roommanager.pb.go
+85 −0 rpc/rpcfakes/fake_typed_participant_client.go
+16 −36 rpc/signal.pb.go
+5 −4 rpc/sip.go
+87 −178 rpc/sip.pb.go
+62 −62 rpc/sip.psrpc.go
+577 −13 sdp/sdp.go
+185 −0 sdp/sdp_test.go
+33 −0 sip/sip.go
+7 −0 utils/error.go
+21 −17 utils/guid/id.go
+10 −0 utils/hwstats/cpu.go
+1 −0 utils/hwstats/cpu_null.go
+41 −0 utils/hwstats/memory.go
+33 −0 utils/hwstats/memory_all.go
+160 −0 utils/hwstats/memory_linux.go
+21 −0 utils/hwstats/memory_nonlinux.go
+21 −17 utils/id.go
+35 −6 utils/promise.go
+42 −0 utils/promise_test.go
+45 −0 webhook/filter.go
+270 −14 webhook/notifier.go
+121 −0 webhook/resource_queue.go
+368 −0 webhook/resource_url_notifier.go
+80 −172 webhook/url_notifier.go
+648 −15 webhook/webhook_test.go
Loading
Loading