Skip to content

Commit 8e58137

Browse files
committed
Update DataStream naming
1 parent e96fdca commit 8e58137

File tree

7 files changed

+381
-168
lines changed

7 files changed

+381
-168
lines changed

livekit-api/src/services/sip.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ impl SIPClient {
257257
.request(
258258
SVC,
259259
"ListSIPTrunk",
260-
proto::ListSipTrunkRequest {},
260+
proto::ListSipTrunkRequest {
261+
// TODO support these attributes
262+
page: Default::default(),
263+
},
261264
self.base.auth_header(
262265
Default::default(),
263266
Some(SIPGrants { admin: true, ..Default::default() }),
@@ -279,6 +282,7 @@ impl SIPClient {
279282
"ListSIPInboundTrunk",
280283
proto::ListSipInboundTrunkRequest {
281284
// TODO: support these attributes
285+
page: Default::default(),
282286
trunk_ids: Default::default(),
283287
numbers: Default::default(),
284288
},
@@ -303,6 +307,7 @@ impl SIPClient {
303307
"ListSIPOutboundTrunk",
304308
proto::ListSipOutboundTrunkRequest {
305309
// TODO: support these attributes
310+
page: Default::default(),
306311
trunk_ids: Default::default(),
307312
numbers: Default::default(),
308313
},
@@ -373,6 +378,7 @@ impl SIPClient {
373378
"ListSIPDispatchRule",
374379
proto::ListSipDispatchRuleRequest {
375380
// TODO: support these attributes
381+
page: Default::default(),
376382
dispatch_rule_ids: Default::default(),
377383
trunk_ids: Default::default(),
378384
},

livekit-ffi/protocol/room.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ message DataStream {
552552

553553
}
554554

555-
// header properties specific to file or image streams
556-
message FileHeader {
557-
required string file_name = 1; // name of the file
555+
// header properties specific to byte or file streams
556+
message ByteHeader {
557+
required string name = 1;
558558
}
559559

560560
// main DataStream.Header that contains a oneof for specific headers
@@ -564,12 +564,12 @@ message DataStream {
564564
required string mime_type = 3;
565565
required string topic = 4;
566566
optional uint64 total_length = 5; // only populated for finite streams, if it's a stream of unknown size this stays empty
567-
map<string, string> extensions = 6; // user defined extensions map that can carry additional info
567+
map<string, string> attributes = 6; // user defined attributes map that can carry additional info
568568

569569
// oneof to choose between specific header types
570570
oneof content_header {
571571
TextHeader text_header = 7;
572-
FileHeader file_header = 8;
572+
ByteHeader byte_header = 8;
573573
}
574574
}
575575

@@ -584,7 +584,7 @@ message DataStream {
584584
message Trailer {
585585
required string stream_id = 1; // unique identifier for this data stream
586586
required string reason = 2; // reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)
587-
map<string, string> extensions = 3; // finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
587+
map<string, string> attributes = 3; // finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
588588
}
589589
}
590590

livekit-ffi/src/conversion/room.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use livekit::{
2525
prelude::{ContinualGatheringPolicy, IceServer, IceTransportsType, RtcConfiguration},
2626
},
2727
};
28+
use prost::bytes;
2829

2930
impl From<EncryptionState> for proto::EncryptionState {
3031
fn from(value: EncryptionState) -> Self {
@@ -302,9 +303,9 @@ impl From<livekit_protocol::data_stream::Header> for proto::data_stream::Header
302303
},
303304
))
304305
}
305-
Some(livekit_protocol::data_stream::header::ContentHeader::FileHeader(file_header)) => {
306-
Some(proto::data_stream::header::ContentHeader::FileHeader(
307-
proto::data_stream::FileHeader { file_name: file_header.file_name },
306+
Some(livekit_protocol::data_stream::header::ContentHeader::ByteHeader(byte_header)) => {
307+
Some(proto::data_stream::header::ContentHeader::ByteHeader(
308+
proto::data_stream::ByteHeader { name: byte_header.name },
308309
))
309310
}
310311
None => None,
@@ -316,7 +317,7 @@ impl From<livekit_protocol::data_stream::Header> for proto::data_stream::Header
316317
topic: msg.topic,
317318
mime_type: msg.mime_type,
318319
total_length: msg.total_length,
319-
extensions: msg.extensions,
320+
attributes: msg.attributes,
320321
content_header,
321322
}
322323
}
@@ -336,9 +337,9 @@ impl From<proto::data_stream::Header> for livekit_protocol::data_stream::Header
336337
},
337338
))
338339
}
339-
Some(proto::data_stream::header::ContentHeader::FileHeader(file_header)) => {
340-
Some(livekit_protocol::data_stream::header::ContentHeader::FileHeader(
341-
livekit_protocol::data_stream::FileHeader { file_name: file_header.file_name },
340+
Some(proto::data_stream::header::ContentHeader::ByteHeader(byte_header)) => {
341+
Some(livekit_protocol::data_stream::header::ContentHeader::ByteHeader(
342+
livekit_protocol::data_stream::ByteHeader { name: byte_header.name },
342343
))
343344
}
344345
None => None,
@@ -350,7 +351,7 @@ impl From<proto::data_stream::Header> for livekit_protocol::data_stream::Header
350351
topic: msg.topic,
351352
mime_type: msg.mime_type,
352353
total_length: msg.total_length,
353-
extensions: msg.extensions,
354+
attributes: msg.attributes,
354355
content_header,
355356
encryption_type: 0,
356357
}
@@ -383,12 +384,12 @@ impl From<proto::data_stream::Chunk> for livekit_protocol::data_stream::Chunk {
383384

384385
impl From<livekit_protocol::data_stream::Trailer> for proto::data_stream::Trailer {
385386
fn from(msg: livekit_protocol::data_stream::Trailer) -> Self {
386-
Self { stream_id: msg.stream_id, reason: msg.reason, extensions: msg.extensions }
387+
Self { stream_id: msg.stream_id, reason: msg.reason, attributes: msg.attributes }
387388
}
388389
}
389390

390391
impl From<proto::data_stream::Trailer> for livekit_protocol::data_stream::Trailer {
391392
fn from(msg: proto::data_stream::Trailer) -> Self {
392-
Self { stream_id: msg.stream_id, reason: msg.reason, extensions: msg.extensions }
393+
Self { stream_id: msg.stream_id, reason: msg.reason, attributes: msg.attributes }
393394
}
394395
}

livekit-ffi/src/livekit.proto.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// @generated
2+
// This file is @generated by prost-build.
23
#[allow(clippy::derive_partial_eq_without_eq)]
34
#[derive(Clone, PartialEq, ::prost::Message)]
45
pub struct FrameCryptor {
@@ -2007,6 +2008,8 @@ impl VideoRotation {
20072008
}
20082009
}
20092010
}
2011+
/// Values of this enum must not be changed
2012+
/// It is used to serialize a rtc.VideoFrame on Python
20102013
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
20112014
#[repr(i32)]
20122015
pub enum VideoBufferType {
@@ -3011,13 +3014,12 @@ pub mod data_stream {
30113014
#[prost(bool, optional, tag="5")]
30123015
pub generated: ::core::option::Option<bool>,
30133016
}
3014-
/// header properties specific to file or image streams
3017+
/// header properties specific to byte or file streams
30153018
#[allow(clippy::derive_partial_eq_without_eq)]
30163019
#[derive(Clone, PartialEq, ::prost::Message)]
3017-
pub struct FileHeader {
3018-
/// name of the file
3020+
pub struct ByteHeader {
30193021
#[prost(string, required, tag="1")]
3020-
pub file_name: ::prost::alloc::string::String,
3022+
pub name: ::prost::alloc::string::String,
30213023
}
30223024
/// main DataStream.Header that contains a oneof for specific headers
30233025
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -3036,9 +3038,9 @@ pub mod data_stream {
30363038
/// only populated for finite streams, if it's a stream of unknown size this stays empty
30373039
#[prost(uint64, optional, tag="5")]
30383040
pub total_length: ::core::option::Option<u64>,
3039-
/// user defined extensions map that can carry additional info
3041+
/// user defined attributes map that can carry additional info
30403042
#[prost(map="string, string", tag="6")]
3041-
pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
3043+
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
30423044
/// oneof to choose between specific header types
30433045
#[prost(oneof="header::ContentHeader", tags="7, 8")]
30443046
pub content_header: ::core::option::Option<header::ContentHeader>,
@@ -3052,7 +3054,7 @@ pub mod data_stream {
30523054
#[prost(message, tag="7")]
30533055
TextHeader(super::TextHeader),
30543056
#[prost(message, tag="8")]
3055-
FileHeader(super::FileHeader),
3057+
ByteHeader(super::ByteHeader),
30563058
}
30573059
}
30583060
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -3084,7 +3086,7 @@ pub mod data_stream {
30843086
pub reason: ::prost::alloc::string::String,
30853087
/// finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
30863088
#[prost(map="string, string", tag="3")]
3087-
pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
3089+
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
30883090
}
30893091
/// enum for operation types (specific to TextHeader)
30903092
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]

livekit-protocol/src/livekit.rs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ impl MetricLabel {
192192
}
193193
#[allow(clippy::derive_partial_eq_without_eq)]
194194
#[derive(Clone, PartialEq, ::prost::Message)]
195+
pub struct Pagination {
196+
/// list entities which IDs are greater
197+
#[prost(string, tag="1")]
198+
pub after_id: ::prost::alloc::string::String,
199+
#[prost(int32, tag="2")]
200+
pub limit: i32,
201+
}
202+
#[allow(clippy::derive_partial_eq_without_eq)]
203+
#[derive(Clone, PartialEq, ::prost::Message)]
195204
pub struct Room {
196205
#[prost(string, tag="1")]
197206
pub sid: ::prost::alloc::string::String,
@@ -1143,13 +1152,12 @@ pub mod data_stream {
11431152
#[prost(bool, tag="5")]
11441153
pub generated: bool,
11451154
}
1146-
/// header properties specific to file or image streams
1155+
/// header properties specific to byte or file streams
11471156
#[allow(clippy::derive_partial_eq_without_eq)]
11481157
#[derive(Clone, PartialEq, ::prost::Message)]
1149-
pub struct FileHeader {
1150-
/// name of the file
1158+
pub struct ByteHeader {
11511159
#[prost(string, tag="1")]
1152-
pub file_name: ::prost::alloc::string::String,
1160+
pub name: ::prost::alloc::string::String,
11531161
}
11541162
/// main DataStream.Header that contains a oneof for specific headers
11551163
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -1171,9 +1179,9 @@ pub mod data_stream {
11711179
/// defaults to NONE
11721180
#[prost(enumeration="super::encryption::Type", tag="7")]
11731181
pub encryption_type: i32,
1174-
/// user defined extensions map that can carry additional info
1182+
/// user defined attributes map that can carry additional info
11751183
#[prost(map="string, string", tag="8")]
1176-
pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
1184+
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
11771185
/// oneof to choose between specific header types
11781186
#[prost(oneof="header::ContentHeader", tags="9, 10")]
11791187
pub content_header: ::core::option::Option<header::ContentHeader>,
@@ -1187,7 +1195,7 @@ pub mod data_stream {
11871195
#[prost(message, tag="9")]
11881196
TextHeader(super::TextHeader),
11891197
#[prost(message, tag="10")]
1190-
FileHeader(super::FileHeader),
1198+
ByteHeader(super::ByteHeader),
11911199
}
11921200
}
11931201
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -1219,7 +1227,7 @@ pub mod data_stream {
12191227
pub reason: ::prost::alloc::string::String,
12201228
/// finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
12211229
#[prost(map="string, string", tag="3")]
1222-
pub extensions: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
1230+
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
12231231
}
12241232
/// enum for operation types (specific to TextHeader)
12251233
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
@@ -4785,6 +4793,8 @@ pub struct GetSipOutboundTrunkResponse {
47854793
#[allow(clippy::derive_partial_eq_without_eq)]
47864794
#[derive(Clone, PartialEq, ::prost::Message)]
47874795
pub struct ListSipTrunkRequest {
4796+
#[prost(message, optional, tag="1")]
4797+
pub page: ::core::option::Option<Pagination>,
47884798
}
47894799
#[allow(clippy::derive_partial_eq_without_eq)]
47904800
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -4796,6 +4806,8 @@ pub struct ListSipTrunkResponse {
47964806
#[allow(clippy::derive_partial_eq_without_eq)]
47974807
#[derive(Clone, PartialEq, ::prost::Message)]
47984808
pub struct ListSipInboundTrunkRequest {
4809+
#[prost(message, optional, tag="3")]
4810+
pub page: ::core::option::Option<Pagination>,
47994811
/// Trunk IDs to list. If this option is set, the response will contains trunks in the same order.
48004812
/// If any of the trunks is missing, a nil item in that position will be sent in the response.
48014813
#[prost(string, repeated, tag="1")]
@@ -4814,6 +4826,8 @@ pub struct ListSipInboundTrunkResponse {
48144826
#[allow(clippy::derive_partial_eq_without_eq)]
48154827
#[derive(Clone, PartialEq, ::prost::Message)]
48164828
pub struct ListSipOutboundTrunkRequest {
4829+
#[prost(message, optional, tag="3")]
4830+
pub page: ::core::option::Option<Pagination>,
48174831
/// Trunk IDs to list. If this option is set, the response will contains trunks in the same order.
48184832
/// If any of the trunks is missing, a nil item in that position will be sent in the response.
48194833
#[prost(string, repeated, tag="1")]
@@ -4966,6 +4980,8 @@ pub struct SipDispatchRuleInfo {
49664980
#[allow(clippy::derive_partial_eq_without_eq)]
49674981
#[derive(Clone, PartialEq, ::prost::Message)]
49684982
pub struct ListSipDispatchRuleRequest {
4983+
#[prost(message, optional, tag="3")]
4984+
pub page: ::core::option::Option<Pagination>,
49694985
/// Rule IDs to list. If this option is set, the response will contains rules in the same order.
49704986
/// If any of the rules is missing, a nil item in that position will be sent in the response.
49714987
#[prost(string, repeated, tag="1")]

0 commit comments

Comments
 (0)