From 6bb1a9de680e05ac5cbaf37d82aa5a5a4681eb22 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Thu, 26 Oct 2023 09:46:43 +0200 Subject: [PATCH] Update protocol (#902) * update protocol * Create sixty-clocks-fail.md * fix another occurrence --- .changeset/sixty-clocks-fail.md | 5 + protocol | 2 +- src/proto/livekit_models_pb.ts | 155 ++++++++++++++++++++--- src/proto/livekit_rtc_pb.ts | 8 +- src/room/participant/LocalParticipant.ts | 4 - 5 files changed, 147 insertions(+), 27 deletions(-) create mode 100644 .changeset/sixty-clocks-fail.md diff --git a/.changeset/sixty-clocks-fail.md b/.changeset/sixty-clocks-fail.md new file mode 100644 index 0000000000..c5c310ddc5 --- /dev/null +++ b/.changeset/sixty-clocks-fail.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Update protocol diff --git a/protocol b/protocol index 9d0d6c9e94..07ca9d4e47 160000 --- a/protocol +++ b/protocol @@ -1 +1 @@ -Subproject commit 9d0d6c9e94279679f87056400030c2ce0e05d362 +Subproject commit 07ca9d4e47bda96cb1040ff629799d3344e8f458 diff --git a/src/proto/livekit_models_pb.ts b/src/proto/livekit_models_pb.ts index 76582bc87f..3790087c22 100644 --- a/src/proto/livekit_models_pb.ts +++ b/src/proto/livekit_models_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" // @generated from file livekit_models.proto (package livekit, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -84,6 +84,26 @@ proto3.util.setEnumType(VideoCodec, "livekit.VideoCodec", [ { no: 4, name: "VP8" }, ]); +/** + * @generated from enum livekit.ImageCodec + */ +export enum ImageCodec { + /** + * @generated from enum value: IC_DEFAULT = 0; + */ + IC_DEFAULT = 0, + + /** + * @generated from enum value: IC_JPEG = 1; + */ + IC_JPEG = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(ImageCodec) +proto3.util.setEnumType(ImageCodec, "livekit.ImageCodec", [ + { no: 0, name: "IC_DEFAULT" }, + { no: 1, name: "IC_JPEG" }, +]); + /** * @generated from enum livekit.TrackType */ @@ -411,11 +431,6 @@ export class Room extends Message { */ activeRecording = false; - /** - * @generated from field: livekit.PlayoutDelay playout_delay = 12; - */ - playoutDelay?: PlayoutDelay; - constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -435,7 +450,6 @@ export class Room extends Message { { no: 9, name: "num_participants", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 11, name: "num_publishers", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 10, name: "active_recording", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 12, name: "playout_delay", kind: "message", T: PlayoutDelay }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Room { @@ -1282,6 +1296,11 @@ export class UserPacket extends Message { */ participantSid = ""; + /** + * @generated from field: string participant_identity = 5; + */ + participantIdentity = ""; + /** * user defined payload * @@ -1290,12 +1309,19 @@ export class UserPacket extends Message { payload = new Uint8Array(0); /** - * the ID of the participants who will receive the message (the message will be sent to all the people in the room if this variable is empty) + * the ID of the participants who will receive the message (sent to all by default) * * @generated from field: repeated string destination_sids = 3; */ destinationSids: string[] = []; + /** + * identities of participants who will receive the message (sent to all by default) + * + * @generated from field: repeated string destination_identities = 6; + */ + destinationIdentities: string[] = []; + /** * topic under which the message was published * @@ -1312,8 +1338,10 @@ export class UserPacket extends Message { static readonly typeName = "livekit.UserPacket"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, { no: 3, name: "destination_sids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 4, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1613,6 +1641,16 @@ export enum ClientInfo_SDK { * @generated from enum value: RUST = 8; */ RUST = 8, + + /** + * @generated from enum value: PYTHON = 9; + */ + PYTHON = 9, + + /** + * @generated from enum value: CPP = 10; + */ + CPP = 10, } // Retrieve enum metadata with: proto3.getEnumType(ClientInfo_SDK) proto3.util.setEnumType(ClientInfo_SDK, "livekit.ClientInfo.SDK", [ @@ -1625,6 +1663,8 @@ proto3.util.setEnumType(ClientInfo_SDK, "livekit.ClientInfo.SDK", [ { no: 6, name: "UNITY" }, { no: 7, name: "REACT_NATIVE" }, { no: 8, name: "RUST" }, + { no: 9, name: "PYTHON" }, + { no: 10, name: "CPP" }, ]); /** @@ -1774,6 +1814,91 @@ export class DisabledCodecs extends Message { } } +/** + * @generated from message livekit.RTPDrift + */ +export class RTPDrift extends Message { + /** + * @generated from field: google.protobuf.Timestamp start_time = 1; + */ + startTime?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp end_time = 2; + */ + endTime?: Timestamp; + + /** + * @generated from field: double duration = 3; + */ + duration = 0; + + /** + * @generated from field: uint64 start_timestamp = 4; + */ + startTimestamp = protoInt64.zero; + + /** + * @generated from field: uint64 end_timestamp = 5; + */ + endTimestamp = protoInt64.zero; + + /** + * @generated from field: uint64 rtp_clock_ticks = 6; + */ + rtpClockTicks = protoInt64.zero; + + /** + * @generated from field: int64 drift_samples = 7; + */ + driftSamples = protoInt64.zero; + + /** + * @generated from field: double drift_ms = 8; + */ + driftMs = 0; + + /** + * @generated from field: double clock_rate = 9; + */ + clockRate = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.RTPDrift"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "start_time", kind: "message", T: Timestamp }, + { no: 2, name: "end_time", kind: "message", T: Timestamp }, + { no: 3, name: "duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 4, name: "start_timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 5, name: "end_timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 6, name: "rtp_clock_ticks", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 7, name: "drift_samples", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 8, name: "drift_ms", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 9, name: "clock_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RTPDrift { + return new RTPDrift().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RTPDrift { + return new RTPDrift().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RTPDrift { + return new RTPDrift().fromJsonString(jsonString, options); + } + + static equals(a: RTPDrift | PlainMessage | undefined, b: RTPDrift | PlainMessage | undefined): boolean { + return proto3.util.equals(RTPDrift, a, b); + } +} + /** * @generated from message livekit.RTPStats */ @@ -1984,16 +2109,16 @@ export class RTPStats extends Message { lastLayerLockPli?: Timestamp; /** - * @generated from field: double sample_rate = 42; + * @generated from field: livekit.RTPDrift packet_drift = 44; */ - sampleRate = 0; + packetDrift?: RTPDrift; /** - * NEXT_ID: 44 + * NEXT_ID: 46 * - * @generated from field: double drift_ms = 43; + * @generated from field: livekit.RTPDrift report_drift = 45; */ - driftMs = 0; + reportDrift?: RTPDrift; constructor(data?: PartialMessage) { super(); @@ -2044,8 +2169,8 @@ export class RTPStats extends Message { { no: 34, name: "last_key_frame", kind: "message", T: Timestamp }, { no: 35, name: "layer_lock_plis", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 36, name: "last_layer_lock_pli", kind: "message", T: Timestamp }, - { no: 42, name: "sample_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 43, name: "drift_ms", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 44, name: "packet_drift", kind: "message", T: RTPDrift }, + { no: 45, name: "report_drift", kind: "message", T: RTPDrift }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RTPStats { diff --git a/src/proto/livekit_rtc_pb.ts b/src/proto/livekit_rtc_pb.ts index 81522a4c00..b57a900b1e 100644 --- a/src/proto/livekit_rtc_pb.ts +++ b/src/proto/livekit_rtc_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" // @generated from file livekit_rtc.proto (package livekit, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -487,11 +487,6 @@ export class SimulcastCodec extends Message { */ cid = ""; - /** - * @generated from field: bool enable_simulcast_layers = 3; - */ - enableSimulcastLayers = false; - constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -502,7 +497,6 @@ export class SimulcastCodec extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "codec", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "cid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "enable_simulcast_layers", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SimulcastCodec { diff --git a/src/room/participant/LocalParticipant.ts b/src/room/participant/LocalParticipant.ts index 332fbf5912..c9f123b8c5 100644 --- a/src/room/participant/LocalParticipant.ts +++ b/src/room/participant/LocalParticipant.ts @@ -701,12 +701,10 @@ export default class LocalParticipant extends Participant { new SimulcastCodec({ codec: opts.videoCodec, cid: track.mediaStreamTrack.id, - enableSimulcastLayers: true, }), new SimulcastCodec({ codec: opts.backupCodec.codec, cid: '', - enableSimulcastLayers: true, }), ]; } else if (opts.videoCodec) { @@ -716,7 +714,6 @@ export default class LocalParticipant extends Participant { new SimulcastCodec({ codec: opts.videoCodec, cid: track.mediaStreamTrack.id, - enableSimulcastLayers: opts.simulcast ?? false, }), ]; } @@ -889,7 +886,6 @@ export default class LocalParticipant extends Participant { { codec: opts.videoCodec, cid: simulcastTrack.mediaStreamTrack.id, - enableSimulcastLayers: opts.simulcast, }, ], });