diff --git a/.changeset/plenty-jobs-pump.md b/.changeset/plenty-jobs-pump.md new file mode 100644 index 00000000..a16babe8 --- /dev/null +++ b/.changeset/plenty-jobs-pump.md @@ -0,0 +1,6 @@ +--- +"@livekit/protocol": patch +"github.com/livekit/protocol": patch +--- + +Option to control auto subscribe of data tracks. diff --git a/livekit/livekit_rtc.pb.go b/livekit/livekit_rtc.pb.go index b22f275d..15825729 100644 --- a/livekit/livekit_rtc.pb.go +++ b/livekit/livekit_rtc.pb.go @@ -4584,13 +4584,14 @@ func (x *TrackSubscribed) GetTrackSid() string { } type ConnectionSettings struct { - state protoimpl.MessageState `protogen:"open.v1"` - AutoSubscribe bool `protobuf:"varint,1,opt,name=auto_subscribe,json=autoSubscribe,proto3" json:"auto_subscribe,omitempty"` - AdaptiveStream bool `protobuf:"varint,2,opt,name=adaptive_stream,json=adaptiveStream,proto3" json:"adaptive_stream,omitempty"` - SubscriberAllowPause *bool `protobuf:"varint,3,opt,name=subscriber_allow_pause,json=subscriberAllowPause,proto3,oneof" json:"subscriber_allow_pause,omitempty"` - DisableIceLite bool `protobuf:"varint,4,opt,name=disable_ice_lite,json=disableIceLite,proto3" json:"disable_ice_lite,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AutoSubscribe bool `protobuf:"varint,1,opt,name=auto_subscribe,json=autoSubscribe,proto3" json:"auto_subscribe,omitempty"` + AdaptiveStream bool `protobuf:"varint,2,opt,name=adaptive_stream,json=adaptiveStream,proto3" json:"adaptive_stream,omitempty"` + SubscriberAllowPause *bool `protobuf:"varint,3,opt,name=subscriber_allow_pause,json=subscriberAllowPause,proto3,oneof" json:"subscriber_allow_pause,omitempty"` + DisableIceLite bool `protobuf:"varint,4,opt,name=disable_ice_lite,json=disableIceLite,proto3" json:"disable_ice_lite,omitempty"` + AutoSubscribeDataTrack *bool `protobuf:"varint,5,opt,name=auto_subscribe_data_track,json=autoSubscribeDataTrack,proto3,oneof" json:"auto_subscribe_data_track,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ConnectionSettings) Reset() { @@ -4651,6 +4652,13 @@ func (x *ConnectionSettings) GetDisableIceLite() bool { return false } +func (x *ConnectionSettings) GetAutoSubscribeDataTrack() bool { + if x != nil && x.AutoSubscribeDataTrack != nil { + return *x.AutoSubscribeDataTrack + } + return false +} + type JoinRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ClientInfo *ClientInfo `protobuf:"bytes,1,opt,name=client_info,json=clientInfo,proto3" json:"client_info,omitempty"` @@ -5341,13 +5349,15 @@ const file_livekit_rtc_proto_rawDesc = "" + "B\t\n" + "\arequest\".\n" + "\x0fTrackSubscribed\x12\x1b\n" + - "\ttrack_sid\x18\x01 \x01(\tR\btrackSid\"\xe4\x01\n" + + "\ttrack_sid\x18\x01 \x01(\tR\btrackSid\"\xc2\x02\n" + "\x12ConnectionSettings\x12%\n" + "\x0eauto_subscribe\x18\x01 \x01(\bR\rautoSubscribe\x12'\n" + "\x0fadaptive_stream\x18\x02 \x01(\bR\x0eadaptiveStream\x129\n" + "\x16subscriber_allow_pause\x18\x03 \x01(\bH\x00R\x14subscriberAllowPause\x88\x01\x01\x12(\n" + - "\x10disable_ice_lite\x18\x04 \x01(\bR\x0edisableIceLiteB\x19\n" + - "\x17_subscriber_allow_pause\"\xfd\x05\n" + + "\x10disable_ice_lite\x18\x04 \x01(\bR\x0edisableIceLite\x12>\n" + + "\x19auto_subscribe_data_track\x18\x05 \x01(\bH\x01R\x16autoSubscribeDataTrack\x88\x01\x01B\x19\n" + + "\x17_subscriber_allow_pauseB\x1c\n" + + "\x1a_auto_subscribe_data_track\"\xfd\x05\n" + "\vJoinRequest\x124\n" + "\vclient_info\x18\x01 \x01(\v2\x13.livekit.ClientInfoR\n" + "clientInfo\x12L\n" + diff --git a/protobufs/livekit_rtc.proto b/protobufs/livekit_rtc.proto index b510c91a..1e88cbe6 100644 --- a/protobufs/livekit_rtc.proto +++ b/protobufs/livekit_rtc.proto @@ -15,14 +15,14 @@ syntax = "proto3"; package livekit; -option go_package = "github.com/livekit/protocol/livekit"; -option csharp_namespace = "LiveKit.Proto"; -option ruby_package = "LiveKit::Proto"; import "livekit_models.proto"; - import "logger/options.proto"; +option csharp_namespace = "LiveKit.Proto"; +option go_package = "github.com/livekit/protocol/livekit"; +option ruby_package = "LiveKit::Proto"; + message SignalRequest { oneof message { // participant offer for publisher @@ -316,8 +316,6 @@ message UpdateTrackSettings { uint32 priority = 8; } - - message UpdateLocalAudioTrack { string track_sid = 1; repeated AudioTrackFeature features = 2; @@ -332,9 +330,9 @@ message UpdateLocalVideoTrack { message LeaveRequest { // indicates action clients should take on receiving this message enum Action { - DISCONNECT = 0; // should disconnect - RESUME = 1; // should attempt a resume with `reconnect=1` in join URL - RECONNECT = 2; // should attempt a reconnect, i. e. no `reconnect=1` + DISCONNECT = 0; // should disconnect + RESUME = 1; // should attempt a resume with `reconnect=1` in join URL + RECONNECT = 2; // should attempt a reconnect, i. e. no `reconnect=1` } // sent when server initiates the disconnect due to server-restart @@ -551,7 +549,7 @@ message RequestResponse { NOT_ALLOWED = 2; LIMIT_EXCEEDED = 3; QUEUED = 4; - UNSUPPORTED_TYPE= 5; + UNSUPPORTED_TYPE = 5; UNCLASSIFIED_ERROR = 6; INVALID_HANDLE = 7; INVALID_NAME = 8; @@ -583,6 +581,7 @@ message ConnectionSettings { bool adaptive_stream = 2; optional bool subscriber_allow_pause = 3; bool disable_ice_lite = 4; + optional bool auto_subscribe_data_track = 5; } message JoinRequest { @@ -618,7 +617,7 @@ message WrappedJoinRequest { } Compression compression = 1; - bytes join_request = 2; // marshalled JoinRequest + potentially compressed + bytes join_request = 2; // marshalled JoinRequest + potentially compressed } message MediaSectionsRequirement {