Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Oct 26, 2023
2 parents a3a4b82 + 7631712 commit 1223ac1
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-clocks-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Update protocol
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 132 files
155 changes: 140 additions & 15 deletions src/proto/livekit_models_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -411,11 +431,6 @@ export class Room extends Message<Room> {
*/
activeRecording = false;

/**
* @generated from field: livekit.PlayoutDelay playout_delay = 12;
*/
playoutDelay?: PlayoutDelay;

constructor(data?: PartialMessage<Room>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -435,7 +450,6 @@ export class Room extends Message<Room> {
{ 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<BinaryReadOptions>): Room {
Expand Down Expand Up @@ -1282,6 +1296,11 @@ export class UserPacket extends Message<UserPacket> {
*/
participantSid = "";

/**
* @generated from field: string participant_identity = 5;
*/
participantIdentity = "";

/**
* user defined payload
*
Expand All @@ -1290,12 +1309,19 @@ export class UserPacket extends Message<UserPacket> {
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
*
Expand All @@ -1312,8 +1338,10 @@ export class UserPacket extends Message<UserPacket> {
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 },
]);

Expand Down Expand Up @@ -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", [
Expand All @@ -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" },
]);

/**
Expand Down Expand Up @@ -1774,6 +1814,91 @@ export class DisabledCodecs extends Message<DisabledCodecs> {
}
}

/**
* @generated from message livekit.RTPDrift
*/
export class RTPDrift extends Message<RTPDrift> {
/**
* @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<RTPDrift>) {
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<BinaryReadOptions>): RTPDrift {
return new RTPDrift().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RTPDrift {
return new RTPDrift().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RTPDrift {
return new RTPDrift().fromJsonString(jsonString, options);
}

static equals(a: RTPDrift | PlainMessage<RTPDrift> | undefined, b: RTPDrift | PlainMessage<RTPDrift> | undefined): boolean {
return proto3.util.equals(RTPDrift, a, b);
}
}

/**
* @generated from message livekit.RTPStats
*/
Expand Down Expand Up @@ -1984,16 +2109,16 @@ export class RTPStats extends Message<RTPStats> {
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<RTPStats>) {
super();
Expand Down Expand Up @@ -2044,8 +2169,8 @@ export class RTPStats extends Message<RTPStats> {
{ 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<BinaryReadOptions>): RTPStats {
Expand Down
8 changes: 1 addition & 7 deletions src/proto/livekit_rtc_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -487,11 +487,6 @@ export class SimulcastCodec extends Message<SimulcastCodec> {
*/
cid = "";

/**
* @generated from field: bool enable_simulcast_layers = 3;
*/
enableSimulcastLayers = false;

constructor(data?: PartialMessage<SimulcastCodec>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -502,7 +497,6 @@ export class SimulcastCodec extends Message<SimulcastCodec> {
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<BinaryReadOptions>): SimulcastCodec {
Expand Down
2 changes: 0 additions & 2 deletions src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
try {
// TODO: react-native-webrtc doesn't have removeTrack yet.
if (publisher.canRemoveTrack()) {
console.log('removing track');
await publisher.removeTrack(sender);
}
} catch (e) {
Expand All @@ -268,7 +267,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
this.subscriber.close();
this.subscriber = undefined;
}

this.primaryTransport = undefined;

const dcCleanup = (dc: RTCDataChannel | undefined) => {
Expand Down
2 changes: 1 addition & 1 deletion src/room/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export enum RoomEvent {
* be emitted.
*
* args: (pub: [[RemoteTrackPublication]],
* status: [[TrackPublication.SubscriptionStatus]],
* status: [[TrackPublication.PermissionStatus]],
* participant: [[RemoteParticipant]])
*/
TrackSubscriptionPermissionChanged = 'trackSubscriptionPermissionChanged',
Expand Down
4 changes: 0 additions & 4 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -716,7 +714,6 @@ export default class LocalParticipant extends Participant {
new SimulcastCodec({
codec: opts.videoCodec,
cid: track.mediaStreamTrack.id,
enableSimulcastLayers: opts.simulcast ?? false,
}),
];
}
Expand Down Expand Up @@ -889,7 +886,6 @@ export default class LocalParticipant extends Participant {
{
codec: opts.videoCodec,
cid: simulcastTrack.mediaStreamTrack.id,
enableSimulcastLayers: opts.simulcast,
},
],
});
Expand Down

0 comments on commit 1223ac1

Please sign in to comment.