From 862d938ee9982d46b093f266133e82a464674ecd Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 25 Dec 2025 13:54:31 +0530 Subject: [PATCH] Store repair ssrc in TrackInfo for migration purposes. (#1348) * Store repair ssrc in TrackInfo for migration purposes. * generated protobuf * Create wild-suns-approve.md --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/wild-suns-approve.md | 6 +++ livekit/livekit_models.pb.go | 14 +++++- protobufs/livekit_models.proto | 89 ++++++++++++++++----------------- 3 files changed, 62 insertions(+), 47 deletions(-) create mode 100644 .changeset/wild-suns-approve.md diff --git a/.changeset/wild-suns-approve.md b/.changeset/wild-suns-approve.md new file mode 100644 index 00000000..4296750c --- /dev/null +++ b/.changeset/wild-suns-approve.md @@ -0,0 +1,6 @@ +--- +"@livekit/protocol": patch +"github.com/livekit/protocol": patch +--- + +Store repair ssrc in TrackInfo for migration purposes. diff --git a/livekit/livekit_models.pb.go b/livekit/livekit_models.pb.go index c8310cf3..c7ca8608 100644 --- a/livekit/livekit_models.pb.go +++ b/livekit/livekit_models.pb.go @@ -2571,6 +2571,7 @@ type VideoLayer struct { Ssrc uint32 `protobuf:"varint,5,opt,name=ssrc,proto3" json:"ssrc,omitempty"` SpatialLayer int32 `protobuf:"varint,6,opt,name=spatial_layer,json=spatialLayer,proto3" json:"spatial_layer,omitempty"` Rid string `protobuf:"bytes,7,opt,name=rid,proto3" json:"rid,omitempty"` + RepairSsrc uint32 `protobuf:"varint,8,opt,name=repair_ssrc,json=repairSsrc,proto3" json:"repair_ssrc,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2654,6 +2655,13 @@ func (x *VideoLayer) GetRid() string { return "" } +func (x *VideoLayer) GetRepairSsrc() uint32 { + if x != nil { + return x.RepairSsrc + } + return 0 +} + // new DataPacket API type DataPacket struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -6157,7 +6165,7 @@ const file_livekit_models_proto_rawDesc = "" + "\x1cDataTrackSubscriptionOptions\x12\"\n" + "\n" + "target_fps\x18\x01 \x01(\rH\x00R\ttargetFps\x88\x01\x01B\r\n" + - "\v_target_fps\"\xe9\x02\n" + + "\v_target_fps\"\x8a\x03\n" + "\n" + "VideoLayer\x12/\n" + "\aquality\x18\x01 \x01(\x0e2\x15.livekit.VideoQualityR\aquality\x12\x14\n" + @@ -6166,7 +6174,9 @@ const file_livekit_models_proto_rawDesc = "" + "\abitrate\x18\x04 \x01(\rR\abitrate\x12\x12\n" + "\x04ssrc\x18\x05 \x01(\rR\x04ssrc\x12#\n" + "\rspatial_layer\x18\x06 \x01(\x05R\fspatialLayer\x12\x10\n" + - "\x03rid\x18\a \x01(\tR\x03rid\"\x96\x01\n" + + "\x03rid\x18\a \x01(\tR\x03rid\x12\x1f\n" + + "\vrepair_ssrc\x18\b \x01(\rR\n" + + "repairSsrc\"\x96\x01\n" + "\x04Mode\x12\x0f\n" + "\vMODE_UNUSED\x10\x00\x12 \n" + "\x1cONE_SPATIAL_LAYER_PER_STREAM\x10\x01\x12&\n" + diff --git a/protobufs/livekit_models.proto b/protobufs/livekit_models.proto index dc7a7afd..e55d6396 100644 --- a/protobufs/livekit_models.proto +++ b/protobufs/livekit_models.proto @@ -15,18 +15,18 @@ syntax = "proto3"; package livekit; -option go_package = "github.com/livekit/protocol/livekit"; -option csharp_namespace = "LiveKit.Proto"; -option ruby_package = "LiveKit::Proto"; import "google/protobuf/timestamp.proto"; - import "livekit_metrics.proto"; import "logger/options.proto"; +option csharp_namespace = "LiveKit.Proto"; +option go_package = "github.com/livekit/protocol/livekit"; +option ruby_package = "LiveKit::Proto"; + message Pagination { string after_id = 1; // list entities which IDs are greater - int32 limit = 2; + int32 limit = 2; } message TokenPagination { @@ -118,12 +118,12 @@ message ParticipantPermission { bool hidden = 7; // indicates it's a recorder instance // deprecated: use ParticipantInfo.kind instead - bool recorder = 8 [deprecated=true]; + bool recorder = 8 [deprecated = true]; // indicates that participant can update own metadata and attributes bool can_update_metadata = 10; // indicates that participant is an agent // deprecated: use ParticipantInfo.kind instead - bool agent = 11 [deprecated=true]; + bool agent = 11 [deprecated = true]; // if a participant can subscribe to metrics bool can_subscribe_metrics = 12; @@ -213,9 +213,9 @@ enum TrackSource { message Encryption { enum Type { - NONE=0; - GCM=1; - CUSTOM=2; + NONE = 0; + GCM = 1; + CUSTOM = 2; } } @@ -245,15 +245,15 @@ message TrackInfo { // true if track is simulcasted bool simulcast = 7 [deprecated = true]; // see `video_layer_mode` in `codecs` // true if DTX (Discontinuous Transmission) is disabled for audio - bool disable_dtx = 8 [deprecated=true]; // deprecated in favor of `audio_features` + bool disable_dtx = 8 [deprecated = true]; // deprecated in favor of `audio_features` // source of media TrackSource source = 9; - repeated VideoLayer layers = 10 [deprecated=true]; // see `codecs` for layers of individual codec + repeated VideoLayer layers = 10 [deprecated = true]; // see `codecs` for layers of individual codec // mime type of codec string mime_type = 11; string mid = 12; repeated SimulcastCodecInfo codecs = 13; - bool stereo = 14 [deprecated=true]; // deprecated in favor of `audio_features` + bool stereo = 14 [deprecated = true]; // deprecated in favor of `audio_features` // true if RED (Redundant Encoding) is disabled for audio bool disable_red = 15; Encryption.Type encryption = 16; @@ -318,6 +318,8 @@ message VideoLayer { uint32 ssrc = 5; int32 spatial_layer = 6; string rid = 7; + + uint32 repair_ssrc = 8; } // new DataPacket API @@ -326,14 +328,14 @@ message DataPacket { RELIABLE = 0; LOSSY = 1; } - Kind kind = 1 [deprecated=true]; + Kind kind = 1 [deprecated = true]; // participant identity of user that sent the message string participant_identity = 4; // identities of participants who will receive the message (sent to all by default) repeated string destination_identities = 5; oneof value { UserPacket user = 2; - ActiveSpeakerUpdate speaker = 3 [deprecated=true]; + ActiveSpeakerUpdate speaker = 3 [deprecated = true]; SipDTMF sip_dtmf = 6; Transcription transcription = 7; MetricsBatch metrics = 8; @@ -376,7 +378,6 @@ message EncryptedPacketPayload { } } - message ActiveSpeakerUpdate { option deprecated = true; repeated SpeakerInfo speakers = 1; @@ -392,14 +393,14 @@ message SpeakerInfo { message UserPacket { // participant ID of user that sent the message - string participant_sid = 1 [deprecated=true]; - string participant_identity = 5 [deprecated=true]; + string participant_sid = 1 [deprecated = true]; + string participant_identity = 5 [deprecated = true]; // user defined payload bytes payload = 2; // the ID of the participants who will receive the message (sent to all by default) - repeated string destination_sids = 3 [deprecated=true]; + repeated string destination_sids = 3 [deprecated = true]; // identities of participants who will receive the message (sent to all by default) - repeated string destination_identities = 6 [deprecated=true]; + repeated string destination_identities = 6 [deprecated = true]; // topic under which the message was published optional string topic = 4; // Unique ID to identify the message @@ -503,21 +504,21 @@ message ServerInfo { // details about the client message ClientInfo { enum SDK { - UNKNOWN = 0; - JS = 1; - SWIFT = 2; - ANDROID = 3; - FLUTTER = 4; - GO = 5; - UNITY = 6; - REACT_NATIVE = 7; - RUST = 8; - PYTHON = 9; - CPP = 10; - UNITY_WEB = 11; - NODE = 12; - UNREAL = 13; - ESP32 = 14; + UNKNOWN = 0; + JS = 1; + SWIFT = 2; + ANDROID = 3; + FLUTTER = 4; + GO = 5; + UNITY = 6; + REACT_NATIVE = 7; + RUST = 8; + PYTHON = 9; + CPP = 10; + UNITY_WEB = 11; + NODE = 12; + UNREAL = 13; + ESP32 = 14; } SDK sdk = 1; @@ -749,7 +750,6 @@ enum AudioTrackFeature { } message DataStream { - // enum for operation types (specific to TextHeader) enum OperationType { CREATE = 0; @@ -761,11 +761,10 @@ message DataStream { // header properties specific to text streams message TextHeader { OperationType operation_type = 1; - int32 version = 2; // Optional: Version for updates/edits - string reply_to_stream_id = 3; // Optional: Reply to specific message + int32 version = 2; // Optional: Version for updates/edits + string reply_to_stream_id = 3; // Optional: Reply to specific message repeated string attached_stream_ids = 4; // file attachments for text streams bool generated = 5; // true if the text has been generated by an agent from a participant's audio transcription - } // header properties specific to byte or file streams @@ -776,12 +775,12 @@ message DataStream { // main DataStream.Header that contains a oneof for specific headers message Header { string stream_id = 1; // unique identifier for this data stream - int64 timestamp = 2; // using int64 for Unix timestamp + int64 timestamp = 2; // using int64 for Unix timestamp string topic = 3; 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 - Encryption.Type encryption_type = 7 [deprecated=true]; // this is set on the DataPacket - map attributes = 8; // user defined attributes map that can carry additional info + optional uint64 total_length = 5; // only populated for finite streams, if it's a stream of unknown size this stays empty + Encryption.Type encryption_type = 7 [deprecated = true]; // this is set on the DataPacket + map attributes = 8; // user defined attributes map that can carry additional info // oneof to choose between specific header types oneof content_header { @@ -791,11 +790,11 @@ message DataStream { } message Chunk { - string stream_id = 1; // unique identifier for this data stream to map it to the correct header + string stream_id = 1; // unique identifier for this data stream to map it to the correct header uint64 chunk_index = 2; bytes content = 3; // content as binary (bytes) int32 version = 4; // a version indicating that this chunk_index has been retroactively modified and the original one needs to be replaced - optional bytes iv = 5 [deprecated=true]; // this is set on the DataPacket + optional bytes iv = 5 [deprecated = true]; // this is set on the DataPacket } message Trailer {