diff --git a/.changeset/dull-trainers-obey.md b/.changeset/dull-trainers-obey.md new file mode 100644 index 000000000..ec4d1e8cc --- /dev/null +++ b/.changeset/dull-trainers-obey.md @@ -0,0 +1,6 @@ +--- +"@livekit/protocol": patch +"github.com/livekit/protocol": patch +--- + +Support per simulcast codec layers. diff --git a/livekit/livekit_rtc.pb.go b/livekit/livekit_rtc.pb.go index d776d79bb..7d8558657 100644 --- a/livekit/livekit_rtc.pb.go +++ b/livekit/livekit_rtc.pb.go @@ -1110,6 +1110,7 @@ type SimulcastCodec struct { state protoimpl.MessageState `protogen:"open.v1"` Codec string `protobuf:"bytes,1,opt,name=codec,proto3" json:"codec,omitempty"` Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` + Layers []*VideoLayer `protobuf:"bytes,4,rep,name=layers,proto3" json:"layers,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1158,6 +1159,13 @@ func (x *SimulcastCodec) GetCid() string { return "" } +func (x *SimulcastCodec) GetLayers() []*VideoLayer { + if x != nil { + return x.Layers + } + return nil +} + type AddTrackRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // client ID of track, to match it when RTC track is received @@ -4199,10 +4207,11 @@ const file_livekit_rtc_proto_rawDesc = "" + "\x10track_subscribed\x18\x17 \x01(\v2\x18.livekit.TrackSubscribedH\x00R\x0ftrackSubscribed\x12;\n" + "\n" + "room_moved\x18\x18 \x01(\v2\x1a.livekit.RoomMovedResponseH\x00R\troomMovedB\t\n" + - "\amessage\"8\n" + + "\amessage\"e\n" + "\x0eSimulcastCodec\x12\x14\n" + "\x05codec\x18\x01 \x01(\tR\x05codec\x12\x10\n" + - "\x03cid\x18\x02 \x01(\tR\x03cid\"\x97\x05\n" + + "\x03cid\x18\x02 \x01(\tR\x03cid\x12+\n" + + "\x06layers\x18\x04 \x03(\v2\x13.livekit.VideoLayerR\x06layers\"\x97\x05\n" + "\x0fAddTrackRequest\x12\x10\n" + "\x03cid\x18\x01 \x01(\tR\x03cid\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12&\n" + @@ -4537,9 +4546,9 @@ var file_livekit_rtc_proto_goTypes = []any{ (*WrappedJoinRequest)(nil), // 52: livekit.WrappedJoinRequest nil, // 53: livekit.UpdateParticipantMetadata.AttributesEntry nil, // 54: livekit.JoinRequest.ParticipantAttributesEntry - (TrackType)(0), // 55: livekit.TrackType - (TrackSource)(0), // 56: livekit.TrackSource - (*VideoLayer)(nil), // 57: livekit.VideoLayer + (*VideoLayer)(nil), // 55: livekit.VideoLayer + (TrackType)(0), // 56: livekit.TrackType + (TrackSource)(0), // 57: livekit.TrackSource (Encryption_Type)(0), // 58: livekit.Encryption.Type (BackupCodecPolicy)(0), // 59: livekit.BackupCodecPolicy (AudioTrackFeature)(0), // 60: livekit.AudioTrackFeature @@ -4596,72 +4605,73 @@ var file_livekit_rtc_proto_depIdxs = []int32{ 48, // 34: livekit.SignalResponse.request_response:type_name -> livekit.RequestResponse 49, // 35: livekit.SignalResponse.track_subscribed:type_name -> livekit.TrackSubscribed 38, // 36: livekit.SignalResponse.room_moved:type_name -> livekit.RoomMovedResponse - 55, // 37: livekit.AddTrackRequest.type:type_name -> livekit.TrackType - 56, // 38: livekit.AddTrackRequest.source:type_name -> livekit.TrackSource - 57, // 39: livekit.AddTrackRequest.layers:type_name -> livekit.VideoLayer - 8, // 40: livekit.AddTrackRequest.simulcast_codecs:type_name -> livekit.SimulcastCodec - 58, // 41: livekit.AddTrackRequest.encryption:type_name -> livekit.Encryption.Type - 59, // 42: livekit.AddTrackRequest.backup_codec_policy:type_name -> livekit.BackupCodecPolicy - 60, // 43: livekit.AddTrackRequest.audio_features:type_name -> livekit.AudioTrackFeature - 0, // 44: livekit.TrickleRequest.target:type_name -> livekit.SignalTarget - 61, // 45: livekit.JoinResponse.room:type_name -> livekit.Room - 62, // 46: livekit.JoinResponse.participant:type_name -> livekit.ParticipantInfo - 62, // 47: livekit.JoinResponse.other_participants:type_name -> livekit.ParticipantInfo - 25, // 48: livekit.JoinResponse.ice_servers:type_name -> livekit.ICEServer - 63, // 49: livekit.JoinResponse.client_configuration:type_name -> livekit.ClientConfiguration - 64, // 50: livekit.JoinResponse.server_info:type_name -> livekit.ServerInfo - 65, // 51: livekit.JoinResponse.enabled_publish_codecs:type_name -> livekit.Codec - 25, // 52: livekit.ReconnectResponse.ice_servers:type_name -> livekit.ICEServer - 63, // 53: livekit.ReconnectResponse.client_configuration:type_name -> livekit.ClientConfiguration - 64, // 54: livekit.ReconnectResponse.server_info:type_name -> livekit.ServerInfo - 66, // 55: livekit.TrackPublishedResponse.track:type_name -> livekit.TrackInfo - 62, // 56: livekit.ParticipantUpdate.participants:type_name -> livekit.ParticipantInfo - 67, // 57: livekit.UpdateSubscription.participant_tracks:type_name -> livekit.ParticipantTracks - 68, // 58: livekit.UpdateTrackSettings.quality:type_name -> livekit.VideoQuality - 60, // 59: livekit.UpdateLocalAudioTrack.features:type_name -> livekit.AudioTrackFeature - 69, // 60: livekit.LeaveRequest.reason:type_name -> livekit.DisconnectReason - 3, // 61: livekit.LeaveRequest.action:type_name -> livekit.LeaveRequest.Action - 45, // 62: livekit.LeaveRequest.regions:type_name -> livekit.RegionSettings - 57, // 63: livekit.UpdateVideoLayers.layers:type_name -> livekit.VideoLayer - 53, // 64: livekit.UpdateParticipantMetadata.attributes:type_name -> livekit.UpdateParticipantMetadata.AttributesEntry - 70, // 65: livekit.SpeakersChanged.speakers:type_name -> livekit.SpeakerInfo - 61, // 66: livekit.RoomUpdate.room:type_name -> livekit.Room - 71, // 67: livekit.ConnectionQualityInfo.quality:type_name -> livekit.ConnectionQuality - 28, // 68: livekit.ConnectionQualityUpdate.updates:type_name -> livekit.ConnectionQualityInfo - 1, // 69: livekit.StreamStateInfo.state:type_name -> livekit.StreamState - 30, // 70: livekit.StreamStateUpdate.stream_states:type_name -> livekit.StreamStateInfo - 68, // 71: livekit.SubscribedQuality.quality:type_name -> livekit.VideoQuality - 32, // 72: livekit.SubscribedCodec.qualities:type_name -> livekit.SubscribedQuality - 32, // 73: livekit.SubscribedQualityUpdate.subscribed_qualities:type_name -> livekit.SubscribedQuality - 33, // 74: livekit.SubscribedQualityUpdate.subscribed_codecs:type_name -> livekit.SubscribedCodec - 35, // 75: livekit.SubscriptionPermission.track_permissions:type_name -> livekit.TrackPermission - 61, // 76: livekit.RoomMovedResponse.room:type_name -> livekit.Room - 62, // 77: livekit.RoomMovedResponse.participant:type_name -> livekit.ParticipantInfo - 62, // 78: livekit.RoomMovedResponse.other_participants:type_name -> livekit.ParticipantInfo - 16, // 79: livekit.SyncState.answer:type_name -> livekit.SessionDescription - 18, // 80: livekit.SyncState.subscription:type_name -> livekit.UpdateSubscription - 14, // 81: livekit.SyncState.publish_tracks:type_name -> livekit.TrackPublishedResponse - 41, // 82: livekit.SyncState.data_channels:type_name -> livekit.DataChannelInfo - 16, // 83: livekit.SyncState.offer:type_name -> livekit.SessionDescription - 40, // 84: livekit.SyncState.datachannel_receive_states:type_name -> livekit.DataChannelReceiveState - 0, // 85: livekit.DataChannelInfo.target:type_name -> livekit.SignalTarget - 2, // 86: livekit.SimulateScenario.switch_candidate_protocol:type_name -> livekit.CandidateProtocol - 46, // 87: livekit.RegionSettings.regions:type_name -> livekit.RegionInfo - 72, // 88: livekit.SubscriptionResponse.err:type_name -> livekit.SubscriptionError - 4, // 89: livekit.RequestResponse.reason:type_name -> livekit.RequestResponse.Reason - 73, // 90: livekit.JoinRequest.client_info:type_name -> livekit.ClientInfo - 50, // 91: livekit.JoinRequest.connection_settings:type_name -> livekit.ConnectionSettings - 54, // 92: livekit.JoinRequest.participant_attributes:type_name -> livekit.JoinRequest.ParticipantAttributesEntry - 9, // 93: livekit.JoinRequest.add_track_requests:type_name -> livekit.AddTrackRequest - 16, // 94: livekit.JoinRequest.publisher_offer:type_name -> livekit.SessionDescription - 74, // 95: livekit.JoinRequest.reconnect_reason:type_name -> livekit.ReconnectReason - 39, // 96: livekit.JoinRequest.sync_state:type_name -> livekit.SyncState - 5, // 97: livekit.WrappedJoinRequest.compression:type_name -> livekit.WrappedJoinRequest.Compression - 98, // [98:98] is the sub-list for method output_type - 98, // [98:98] is the sub-list for method input_type - 98, // [98:98] is the sub-list for extension type_name - 98, // [98:98] is the sub-list for extension extendee - 0, // [0:98] is the sub-list for field type_name + 55, // 37: livekit.SimulcastCodec.layers:type_name -> livekit.VideoLayer + 56, // 38: livekit.AddTrackRequest.type:type_name -> livekit.TrackType + 57, // 39: livekit.AddTrackRequest.source:type_name -> livekit.TrackSource + 55, // 40: livekit.AddTrackRequest.layers:type_name -> livekit.VideoLayer + 8, // 41: livekit.AddTrackRequest.simulcast_codecs:type_name -> livekit.SimulcastCodec + 58, // 42: livekit.AddTrackRequest.encryption:type_name -> livekit.Encryption.Type + 59, // 43: livekit.AddTrackRequest.backup_codec_policy:type_name -> livekit.BackupCodecPolicy + 60, // 44: livekit.AddTrackRequest.audio_features:type_name -> livekit.AudioTrackFeature + 0, // 45: livekit.TrickleRequest.target:type_name -> livekit.SignalTarget + 61, // 46: livekit.JoinResponse.room:type_name -> livekit.Room + 62, // 47: livekit.JoinResponse.participant:type_name -> livekit.ParticipantInfo + 62, // 48: livekit.JoinResponse.other_participants:type_name -> livekit.ParticipantInfo + 25, // 49: livekit.JoinResponse.ice_servers:type_name -> livekit.ICEServer + 63, // 50: livekit.JoinResponse.client_configuration:type_name -> livekit.ClientConfiguration + 64, // 51: livekit.JoinResponse.server_info:type_name -> livekit.ServerInfo + 65, // 52: livekit.JoinResponse.enabled_publish_codecs:type_name -> livekit.Codec + 25, // 53: livekit.ReconnectResponse.ice_servers:type_name -> livekit.ICEServer + 63, // 54: livekit.ReconnectResponse.client_configuration:type_name -> livekit.ClientConfiguration + 64, // 55: livekit.ReconnectResponse.server_info:type_name -> livekit.ServerInfo + 66, // 56: livekit.TrackPublishedResponse.track:type_name -> livekit.TrackInfo + 62, // 57: livekit.ParticipantUpdate.participants:type_name -> livekit.ParticipantInfo + 67, // 58: livekit.UpdateSubscription.participant_tracks:type_name -> livekit.ParticipantTracks + 68, // 59: livekit.UpdateTrackSettings.quality:type_name -> livekit.VideoQuality + 60, // 60: livekit.UpdateLocalAudioTrack.features:type_name -> livekit.AudioTrackFeature + 69, // 61: livekit.LeaveRequest.reason:type_name -> livekit.DisconnectReason + 3, // 62: livekit.LeaveRequest.action:type_name -> livekit.LeaveRequest.Action + 45, // 63: livekit.LeaveRequest.regions:type_name -> livekit.RegionSettings + 55, // 64: livekit.UpdateVideoLayers.layers:type_name -> livekit.VideoLayer + 53, // 65: livekit.UpdateParticipantMetadata.attributes:type_name -> livekit.UpdateParticipantMetadata.AttributesEntry + 70, // 66: livekit.SpeakersChanged.speakers:type_name -> livekit.SpeakerInfo + 61, // 67: livekit.RoomUpdate.room:type_name -> livekit.Room + 71, // 68: livekit.ConnectionQualityInfo.quality:type_name -> livekit.ConnectionQuality + 28, // 69: livekit.ConnectionQualityUpdate.updates:type_name -> livekit.ConnectionQualityInfo + 1, // 70: livekit.StreamStateInfo.state:type_name -> livekit.StreamState + 30, // 71: livekit.StreamStateUpdate.stream_states:type_name -> livekit.StreamStateInfo + 68, // 72: livekit.SubscribedQuality.quality:type_name -> livekit.VideoQuality + 32, // 73: livekit.SubscribedCodec.qualities:type_name -> livekit.SubscribedQuality + 32, // 74: livekit.SubscribedQualityUpdate.subscribed_qualities:type_name -> livekit.SubscribedQuality + 33, // 75: livekit.SubscribedQualityUpdate.subscribed_codecs:type_name -> livekit.SubscribedCodec + 35, // 76: livekit.SubscriptionPermission.track_permissions:type_name -> livekit.TrackPermission + 61, // 77: livekit.RoomMovedResponse.room:type_name -> livekit.Room + 62, // 78: livekit.RoomMovedResponse.participant:type_name -> livekit.ParticipantInfo + 62, // 79: livekit.RoomMovedResponse.other_participants:type_name -> livekit.ParticipantInfo + 16, // 80: livekit.SyncState.answer:type_name -> livekit.SessionDescription + 18, // 81: livekit.SyncState.subscription:type_name -> livekit.UpdateSubscription + 14, // 82: livekit.SyncState.publish_tracks:type_name -> livekit.TrackPublishedResponse + 41, // 83: livekit.SyncState.data_channels:type_name -> livekit.DataChannelInfo + 16, // 84: livekit.SyncState.offer:type_name -> livekit.SessionDescription + 40, // 85: livekit.SyncState.datachannel_receive_states:type_name -> livekit.DataChannelReceiveState + 0, // 86: livekit.DataChannelInfo.target:type_name -> livekit.SignalTarget + 2, // 87: livekit.SimulateScenario.switch_candidate_protocol:type_name -> livekit.CandidateProtocol + 46, // 88: livekit.RegionSettings.regions:type_name -> livekit.RegionInfo + 72, // 89: livekit.SubscriptionResponse.err:type_name -> livekit.SubscriptionError + 4, // 90: livekit.RequestResponse.reason:type_name -> livekit.RequestResponse.Reason + 73, // 91: livekit.JoinRequest.client_info:type_name -> livekit.ClientInfo + 50, // 92: livekit.JoinRequest.connection_settings:type_name -> livekit.ConnectionSettings + 54, // 93: livekit.JoinRequest.participant_attributes:type_name -> livekit.JoinRequest.ParticipantAttributesEntry + 9, // 94: livekit.JoinRequest.add_track_requests:type_name -> livekit.AddTrackRequest + 16, // 95: livekit.JoinRequest.publisher_offer:type_name -> livekit.SessionDescription + 74, // 96: livekit.JoinRequest.reconnect_reason:type_name -> livekit.ReconnectReason + 39, // 97: livekit.JoinRequest.sync_state:type_name -> livekit.SyncState + 5, // 98: livekit.WrappedJoinRequest.compression:type_name -> livekit.WrappedJoinRequest.Compression + 99, // [99:99] is the sub-list for method output_type + 99, // [99:99] is the sub-list for method input_type + 99, // [99:99] is the sub-list for extension type_name + 99, // [99:99] is the sub-list for extension extendee + 0, // [0:99] is the sub-list for field type_name } func init() { file_livekit_rtc_proto_init() } diff --git a/protobufs/livekit_rtc.proto b/protobufs/livekit_rtc.proto index 7602f16b6..5ab8e6cc8 100644 --- a/protobufs/livekit_rtc.proto +++ b/protobufs/livekit_rtc.proto @@ -118,8 +118,9 @@ enum SignalTarget { message SimulcastCodec { string codec = 1; string cid = 2; + repeated VideoLayer layers = 4; - // NEXT-ID: 4 + // NEXT-ID: 5 } message AddTrackRequest {