fix:调整兼容ios的对讲解码流程

This commit is contained in:
liyi 2025-06-25 18:48:31 +08:00
parent 1103e61152
commit 9acb5f4cce
2 changed files with 20 additions and 18 deletions

View File

@ -239,25 +239,27 @@ class StartChartManage {
// udp // udp
Future<void> _onlineRelayService() async { Future<void> _onlineRelayService() async {
var addressIListenFrom = InternetAddress.anyIPv4; var addressIListenFrom = InternetAddress.anyIPv4;
RawDatagramSocket.bind(addressIListenFrom, localPort) await RawDatagramSocket.bind(addressIListenFrom, localPort)
.then((RawDatagramSocket socket) { .then((RawDatagramSocket socket) {
// (SO_RCVBUF = 8) // (SO_RCVBUF = 8)
socket.setRawOption( if (AppPlatform.isAndroid) {
RawSocketOption.fromInt( socket.setRawOption(
RawSocketOption.levelSocket, RawSocketOption.fromInt(
8, // SO_RCVBUF for Android/iOS RawSocketOption.levelSocket,
2 * 1024 * 1024, // 2MB receive buffer 8, // SO_RCVBUF for Android/iOS
), 2 * 1024 * 1024, // 2MB receive buffer
); ),
);
// (SO_SNDBUF = 7) // (SO_SNDBUF = 7)
socket.setRawOption( socket.setRawOption(
RawSocketOption.fromInt( RawSocketOption.fromInt(
RawSocketOption.levelSocket, RawSocketOption.levelSocket,
7, // SO_SNDBUF for Android/iOS 7, // SO_SNDBUF for Android/iOS
2 * 1024 * 1024, // 2MB send buffer 2 * 1024 * 1024, // 2MB send buffer
), ),
); );
}
_udpSocket = socket; _udpSocket = socket;

View File

@ -106,9 +106,9 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
state.isLoading.value = true; state.isLoading.value = true;
// //
final config = VideoDecoderConfig( final config = VideoDecoderConfig(
width: StartChartManage().videoWidth, width: 864,
// //
height: StartChartManage().videoHeight, height: 480,
codecType: 'h264', codecType: 'h264',
); );
// textureId // textureId