diff --git a/Sources/LiveKit/Protos/livekit_metrics.pb.swift b/Sources/LiveKit/Protos/livekit_metrics.pb.swift index b9f453398..d384b603f 100644 --- a/Sources/LiveKit/Protos/livekit_metrics.pb.swift +++ b/Sources/LiveKit/Protos/livekit_metrics.pb.swift @@ -20,7 +20,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } -/// index from [0; 512] are for predefined labels (`MetricLabel`) +/// index from [0: MAX_LABEL_PREDEFINED_MAX_VALUE) are for predefined labels (`MetricLabel`) enum Livekit_MetricLabel: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int @@ -32,7 +32,49 @@ enum Livekit_MetricLabel: SwiftProtobuf.Enum, Swift.CaseIterable { /// time to first byte case agentsTtsTtfb // = 2 - case maxValue // = 512 + + /// Number of video freezes + case clientVideoSubscriberFreezeCount // = 3 + + /// total duration of freezes + case clientVideoSubscriberTotalFreezeDuration // = 4 + + /// number of video pauses + case clientVideoSubscriberPauseCount // = 5 + + /// total duration of pauses + case clientVideoSubscriberTotalPausesDuration // = 6 + + /// number of concealed (synthesized) audio samples + case clientAudioSubscriberConcealedSamples // = 7 + + /// number of silent concealed samples + case clientAudioSubscriberSilentConcealedSamples // = 8 + + /// number of concealment events + case clientAudioSubscriberConcealmentEvents // = 9 + + /// number of interruptions + case clientAudioSubscriberInterruptionCount // = 10 + + /// total duration of interruptions + case clientAudioSubscriberTotalInterruptionDuration // = 11 + + /// total time spent in jitter buffer + case clientSubscriberJitterBufferDelay // = 12 + + /// total time spent in jitter buffer + case clientSubscriberJitterBufferEmittedCount // = 13 + + /// total duration spent in bandwidth quality limitation + case clientVideoPublisherQualityLimitationDurationBandwidth // = 14 + + /// total duration spent in cpu quality limitation + case clientVideoPublisherQualityLimitationDurationCpu // = 15 + + /// total duration spent in other quality limitation + case clientVideoPublisherQualityLimitationDurationOther // = 16 + case predefinedMaxValue // = 4096 case UNRECOGNIZED(Int) init() { @@ -44,7 +86,21 @@ enum Livekit_MetricLabel: SwiftProtobuf.Enum, Swift.CaseIterable { case 0: self = .agentsLlmTtft case 1: self = .agentsSttTtft case 2: self = .agentsTtsTtfb - case 512: self = .maxValue + case 3: self = .clientVideoSubscriberFreezeCount + case 4: self = .clientVideoSubscriberTotalFreezeDuration + case 5: self = .clientVideoSubscriberPauseCount + case 6: self = .clientVideoSubscriberTotalPausesDuration + case 7: self = .clientAudioSubscriberConcealedSamples + case 8: self = .clientAudioSubscriberSilentConcealedSamples + case 9: self = .clientAudioSubscriberConcealmentEvents + case 10: self = .clientAudioSubscriberInterruptionCount + case 11: self = .clientAudioSubscriberTotalInterruptionDuration + case 12: self = .clientSubscriberJitterBufferDelay + case 13: self = .clientSubscriberJitterBufferEmittedCount + case 14: self = .clientVideoPublisherQualityLimitationDurationBandwidth + case 15: self = .clientVideoPublisherQualityLimitationDurationCpu + case 16: self = .clientVideoPublisherQualityLimitationDurationOther + case 4096: self = .predefinedMaxValue default: self = .UNRECOGNIZED(rawValue) } } @@ -54,7 +110,21 @@ enum Livekit_MetricLabel: SwiftProtobuf.Enum, Swift.CaseIterable { case .agentsLlmTtft: return 0 case .agentsSttTtft: return 1 case .agentsTtsTtfb: return 2 - case .maxValue: return 512 + case .clientVideoSubscriberFreezeCount: return 3 + case .clientVideoSubscriberTotalFreezeDuration: return 4 + case .clientVideoSubscriberPauseCount: return 5 + case .clientVideoSubscriberTotalPausesDuration: return 6 + case .clientAudioSubscriberConcealedSamples: return 7 + case .clientAudioSubscriberSilentConcealedSamples: return 8 + case .clientAudioSubscriberConcealmentEvents: return 9 + case .clientAudioSubscriberInterruptionCount: return 10 + case .clientAudioSubscriberTotalInterruptionDuration: return 11 + case .clientSubscriberJitterBufferDelay: return 12 + case .clientSubscriberJitterBufferEmittedCount: return 13 + case .clientVideoPublisherQualityLimitationDurationBandwidth: return 14 + case .clientVideoPublisherQualityLimitationDurationCpu: return 15 + case .clientVideoPublisherQualityLimitationDurationOther: return 16 + case .predefinedMaxValue: return 4096 case .UNRECOGNIZED(let i): return i } } @@ -64,7 +134,21 @@ enum Livekit_MetricLabel: SwiftProtobuf.Enum, Swift.CaseIterable { .agentsLlmTtft, .agentsSttTtft, .agentsTtsTtfb, - .maxValue, + .clientVideoSubscriberFreezeCount, + .clientVideoSubscriberTotalFreezeDuration, + .clientVideoSubscriberPauseCount, + .clientVideoSubscriberTotalPausesDuration, + .clientAudioSubscriberConcealedSamples, + .clientAudioSubscriberSilentConcealedSamples, + .clientAudioSubscriberConcealmentEvents, + .clientAudioSubscriberInterruptionCount, + .clientAudioSubscriberTotalInterruptionDuration, + .clientSubscriberJitterBufferDelay, + .clientSubscriberJitterBufferEmittedCount, + .clientVideoPublisherQualityLimitationDurationBandwidth, + .clientVideoPublisherQualityLimitationDurationCpu, + .clientVideoPublisherQualityLimitationDurationOther, + .predefinedMaxValue, ] } @@ -74,10 +158,24 @@ struct Livekit_MetricsBatch: Sendable { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// time at which this batch is sent based on a monotonic clock (millisecond resolution) + var timestampMs: Int64 = 0 + + var normalizedTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _normalizedTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_normalizedTimestamp = newValue} + } + /// Returns true if `normalizedTimestamp` has been explicitly set. + var hasNormalizedTimestamp: Bool {return self._normalizedTimestamp != nil} + /// Clears the value of `normalizedTimestamp`. Subsequent reads from it will return its default value. + mutating func clearNormalizedTimestamp() {self._normalizedTimestamp = nil} + /// To avoid repeating string values, we store them in a separate list and reference them by index /// This is useful for storing participant identities, track names, etc. /// There is also a predefined list of labels that can be used to reference common metrics. - /// They have reserved indices from 0 to 512 + /// They have reserved indices from 0 to (METRIC_LABEL_PREDEFINED_MAX_VALUE - 1). + /// Indexes pointing at str_data should start from METRIC_LABEL_PREDEFINED_MAX_VALUE, + /// such that str_data[0] == index of METRIC_LABEL_PREDEFINED_MAX_VALUE. var strData: [String] = [] var timeSeries: [Livekit_TimeSeriesMetric] = [] @@ -87,6 +185,8 @@ struct Livekit_MetricsBatch: Sendable { var unknownFields = SwiftProtobuf.UnknownStorage() init() {} + + fileprivate var _normalizedTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil } struct Livekit_TimeSeriesMetric: Sendable { @@ -98,18 +198,17 @@ struct Livekit_TimeSeriesMetric: Sendable { /// in the `str_data` field of `MetricsBatch` var label: UInt32 = 0 + /// index into `str_data` var participantIdentity: UInt32 = 0 + /// index into `str_data` var trackSid: UInt32 = 0 - /// samples - var startTimestamp: Int64 = 0 - - var endTimestamp: Int64 = 0 - - /// list of samples between start_timestamp and end_timestamp var samples: [Livekit_MetricSample] = [] + /// index into 'str_data' + var rid: UInt32 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -120,13 +219,25 @@ struct Livekit_MetricSample: Sendable { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var timestamp: Int64 = 0 + /// time of metric based on a monotonic clock (in milliseconds) + var timestampMs: Int64 = 0 + + var normalizedTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _normalizedTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_normalizedTimestamp = newValue} + } + /// Returns true if `normalizedTimestamp` has been explicitly set. + var hasNormalizedTimestamp: Bool {return self._normalizedTimestamp != nil} + /// Clears the value of `normalizedTimestamp`. Subsequent reads from it will return its default value. + mutating func clearNormalizedTimestamp() {self._normalizedTimestamp = nil} var value: Float = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} + + fileprivate var _normalizedTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil } struct Livekit_EventMetric: Sendable { @@ -136,29 +247,55 @@ struct Livekit_EventMetric: Sendable { var label: UInt32 = 0 + /// index into `str_data` var participantIdentity: UInt32 = 0 - /// 0 = + /// index into `str_data` var trackSid: UInt32 = 0 - var startTimestamp: Int64 = 0 + /// start time of event based on a monotonic clock (in milliseconds) + var startTimestampMs: Int64 = 0 - var endTimestamp: Int64 { - get {return _endTimestamp ?? 0} - set {_endTimestamp = newValue} + /// end time of event based on a monotonic clock (in milliseconds), if needed + var endTimestampMs: Int64 { + get {return _endTimestampMs ?? 0} + set {_endTimestampMs = newValue} + } + /// Returns true if `endTimestampMs` has been explicitly set. + var hasEndTimestampMs: Bool {return self._endTimestampMs != nil} + /// Clears the value of `endTimestampMs`. Subsequent reads from it will return its default value. + mutating func clearEndTimestampMs() {self._endTimestampMs = nil} + + var normalizedStartTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _normalizedStartTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_normalizedStartTimestamp = newValue} } - /// Returns true if `endTimestamp` has been explicitly set. - var hasEndTimestamp: Bool {return self._endTimestamp != nil} - /// Clears the value of `endTimestamp`. Subsequent reads from it will return its default value. - mutating func clearEndTimestamp() {self._endTimestamp = nil} + /// Returns true if `normalizedStartTimestamp` has been explicitly set. + var hasNormalizedStartTimestamp: Bool {return self._normalizedStartTimestamp != nil} + /// Clears the value of `normalizedStartTimestamp`. Subsequent reads from it will return its default value. + mutating func clearNormalizedStartTimestamp() {self._normalizedStartTimestamp = nil} + + var normalizedEndTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _normalizedEndTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_normalizedEndTimestamp = newValue} + } + /// Returns true if `normalizedEndTimestamp` has been explicitly set. + var hasNormalizedEndTimestamp: Bool {return self._normalizedEndTimestamp != nil} + /// Clears the value of `normalizedEndTimestamp`. Subsequent reads from it will return its default value. + mutating func clearNormalizedEndTimestamp() {self._normalizedEndTimestamp = nil} var metadata: String = String() + /// index into 'str_data' + var rid: UInt32 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - fileprivate var _endTimestamp: Int64? = nil + fileprivate var _endTimestampMs: Int64? = nil + fileprivate var _normalizedStartTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil + fileprivate var _normalizedEndTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil } // MARK: - Code below here is support for the SwiftProtobuf runtime. @@ -170,16 +307,32 @@ extension Livekit_MetricLabel: SwiftProtobuf._ProtoNameProviding { 0: .same(proto: "AGENTS_LLM_TTFT"), 1: .same(proto: "AGENTS_STT_TTFT"), 2: .same(proto: "AGENTS_TTS_TTFB"), - 512: .same(proto: "METRIC_LABEL_MAX_VALUE"), + 3: .same(proto: "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT"), + 4: .same(proto: "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION"), + 5: .same(proto: "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT"), + 6: .same(proto: "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION"), + 7: .same(proto: "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES"), + 8: .same(proto: "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES"), + 9: .same(proto: "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS"), + 10: .same(proto: "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT"), + 11: .same(proto: "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION"), + 12: .same(proto: "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY"), + 13: .same(proto: "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT"), + 14: .same(proto: "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH"), + 15: .same(proto: "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU"), + 16: .same(proto: "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER"), + 4096: .same(proto: "METRIC_LABEL_PREDEFINED_MAX_VALUE"), ] } extension Livekit_MetricsBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MetricsBatch" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "str_data"), - 2: .standard(proto: "time_series"), - 3: .same(proto: "events"), + 1: .standard(proto: "timestamp_ms"), + 2: .standard(proto: "normalized_timestamp"), + 3: .standard(proto: "str_data"), + 4: .standard(proto: "time_series"), + 5: .same(proto: "events"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -188,28 +341,42 @@ extension Livekit_MetricsBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.strData) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.timeSeries) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.events) }() + case 1: try { try decoder.decodeSingularInt64Field(value: &self.timestampMs) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._normalizedTimestamp) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.strData) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.timeSeries) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.events) }() default: break } } } func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.timestampMs != 0 { + try visitor.visitSingularInt64Field(value: self.timestampMs, fieldNumber: 1) + } + try { if let v = self._normalizedTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() if !self.strData.isEmpty { - try visitor.visitRepeatedStringField(value: self.strData, fieldNumber: 1) + try visitor.visitRepeatedStringField(value: self.strData, fieldNumber: 3) } if !self.timeSeries.isEmpty { - try visitor.visitRepeatedMessageField(value: self.timeSeries, fieldNumber: 2) + try visitor.visitRepeatedMessageField(value: self.timeSeries, fieldNumber: 4) } if !self.events.isEmpty { - try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 3) + try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Livekit_MetricsBatch, rhs: Livekit_MetricsBatch) -> Bool { + if lhs.timestampMs != rhs.timestampMs {return false} + if lhs._normalizedTimestamp != rhs._normalizedTimestamp {return false} if lhs.strData != rhs.strData {return false} if lhs.timeSeries != rhs.timeSeries {return false} if lhs.events != rhs.events {return false} @@ -224,9 +391,8 @@ extension Livekit_TimeSeriesMetric: SwiftProtobuf.Message, SwiftProtobuf._Messag 1: .same(proto: "label"), 2: .standard(proto: "participant_identity"), 3: .standard(proto: "track_sid"), - 4: .standard(proto: "start_timestamp"), - 5: .standard(proto: "end_timestamp"), - 6: .same(proto: "samples"), + 4: .same(proto: "samples"), + 5: .same(proto: "rid"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -238,9 +404,8 @@ extension Livekit_TimeSeriesMetric: SwiftProtobuf.Message, SwiftProtobuf._Messag case 1: try { try decoder.decodeSingularUInt32Field(value: &self.label) }() case 2: try { try decoder.decodeSingularUInt32Field(value: &self.participantIdentity) }() case 3: try { try decoder.decodeSingularUInt32Field(value: &self.trackSid) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.startTimestamp) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self.endTimestamp) }() - case 6: try { try decoder.decodeRepeatedMessageField(value: &self.samples) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.samples) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &self.rid) }() default: break } } @@ -256,14 +421,11 @@ extension Livekit_TimeSeriesMetric: SwiftProtobuf.Message, SwiftProtobuf._Messag if self.trackSid != 0 { try visitor.visitSingularUInt32Field(value: self.trackSid, fieldNumber: 3) } - if self.startTimestamp != 0 { - try visitor.visitSingularInt64Field(value: self.startTimestamp, fieldNumber: 4) - } - if self.endTimestamp != 0 { - try visitor.visitSingularInt64Field(value: self.endTimestamp, fieldNumber: 5) - } if !self.samples.isEmpty { - try visitor.visitRepeatedMessageField(value: self.samples, fieldNumber: 6) + try visitor.visitRepeatedMessageField(value: self.samples, fieldNumber: 4) + } + if self.rid != 0 { + try visitor.visitSingularUInt32Field(value: self.rid, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } @@ -272,9 +434,8 @@ extension Livekit_TimeSeriesMetric: SwiftProtobuf.Message, SwiftProtobuf._Messag if lhs.label != rhs.label {return false} if lhs.participantIdentity != rhs.participantIdentity {return false} if lhs.trackSid != rhs.trackSid {return false} - if lhs.startTimestamp != rhs.startTimestamp {return false} - if lhs.endTimestamp != rhs.endTimestamp {return false} if lhs.samples != rhs.samples {return false} + if lhs.rid != rhs.rid {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -283,8 +444,9 @@ extension Livekit_TimeSeriesMetric: SwiftProtobuf.Message, SwiftProtobuf._Messag extension Livekit_MetricSample: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MetricSample" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "timestamp"), - 2: .same(proto: "value"), + 1: .standard(proto: "timestamp_ms"), + 2: .standard(proto: "normalized_timestamp"), + 3: .same(proto: "value"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -293,25 +455,34 @@ extension Livekit_MetricSample: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.value) }() + case 1: try { try decoder.decodeSingularInt64Field(value: &self.timestampMs) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._normalizedTimestamp) }() + case 3: try { try decoder.decodeSingularFloatField(value: &self.value) }() default: break } } } func traverse(visitor: inout V) throws { - if self.timestamp != 0 { - try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 1) + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.timestampMs != 0 { + try visitor.visitSingularInt64Field(value: self.timestampMs, fieldNumber: 1) } + try { if let v = self._normalizedTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() if self.value.bitPattern != 0 { - try visitor.visitSingularFloatField(value: self.value, fieldNumber: 2) + try visitor.visitSingularFloatField(value: self.value, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Livekit_MetricSample, rhs: Livekit_MetricSample) -> Bool { - if lhs.timestamp != rhs.timestamp {return false} + if lhs.timestampMs != rhs.timestampMs {return false} + if lhs._normalizedTimestamp != rhs._normalizedTimestamp {return false} if lhs.value != rhs.value {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true @@ -324,9 +495,12 @@ extension Livekit_EventMetric: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl 1: .same(proto: "label"), 2: .standard(proto: "participant_identity"), 3: .standard(proto: "track_sid"), - 4: .standard(proto: "start_timestamp"), - 5: .standard(proto: "end_timestamp"), - 6: .same(proto: "metadata"), + 4: .standard(proto: "start_timestamp_ms"), + 5: .standard(proto: "end_timestamp_ms"), + 6: .standard(proto: "normalized_start_timestamp"), + 7: .standard(proto: "normalized_end_timestamp"), + 8: .same(proto: "metadata"), + 9: .same(proto: "rid"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -338,9 +512,12 @@ extension Livekit_EventMetric: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl case 1: try { try decoder.decodeSingularUInt32Field(value: &self.label) }() case 2: try { try decoder.decodeSingularUInt32Field(value: &self.participantIdentity) }() case 3: try { try decoder.decodeSingularUInt32Field(value: &self.trackSid) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.startTimestamp) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self._endTimestamp) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.metadata) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.startTimestampMs) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self._endTimestampMs) }() + case 6: try { try decoder.decodeSingularMessageField(value: &self._normalizedStartTimestamp) }() + case 7: try { try decoder.decodeSingularMessageField(value: &self._normalizedEndTimestamp) }() + case 8: try { try decoder.decodeSingularStringField(value: &self.metadata) }() + case 9: try { try decoder.decodeSingularUInt32Field(value: &self.rid) }() default: break } } @@ -360,14 +537,23 @@ extension Livekit_EventMetric: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl if self.trackSid != 0 { try visitor.visitSingularUInt32Field(value: self.trackSid, fieldNumber: 3) } - if self.startTimestamp != 0 { - try visitor.visitSingularInt64Field(value: self.startTimestamp, fieldNumber: 4) + if self.startTimestampMs != 0 { + try visitor.visitSingularInt64Field(value: self.startTimestampMs, fieldNumber: 4) } - try { if let v = self._endTimestamp { + try { if let v = self._endTimestampMs { try visitor.visitSingularInt64Field(value: v, fieldNumber: 5) } }() + try { if let v = self._normalizedStartTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try { if let v = self._normalizedEndTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() if !self.metadata.isEmpty { - try visitor.visitSingularStringField(value: self.metadata, fieldNumber: 6) + try visitor.visitSingularStringField(value: self.metadata, fieldNumber: 8) + } + if self.rid != 0 { + try visitor.visitSingularUInt32Field(value: self.rid, fieldNumber: 9) } try unknownFields.traverse(visitor: &visitor) } @@ -376,9 +562,12 @@ extension Livekit_EventMetric: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl if lhs.label != rhs.label {return false} if lhs.participantIdentity != rhs.participantIdentity {return false} if lhs.trackSid != rhs.trackSid {return false} - if lhs.startTimestamp != rhs.startTimestamp {return false} - if lhs._endTimestamp != rhs._endTimestamp {return false} + if lhs.startTimestampMs != rhs.startTimestampMs {return false} + if lhs._endTimestampMs != rhs._endTimestampMs {return false} + if lhs._normalizedStartTimestamp != rhs._normalizedStartTimestamp {return false} + if lhs._normalizedEndTimestamp != rhs._normalizedEndTimestamp {return false} if lhs.metadata != rhs.metadata {return false} + if lhs.rid != rhs.rid {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Sources/LiveKit/Protos/livekit_models.pb.swift b/Sources/LiveKit/Protos/livekit_models.pb.swift index 3f9fcb451..f6997c43b 100644 --- a/Sources/LiveKit/Protos/livekit_models.pb.swift +++ b/Sources/LiveKit/Protos/livekit_models.pb.swift @@ -1162,6 +1162,38 @@ struct Livekit_DataPacket: Sendable { set {value = .metrics(newValue)} } + var chatMessage: Livekit_ChatMessage { + get { + if case .chatMessage(let v)? = value {return v} + return Livekit_ChatMessage() + } + set {value = .chatMessage(newValue)} + } + + var rpcRequest: Livekit_RpcRequest { + get { + if case .rpcRequest(let v)? = value {return v} + return Livekit_RpcRequest() + } + set {value = .rpcRequest(newValue)} + } + + var rpcAck: Livekit_RpcAck { + get { + if case .rpcAck(let v)? = value {return v} + return Livekit_RpcAck() + } + set {value = .rpcAck(newValue)} + } + + var rpcResponse: Livekit_RpcResponse { + get { + if case .rpcResponse(let v)? = value {return v} + return Livekit_RpcResponse() + } + set {value = .rpcResponse(newValue)} + } + var unknownFields = SwiftProtobuf.UnknownStorage() enum OneOf_Value: Equatable, Sendable { @@ -1171,6 +1203,10 @@ struct Livekit_DataPacket: Sendable { case sipDtmf(Livekit_SipDTMF) case transcription(Livekit_Transcription) case metrics(Livekit_MetricsBatch) + case chatMessage(Livekit_ChatMessage) + case rpcRequest(Livekit_RpcRequest) + case rpcAck(Livekit_RpcAck) + case rpcResponse(Livekit_RpcResponse) } @@ -1369,6 +1405,125 @@ struct Livekit_TranscriptionSegment: Sendable { init() {} } +struct Livekit_ChatMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// uuid + var id: String = String() + + var timestamp: Int64 = 0 + + /// populated only if the intent is to edit/update an existing message + var editTimestamp: Int64 { + get {return _editTimestamp ?? 0} + set {_editTimestamp = newValue} + } + /// Returns true if `editTimestamp` has been explicitly set. + var hasEditTimestamp: Bool {return self._editTimestamp != nil} + /// Clears the value of `editTimestamp`. Subsequent reads from it will return its default value. + mutating func clearEditTimestamp() {self._editTimestamp = nil} + + var message: String = String() + + /// true to remove message + var deleted: Bool = false + + /// true if the chat message has been generated by an agent from a participant's audio transcription + var generated: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _editTimestamp: Int64? = nil +} + +struct Livekit_RpcRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var id: String = String() + + var method: String = String() + + var payload: String = String() + + var responseTimeoutMs: UInt32 = 0 + + var version: UInt32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Livekit_RpcAck: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var requestID: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Livekit_RpcResponse: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var requestID: String = String() + + var value: Livekit_RpcResponse.OneOf_Value? = nil + + var payload: String { + get { + if case .payload(let v)? = value {return v} + return String() + } + set {value = .payload(newValue)} + } + + var error: Livekit_RpcError { + get { + if case .error(let v)? = value {return v} + return Livekit_RpcError() + } + set {value = .error(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Value: Equatable, Sendable { + case payload(String) + case error(Livekit_RpcError) + + } + + init() {} +} + +struct Livekit_RpcError: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var code: UInt32 = 0 + + var message: String = String() + + var data: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + struct Livekit_ParticipantTracks: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1471,6 +1626,10 @@ struct Livekit_ClientInfo: Sendable { /// wifi, wired, cellular, vpn, empty if not known var network: String = String() + /// comma separated list of additional LiveKit SDKs in use of this client, with versions + /// e.g. "components-js:1.2.3,track-processors-js:1.2.3" + var otherSdks: String = String() + var unknownFields = SwiftProtobuf.UnknownStorage() enum SDK: SwiftProtobuf.Enum, Swift.CaseIterable { @@ -1916,16 +2075,15 @@ struct Livekit_RTPStats: @unchecked Sendable { /// Clears the value of `packetDrift`. Subsequent reads from it will return its default value. mutating func clearPacketDrift() {_uniqueStorage()._packetDrift = nil} - var reportDrift: Livekit_RTPDrift { - get {return _storage._reportDrift ?? Livekit_RTPDrift()} - set {_uniqueStorage()._reportDrift = newValue} + var ntpReportDrift: Livekit_RTPDrift { + get {return _storage._ntpReportDrift ?? Livekit_RTPDrift()} + set {_uniqueStorage()._ntpReportDrift = newValue} } - /// Returns true if `reportDrift` has been explicitly set. - var hasReportDrift: Bool {return _storage._reportDrift != nil} - /// Clears the value of `reportDrift`. Subsequent reads from it will return its default value. - mutating func clearReportDrift() {_uniqueStorage()._reportDrift = nil} + /// Returns true if `ntpReportDrift` has been explicitly set. + var hasNtpReportDrift: Bool {return _storage._ntpReportDrift != nil} + /// Clears the value of `ntpReportDrift`. Subsequent reads from it will return its default value. + mutating func clearNtpReportDrift() {_uniqueStorage()._ntpReportDrift = nil} - /// NEXT_ID: 47 var rebasedReportDrift: Livekit_RTPDrift { get {return _storage._rebasedReportDrift ?? Livekit_RTPDrift()} set {_uniqueStorage()._rebasedReportDrift = newValue} @@ -1935,6 +2093,16 @@ struct Livekit_RTPStats: @unchecked Sendable { /// Clears the value of `rebasedReportDrift`. Subsequent reads from it will return its default value. mutating func clearRebasedReportDrift() {_uniqueStorage()._rebasedReportDrift = nil} + /// NEXT_ID: 48 + var receivedReportDrift: Livekit_RTPDrift { + get {return _storage._receivedReportDrift ?? Livekit_RTPDrift()} + set {_uniqueStorage()._receivedReportDrift = newValue} + } + /// Returns true if `receivedReportDrift` has been explicitly set. + var hasReceivedReportDrift: Bool {return _storage._receivedReportDrift != nil} + /// Clears the value of `receivedReportDrift`. Subsequent reads from it will return its default value. + mutating func clearReceivedReportDrift() {_uniqueStorage()._receivedReportDrift = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -1942,6 +2110,31 @@ struct Livekit_RTPStats: @unchecked Sendable { fileprivate var _storage = _StorageClass.defaultInstance } +struct Livekit_RTCPSenderReportState: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var rtpTimestamp: UInt32 = 0 + + var rtpTimestampExt: UInt64 = 0 + + var ntpTimestamp: UInt64 = 0 + + /// time at which this happened + var at: Int64 = 0 + + var atAdjusted: Int64 = 0 + + var packets: UInt32 = 0 + + var octets: UInt64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + struct Livekit_RTPForwarderState: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1994,6 +2187,11 @@ struct Livekit_RTPForwarderState: @unchecked Sendable { set {_uniqueStorage()._codecMunger = .vp8Munger(newValue)} } + var senderReportState: [Livekit_RTCPSenderReportState] { + get {return _storage._senderReportState} + set {_uniqueStorage()._senderReportState = newValue} + } + var unknownFields = SwiftProtobuf.UnknownStorage() enum OneOf_CodecMunger: Equatable, Sendable { @@ -3017,6 +3215,10 @@ extension Livekit_DataPacket: SwiftProtobuf.Message, SwiftProtobuf._MessageImple 6: .standard(proto: "sip_dtmf"), 7: .same(proto: "transcription"), 8: .same(proto: "metrics"), + 9: .standard(proto: "chat_message"), + 10: .standard(proto: "rpc_request"), + 11: .standard(proto: "rpc_ack"), + 12: .standard(proto: "rpc_response"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -3093,6 +3295,58 @@ extension Livekit_DataPacket: SwiftProtobuf.Message, SwiftProtobuf._MessageImple self.value = .metrics(v) } }() + case 9: try { + var v: Livekit_ChatMessage? + var hadOneofValue = false + if let current = self.value { + hadOneofValue = true + if case .chatMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.value = .chatMessage(v) + } + }() + case 10: try { + var v: Livekit_RpcRequest? + var hadOneofValue = false + if let current = self.value { + hadOneofValue = true + if case .rpcRequest(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.value = .rpcRequest(v) + } + }() + case 11: try { + var v: Livekit_RpcAck? + var hadOneofValue = false + if let current = self.value { + hadOneofValue = true + if case .rpcAck(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.value = .rpcAck(v) + } + }() + case 12: try { + var v: Livekit_RpcResponse? + var hadOneofValue = false + if let current = self.value { + hadOneofValue = true + if case .rpcResponse(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.value = .rpcResponse(v) + } + }() default: break } } @@ -3136,6 +3390,22 @@ extension Livekit_DataPacket: SwiftProtobuf.Message, SwiftProtobuf._MessageImple guard case .metrics(let v)? = self.value else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 8) }() + case .chatMessage?: try { + guard case .chatMessage(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + }() + case .rpcRequest?: try { + guard case .rpcRequest(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + }() + case .rpcAck?: try { + guard case .rpcAck(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + }() + case .rpcResponse?: try { + guard case .rpcResponse(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + }() default: break } try unknownFields.traverse(visitor: &visitor) @@ -3462,6 +3732,275 @@ extension Livekit_TranscriptionSegment: SwiftProtobuf.Message, SwiftProtobuf._Me } } +extension Livekit_ChatMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ChatMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "id"), + 2: .same(proto: "timestamp"), + 3: .standard(proto: "edit_timestamp"), + 4: .same(proto: "message"), + 5: .same(proto: "deleted"), + 6: .same(proto: "generated"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self._editTimestamp) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.message) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self.deleted) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self.generated) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.id.isEmpty { + try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 2) + } + try { if let v = self._editTimestamp { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 3) + } }() + if !self.message.isEmpty { + try visitor.visitSingularStringField(value: self.message, fieldNumber: 4) + } + if self.deleted != false { + try visitor.visitSingularBoolField(value: self.deleted, fieldNumber: 5) + } + if self.generated != false { + try visitor.visitSingularBoolField(value: self.generated, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_ChatMessage, rhs: Livekit_ChatMessage) -> Bool { + if lhs.id != rhs.id {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs._editTimestamp != rhs._editTimestamp {return false} + if lhs.message != rhs.message {return false} + if lhs.deleted != rhs.deleted {return false} + if lhs.generated != rhs.generated {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Livekit_RpcRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RpcRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "id"), + 2: .same(proto: "method"), + 3: .same(proto: "payload"), + 4: .standard(proto: "response_timeout_ms"), + 5: .same(proto: "version"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.method) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.payload) }() + case 4: try { try decoder.decodeSingularUInt32Field(value: &self.responseTimeoutMs) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &self.version) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.id.isEmpty { + try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) + } + if !self.method.isEmpty { + try visitor.visitSingularStringField(value: self.method, fieldNumber: 2) + } + if !self.payload.isEmpty { + try visitor.visitSingularStringField(value: self.payload, fieldNumber: 3) + } + if self.responseTimeoutMs != 0 { + try visitor.visitSingularUInt32Field(value: self.responseTimeoutMs, fieldNumber: 4) + } + if self.version != 0 { + try visitor.visitSingularUInt32Field(value: self.version, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_RpcRequest, rhs: Livekit_RpcRequest) -> Bool { + if lhs.id != rhs.id {return false} + if lhs.method != rhs.method {return false} + if lhs.payload != rhs.payload {return false} + if lhs.responseTimeoutMs != rhs.responseTimeoutMs {return false} + if lhs.version != rhs.version {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Livekit_RpcAck: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RpcAck" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "request_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.requestID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.requestID.isEmpty { + try visitor.visitSingularStringField(value: self.requestID, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_RpcAck, rhs: Livekit_RpcAck) -> Bool { + if lhs.requestID != rhs.requestID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Livekit_RpcResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RpcResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "request_id"), + 2: .same(proto: "payload"), + 3: .same(proto: "error"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.requestID) }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.value != nil {try decoder.handleConflictingOneOf()} + self.value = .payload(v) + } + }() + case 3: try { + var v: Livekit_RpcError? + var hadOneofValue = false + if let current = self.value { + hadOneofValue = true + if case .error(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.value = .error(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.requestID.isEmpty { + try visitor.visitSingularStringField(value: self.requestID, fieldNumber: 1) + } + switch self.value { + case .payload?: try { + guard case .payload(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + case .error?: try { + guard case .error(let v)? = self.value else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_RpcResponse, rhs: Livekit_RpcResponse) -> Bool { + if lhs.requestID != rhs.requestID {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Livekit_RpcError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RpcError" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + 2: .same(proto: "message"), + 3: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.code) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.message) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.code != 0 { + try visitor.visitSingularUInt32Field(value: self.code, fieldNumber: 1) + } + if !self.message.isEmpty { + try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) + } + if !self.data.isEmpty { + try visitor.visitSingularStringField(value: self.data, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_RpcError, rhs: Livekit_RpcError) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.message != rhs.message {return false} + if lhs.data != rhs.data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Livekit_ParticipantTracks: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ParticipantTracks" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -3588,6 +4127,7 @@ extension Livekit_ClientInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImple 8: .standard(proto: "browser_version"), 9: .same(proto: "address"), 10: .same(proto: "network"), + 11: .standard(proto: "other_sdks"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -3606,6 +4146,7 @@ extension Livekit_ClientInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImple case 8: try { try decoder.decodeSingularStringField(value: &self.browserVersion) }() case 9: try { try decoder.decodeSingularStringField(value: &self.address) }() case 10: try { try decoder.decodeSingularStringField(value: &self.network) }() + case 11: try { try decoder.decodeSingularStringField(value: &self.otherSdks) }() default: break } } @@ -3642,6 +4183,9 @@ extension Livekit_ClientInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImple if !self.network.isEmpty { try visitor.visitSingularStringField(value: self.network, fieldNumber: 10) } + if !self.otherSdks.isEmpty { + try visitor.visitSingularStringField(value: self.otherSdks, fieldNumber: 11) + } try unknownFields.traverse(visitor: &visitor) } @@ -3656,6 +4200,7 @@ extension Livekit_ClientInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImple if lhs.browserVersion != rhs.browserVersion {return false} if lhs.address != rhs.address {return false} if lhs.network != rhs.network {return false} + if lhs.otherSdks != rhs.otherSdks {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3938,8 +4483,9 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme 35: .standard(proto: "layer_lock_plis"), 36: .standard(proto: "last_layer_lock_pli"), 44: .standard(proto: "packet_drift"), - 45: .standard(proto: "report_drift"), + 45: .standard(proto: "ntp_report_drift"), 46: .standard(proto: "rebased_report_drift"), + 47: .standard(proto: "received_report_drift"), ] fileprivate class _StorageClass { @@ -3985,8 +4531,9 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme var _layerLockPlis: UInt32 = 0 var _lastLayerLockPli: SwiftProtobuf.Google_Protobuf_Timestamp? = nil var _packetDrift: Livekit_RTPDrift? = nil - var _reportDrift: Livekit_RTPDrift? = nil + var _ntpReportDrift: Livekit_RTPDrift? = nil var _rebasedReportDrift: Livekit_RTPDrift? = nil + var _receivedReportDrift: Livekit_RTPDrift? = nil #if swift(>=5.10) // This property is used as the initial default value for new instances of the type. @@ -4043,8 +4590,9 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme _layerLockPlis = source._layerLockPlis _lastLayerLockPli = source._lastLayerLockPli _packetDrift = source._packetDrift - _reportDrift = source._reportDrift + _ntpReportDrift = source._ntpReportDrift _rebasedReportDrift = source._rebasedReportDrift + _receivedReportDrift = source._receivedReportDrift } } @@ -4105,8 +4653,9 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme case 40: try { try decoder.decodeSingularUInt64Field(value: &_storage._headerBytesDuplicate) }() case 41: try { try decoder.decodeSingularUInt64Field(value: &_storage._headerBytesPadding) }() case 44: try { try decoder.decodeSingularMessageField(value: &_storage._packetDrift) }() - case 45: try { try decoder.decodeSingularMessageField(value: &_storage._reportDrift) }() + case 45: try { try decoder.decodeSingularMessageField(value: &_storage._ntpReportDrift) }() case 46: try { try decoder.decodeSingularMessageField(value: &_storage._rebasedReportDrift) }() + case 47: try { try decoder.decodeSingularMessageField(value: &_storage._receivedReportDrift) }() default: break } } @@ -4245,12 +4794,15 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme try { if let v = _storage._packetDrift { try visitor.visitSingularMessageField(value: v, fieldNumber: 44) } }() - try { if let v = _storage._reportDrift { + try { if let v = _storage._ntpReportDrift { try visitor.visitSingularMessageField(value: v, fieldNumber: 45) } }() try { if let v = _storage._rebasedReportDrift { try visitor.visitSingularMessageField(value: v, fieldNumber: 46) } }() + try { if let v = _storage._receivedReportDrift { + try visitor.visitSingularMessageField(value: v, fieldNumber: 47) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -4302,8 +4854,9 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme if _storage._layerLockPlis != rhs_storage._layerLockPlis {return false} if _storage._lastLayerLockPli != rhs_storage._lastLayerLockPli {return false} if _storage._packetDrift != rhs_storage._packetDrift {return false} - if _storage._reportDrift != rhs_storage._reportDrift {return false} + if _storage._ntpReportDrift != rhs_storage._ntpReportDrift {return false} if _storage._rebasedReportDrift != rhs_storage._rebasedReportDrift {return false} + if _storage._receivedReportDrift != rhs_storage._receivedReportDrift {return false} return true } if !storagesAreEqual {return false} @@ -4313,6 +4866,74 @@ extension Livekit_RTPStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme } } +extension Livekit_RTCPSenderReportState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RTCPSenderReportState" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "rtp_timestamp"), + 2: .standard(proto: "rtp_timestamp_ext"), + 3: .standard(proto: "ntp_timestamp"), + 4: .same(proto: "at"), + 5: .standard(proto: "at_adjusted"), + 6: .same(proto: "packets"), + 7: .same(proto: "octets"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.rtpTimestamp) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self.rtpTimestampExt) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.ntpTimestamp) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.at) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.atAdjusted) }() + case 6: try { try decoder.decodeSingularUInt32Field(value: &self.packets) }() + case 7: try { try decoder.decodeSingularUInt64Field(value: &self.octets) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.rtpTimestamp != 0 { + try visitor.visitSingularUInt32Field(value: self.rtpTimestamp, fieldNumber: 1) + } + if self.rtpTimestampExt != 0 { + try visitor.visitSingularUInt64Field(value: self.rtpTimestampExt, fieldNumber: 2) + } + if self.ntpTimestamp != 0 { + try visitor.visitSingularUInt64Field(value: self.ntpTimestamp, fieldNumber: 3) + } + if self.at != 0 { + try visitor.visitSingularInt64Field(value: self.at, fieldNumber: 4) + } + if self.atAdjusted != 0 { + try visitor.visitSingularInt64Field(value: self.atAdjusted, fieldNumber: 5) + } + if self.packets != 0 { + try visitor.visitSingularUInt32Field(value: self.packets, fieldNumber: 6) + } + if self.octets != 0 { + try visitor.visitSingularUInt64Field(value: self.octets, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Livekit_RTCPSenderReportState, rhs: Livekit_RTCPSenderReportState) -> Bool { + if lhs.rtpTimestamp != rhs.rtpTimestamp {return false} + if lhs.rtpTimestampExt != rhs.rtpTimestampExt {return false} + if lhs.ntpTimestamp != rhs.ntpTimestamp {return false} + if lhs.at != rhs.at {return false} + if lhs.atAdjusted != rhs.atAdjusted {return false} + if lhs.packets != rhs.packets {return false} + if lhs.octets != rhs.octets {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".RTPForwarderState" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -4323,6 +4944,7 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa 5: .standard(proto: "dummy_start_timestamp_offset"), 6: .standard(proto: "rtp_munger"), 7: .standard(proto: "vp8_munger"), + 8: .standard(proto: "sender_report_state"), ] fileprivate class _StorageClass { @@ -4333,6 +4955,7 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa var _dummyStartTimestampOffset: UInt64 = 0 var _rtpMunger: Livekit_RTPMungerState? = nil var _codecMunger: Livekit_RTPForwarderState.OneOf_CodecMunger? + var _senderReportState: [Livekit_RTCPSenderReportState] = [] #if swift(>=5.10) // This property is used as the initial default value for new instances of the type. @@ -4354,6 +4977,7 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa _dummyStartTimestampOffset = source._dummyStartTimestampOffset _rtpMunger = source._rtpMunger _codecMunger = source._codecMunger + _senderReportState = source._senderReportState } } @@ -4391,6 +5015,7 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa _storage._codecMunger = .vp8Munger(v) } }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &_storage._senderReportState) }() default: break } } @@ -4424,6 +5049,9 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa try { if case .vp8Munger(let v)? = _storage._codecMunger { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) } }() + if !_storage._senderReportState.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._senderReportState, fieldNumber: 8) + } } try unknownFields.traverse(visitor: &visitor) } @@ -4440,6 +5068,7 @@ extension Livekit_RTPForwarderState: SwiftProtobuf.Message, SwiftProtobuf._Messa if _storage._dummyStartTimestampOffset != rhs_storage._dummyStartTimestampOffset {return false} if _storage._rtpMunger != rhs_storage._rtpMunger {return false} if _storage._codecMunger != rhs_storage._codecMunger {return false} + if _storage._senderReportState != rhs_storage._senderReportState {return false} return true } if !storagesAreEqual {return false}