diff --git a/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart b/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart index d8b1ad89..a38f79a3 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart @@ -16,9 +16,6 @@ import 'package:protobuf/protobuf.dart' as $pb; import '../models/models.pb.dart' as $0; import '../models/models.pbenum.dart' as $0; import '../signal_rpc/signal.pb.dart' as $1; -import 'events.pbenum.dart'; - -export 'events.pbenum.dart'; enum SfuEvent_EventPayload { subscriberOffer, @@ -2272,65 +2269,11 @@ class AudioLevelChanged extends $pb.GeneratedMessage { $core.List get audioLevels => $_getList(0); } -class AudioMediaRequest extends $pb.GeneratedMessage { - factory AudioMediaRequest({ - $core.int? channelCount, - }) { - final $result = create(); - if (channelCount != null) { - $result.channelCount = channelCount; - } - return $result; - } - AudioMediaRequest._() : super(); - factory AudioMediaRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AudioMediaRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AudioMediaRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'channelCount', $pb.PbFieldType.O3) - ..hasRequiredFields = false - ; - - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AudioMediaRequest clone() => AudioMediaRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AudioMediaRequest copyWith(void Function(AudioMediaRequest) updates) => super.copyWith((message) => updates(message as AudioMediaRequest)) as AudioMediaRequest; - - $pb.BuilderInfo get info_ => _i; - - @$core.pragma('dart2js:noInline') - static AudioMediaRequest create() => AudioMediaRequest._(); - AudioMediaRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static AudioMediaRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static AudioMediaRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get channelCount => $_getIZ(0); - @$pb.TagNumber(1) - set channelCount($core.int v) { $_setSignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasChannelCount() => $_has(0); - @$pb.TagNumber(1) - void clearChannelCount() => clearField(1); -} - class AudioSender extends $pb.GeneratedMessage { factory AudioSender({ - AudioMediaRequest? mediaRequest, $0.Codec? codec, }) { final $result = create(); - if (mediaRequest != null) { - $result.mediaRequest = mediaRequest; - } if (codec != null) { $result.codec = codec; } @@ -2341,7 +2284,6 @@ class AudioSender extends $pb.GeneratedMessage { factory AudioSender.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AudioSender', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'mediaRequest', subBuilder: AudioMediaRequest.create) ..aOM<$0.Codec>(2, _omitFieldNames ? '' : 'codec', subBuilder: $0.Codec.create) ..hasRequiredFields = false ; @@ -2367,105 +2309,16 @@ class AudioSender extends $pb.GeneratedMessage { static AudioSender getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AudioSender? _defaultInstance; - @$pb.TagNumber(1) - AudioMediaRequest get mediaRequest => $_getN(0); - @$pb.TagNumber(1) - set mediaRequest(AudioMediaRequest v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasMediaRequest() => $_has(0); - @$pb.TagNumber(1) - void clearMediaRequest() => clearField(1); - @$pb.TagNumber(1) - AudioMediaRequest ensureMediaRequest() => $_ensure(0); - @$pb.TagNumber(2) - $0.Codec get codec => $_getN(1); + $0.Codec get codec => $_getN(0); @$pb.TagNumber(2) set codec($0.Codec v) { setField(2, v); } @$pb.TagNumber(2) - $core.bool hasCodec() => $_has(1); + $core.bool hasCodec() => $_has(0); @$pb.TagNumber(2) void clearCodec() => clearField(2); @$pb.TagNumber(2) - $0.Codec ensureCodec() => $_ensure(1); -} - -class VideoMediaRequest extends $pb.GeneratedMessage { - factory VideoMediaRequest({ - $core.int? idealHeight, - $core.int? idealWidth, - $core.int? idealFrameRate, - }) { - final $result = create(); - if (idealHeight != null) { - $result.idealHeight = idealHeight; - } - if (idealWidth != null) { - $result.idealWidth = idealWidth; - } - if (idealFrameRate != null) { - $result.idealFrameRate = idealFrameRate; - } - return $result; - } - VideoMediaRequest._() : super(); - factory VideoMediaRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory VideoMediaRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'VideoMediaRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'idealHeight', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'idealWidth', $pb.PbFieldType.O3) - ..a<$core.int>(3, _omitFieldNames ? '' : 'idealFrameRate', $pb.PbFieldType.O3) - ..hasRequiredFields = false - ; - - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - VideoMediaRequest clone() => VideoMediaRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - VideoMediaRequest copyWith(void Function(VideoMediaRequest) updates) => super.copyWith((message) => updates(message as VideoMediaRequest)) as VideoMediaRequest; - - $pb.BuilderInfo get info_ => _i; - - @$core.pragma('dart2js:noInline') - static VideoMediaRequest create() => VideoMediaRequest._(); - VideoMediaRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static VideoMediaRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static VideoMediaRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get idealHeight => $_getIZ(0); - @$pb.TagNumber(1) - set idealHeight($core.int v) { $_setSignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasIdealHeight() => $_has(0); - @$pb.TagNumber(1) - void clearIdealHeight() => clearField(1); - - @$pb.TagNumber(2) - $core.int get idealWidth => $_getIZ(1); - @$pb.TagNumber(2) - set idealWidth($core.int v) { $_setSignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasIdealWidth() => $_has(1); - @$pb.TagNumber(2) - void clearIdealWidth() => clearField(2); - - @$pb.TagNumber(3) - $core.int get idealFrameRate => $_getIZ(2); - @$pb.TagNumber(3) - set idealFrameRate($core.int v) { $_setSignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasIdealFrameRate() => $_has(2); - @$pb.TagNumber(3) - void clearIdealFrameRate() => clearField(3); + $0.Codec ensureCodec() => $_ensure(0); } /// VideoLayerSetting is used to specify various parameters of a particular encoding in simulcast. @@ -2477,9 +2330,9 @@ class VideoLayerSetting extends $pb.GeneratedMessage { $core.bool? active, $core.int? maxBitrate, $core.double? scaleResolutionDownBy, - VideoLayerSetting_Priority? priority, $0.Codec? codec, $core.int? maxFramerate, + $core.String? scalabilityMode, }) { final $result = create(); if (name != null) { @@ -2494,15 +2347,15 @@ class VideoLayerSetting extends $pb.GeneratedMessage { if (scaleResolutionDownBy != null) { $result.scaleResolutionDownBy = scaleResolutionDownBy; } - if (priority != null) { - $result.priority = priority; - } if (codec != null) { $result.codec = codec; } if (maxFramerate != null) { $result.maxFramerate = maxFramerate; } + if (scalabilityMode != null) { + $result.scalabilityMode = scalabilityMode; + } return $result; } VideoLayerSetting._() : super(); @@ -2514,9 +2367,9 @@ class VideoLayerSetting extends $pb.GeneratedMessage { ..aOB(2, _omitFieldNames ? '' : 'active') ..a<$core.int>(3, _omitFieldNames ? '' : 'maxBitrate', $pb.PbFieldType.O3) ..a<$core.double>(4, _omitFieldNames ? '' : 'scaleResolutionDownBy', $pb.PbFieldType.OF) - ..e(5, _omitFieldNames ? '' : 'priority', $pb.PbFieldType.OE, defaultOrMaker: VideoLayerSetting_Priority.PRIORITY_HIGH_UNSPECIFIED, valueOf: VideoLayerSetting_Priority.valueOf, enumValues: VideoLayerSetting_Priority.values) ..aOM<$0.Codec>(6, _omitFieldNames ? '' : 'codec', subBuilder: $0.Codec.create) ..a<$core.int>(7, _omitFieldNames ? '' : 'maxFramerate', $pb.PbFieldType.OU3) + ..aOS(8, _omitFieldNames ? '' : 'scalabilityMode') ..hasRequiredFields = false ; @@ -2577,46 +2430,42 @@ class VideoLayerSetting extends $pb.GeneratedMessage { @$pb.TagNumber(4) void clearScaleResolutionDownBy() => clearField(4); - @$pb.TagNumber(5) - VideoLayerSetting_Priority get priority => $_getN(4); - @$pb.TagNumber(5) - set priority(VideoLayerSetting_Priority v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasPriority() => $_has(4); - @$pb.TagNumber(5) - void clearPriority() => clearField(5); - @$pb.TagNumber(6) - $0.Codec get codec => $_getN(5); + $0.Codec get codec => $_getN(4); @$pb.TagNumber(6) set codec($0.Codec v) { setField(6, v); } @$pb.TagNumber(6) - $core.bool hasCodec() => $_has(5); + $core.bool hasCodec() => $_has(4); @$pb.TagNumber(6) void clearCodec() => clearField(6); @$pb.TagNumber(6) - $0.Codec ensureCodec() => $_ensure(5); + $0.Codec ensureCodec() => $_ensure(4); @$pb.TagNumber(7) - $core.int get maxFramerate => $_getIZ(6); + $core.int get maxFramerate => $_getIZ(5); @$pb.TagNumber(7) - set maxFramerate($core.int v) { $_setUnsignedInt32(6, v); } + set maxFramerate($core.int v) { $_setUnsignedInt32(5, v); } @$pb.TagNumber(7) - $core.bool hasMaxFramerate() => $_has(6); + $core.bool hasMaxFramerate() => $_has(5); @$pb.TagNumber(7) void clearMaxFramerate() => clearField(7); + + @$pb.TagNumber(8) + $core.String get scalabilityMode => $_getSZ(6); + @$pb.TagNumber(8) + set scalabilityMode($core.String v) { $_setString(6, v); } + @$pb.TagNumber(8) + $core.bool hasScalabilityMode() => $_has(6); + @$pb.TagNumber(8) + void clearScalabilityMode() => clearField(8); } class VideoSender extends $pb.GeneratedMessage { factory VideoSender({ - VideoMediaRequest? mediaRequest, $0.Codec? codec, $core.Iterable? layers, }) { final $result = create(); - if (mediaRequest != null) { - $result.mediaRequest = mediaRequest; - } if (codec != null) { $result.codec = codec; } @@ -2630,7 +2479,6 @@ class VideoSender extends $pb.GeneratedMessage { factory VideoSender.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'VideoSender', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'mediaRequest', subBuilder: VideoMediaRequest.create) ..aOM<$0.Codec>(2, _omitFieldNames ? '' : 'codec', subBuilder: $0.Codec.create) ..pc(3, _omitFieldNames ? '' : 'layers', $pb.PbFieldType.PM, subBuilder: VideoLayerSetting.create) ..hasRequiredFields = false @@ -2657,30 +2505,19 @@ class VideoSender extends $pb.GeneratedMessage { static VideoSender getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static VideoSender? _defaultInstance; - @$pb.TagNumber(1) - VideoMediaRequest get mediaRequest => $_getN(0); - @$pb.TagNumber(1) - set mediaRequest(VideoMediaRequest v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasMediaRequest() => $_has(0); - @$pb.TagNumber(1) - void clearMediaRequest() => clearField(1); - @$pb.TagNumber(1) - VideoMediaRequest ensureMediaRequest() => $_ensure(0); - @$pb.TagNumber(2) - $0.Codec get codec => $_getN(1); + $0.Codec get codec => $_getN(0); @$pb.TagNumber(2) set codec($0.Codec v) { setField(2, v); } @$pb.TagNumber(2) - $core.bool hasCodec() => $_has(1); + $core.bool hasCodec() => $_has(0); @$pb.TagNumber(2) void clearCodec() => clearField(2); @$pb.TagNumber(2) - $0.Codec ensureCodec() => $_ensure(1); + $0.Codec ensureCodec() => $_ensure(0); @$pb.TagNumber(3) - $core.List get layers => $_getList(2); + $core.List get layers => $_getList(1); } /// sent to users when they need to change the quality of their video diff --git a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbenum.dart b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbenum.dart index f1936a38..406c2e82 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbenum.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbenum.dart @@ -9,28 +9,3 @@ // ignore_for_file: non_constant_identifier_names, prefer_final_fields // ignore_for_file: unnecessary_import, unnecessary_this, unused_import -import 'dart:core' as $core; - -import 'package:protobuf/protobuf.dart' as $pb; - -class VideoLayerSetting_Priority extends $pb.ProtobufEnum { - static const VideoLayerSetting_Priority PRIORITY_HIGH_UNSPECIFIED = VideoLayerSetting_Priority._(0, _omitEnumNames ? '' : 'PRIORITY_HIGH_UNSPECIFIED'); - static const VideoLayerSetting_Priority PRIORITY_LOW = VideoLayerSetting_Priority._(1, _omitEnumNames ? '' : 'PRIORITY_LOW'); - static const VideoLayerSetting_Priority PRIORITY_MEDIUM = VideoLayerSetting_Priority._(2, _omitEnumNames ? '' : 'PRIORITY_MEDIUM'); - static const VideoLayerSetting_Priority PRIORITY_VERY_LOW = VideoLayerSetting_Priority._(3, _omitEnumNames ? '' : 'PRIORITY_VERY_LOW'); - - static const $core.List values = [ - PRIORITY_HIGH_UNSPECIFIED, - PRIORITY_LOW, - PRIORITY_MEDIUM, - PRIORITY_VERY_LOW, - ]; - - static final $core.Map<$core.int, VideoLayerSetting_Priority> _byValue = $pb.ProtobufEnum.initByValue(values); - static VideoLayerSetting_Priority? valueOf($core.int value) => _byValue[value]; - - const VideoLayerSetting_Priority._($core.int v, $core.String n) : super(v, n); -} - - -const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart index 82900d63..68a15436 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart @@ -485,49 +485,18 @@ final $typed_data.Uint8List audioLevelChangedDescriptor = $convert.base64Decode( 'ChFBdWRpb0xldmVsQ2hhbmdlZBJFCgxhdWRpb19sZXZlbHMYASADKAsyIi5zdHJlYW0udmlkZW' '8uc2Z1LmV2ZW50LkF1ZGlvTGV2ZWxSC2F1ZGlvTGV2ZWxz'); -@$core.Deprecated('Use audioMediaRequestDescriptor instead') -const AudioMediaRequest$json = { - '1': 'AudioMediaRequest', - '2': [ - {'1': 'channel_count', '3': 1, '4': 1, '5': 5, '10': 'channelCount'}, - ], -}; - -/// Descriptor for `AudioMediaRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List audioMediaRequestDescriptor = $convert.base64Decode( - 'ChFBdWRpb01lZGlhUmVxdWVzdBIjCg1jaGFubmVsX2NvdW50GAEgASgFUgxjaGFubmVsQ291bn' - 'Q='); - @$core.Deprecated('Use audioSenderDescriptor instead') const AudioSender$json = { '1': 'AudioSender', '2': [ - {'1': 'media_request', '3': 1, '4': 1, '5': 11, '6': '.stream.video.sfu.event.AudioMediaRequest', '10': 'mediaRequest'}, {'1': 'codec', '3': 2, '4': 1, '5': 11, '6': '.stream.video.sfu.models.Codec', '10': 'codec'}, ], }; /// Descriptor for `AudioSender`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List audioSenderDescriptor = $convert.base64Decode( - 'CgtBdWRpb1NlbmRlchJOCg1tZWRpYV9yZXF1ZXN0GAEgASgLMikuc3RyZWFtLnZpZGVvLnNmdS' - '5ldmVudC5BdWRpb01lZGlhUmVxdWVzdFIMbWVkaWFSZXF1ZXN0EjQKBWNvZGVjGAIgASgLMh4u' - 'c3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuQ29kZWNSBWNvZGVj'); - -@$core.Deprecated('Use videoMediaRequestDescriptor instead') -const VideoMediaRequest$json = { - '1': 'VideoMediaRequest', - '2': [ - {'1': 'ideal_height', '3': 1, '4': 1, '5': 5, '10': 'idealHeight'}, - {'1': 'ideal_width', '3': 2, '4': 1, '5': 5, '10': 'idealWidth'}, - {'1': 'ideal_frame_rate', '3': 3, '4': 1, '5': 5, '10': 'idealFrameRate'}, - ], -}; - -/// Descriptor for `VideoMediaRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List videoMediaRequestDescriptor = $convert.base64Decode( - 'ChFWaWRlb01lZGlhUmVxdWVzdBIhCgxpZGVhbF9oZWlnaHQYASABKAVSC2lkZWFsSGVpZ2h0Eh' - '8KC2lkZWFsX3dpZHRoGAIgASgFUgppZGVhbFdpZHRoEigKEGlkZWFsX2ZyYW1lX3JhdGUYAyAB' - 'KAVSDmlkZWFsRnJhbWVSYXRl'); + 'CgtBdWRpb1NlbmRlchI0CgVjb2RlYxgCIAEoCzIeLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLk' + 'NvZGVjUgVjb2RlYw=='); @$core.Deprecated('Use videoLayerSettingDescriptor instead') const VideoLayerSetting$json = { @@ -537,21 +506,9 @@ const VideoLayerSetting$json = { {'1': 'active', '3': 2, '4': 1, '5': 8, '10': 'active'}, {'1': 'max_bitrate', '3': 3, '4': 1, '5': 5, '10': 'maxBitrate'}, {'1': 'scale_resolution_down_by', '3': 4, '4': 1, '5': 2, '10': 'scaleResolutionDownBy'}, - {'1': 'priority', '3': 5, '4': 1, '5': 14, '6': '.stream.video.sfu.event.VideoLayerSetting.Priority', '10': 'priority'}, {'1': 'codec', '3': 6, '4': 1, '5': 11, '6': '.stream.video.sfu.models.Codec', '10': 'codec'}, {'1': 'max_framerate', '3': 7, '4': 1, '5': 13, '10': 'maxFramerate'}, - ], - '4': [VideoLayerSetting_Priority$json], -}; - -@$core.Deprecated('Use videoLayerSettingDescriptor instead') -const VideoLayerSetting_Priority$json = { - '1': 'Priority', - '2': [ - {'1': 'PRIORITY_HIGH_UNSPECIFIED', '2': 0}, - {'1': 'PRIORITY_LOW', '2': 1}, - {'1': 'PRIORITY_MEDIUM', '2': 2}, - {'1': 'PRIORITY_VERY_LOW', '2': 3}, + {'1': 'scalability_mode', '3': 8, '4': 1, '5': 9, '10': 'scalabilityMode'}, ], }; @@ -559,18 +516,15 @@ const VideoLayerSetting_Priority$json = { final $typed_data.Uint8List videoLayerSettingDescriptor = $convert.base64Decode( 'ChFWaWRlb0xheWVyU2V0dGluZxISCgRuYW1lGAEgASgJUgRuYW1lEhYKBmFjdGl2ZRgCIAEoCF' 'IGYWN0aXZlEh8KC21heF9iaXRyYXRlGAMgASgFUgptYXhCaXRyYXRlEjcKGHNjYWxlX3Jlc29s' - 'dXRpb25fZG93bl9ieRgEIAEoAlIVc2NhbGVSZXNvbHV0aW9uRG93bkJ5Ek4KCHByaW9yaXR5GA' - 'UgASgOMjIuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5WaWRlb0xheWVyU2V0dGluZy5Qcmlvcml0' - 'eVIIcHJpb3JpdHkSNAoFY29kZWMYBiABKAsyHi5zdHJlYW0udmlkZW8uc2Z1Lm1vZGVscy5Db2' - 'RlY1IFY29kZWMSIwoNbWF4X2ZyYW1lcmF0ZRgHIAEoDVIMbWF4RnJhbWVyYXRlImcKCFByaW9y' - 'aXR5Eh0KGVBSSU9SSVRZX0hJR0hfVU5TUEVDSUZJRUQQABIQCgxQUklPUklUWV9MT1cQARITCg' - '9QUklPUklUWV9NRURJVU0QAhIVChFQUklPUklUWV9WRVJZX0xPVxAD'); + 'dXRpb25fZG93bl9ieRgEIAEoAlIVc2NhbGVSZXNvbHV0aW9uRG93bkJ5EjQKBWNvZGVjGAYgAS' + 'gLMh4uc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuQ29kZWNSBWNvZGVjEiMKDW1heF9mcmFtZXJh' + 'dGUYByABKA1SDG1heEZyYW1lcmF0ZRIpChBzY2FsYWJpbGl0eV9tb2RlGAggASgJUg9zY2FsYW' + 'JpbGl0eU1vZGU='); @$core.Deprecated('Use videoSenderDescriptor instead') const VideoSender$json = { '1': 'VideoSender', '2': [ - {'1': 'media_request', '3': 1, '4': 1, '5': 11, '6': '.stream.video.sfu.event.VideoMediaRequest', '10': 'mediaRequest'}, {'1': 'codec', '3': 2, '4': 1, '5': 11, '6': '.stream.video.sfu.models.Codec', '10': 'codec'}, {'1': 'layers', '3': 3, '4': 3, '5': 11, '6': '.stream.video.sfu.event.VideoLayerSetting', '10': 'layers'}, ], @@ -578,10 +532,9 @@ const VideoSender$json = { /// Descriptor for `VideoSender`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List videoSenderDescriptor = $convert.base64Decode( - 'CgtWaWRlb1NlbmRlchJOCg1tZWRpYV9yZXF1ZXN0GAEgASgLMikuc3RyZWFtLnZpZGVvLnNmdS' - '5ldmVudC5WaWRlb01lZGlhUmVxdWVzdFIMbWVkaWFSZXF1ZXN0EjQKBWNvZGVjGAIgASgLMh4u' - 'c3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuQ29kZWNSBWNvZGVjEkEKBmxheWVycxgDIAMoCzIpLn' - 'N0cmVhbS52aWRlby5zZnUuZXZlbnQuVmlkZW9MYXllclNldHRpbmdSBmxheWVycw=='); + 'CgtWaWRlb1NlbmRlchI0CgVjb2RlYxgCIAEoCzIeLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLk' + 'NvZGVjUgVjb2RlYxJBCgZsYXllcnMYAyADKAsyKS5zdHJlYW0udmlkZW8uc2Z1LmV2ZW50LlZp' + 'ZGVvTGF5ZXJTZXR0aW5nUgZsYXllcnM='); @$core.Deprecated('Use changePublishQualityDescriptor instead') const ChangePublishQuality$json = { diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart index 340091c8..5a5a4258 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart @@ -699,31 +699,19 @@ class VideoLayer extends $pb.GeneratedMessage { class Codec extends $pb.GeneratedMessage { factory Codec({ - $core.int? payloadType, - $core.String? name, - $core.String? fmtpLine, - $core.int? clockRate, - $core.String? encodingParameters, - $core.Iterable<$core.String>? feedbacks, + $core.String? mimeType, + $core.String? scalabilityMode, + $core.String? fmtp, }) { final $result = create(); - if (payloadType != null) { - $result.payloadType = payloadType; - } - if (name != null) { - $result.name = name; + if (mimeType != null) { + $result.mimeType = mimeType; } - if (fmtpLine != null) { - $result.fmtpLine = fmtpLine; + if (scalabilityMode != null) { + $result.scalabilityMode = scalabilityMode; } - if (clockRate != null) { - $result.clockRate = clockRate; - } - if (encodingParameters != null) { - $result.encodingParameters = encodingParameters; - } - if (feedbacks != null) { - $result.feedbacks.addAll(feedbacks); + if (fmtp != null) { + $result.fmtp = fmtp; } return $result; } @@ -732,12 +720,9 @@ class Codec extends $pb.GeneratedMessage { factory Codec.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Codec', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'payloadType', $pb.PbFieldType.OU3) - ..aOS(2, _omitFieldNames ? '' : 'name') - ..aOS(3, _omitFieldNames ? '' : 'fmtpLine') - ..a<$core.int>(4, _omitFieldNames ? '' : 'clockRate', $pb.PbFieldType.OU3) - ..aOS(5, _omitFieldNames ? '' : 'encodingParameters') - ..pPS(6, _omitFieldNames ? '' : 'feedbacks') + ..aOS(1, _omitFieldNames ? '' : 'mimeType') + ..aOS(2, _omitFieldNames ? '' : 'scalabilityMode') + ..aOS(3, _omitFieldNames ? '' : 'fmtp') ..hasRequiredFields = false ; @@ -763,52 +748,31 @@ class Codec extends $pb.GeneratedMessage { static Codec? _defaultInstance; @$pb.TagNumber(1) - $core.int get payloadType => $_getIZ(0); + $core.String get mimeType => $_getSZ(0); @$pb.TagNumber(1) - set payloadType($core.int v) { $_setUnsignedInt32(0, v); } + set mimeType($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) - $core.bool hasPayloadType() => $_has(0); + $core.bool hasMimeType() => $_has(0); @$pb.TagNumber(1) - void clearPayloadType() => clearField(1); + void clearMimeType() => clearField(1); @$pb.TagNumber(2) - $core.String get name => $_getSZ(1); + $core.String get scalabilityMode => $_getSZ(1); @$pb.TagNumber(2) - set name($core.String v) { $_setString(1, v); } + set scalabilityMode($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) - $core.bool hasName() => $_has(1); + $core.bool hasScalabilityMode() => $_has(1); @$pb.TagNumber(2) - void clearName() => clearField(2); + void clearScalabilityMode() => clearField(2); @$pb.TagNumber(3) - $core.String get fmtpLine => $_getSZ(2); + $core.String get fmtp => $_getSZ(2); @$pb.TagNumber(3) - set fmtpLine($core.String v) { $_setString(2, v); } + set fmtp($core.String v) { $_setString(2, v); } @$pb.TagNumber(3) - $core.bool hasFmtpLine() => $_has(2); + $core.bool hasFmtp() => $_has(2); @$pb.TagNumber(3) - void clearFmtpLine() => clearField(3); - - @$pb.TagNumber(4) - $core.int get clockRate => $_getIZ(3); - @$pb.TagNumber(4) - set clockRate($core.int v) { $_setUnsignedInt32(3, v); } - @$pb.TagNumber(4) - $core.bool hasClockRate() => $_has(3); - @$pb.TagNumber(4) - void clearClockRate() => clearField(4); - - @$pb.TagNumber(5) - $core.String get encodingParameters => $_getSZ(4); - @$pb.TagNumber(5) - set encodingParameters($core.String v) { $_setString(4, v); } - @$pb.TagNumber(5) - $core.bool hasEncodingParameters() => $_has(4); - @$pb.TagNumber(5) - void clearEncodingParameters() => clearField(5); - - @$pb.TagNumber(6) - $core.List<$core.String> get feedbacks => $_getList(5); + void clearFmtp() => clearField(3); } class ICETrickle extends $pb.GeneratedMessage { @@ -899,6 +863,7 @@ class TrackInfo extends $pb.GeneratedMessage { $core.bool? stereo, $core.bool? red, $core.bool? muted, + $core.Iterable? preferredCodecs, }) { final $result = create(); if (trackId != null) { @@ -925,6 +890,9 @@ class TrackInfo extends $pb.GeneratedMessage { if (muted != null) { $result.muted = muted; } + if (preferredCodecs != null) { + $result.preferredCodecs.addAll(preferredCodecs); + } return $result; } TrackInfo._() : super(); @@ -940,6 +908,7 @@ class TrackInfo extends $pb.GeneratedMessage { ..aOB(8, _omitFieldNames ? '' : 'stereo') ..aOB(9, _omitFieldNames ? '' : 'red') ..aOB(10, _omitFieldNames ? '' : 'muted') + ..pc(11, _omitFieldNames ? '' : 'preferredCodecs', $pb.PbFieldType.PM, subBuilder: Codec.create) ..hasRequiredFields = false ; @@ -1030,6 +999,9 @@ class TrackInfo extends $pb.GeneratedMessage { $core.bool hasMuted() => $_has(7); @$pb.TagNumber(10) void clearMuted() => clearField(10); + + @$pb.TagNumber(11) + $core.List get preferredCodecs => $_getList(8); } class Error extends $pb.GeneratedMessage { @@ -1732,6 +1704,207 @@ class CallGrants extends $pb.GeneratedMessage { void clearCanScreenshare() => clearField(3); } +class InputDevices extends $pb.GeneratedMessage { + factory InputDevices({ + $core.Iterable<$core.String>? availableDevices, + $core.String? currentDevice, + $core.bool? isPermitted, + }) { + final $result = create(); + if (availableDevices != null) { + $result.availableDevices.addAll(availableDevices); + } + if (currentDevice != null) { + $result.currentDevice = currentDevice; + } + if (isPermitted != null) { + $result.isPermitted = isPermitted; + } + return $result; + } + InputDevices._() : super(); + factory InputDevices.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory InputDevices.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'InputDevices', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) + ..pPS(1, _omitFieldNames ? '' : 'availableDevices') + ..aOS(2, _omitFieldNames ? '' : 'currentDevice') + ..aOB(3, _omitFieldNames ? '' : 'isPermitted') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + InputDevices clone() => InputDevices()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + InputDevices copyWith(void Function(InputDevices) updates) => super.copyWith((message) => updates(message as InputDevices)) as InputDevices; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static InputDevices create() => InputDevices._(); + InputDevices createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static InputDevices getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static InputDevices? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.String> get availableDevices => $_getList(0); + + @$pb.TagNumber(2) + $core.String get currentDevice => $_getSZ(1); + @$pb.TagNumber(2) + set currentDevice($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasCurrentDevice() => $_has(1); + @$pb.TagNumber(2) + void clearCurrentDevice() => clearField(2); + + @$pb.TagNumber(3) + $core.bool get isPermitted => $_getBF(2); + @$pb.TagNumber(3) + set isPermitted($core.bool v) { $_setBool(2, v); } + @$pb.TagNumber(3) + $core.bool hasIsPermitted() => $_has(2); + @$pb.TagNumber(3) + void clearIsPermitted() => clearField(3); +} + +class AndroidState extends $pb.GeneratedMessage { + factory AndroidState({ + AndroidThermalState? thermalState, + $core.bool? isPowerSaverMode, + }) { + final $result = create(); + if (thermalState != null) { + $result.thermalState = thermalState; + } + if (isPowerSaverMode != null) { + $result.isPowerSaverMode = isPowerSaverMode; + } + return $result; + } + AndroidState._() : super(); + factory AndroidState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AndroidState.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AndroidState', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'thermalState', $pb.PbFieldType.OE, defaultOrMaker: AndroidThermalState.ANDROID_THERMAL_STATE_UNSPECIFIED, valueOf: AndroidThermalState.valueOf, enumValues: AndroidThermalState.values) + ..aOB(2, _omitFieldNames ? '' : 'isPowerSaverMode') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + AndroidState clone() => AndroidState()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + AndroidState copyWith(void Function(AndroidState) updates) => super.copyWith((message) => updates(message as AndroidState)) as AndroidState; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static AndroidState create() => AndroidState._(); + AndroidState createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static AndroidState getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AndroidState? _defaultInstance; + + @$pb.TagNumber(1) + AndroidThermalState get thermalState => $_getN(0); + @$pb.TagNumber(1) + set thermalState(AndroidThermalState v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasThermalState() => $_has(0); + @$pb.TagNumber(1) + void clearThermalState() => clearField(1); + + @$pb.TagNumber(2) + $core.bool get isPowerSaverMode => $_getBF(1); + @$pb.TagNumber(2) + set isPowerSaverMode($core.bool v) { $_setBool(1, v); } + @$pb.TagNumber(2) + $core.bool hasIsPowerSaverMode() => $_has(1); + @$pb.TagNumber(2) + void clearIsPowerSaverMode() => clearField(2); +} + +class AppleState extends $pb.GeneratedMessage { + factory AppleState({ + AppleThermalState? thermalState, + $core.bool? isLowPowerModeEnabled, + }) { + final $result = create(); + if (thermalState != null) { + $result.thermalState = thermalState; + } + if (isLowPowerModeEnabled != null) { + $result.isLowPowerModeEnabled = isLowPowerModeEnabled; + } + return $result; + } + AppleState._() : super(); + factory AppleState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AppleState.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AppleState', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'thermalState', $pb.PbFieldType.OE, defaultOrMaker: AppleThermalState.APPLE_THERMAL_STATE_UNSPECIFIED, valueOf: AppleThermalState.valueOf, enumValues: AppleThermalState.values) + ..aOB(2, _omitFieldNames ? '' : 'isLowPowerModeEnabled') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + AppleState clone() => AppleState()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + AppleState copyWith(void Function(AppleState) updates) => super.copyWith((message) => updates(message as AppleState)) as AppleState; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static AppleState create() => AppleState._(); + AppleState createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static AppleState getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AppleState? _defaultInstance; + + @$pb.TagNumber(1) + AppleThermalState get thermalState => $_getN(0); + @$pb.TagNumber(1) + set thermalState(AppleThermalState v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasThermalState() => $_has(0); + @$pb.TagNumber(1) + void clearThermalState() => clearField(1); + + /// https://developer.apple.com/documentation/foundation/processinfo/1617047-islowpowermodeenabled + @$pb.TagNumber(2) + $core.bool get isLowPowerModeEnabled => $_getBF(1); + @$pb.TagNumber(2) + set isLowPowerModeEnabled($core.bool v) { $_setBool(1, v); } + @$pb.TagNumber(2) + $core.bool hasIsLowPowerModeEnabled() => $_has(1); + @$pb.TagNumber(2) + void clearIsLowPowerModeEnabled() => clearField(2); +} + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart index 8516d1c2..4b9fb450 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart @@ -251,5 +251,57 @@ class WebsocketReconnectStrategy extends $pb.ProtobufEnum { const WebsocketReconnectStrategy._($core.int v, $core.String n) : super(v, n); } +/// AndroidThermalState is reported by the Android API. The full list of values is documented here +/// https://developer.android.com/reference/android/os/PowerManager.html#getCurrentThermalStatus() +class AndroidThermalState extends $pb.ProtobufEnum { + static const AndroidThermalState ANDROID_THERMAL_STATE_UNSPECIFIED = AndroidThermalState._(0, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_UNSPECIFIED'); + static const AndroidThermalState ANDROID_THERMAL_STATE_NONE = AndroidThermalState._(1, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_NONE'); + static const AndroidThermalState ANDROID_THERMAL_STATE_LIGHT = AndroidThermalState._(2, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_LIGHT'); + static const AndroidThermalState ANDROID_THERMAL_STATE_MODERATE = AndroidThermalState._(3, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_MODERATE'); + static const AndroidThermalState ANDROID_THERMAL_STATE_SEVERE = AndroidThermalState._(4, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_SEVERE'); + static const AndroidThermalState ANDROID_THERMAL_STATE_CRITICAL = AndroidThermalState._(5, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_CRITICAL'); + static const AndroidThermalState ANDROID_THERMAL_STATE_EMERGENCY = AndroidThermalState._(6, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_EMERGENCY'); + static const AndroidThermalState ANDROID_THERMAL_STATE_SHUTDOWN = AndroidThermalState._(7, _omitEnumNames ? '' : 'ANDROID_THERMAL_STATE_SHUTDOWN'); + + static const $core.List values = [ + ANDROID_THERMAL_STATE_UNSPECIFIED, + ANDROID_THERMAL_STATE_NONE, + ANDROID_THERMAL_STATE_LIGHT, + ANDROID_THERMAL_STATE_MODERATE, + ANDROID_THERMAL_STATE_SEVERE, + ANDROID_THERMAL_STATE_CRITICAL, + ANDROID_THERMAL_STATE_EMERGENCY, + ANDROID_THERMAL_STATE_SHUTDOWN, + ]; + + static final $core.Map<$core.int, AndroidThermalState> _byValue = $pb.ProtobufEnum.initByValue(values); + static AndroidThermalState? valueOf($core.int value) => _byValue[value]; + + const AndroidThermalState._($core.int v, $core.String n) : super(v, n); +} + +/// AppleThermalState is the thermal state as reported by Apple devices when available or applicable to the platform. +/// The full list of states (enum) is available here: https://developer.apple.com/documentation/foundation/processinfo/thermalstate +class AppleThermalState extends $pb.ProtobufEnum { + static const AppleThermalState APPLE_THERMAL_STATE_UNSPECIFIED = AppleThermalState._(0, _omitEnumNames ? '' : 'APPLE_THERMAL_STATE_UNSPECIFIED'); + static const AppleThermalState APPLE_THERMAL_STATE_NOMINAL = AppleThermalState._(1, _omitEnumNames ? '' : 'APPLE_THERMAL_STATE_NOMINAL'); + static const AppleThermalState APPLE_THERMAL_STATE_FAIR = AppleThermalState._(2, _omitEnumNames ? '' : 'APPLE_THERMAL_STATE_FAIR'); + static const AppleThermalState APPLE_THERMAL_STATE_SERIOUS = AppleThermalState._(3, _omitEnumNames ? '' : 'APPLE_THERMAL_STATE_SERIOUS'); + static const AppleThermalState APPLE_THERMAL_STATE_CRITICAL = AppleThermalState._(4, _omitEnumNames ? '' : 'APPLE_THERMAL_STATE_CRITICAL'); + + static const $core.List values = [ + APPLE_THERMAL_STATE_UNSPECIFIED, + APPLE_THERMAL_STATE_NOMINAL, + APPLE_THERMAL_STATE_FAIR, + APPLE_THERMAL_STATE_SERIOUS, + APPLE_THERMAL_STATE_CRITICAL, + ]; + + static final $core.Map<$core.int, AppleThermalState> _byValue = $pb.ProtobufEnum.initByValue(values); + static AppleThermalState? valueOf($core.int value) => _byValue[value]; + + const AppleThermalState._($core.int v, $core.String n) : super(v, n); +} + const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart index 368537a4..1ff5d3d9 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart @@ -221,6 +221,49 @@ final $typed_data.Uint8List websocketReconnectStrategyDescriptor = $convert.base '9DS0VUX1JFQ09OTkVDVF9TVFJBVEVHWV9SRUpPSU4QAxIoCiRXRUJTT0NLRVRfUkVDT05ORUNU' 'X1NUUkFURUdZX01JR1JBVEUQBA=='); +@$core.Deprecated('Use androidThermalStateDescriptor instead') +const AndroidThermalState$json = { + '1': 'AndroidThermalState', + '2': [ + {'1': 'ANDROID_THERMAL_STATE_UNSPECIFIED', '2': 0}, + {'1': 'ANDROID_THERMAL_STATE_NONE', '2': 1}, + {'1': 'ANDROID_THERMAL_STATE_LIGHT', '2': 2}, + {'1': 'ANDROID_THERMAL_STATE_MODERATE', '2': 3}, + {'1': 'ANDROID_THERMAL_STATE_SEVERE', '2': 4}, + {'1': 'ANDROID_THERMAL_STATE_CRITICAL', '2': 5}, + {'1': 'ANDROID_THERMAL_STATE_EMERGENCY', '2': 6}, + {'1': 'ANDROID_THERMAL_STATE_SHUTDOWN', '2': 7}, + ], +}; + +/// Descriptor for `AndroidThermalState`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List androidThermalStateDescriptor = $convert.base64Decode( + 'ChNBbmRyb2lkVGhlcm1hbFN0YXRlEiUKIUFORFJPSURfVEhFUk1BTF9TVEFURV9VTlNQRUNJRk' + 'lFRBAAEh4KGkFORFJPSURfVEhFUk1BTF9TVEFURV9OT05FEAESHwobQU5EUk9JRF9USEVSTUFM' + 'X1NUQVRFX0xJR0hUEAISIgoeQU5EUk9JRF9USEVSTUFMX1NUQVRFX01PREVSQVRFEAMSIAocQU' + '5EUk9JRF9USEVSTUFMX1NUQVRFX1NFVkVSRRAEEiIKHkFORFJPSURfVEhFUk1BTF9TVEFURV9D' + 'UklUSUNBTBAFEiMKH0FORFJPSURfVEhFUk1BTF9TVEFURV9FTUVSR0VOQ1kQBhIiCh5BTkRST0' + 'lEX1RIRVJNQUxfU1RBVEVfU0hVVERPV04QBw=='); + +@$core.Deprecated('Use appleThermalStateDescriptor instead') +const AppleThermalState$json = { + '1': 'AppleThermalState', + '2': [ + {'1': 'APPLE_THERMAL_STATE_UNSPECIFIED', '2': 0}, + {'1': 'APPLE_THERMAL_STATE_NOMINAL', '2': 1}, + {'1': 'APPLE_THERMAL_STATE_FAIR', '2': 2}, + {'1': 'APPLE_THERMAL_STATE_SERIOUS', '2': 3}, + {'1': 'APPLE_THERMAL_STATE_CRITICAL', '2': 4}, + ], +}; + +/// Descriptor for `AppleThermalState`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List appleThermalStateDescriptor = $convert.base64Decode( + 'ChFBcHBsZVRoZXJtYWxTdGF0ZRIjCh9BUFBMRV9USEVSTUFMX1NUQVRFX1VOU1BFQ0lGSUVEEA' + 'ASHwobQVBQTEVfVEhFUk1BTF9TVEFURV9OT01JTkFMEAESHAoYQVBQTEVfVEhFUk1BTF9TVEFU' + 'RV9GQUlSEAISHwobQVBQTEVfVEhFUk1BTF9TVEFURV9TRVJJT1VTEAMSIAocQVBQTEVfVEhFUk' + '1BTF9TVEFURV9DUklUSUNBTBAE'); + @$core.Deprecated('Use callStateDescriptor instead') const CallState$json = { '1': 'CallState', @@ -355,21 +398,16 @@ final $typed_data.Uint8List videoLayerDescriptor = $convert.base64Decode( const Codec$json = { '1': 'Codec', '2': [ - {'1': 'payload_type', '3': 1, '4': 1, '5': 13, '10': 'payloadType'}, - {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, - {'1': 'fmtp_line', '3': 3, '4': 1, '5': 9, '10': 'fmtpLine'}, - {'1': 'clock_rate', '3': 4, '4': 1, '5': 13, '10': 'clockRate'}, - {'1': 'encoding_parameters', '3': 5, '4': 1, '5': 9, '10': 'encodingParameters'}, - {'1': 'feedbacks', '3': 6, '4': 3, '5': 9, '10': 'feedbacks'}, + {'1': 'mime_type', '3': 1, '4': 1, '5': 9, '10': 'mimeType'}, + {'1': 'scalability_mode', '3': 2, '4': 1, '5': 9, '10': 'scalabilityMode'}, + {'1': 'fmtp', '3': 3, '4': 1, '5': 9, '10': 'fmtp'}, ], }; /// Descriptor for `Codec`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List codecDescriptor = $convert.base64Decode( - 'CgVDb2RlYxIhCgxwYXlsb2FkX3R5cGUYASABKA1SC3BheWxvYWRUeXBlEhIKBG5hbWUYAiABKA' - 'lSBG5hbWUSGwoJZm10cF9saW5lGAMgASgJUghmbXRwTGluZRIdCgpjbG9ja19yYXRlGAQgASgN' - 'UgljbG9ja1JhdGUSLwoTZW5jb2RpbmdfcGFyYW1ldGVycxgFIAEoCVISZW5jb2RpbmdQYXJhbW' - 'V0ZXJzEhwKCWZlZWRiYWNrcxgGIAMoCVIJZmVlZGJhY2tz'); + 'CgVDb2RlYxIbCgltaW1lX3R5cGUYASABKAlSCG1pbWVUeXBlEikKEHNjYWxhYmlsaXR5X21vZG' + 'UYAiABKAlSD3NjYWxhYmlsaXR5TW9kZRISCgRmbXRwGAMgASgJUgRmbXRw'); @$core.Deprecated('Use iCETrickleDescriptor instead') const ICETrickle$json = { @@ -399,6 +437,7 @@ const TrackInfo$json = { {'1': 'stereo', '3': 8, '4': 1, '5': 8, '10': 'stereo'}, {'1': 'red', '3': 9, '4': 1, '5': 8, '10': 'red'}, {'1': 'muted', '3': 10, '4': 1, '5': 8, '10': 'muted'}, + {'1': 'preferred_codecs', '3': 11, '4': 3, '5': 11, '6': '.stream.video.sfu.models.Codec', '10': 'preferredCodecs'}, ], }; @@ -408,7 +447,9 @@ final $typed_data.Uint8List trackInfoDescriptor = $convert.base64Decode( 'EoDjIiLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLlRyYWNrVHlwZVIJdHJhY2tUeXBlEjsKBmxh' 'eWVycxgFIAMoCzIjLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLlZpZGVvTGF5ZXJSBmxheWVycx' 'IQCgNtaWQYBiABKAlSA21pZBIQCgNkdHgYByABKAhSA2R0eBIWCgZzdGVyZW8YCCABKAhSBnN0' - 'ZXJlbxIQCgNyZWQYCSABKAhSA3JlZBIUCgVtdXRlZBgKIAEoCFIFbXV0ZWQ='); + 'ZXJlbxIQCgNyZWQYCSABKAhSA3JlZBIUCgVtdXRlZBgKIAEoCFIFbXV0ZWQSSQoQcHJlZmVycm' + 'VkX2NvZGVjcxgLIAMoCzIeLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLkNvZGVjUg9wcmVmZXJy' + 'ZWRDb2RlY3M='); @$core.Deprecated('Use errorDescriptor instead') const Error$json = { @@ -543,3 +584,49 @@ final $typed_data.Uint8List callGrantsDescriptor = $convert.base64Decode( '8SKgoRY2FuX3B1Ymxpc2hfdmlkZW8YAiABKAhSD2NhblB1Ymxpc2hWaWRlbxInCg9jYW5fc2Ny' 'ZWVuc2hhcmUYAyABKAhSDmNhblNjcmVlbnNoYXJl'); +@$core.Deprecated('Use inputDevicesDescriptor instead') +const InputDevices$json = { + '1': 'InputDevices', + '2': [ + {'1': 'available_devices', '3': 1, '4': 3, '5': 9, '10': 'availableDevices'}, + {'1': 'current_device', '3': 2, '4': 1, '5': 9, '10': 'currentDevice'}, + {'1': 'is_permitted', '3': 3, '4': 1, '5': 8, '10': 'isPermitted'}, + ], +}; + +/// Descriptor for `InputDevices`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List inputDevicesDescriptor = $convert.base64Decode( + 'CgxJbnB1dERldmljZXMSKwoRYXZhaWxhYmxlX2RldmljZXMYASADKAlSEGF2YWlsYWJsZURldm' + 'ljZXMSJQoOY3VycmVudF9kZXZpY2UYAiABKAlSDWN1cnJlbnREZXZpY2USIQoMaXNfcGVybWl0' + 'dGVkGAMgASgIUgtpc1Blcm1pdHRlZA=='); + +@$core.Deprecated('Use androidStateDescriptor instead') +const AndroidState$json = { + '1': 'AndroidState', + '2': [ + {'1': 'thermal_state', '3': 1, '4': 1, '5': 14, '6': '.stream.video.sfu.models.AndroidThermalState', '10': 'thermalState'}, + {'1': 'is_power_saver_mode', '3': 2, '4': 1, '5': 8, '10': 'isPowerSaverMode'}, + ], +}; + +/// Descriptor for `AndroidState`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List androidStateDescriptor = $convert.base64Decode( + 'CgxBbmRyb2lkU3RhdGUSUQoNdGhlcm1hbF9zdGF0ZRgBIAEoDjIsLnN0cmVhbS52aWRlby5zZn' + 'UubW9kZWxzLkFuZHJvaWRUaGVybWFsU3RhdGVSDHRoZXJtYWxTdGF0ZRItChNpc19wb3dlcl9z' + 'YXZlcl9tb2RlGAIgASgIUhBpc1Bvd2VyU2F2ZXJNb2Rl'); + +@$core.Deprecated('Use appleStateDescriptor instead') +const AppleState$json = { + '1': 'AppleState', + '2': [ + {'1': 'thermal_state', '3': 1, '4': 1, '5': 14, '6': '.stream.video.sfu.models.AppleThermalState', '10': 'thermalState'}, + {'1': 'is_low_power_mode_enabled', '3': 2, '4': 1, '5': 8, '10': 'isLowPowerModeEnabled'}, + ], +}; + +/// Descriptor for `AppleState`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List appleStateDescriptor = $convert.base64Decode( + 'CgpBcHBsZVN0YXRlEk8KDXRoZXJtYWxfc3RhdGUYASABKA4yKi5zdHJlYW0udmlkZW8uc2Z1Lm' + '1vZGVscy5BcHBsZVRoZXJtYWxTdGF0ZVIMdGhlcm1hbFN0YXRlEjgKGWlzX2xvd19wb3dlcl9t' + 'b2RlX2VuYWJsZWQYAiABKAhSFWlzTG93UG93ZXJNb2RlRW5hYmxlZA=='); + diff --git a/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pb.dart b/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pb.dart index 59cfb6ca..e8ac65ef 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pb.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pb.dart @@ -221,6 +221,12 @@ class StopNoiseCancellationResponse extends $pb.GeneratedMessage { $0.Error ensureError() => $_ensure(0); } +enum SendStatsRequest_DeviceState { + android, + apple, + notSet +} + class SendStatsRequest extends $pb.GeneratedMessage { factory SendStatsRequest({ $core.String? sessionId, @@ -229,6 +235,10 @@ class SendStatsRequest extends $pb.GeneratedMessage { $core.String? webrtcVersion, $core.String? sdk, $core.String? sdkVersion, + $0.InputDevices? audioDevices, + $0.InputDevices? videoDevices, + $0.AndroidState? android, + $0.AppleState? apple, }) { final $result = create(); if (sessionId != null) { @@ -249,19 +259,41 @@ class SendStatsRequest extends $pb.GeneratedMessage { if (sdkVersion != null) { $result.sdkVersion = sdkVersion; } + if (audioDevices != null) { + $result.audioDevices = audioDevices; + } + if (videoDevices != null) { + $result.videoDevices = videoDevices; + } + if (android != null) { + $result.android = android; + } + if (apple != null) { + $result.apple = apple; + } return $result; } SendStatsRequest._() : super(); factory SendStatsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory SendStatsRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + static const $core.Map<$core.int, SendStatsRequest_DeviceState> _SendStatsRequest_DeviceStateByTag = { + 9 : SendStatsRequest_DeviceState.android, + 10 : SendStatsRequest_DeviceState.apple, + 0 : SendStatsRequest_DeviceState.notSet + }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SendStatsRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'stream.video.sfu.signal'), createEmptyInstance: create) + ..oo(0, [9, 10]) ..aOS(1, _omitFieldNames ? '' : 'sessionId') ..aOS(2, _omitFieldNames ? '' : 'subscriberStats') ..aOS(3, _omitFieldNames ? '' : 'publisherStats') ..aOS(4, _omitFieldNames ? '' : 'webrtcVersion') ..aOS(5, _omitFieldNames ? '' : 'sdk') ..aOS(6, _omitFieldNames ? '' : 'sdkVersion') + ..aOM<$0.InputDevices>(7, _omitFieldNames ? '' : 'audioDevices', subBuilder: $0.InputDevices.create) + ..aOM<$0.InputDevices>(8, _omitFieldNames ? '' : 'videoDevices', subBuilder: $0.InputDevices.create) + ..aOM<$0.AndroidState>(9, _omitFieldNames ? '' : 'android', subBuilder: $0.AndroidState.create) + ..aOM<$0.AppleState>(10, _omitFieldNames ? '' : 'apple', subBuilder: $0.AppleState.create) ..hasRequiredFields = false ; @@ -286,6 +318,9 @@ class SendStatsRequest extends $pb.GeneratedMessage { static SendStatsRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static SendStatsRequest? _defaultInstance; + SendStatsRequest_DeviceState whichDeviceState() => _SendStatsRequest_DeviceStateByTag[$_whichOneof(0)]!; + void clearDeviceState() => clearField($_whichOneof(0)); + @$pb.TagNumber(1) $core.String get sessionId => $_getSZ(0); @$pb.TagNumber(1) @@ -339,6 +374,50 @@ class SendStatsRequest extends $pb.GeneratedMessage { $core.bool hasSdkVersion() => $_has(5); @$pb.TagNumber(6) void clearSdkVersion() => clearField(6); + + @$pb.TagNumber(7) + $0.InputDevices get audioDevices => $_getN(6); + @$pb.TagNumber(7) + set audioDevices($0.InputDevices v) { setField(7, v); } + @$pb.TagNumber(7) + $core.bool hasAudioDevices() => $_has(6); + @$pb.TagNumber(7) + void clearAudioDevices() => clearField(7); + @$pb.TagNumber(7) + $0.InputDevices ensureAudioDevices() => $_ensure(6); + + @$pb.TagNumber(8) + $0.InputDevices get videoDevices => $_getN(7); + @$pb.TagNumber(8) + set videoDevices($0.InputDevices v) { setField(8, v); } + @$pb.TagNumber(8) + $core.bool hasVideoDevices() => $_has(7); + @$pb.TagNumber(8) + void clearVideoDevices() => clearField(8); + @$pb.TagNumber(8) + $0.InputDevices ensureVideoDevices() => $_ensure(7); + + @$pb.TagNumber(9) + $0.AndroidState get android => $_getN(8); + @$pb.TagNumber(9) + set android($0.AndroidState v) { setField(9, v); } + @$pb.TagNumber(9) + $core.bool hasAndroid() => $_has(8); + @$pb.TagNumber(9) + void clearAndroid() => clearField(9); + @$pb.TagNumber(9) + $0.AndroidState ensureAndroid() => $_ensure(8); + + @$pb.TagNumber(10) + $0.AppleState get apple => $_getN(9); + @$pb.TagNumber(10) + set apple($0.AppleState v) { setField(10, v); } + @$pb.TagNumber(10) + $core.bool hasApple() => $_has(9); + @$pb.TagNumber(10) + void clearApple() => clearField(10); + @$pb.TagNumber(10) + $0.AppleState ensureApple() => $_ensure(9); } class SendStatsResponse extends $pb.GeneratedMessage { diff --git a/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pbjson.dart b/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pbjson.dart index d18915c2..867c7f29 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pbjson.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/signal_rpc/signal.pbjson.dart @@ -77,6 +77,13 @@ const SendStatsRequest$json = { {'1': 'webrtc_version', '3': 4, '4': 1, '5': 9, '10': 'webrtcVersion'}, {'1': 'sdk', '3': 5, '4': 1, '5': 9, '10': 'sdk'}, {'1': 'sdk_version', '3': 6, '4': 1, '5': 9, '10': 'sdkVersion'}, + {'1': 'audio_devices', '3': 7, '4': 1, '5': 11, '6': '.stream.video.sfu.models.InputDevices', '10': 'audioDevices'}, + {'1': 'video_devices', '3': 8, '4': 1, '5': 11, '6': '.stream.video.sfu.models.InputDevices', '10': 'videoDevices'}, + {'1': 'android', '3': 9, '4': 1, '5': 11, '6': '.stream.video.sfu.models.AndroidState', '9': 0, '10': 'android'}, + {'1': 'apple', '3': 10, '4': 1, '5': 11, '6': '.stream.video.sfu.models.AppleState', '9': 0, '10': 'apple'}, + ], + '8': [ + {'1': 'device_state'}, ], }; @@ -86,7 +93,12 @@ final $typed_data.Uint8List sendStatsRequestDescriptor = $convert.base64Decode( 'JzY3JpYmVyX3N0YXRzGAIgASgJUg9zdWJzY3JpYmVyU3RhdHMSJwoPcHVibGlzaGVyX3N0YXRz' 'GAMgASgJUg5wdWJsaXNoZXJTdGF0cxIlCg53ZWJydGNfdmVyc2lvbhgEIAEoCVINd2VicnRjVm' 'Vyc2lvbhIQCgNzZGsYBSABKAlSA3NkaxIfCgtzZGtfdmVyc2lvbhgGIAEoCVIKc2RrVmVyc2lv' - 'bg=='); + 'bhJKCg1hdWRpb19kZXZpY2VzGAcgASgLMiUuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuSW5wdX' + 'REZXZpY2VzUgxhdWRpb0RldmljZXMSSgoNdmlkZW9fZGV2aWNlcxgIIAEoCzIlLnN0cmVhbS52' + 'aWRlby5zZnUubW9kZWxzLklucHV0RGV2aWNlc1IMdmlkZW9EZXZpY2VzEkEKB2FuZHJvaWQYCS' + 'ABKAsyJS5zdHJlYW0udmlkZW8uc2Z1Lm1vZGVscy5BbmRyb2lkU3RhdGVIAFIHYW5kcm9pZBI7' + 'CgVhcHBsZRgKIAEoCzIjLnN0cmVhbS52aWRlby5zZnUubW9kZWxzLkFwcGxlU3RhdGVIAFIFYX' + 'BwbGVCDgoMZGV2aWNlX3N0YXRl'); @$core.Deprecated('Use sendStatsResponseDescriptor instead') const SendStatsResponse$json = { @@ -337,6 +349,7 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> SignalServ '.stream.video.sfu.models.TrackInfo': $0.TrackInfo$json, '.stream.video.sfu.models.VideoLayer': $0.VideoLayer$json, '.stream.video.sfu.models.VideoDimension': $0.VideoDimension$json, + '.stream.video.sfu.models.Codec': $0.Codec$json, '.stream.video.sfu.signal.SetPublisherResponse': SetPublisherResponse$json, '.stream.video.sfu.models.Error': $0.Error$json, '.stream.video.sfu.signal.SendAnswerRequest': SendAnswerRequest$json, @@ -352,6 +365,9 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> SignalServ '.stream.video.sfu.signal.ICERestartRequest': ICERestartRequest$json, '.stream.video.sfu.signal.ICERestartResponse': ICERestartResponse$json, '.stream.video.sfu.signal.SendStatsRequest': SendStatsRequest$json, + '.stream.video.sfu.models.InputDevices': $0.InputDevices$json, + '.stream.video.sfu.models.AndroidState': $0.AndroidState$json, + '.stream.video.sfu.models.AppleState': $0.AppleState$json, '.stream.video.sfu.signal.SendStatsResponse': SendStatsResponse$json, '.stream.video.sfu.signal.StartNoiseCancellationRequest': StartNoiseCancellationRequest$json, '.stream.video.sfu.signal.StartNoiseCancellationResponse': StartNoiseCancellationResponse$json, diff --git a/packages/stream_video/lib/src/call/call.dart b/packages/stream_video/lib/src/call/call.dart index 7b42669b..950ebab6 100644 --- a/packages/stream_video/lib/src/call/call.dart +++ b/packages/stream_video/lib/src/call/call.dart @@ -1314,6 +1314,9 @@ class Call { final audioInputs = mediaDevices .where((d) => d.kind == RtcMediaDeviceKind.audioInput) .toList(); + final videoInputs = mediaDevices + .where((d) => d.kind == RtcMediaDeviceKind.videoInput) + .toList(); var defaultAudioOutput = audioOutputs.firstWhereOrNull((device) { if (settings.audio.defaultDevice == @@ -1332,6 +1335,17 @@ class Call { defaultAudioOutput = audioOutputs.first; } + var defaultVideoInput = videoInputs.firstWhereOrNull( + (device) => device.label + .toLowerCase() + .contains(settings.video.cameraFacing.value.toLowerCase()), + ); + + if (defaultVideoInput == null && videoInputs.length > 2) { + // If it's not front or back then take one of the external cameras + defaultVideoInput = videoInputs.last; + } + final defaultAudioInput = audioInputs .firstWhereOrNull((d) => d.label == defaultAudioOutput?.label) ?? audioInputs.firstOrNull; @@ -1345,6 +1359,7 @@ class Call { ), audioInputDevice: defaultAudioInput, audioOutputDevice: defaultAudioOutput, + videoInputDevice: defaultVideoInput ?? videoInputs.firstOrNull, cameraFacingMode: settings.video.cameraFacing == VideoSettingsRequestCameraFacingEnum.front ? FacingMode.user @@ -1361,7 +1376,9 @@ class Call { _connectOptions.camera, _connectOptions.cameraFacingMode, _connectOptions.targetResolution, + _connectOptions.videoInputDevice?.id, ); + await _applyMicrophoneOption(_connectOptions.microphone); await _applyScreenShareOption( _connectOptions.screenShare, @@ -1385,23 +1402,27 @@ class Call { _logger.v(() => '[applyConnectOptions] finished'); } - Future _applyCameraOption( + Future> _applyCameraOption( TrackOption cameraOption, FacingMode facingMode, StreamTargetResolution? targetResolution, + String? deviceId, ) async { if (cameraOption is TrackProvided) { - await _setLocalTrack(cameraOption.track); + return _setLocalTrack(cameraOption.track); } else if (cameraOption is TrackEnabled) { - await setCameraEnabled( + return setCameraEnabled( enabled: true, constraints: CameraConstraints( facingMode: facingMode, + deviceId: deviceId, params: targetResolution?.toVideoParams() ?? RtcVideoParametersPresets.h720_16x9, ), ); } + + return const Result.success(none); } Future _applyMicrophoneOption(TrackOption microphoneOption) async { @@ -1828,15 +1849,31 @@ class Call { final result = await _session?.flipCamera() ?? Result.error('Session is null'); - if (result.isSuccess) { - _connectOptions = connectOptions.copyWith( - cameraFacingMode: connectOptions.cameraFacingMode.flip(), - ); + await result.fold( + success: (success) async { + final mediaDevicesResult = + await RtcMediaDeviceNotifier.instance.enumerateDevices(); - _stateManager.participantFlipCamera(); - } + final mediaDevices = mediaDevicesResult.fold( + success: (success) => success.data, + failure: (failure) => [], + ); - return result; + final currentInput = mediaDevices + .where((d) => d.id == success.data.mediaConstraints.deviceId) + .firstOrNull; + + _connectOptions = connectOptions.copyWith( + cameraFacingMode: connectOptions.cameraFacingMode.flip(), + videoInputDevice: currentInput, + ); + + _stateManager.participantFlipCamera(currentInput); + }, + failure: (failure) {}, + ); + + return result.map((_) => none); } Future> setVideoInputDevice(RtcMediaDevice device) async { @@ -1844,6 +1881,7 @@ class Call { Result.error('Session is null'); if (result.isSuccess) { + _connectOptions = connectOptions.copyWith(videoInputDevice: device); _stateManager.participantSetVideoInputDevice(device: device); } diff --git a/packages/stream_video/lib/src/call/call_connect_options.dart b/packages/stream_video/lib/src/call/call_connect_options.dart index 90330c36..b8a5a28f 100644 --- a/packages/stream_video/lib/src/call/call_connect_options.dart +++ b/packages/stream_video/lib/src/call/call_connect_options.dart @@ -9,6 +9,7 @@ class CallConnectOptions with EquatableMixin { this.screenShare = TrackDisabled._instance, this.audioOutputDevice, this.audioInputDevice, + this.videoInputDevice, this.speakerDefaultOn = false, this.cameraFacingMode = FacingMode.user, this.targetResolution, @@ -21,6 +22,7 @@ class CallConnectOptions with EquatableMixin { final RtcMediaDevice? audioOutputDevice; final RtcMediaDevice? audioInputDevice; + final RtcMediaDevice? videoInputDevice; final bool speakerDefaultOn; final FacingMode cameraFacingMode; @@ -33,6 +35,7 @@ class CallConnectOptions with EquatableMixin { TrackOption? screenShare, RtcMediaDevice? audioOutputDevice, RtcMediaDevice? audioInputDevice, + RtcMediaDevice? videoInputDevice, FacingMode? cameraFacingMode, bool? speakerDefaultOn, StreamTargetResolution? targetResolution, @@ -44,6 +47,7 @@ class CallConnectOptions with EquatableMixin { screenShare: screenShare ?? this.screenShare, audioOutputDevice: audioOutputDevice ?? this.audioOutputDevice, audioInputDevice: audioInputDevice ?? this.audioInputDevice, + videoInputDevice: videoInputDevice ?? this.videoInputDevice, cameraFacingMode: cameraFacingMode ?? this.cameraFacingMode, speakerDefaultOn: speakerDefaultOn ?? this.speakerDefaultOn, targetResolution: targetResolution ?? this.targetResolution, @@ -59,6 +63,7 @@ class CallConnectOptions with EquatableMixin { screenShare: other.screenShare, audioOutputDevice: other.audioOutputDevice, audioInputDevice: other.audioInputDevice, + videoInputDevice: other.videoInputDevice, cameraFacingMode: other.cameraFacingMode, speakerDefaultOn: other.speakerDefaultOn, targetResolution: other.targetResolution, @@ -73,6 +78,7 @@ class CallConnectOptions with EquatableMixin { screenShare, audioOutputDevice, audioInputDevice, + videoInputDevice, cameraFacingMode, speakerDefaultOn, targetResolution, @@ -87,6 +93,7 @@ class CallConnectOptions with EquatableMixin { ' screenShare: $screenShare, ' ' audioOutput: $audioOutputDevice,' ' audioInput: $audioInputDevice, ' + ' videoInput: $videoInputDevice, ' ' cameraFacingMode: $cameraFacingMode, ' ' speakerDefaultOn: $speakerDefaultOn' ' targetResolution: $targetResolution' diff --git a/packages/stream_video/lib/src/call/session/call_session.dart b/packages/stream_video/lib/src/call/session/call_session.dart index 498732c9..92f1d6db 100644 --- a/packages/stream_video/lib/src/call/session/call_session.dart +++ b/packages/stream_video/lib/src/call/session/call_session.dart @@ -1,11 +1,13 @@ import 'dart:async'; import 'dart:convert'; +import 'package:battery_plus/battery_plus.dart'; import 'package:collection/collection.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:rxdart/rxdart.dart'; import 'package:stream_webrtc_flutter/stream_webrtc_flutter.dart' as rtc; import 'package:system_info2/system_info2.dart'; +import 'package:thermal/thermal.dart'; import '../../../protobuf/video/sfu/event/events.pb.dart' as sfu_events; import '../../../protobuf/video/sfu/models/models.pb.dart' as sfu_models; @@ -15,6 +17,7 @@ import '../../../version.g.dart'; import '../../disposable.dart'; import '../../errors/video_error.dart'; import '../../errors/video_error_composer.dart'; +import '../../extensions/thermal_status_ext.dart'; import '../../sfu/data/events/sfu_events.dart'; import '../../sfu/data/models/sfu_call_state.dart'; import '../../sfu/data/models/sfu_error.dart'; @@ -71,6 +74,26 @@ class CallSession extends Disposable { sdpEditor: sdpEditor, ) { _logger.i(() => ' callCid: $callCid, sessionId: $sessionId'); + + _thermalStatusSubscription = + Thermal().onThermalStatusChanged.listen((ThermalStatus status) { + _thermalStatus = status; + }); + + _mediaDeviceSubscription = + RtcMediaDeviceNotifier.instance.onDeviceChange.listen( + (devices) { + _availableAudioInputs = devices + .where((device) => device.kind == RtcMediaDeviceKind.audioInput) + .map((device) => device.label) + .toList(); + + _availableVideoInputs = devices + .where((device) => device.kind == RtcMediaDeviceKind.videoInput) + .map((device) => device.label) + .toList(); + }, + ); } late final _logger = taggedLogger(tag: '$_tag-$sessionSeq'); @@ -92,6 +115,13 @@ class CallSession extends Disposable { BehaviorSubject? _rtcManagerSubject; StreamSubscription? _eventsSubscription; StreamSubscription>? _statsSubscription; + StreamSubscription>? _mediaDeviceSubscription; + StreamSubscription? _thermalStatusSubscription; + + List? _availableAudioInputs; + List? _availableVideoInputs; + ThermalStatus? _thermalStatus; + Timer? _peerConnectionCheckTimer; sfu_models.ClientDetails? _clientDetails; @@ -285,23 +315,7 @@ class CallSession extends Disposable { _rtcManagerSubject!.add(rtcManager!); - await _statsSubscription?.cancel(); - _statsSubscription = rtcManager?.statsStream.listen((rawStats) { - sfuClient.sendStats( - sfu.SendStatsRequest( - sessionId: sessionId, - publisherStats: jsonEncode(rawStats['publisherStats']), - subscriberStats: jsonEncode(rawStats['subscriberStats']), - sdkVersion: streamVideoVersion, - sdk: streamSdkName, - webrtcVersion: switch (CurrentPlatform.type) { - PlatformType.android => androidWebRTCVersion, - PlatformType.ios => iosWebRTCVersion, - _ => null, - }, - ), - ); - }); + await observePeerConnectionStats(); _logger.d(() => '[start] completed'); return Result.success( @@ -410,9 +424,9 @@ class CallSession extends Disposable { await _stats.close(); await _eventsSubscription?.cancel(); - _eventsSubscription = null; await _statsSubscription?.cancel(); - _statsSubscription = null; + await _mediaDeviceSubscription?.cancel(); + await _thermalStatusSubscription?.cancel(); await sfuWS.disconnect( code.value, @@ -866,14 +880,14 @@ class CallSession extends Disposable { return result.map((_) => none); } - Future> flipCamera() async { + Future>> flipCamera() async { final rtcManager = this.rtcManager; if (rtcManager == null) { return Result.error('Unable to flip camera, Call not connected'); } final result = await rtcManager.flipCamera(); - return result.map((_) => none); + return result; } Future> setVideoInputDevice(RtcMediaDevice device) async { @@ -896,6 +910,66 @@ class CallSession extends Disposable { return result.map((_) => none); } + Future observePeerConnectionStats() async { + await _statsSubscription?.cancel(); + + _statsSubscription = rtcManager?.statsStream.listen((rawStats) async { + final lowPowerMode = await Battery().isInBatterySaveMode; + + sfu_models.AndroidState? androidState; + sfu_models.AppleState? appleState; + + final audioInputDevices = sfu_models.InputDevices( + availableDevices: _availableAudioInputs, + currentDevice: stateManager.callState.audioInputDevice?.label, + isPermitted: stateManager.callState.audioInputDevice != null && + stateManager.callState.ownCapabilities + .contains(CallPermission.sendAudio), + ); + + final videoInputDevices = sfu_models.InputDevices( + availableDevices: _availableVideoInputs, + currentDevice: stateManager.callState.videoInputDevice?.label, + isPermitted: stateManager.callState.videoInputDevice != null && + stateManager.callState.ownCapabilities + .contains(CallPermission.sendVideo), + ); + + if (CurrentPlatform.isAndroid) { + androidState = sfu_models.AndroidState( + thermalState: _thermalStatus?.toAndroidThermalState(), + isPowerSaverMode: lowPowerMode, + ); + } else if (CurrentPlatform.isIos) { + appleState = sfu_models.AppleState( + thermalState: _thermalStatus?.toAppleThermalState(), + isLowPowerModeEnabled: lowPowerMode, + ); + } + + final request = sfu.SendStatsRequest( + sessionId: sessionId, + publisherStats: jsonEncode(rawStats['publisherStats']), + subscriberStats: jsonEncode(rawStats['subscriberStats']), + sdkVersion: streamVideoVersion, + sdk: streamSdkName, + android: androidState, + apple: appleState, + audioDevices: audioInputDevices, + videoDevices: videoInputDevices, + webrtcVersion: switch (CurrentPlatform.type) { + PlatformType.android => androidWebRTCVersion, + PlatformType.ios => iosWebRTCVersion, + _ => null, + }, + ); + + await sfuClient.sendStats( + request, + ); + }); + } + @override String toString() => 'CallSession{seq: $sessionSeq, id: $sessionId}'; } diff --git a/packages/stream_video/lib/src/call/state/mixins/state_lifecycle_mixin.dart b/packages/stream_video/lib/src/call/state/mixins/state_lifecycle_mixin.dart index 820dbcb4..fd555224 100644 --- a/packages/stream_video/lib/src/call/state/mixins/state_lifecycle_mixin.dart +++ b/packages/stream_video/lib/src/call/state/mixins/state_lifecycle_mixin.dart @@ -106,6 +106,7 @@ mixin StateLifecycleMixin on StateNotifier { isRingingFlow: ringing, audioOutputDevice: callConnectOptions.audioOutputDevice, audioInputDevice: callConnectOptions.audioInputDevice, + videoInputDevice: callConnectOptions.videoInputDevice, ); } @@ -155,6 +156,7 @@ mixin StateLifecycleMixin on StateNotifier { ), audioOutputDevice: callConnectOptions?.audioOutputDevice, audioInputDevice: callConnectOptions?.audioInputDevice, + videoInputDevice: callConnectOptions?.videoInputDevice, ); } diff --git a/packages/stream_video/lib/src/call/state/mixins/state_participant_mixin.dart b/packages/stream_video/lib/src/call/state/mixins/state_participant_mixin.dart index 748cc22a..97a14b19 100644 --- a/packages/stream_video/lib/src/call/state/mixins/state_participant_mixin.dart +++ b/packages/stream_video/lib/src/call/state/mixins/state_participant_mixin.dart @@ -166,8 +166,9 @@ mixin StateParticipantMixin on StateNotifier { ); } - void participantFlipCamera() { + void participantFlipCamera(RtcMediaDevice? videoDevice) { state = state.copyWith( + videoInputDevice: videoDevice, callParticipants: state.callParticipants.map((participant) { if (participant.isLocal) { final trackState = participant.publishedTracks[SfuTrackType.video]; diff --git a/packages/stream_video/lib/src/extensions/thermal_status_ext.dart b/packages/stream_video/lib/src/extensions/thermal_status_ext.dart new file mode 100644 index 00000000..07836884 --- /dev/null +++ b/packages/stream_video/lib/src/extensions/thermal_status_ext.dart @@ -0,0 +1,42 @@ +import 'package:thermal/thermal.dart'; +import '../../../protobuf/video/sfu/models/models.pb.dart' as sfu_models; + +extension TherlalStatusExt on ThermalStatus { + sfu_models.AndroidThermalState toAndroidThermalState() { + return switch (this) { + ThermalStatus.none => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_NONE, + ThermalStatus.light => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_LIGHT, + ThermalStatus.moderate => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_MODERATE, + ThermalStatus.severe => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_SEVERE, + ThermalStatus.critical => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_CRITICAL, + ThermalStatus.emergency => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_EMERGENCY, + ThermalStatus.shutdown => + sfu_models.AndroidThermalState.ANDROID_THERMAL_STATE_SHUTDOWN, + }; + } + + sfu_models.AppleThermalState toAppleThermalState() { + return switch (this) { + ThermalStatus.none => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_NOMINAL, + ThermalStatus.light => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_FAIR, + ThermalStatus.moderate => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_FAIR, + ThermalStatus.severe => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_SERIOUS, + ThermalStatus.critical => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_CRITICAL, + ThermalStatus.emergency => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_CRITICAL, + ThermalStatus.shutdown => + sfu_models.AppleThermalState.APPLE_THERMAL_STATE_CRITICAL, + }; + } +} diff --git a/packages/stream_video/lib/src/sfu/data/events/sfu_event_mapper_extensions.dart b/packages/stream_video/lib/src/sfu/data/events/sfu_event_mapper_extensions.dart index 127740c3..61aa4f48 100644 --- a/packages/stream_video/lib/src/sfu/data/events/sfu_event_mapper_extensions.dart +++ b/packages/stream_video/lib/src/sfu/data/events/sfu_event_mapper_extensions.dart @@ -324,9 +324,6 @@ extension SfuWebsocketReconnectStrategyExtension extension SfuAudioSenderExtension on sfu_events.AudioSender { SfuAudioSender toDomain() { return SfuAudioSender( - mediaRequest: SfuAudioMediaRequest( - channelCount: mediaRequest.channelCount, - ), codec: codec.toDomain(), ); } @@ -336,11 +333,6 @@ extension SfuAudioSenderExtension on sfu_events.AudioSender { extension SfuVideoSenderExtension on sfu_events.VideoSender { SfuVideoSender toDomain() { return SfuVideoSender( - mediaRequest: SfuVideoMediaRequest( - idealHeight: mediaRequest.idealHeight, - idealWidth: mediaRequest.idealWidth, - idealFrameRate: mediaRequest.idealFrameRate, - ), codec: codec.toDomain(), layers: layers.map((it) => it.toDomain()).toList(), ); @@ -351,12 +343,9 @@ extension SfuVideoSenderExtension on sfu_events.VideoSender { extension SfuCodecExtension on sfu_models.Codec { SfuCodec toDomain() { return SfuCodec( - payloadType: payloadType, - name: name, - fmtpLine: fmtpLine, - clockRate: clockRate, - encodingParameters: encodingParameters, - feedbacks: feedbacks, + mimeType: mimeType, + scalabilityMode: scalabilityMode, + fmtp: fmtp, ); } } @@ -367,26 +356,10 @@ extension on sfu_events.VideoLayerSetting { name: name, active: active, maxBitrate: maxBitrate, + maxFramerate: maxFramerate, scaleResolutionDownBy: scaleResolutionDownBy, - priority: priority.toDomain(), + scalabilityMode: scalabilityMode, codec: codec.toDomain(), ); } } - -extension on sfu_events.VideoLayerSetting_Priority { - SfuVideoLayerSettingPriority toDomain() { - switch (this) { - case sfu_events.VideoLayerSetting_Priority.PRIORITY_HIGH_UNSPECIFIED: - return SfuVideoLayerSettingPriority.high; - case sfu_events.VideoLayerSetting_Priority.PRIORITY_LOW: - return SfuVideoLayerSettingPriority.low; - case sfu_events.VideoLayerSetting_Priority.PRIORITY_MEDIUM: - return SfuVideoLayerSettingPriority.medium; - case sfu_events.VideoLayerSetting_Priority.PRIORITY_VERY_LOW: - return SfuVideoLayerSettingPriority.veryLow; - default: - throw StateError('unexpected VideoLayerSetting_Priority: $this'); - } - } -} diff --git a/packages/stream_video/lib/src/sfu/data/models/sfu_audio_sender.dart b/packages/stream_video/lib/src/sfu/data/models/sfu_audio_sender.dart index eff353c0..645a9e48 100644 --- a/packages/stream_video/lib/src/sfu/data/models/sfu_audio_sender.dart +++ b/packages/stream_video/lib/src/sfu/data/models/sfu_audio_sender.dart @@ -5,16 +5,14 @@ import 'sfu_codec.dart'; @immutable class SfuAudioSender { const SfuAudioSender({ - required this.mediaRequest, required this.codec, }); - final SfuAudioMediaRequest mediaRequest; final SfuCodec codec; @override String toString() { - return 'SfuAudioSender{mediaRequest: $mediaRequest, codec: $codec}'; + return 'SfuAudioSender{codec: $codec}'; } @override @@ -22,33 +20,8 @@ class SfuAudioSender { identical(this, other) || other is SfuAudioSender && runtimeType == other.runtimeType && - mediaRequest == other.mediaRequest && codec == other.codec; @override - int get hashCode => mediaRequest.hashCode ^ codec.hashCode; -} - -@immutable -class SfuAudioMediaRequest { - const SfuAudioMediaRequest({ - required this.channelCount, - }); - - final int channelCount; - - @override - String toString() { - return 'SfuAudioLevel{channelCount: $channelCount}'; - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is SfuAudioMediaRequest && - runtimeType == other.runtimeType && - channelCount == other.channelCount; - - @override - int get hashCode => channelCount.hashCode; + int get hashCode => codec.hashCode; } diff --git a/packages/stream_video/lib/src/sfu/data/models/sfu_codec.dart b/packages/stream_video/lib/src/sfu/data/models/sfu_codec.dart index 3e72c360..b0881ea4 100644 --- a/packages/stream_video/lib/src/sfu/data/models/sfu_codec.dart +++ b/packages/stream_video/lib/src/sfu/data/models/sfu_codec.dart @@ -3,26 +3,18 @@ import 'package:meta/meta.dart'; @immutable class SfuCodec { const SfuCodec({ - required this.payloadType, - required this.name, - required this.fmtpLine, - required this.clockRate, - required this.encodingParameters, - required this.feedbacks, + required this.mimeType, + required this.scalabilityMode, + required this.fmtp, }); - final int payloadType; - final String name; - final String fmtpLine; - final int clockRate; - final String encodingParameters; - final List feedbacks; + final String mimeType; + final String scalabilityMode; + final String fmtp; @override String toString() { - return 'SfuCodec{payloadType: $payloadType, name: $name, ' - 'fmtpLine: $fmtpLine, clockRate: $clockRate, ' - 'encodingParameters: $encodingParameters, feedbacks: $feedbacks}'; + return 'SfuCodec{mimeType: $mimeType, scalabilityMode: $scalabilityMode, fmtp: $fmtp}'; } @override @@ -30,19 +22,11 @@ class SfuCodec { identical(this, other) || other is SfuCodec && runtimeType == other.runtimeType && - payloadType == other.payloadType && - name == other.name && - fmtpLine == other.fmtpLine && - clockRate == other.clockRate && - encodingParameters == other.encodingParameters && - feedbacks == other.feedbacks; + mimeType == other.mimeType && + scalabilityMode == other.scalabilityMode && + fmtp == other.fmtp; @override int get hashCode => - payloadType.hashCode ^ - name.hashCode ^ - fmtpLine.hashCode ^ - clockRate.hashCode ^ - encodingParameters.hashCode ^ - feedbacks.hashCode; + mimeType.hashCode ^ scalabilityMode.hashCode ^ fmtp.hashCode; } diff --git a/packages/stream_video/lib/src/sfu/data/models/sfu_video_layer_setting.dart b/packages/stream_video/lib/src/sfu/data/models/sfu_video_layer_setting.dart index 326250bf..326f2a10 100644 --- a/packages/stream_video/lib/src/sfu/data/models/sfu_video_layer_setting.dart +++ b/packages/stream_video/lib/src/sfu/data/models/sfu_video_layer_setting.dart @@ -7,16 +7,18 @@ class SfuVideoLayerSetting with EquatableMixin { required this.name, required this.active, required this.maxBitrate, + required this.maxFramerate, required this.scaleResolutionDownBy, - required this.priority, + required this.scalabilityMode, required this.codec, }); final String name; final bool active; final int maxBitrate; + final int maxFramerate; final double scaleResolutionDownBy; - final SfuVideoLayerSettingPriority priority; + final String scalabilityMode; final SfuCodec codec; @override @@ -27,18 +29,9 @@ class SfuVideoLayerSetting with EquatableMixin { name, active, maxBitrate, + maxFramerate, scaleResolutionDownBy, - priority, + scalabilityMode, codec, ]; } - -enum SfuVideoLayerSettingPriority { - high, - medium, - low, - veryLow; - - @override - String toString() => name; -} diff --git a/packages/stream_video/lib/src/sfu/data/models/sfu_video_sender.dart b/packages/stream_video/lib/src/sfu/data/models/sfu_video_sender.dart index 342e3393..578e4384 100644 --- a/packages/stream_video/lib/src/sfu/data/models/sfu_video_sender.dart +++ b/packages/stream_video/lib/src/sfu/data/models/sfu_video_sender.dart @@ -5,12 +5,10 @@ import 'sfu_video_layer_setting.dart'; class SfuVideoSender with EquatableMixin { SfuVideoSender({ - required this.mediaRequest, required this.codec, required this.layers, }); - final SfuVideoMediaRequest mediaRequest; final SfuCodec codec; final List layers; @@ -18,23 +16,5 @@ class SfuVideoSender with EquatableMixin { bool? get stringify => true; @override - List get props => [mediaRequest, codec, layers]; -} - -class SfuVideoMediaRequest with EquatableMixin { - SfuVideoMediaRequest({ - required this.idealHeight, - required this.idealWidth, - required this.idealFrameRate, - }); - - final int idealHeight; - final int idealWidth; - final int idealFrameRate; - - @override - bool? get stringify => true; - - @override - List get props => [idealHeight, idealWidth, idealFrameRate]; + List get props => [codec, layers]; } diff --git a/packages/stream_video/lib/src/sfu/sfu_client.dart b/packages/stream_video/lib/src/sfu/sfu_client.dart index 8ffdff11..c1deb734 100644 --- a/packages/stream_video/lib/src/sfu/sfu_client.dart +++ b/packages/stream_video/lib/src/sfu/sfu_client.dart @@ -121,7 +121,7 @@ class SfuClient { sfu.SendStatsRequest request, ) async { try { - _logger.d(() => '[sendStats] request: $request'); + _logger.v(() => '[sendStats] request: $request'); final response = await _client.sendStats(_withAuthHeaders(), request); _logger.v(() => '[sendStats] response: $response'); return Result.success(response); diff --git a/packages/stream_video/lib/src/stream_video.dart b/packages/stream_video/lib/src/stream_video.dart index 8bbb6af9..0aa2ca5e 100644 --- a/packages/stream_video/lib/src/stream_video.dart +++ b/packages/stream_video/lib/src/stream_video.dart @@ -644,6 +644,7 @@ class StreamVideo extends Disposable { return; } + unawaited(callToJoin.join()); onCallAccepted?.call(callToJoin); } diff --git a/packages/stream_video/lib/src/webrtc/rtc_track/rtc_local_track.dart b/packages/stream_video/lib/src/webrtc/rtc_track/rtc_local_track.dart index 30f44856..089bede2 100644 --- a/packages/stream_video/lib/src/webrtc/rtc_track/rtc_local_track.dart +++ b/packages/stream_video/lib/src/webrtc/rtc_track/rtc_local_track.dart @@ -5,9 +5,11 @@ import '../../exceptions/video_exception.dart'; import '../../logger/stream_log.dart'; import '../../platform_detector/platform_detector.dart'; import '../../sfu/data/models/sfu_track_type.dart'; +import '../../utils/result.dart'; import '../media/media_constraints.dart'; import '../model/rtc_video_dimension.dart'; import '../rtc_media_device/rtc_media_device.dart'; +import '../rtc_media_device/rtc_media_device_notifier.dart'; import 'rtc_track.dart'; const kLocalTrackIdPrefix = 'local'; @@ -217,9 +219,26 @@ extension RtcLocalCameraTrackHardwareExt on RtcLocalCameraTrack { // Use the native switchCamera method. final isFrontCamera = await rtc.Helper.switchCamera(mediaTrack); + + final mediaDevicesResult = await RtcMediaDeviceNotifier.instance + .enumerateDevices(kind: RtcMediaDeviceKind.videoInput); + + final mediaDevices = mediaDevicesResult.fold( + success: (success) => success.data, + failure: (failure) => [], + ); + + final currentCamera = mediaDevices + .where( + (d) => + d.label.toLowerCase().contains(isFrontCamera ? 'front' : 'back'), + ) + .firstOrNull; + return copyWith( mediaConstraints: mediaConstraints.copyWith( facingMode: isFrontCamera ? FacingMode.user : FacingMode.environment, + deviceId: currentCamera?.id, ), ); } diff --git a/packages/stream_video/pubspec.yaml b/packages/stream_video/pubspec.yaml index 579a41cd..362ec35c 100644 --- a/packages/stream_video/pubspec.yaml +++ b/packages/stream_video/pubspec.yaml @@ -12,6 +12,7 @@ environment: dependencies: async: ^2.11.0 + battery_plus: ^6.2.0 collection: ^1.18.0 connectivity_plus: ^6.0.4 dart_webrtc: ^1.4.9 @@ -33,6 +34,7 @@ dependencies: synchronized: ^3.1.0 system_info2: ^4.0.0 tart: ^0.5.1 + thermal: ^1.1.8 uuid: ^4.2.1 web: ^1.0.0 web_socket_channel: ^3.0.1 diff --git a/packages/stream_video_push_notification/lib/src/stream_video_push_notification.dart b/packages/stream_video_push_notification/lib/src/stream_video_push_notification.dart index 66127a33..ab53266a 100644 --- a/packages/stream_video_push_notification/lib/src/stream_video_push_notification.dart +++ b/packages/stream_video_push_notification/lib/src/stream_video_push_notification.dart @@ -164,7 +164,6 @@ class StreamVideoPushNotificationManager implements PushNotificationManager { onCallEvent.whereType().listen( (_) { if (!client.isConnected) { - _wasWsConnected = client.isConnected; client.openConnection(); } @@ -179,12 +178,7 @@ class StreamVideoPushNotificationManager implements PushNotificationManager { onCallEvent.whereType().map((_) => null), onCallEvent.whereType().map((_) => null), ]).listen( - (_) { - if (_wasWsConnected == false) { - _wasWsConnected = null; - client.closeConnection(); - } - + (event) { _subscriptions.cancel(_idCallAccepted); _subscriptions.cancel(_idCallEnded); _subscriptions.cancel(_idCallRejected); @@ -203,7 +197,6 @@ class StreamVideoPushNotificationManager implements PushNotificationManager { late SharedPreferences _sharedPreferences; final _logger = taggedLogger(tag: 'SV:PNManager'); - bool? _wasWsConnected; final Subscriptions _subscriptions = Subscriptions();