refactor(videocall): migrate to @riverpod controller pattern and add device config

- Rename ViewModel → Controller, ViewState → State with @riverpod codegen
- Move state/ → providers/ folder for consistency
- Add post-init device configuration (camera, speaker, maxCallNum, mediaConfig)
- Use MediaConfig.generateByMode based on device capabilities.system (rtos/android)
- Add CallParam.ticket for smartwatch wake-up protocol
- Start audio/camera before call, stop on hangup
- Granular video management based on uploadVideoStreamSelf/Other flags
- Build watch userId from device.imei (w_ prefix)
- Add imei field to DeviceEntity
- Add system field to DeviceCapabilitiesEntity with isRtos/isAndroid helpers
This commit is contained in:
2026-04-26 09:54:31 +02:00
parent 9f23ecb42e
commit 57f0f64d08
22 changed files with 444 additions and 236 deletions

View File

@@ -7,24 +7,34 @@ class VideocallItem {
required this.isVideo,
required this.direction,
required this.state,
this.uploadVideoStreamSelf = false,
this.uploadVideoStreamOther = false,
});
final String userId;
final bool isVideo;
final CallDirection direction;
final VideocallState state;
final bool uploadVideoStreamSelf;
final bool uploadVideoStreamOther;
VideocallItem copyWith({
String? userId,
bool? isVideo,
CallDirection? direction,
VideocallState? state,
bool? uploadVideoStreamSelf,
bool? uploadVideoStreamOther,
}) {
return VideocallItem(
userId: userId ?? this.userId,
isVideo: isVideo ?? this.isVideo,
direction: direction ?? this.direction,
state: state ?? this.state,
uploadVideoStreamSelf:
uploadVideoStreamSelf ?? this.uploadVideoStreamSelf,
uploadVideoStreamOther:
uploadVideoStreamOther ?? this.uploadVideoStreamOther,
);
}
}

View File

@@ -265,6 +265,8 @@ class VideocallCallService with JCCallCallback {
? CallDirection.incoming
: CallDirection.outgoing,
state: state,
uploadVideoStreamSelf: item.uploadVideoStreamSelf,
uploadVideoStreamOther: item.uploadVideoStreamOther,
);
}