@@ -1373,6 +1373,49 @@ struct Stream_Video_Sfu_Models_AppleState {
1373
1373
init ( ) { }
1374
1374
}
1375
1375
1376
+ /// PerformanceStats represents the encoding/decoding statistics for a track.
1377
+ struct Stream_Video_Sfu_Models_PerformanceStats {
1378
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
1379
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
1380
+ // methods supported on all messages.
1381
+
1382
+ /// the type of the track (e.g., video, audio, screen share)
1383
+ var trackType : Stream_Video_Sfu_Models_TrackType = . unspecified
1384
+
1385
+ /// the codec used for the track
1386
+ var codec : Stream_Video_Sfu_Models_Codec {
1387
+ get { return _codec ?? Stream_Video_Sfu_Models_Codec ( ) }
1388
+ set { _codec = newValue}
1389
+ }
1390
+ /// Returns true if `codec` has been explicitly set.
1391
+ var hasCodec : Bool { return self . _codec != nil }
1392
+ /// Clears the value of `codec`. Subsequent reads from it will return its default value.
1393
+ mutating func clearCodec( ) { self . _codec = nil }
1394
+
1395
+ /// the average encode/decode time in ms
1396
+ var avgFrameTimeMs : Float = 0
1397
+
1398
+ /// the average fps for the track
1399
+ var avgFps : Float = 0
1400
+
1401
+ /// the track dimensions
1402
+ var videoDimension : Stream_Video_Sfu_Models_VideoDimension {
1403
+ get { return _videoDimension ?? Stream_Video_Sfu_Models_VideoDimension ( ) }
1404
+ set { _videoDimension = newValue}
1405
+ }
1406
+ /// Returns true if `videoDimension` has been explicitly set.
1407
+ var hasVideoDimension : Bool { return self . _videoDimension != nil }
1408
+ /// Clears the value of `videoDimension`. Subsequent reads from it will return its default value.
1409
+ mutating func clearVideoDimension( ) { self . _videoDimension = nil }
1410
+
1411
+ var unknownFields = SwiftProtobuf . UnknownStorage ( )
1412
+
1413
+ init ( ) { }
1414
+
1415
+ fileprivate var _codec : Stream_Video_Sfu_Models_Codec ? = nil
1416
+ fileprivate var _videoDimension : Stream_Video_Sfu_Models_VideoDimension ? = nil
1417
+ }
1418
+
1376
1419
#if swift(>=5.5) && canImport(_Concurrency)
1377
1420
extension Stream_Video_Sfu_Models_PeerType : @unchecked Sendable { }
1378
1421
extension Stream_Video_Sfu_Models_ConnectionQuality : @unchecked Sendable { }
@@ -1410,6 +1453,7 @@ extension Stream_Video_Sfu_Models_CallGrants: @unchecked Sendable {}
1410
1453
extension Stream_Video_Sfu_Models_InputDevices : @unchecked Sendable { }
1411
1454
extension Stream_Video_Sfu_Models_AndroidState : @unchecked Sendable { }
1412
1455
extension Stream_Video_Sfu_Models_AppleState : @unchecked Sendable { }
1456
+ extension Stream_Video_Sfu_Models_PerformanceStats : @unchecked Sendable { }
1413
1457
#endif // swift(>=5.5) && canImport(_Concurrency)
1414
1458
1415
1459
// MARK: - Code below here is support for the SwiftProtobuf runtime.
@@ -2802,3 +2846,63 @@ extension Stream_Video_Sfu_Models_AppleState: SwiftProtobuf.Message, SwiftProtob
2802
2846
return true
2803
2847
}
2804
2848
}
2849
+
2850
+ extension Stream_Video_Sfu_Models_PerformanceStats : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
2851
+ static let protoMessageName : String = _protobuf_package + " .PerformanceStats "
2852
+ static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
2853
+ 1 : . standard( proto: " track_type " ) ,
2854
+ 2 : . same( proto: " codec " ) ,
2855
+ 3 : . standard( proto: " avg_frame_time_ms " ) ,
2856
+ 4 : . standard( proto: " avg_fps " ) ,
2857
+ 5 : . standard( proto: " video_dimension " ) ,
2858
+ ]
2859
+
2860
+ mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
2861
+ while let fieldNumber = try decoder. nextFieldNumber ( ) {
2862
+ // The use of inline closures is to circumvent an issue where the compiler
2863
+ // allocates stack space for every case branch when no optimizations are
2864
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
2865
+ switch fieldNumber {
2866
+ case 1 : try { try decoder. decodeSingularEnumField ( value: & self . trackType) } ( )
2867
+ case 2 : try { try decoder. decodeSingularMessageField ( value: & self . _codec) } ( )
2868
+ case 3 : try { try decoder. decodeSingularFloatField ( value: & self . avgFrameTimeMs) } ( )
2869
+ case 4 : try { try decoder. decodeSingularFloatField ( value: & self . avgFps) } ( )
2870
+ case 5 : try { try decoder. decodeSingularMessageField ( value: & self . _videoDimension) } ( )
2871
+ default : break
2872
+ }
2873
+ }
2874
+ }
2875
+
2876
+ func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
2877
+ // The use of inline closures is to circumvent an issue where the compiler
2878
+ // allocates stack space for every if/case branch local when no optimizations
2879
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
2880
+ // https://github.com/apple/swift-protobuf/issues/1182
2881
+ if self . trackType != . unspecified {
2882
+ try visitor. visitSingularEnumField ( value: self . trackType, fieldNumber: 1 )
2883
+ }
2884
+ try { if let v = self . _codec {
2885
+ try visitor. visitSingularMessageField ( value: v, fieldNumber: 2 )
2886
+ } } ( )
2887
+ if self . avgFrameTimeMs != 0 {
2888
+ try visitor. visitSingularFloatField ( value: self . avgFrameTimeMs, fieldNumber: 3 )
2889
+ }
2890
+ if self . avgFps != 0 {
2891
+ try visitor. visitSingularFloatField ( value: self . avgFps, fieldNumber: 4 )
2892
+ }
2893
+ try { if let v = self . _videoDimension {
2894
+ try visitor. visitSingularMessageField ( value: v, fieldNumber: 5 )
2895
+ } } ( )
2896
+ try unknownFields. traverse ( visitor: & visitor)
2897
+ }
2898
+
2899
+ static func == ( lhs: Stream_Video_Sfu_Models_PerformanceStats , rhs: Stream_Video_Sfu_Models_PerformanceStats ) -> Bool {
2900
+ if lhs. trackType != rhs. trackType { return false }
2901
+ if lhs. _codec != rhs. _codec { return false }
2902
+ if lhs. avgFrameTimeMs != rhs. avgFrameTimeMs { return false }
2903
+ if lhs. avgFps != rhs. avgFps { return false }
2904
+ if lhs. _videoDimension != rhs. _videoDimension { return false }
2905
+ if lhs. unknownFields != rhs. unknownFields { return false }
2906
+ return true
2907
+ }
2908
+ }
0 commit comments