fix:调整兼容ios的对讲解码流程
This commit is contained in:
parent
1103e61152
commit
9acb5f4cce
@ -239,25 +239,27 @@ class StartChartManage {
|
||||
// 初始化udp
|
||||
Future<void> _onlineRelayService() async {
|
||||
var addressIListenFrom = InternetAddress.anyIPv4;
|
||||
RawDatagramSocket.bind(addressIListenFrom, localPort)
|
||||
await RawDatagramSocket.bind(addressIListenFrom, localPort)
|
||||
.then((RawDatagramSocket socket) {
|
||||
// 设置接收缓冲区大小 (SO_RCVBUF = 8)
|
||||
socket.setRawOption(
|
||||
RawSocketOption.fromInt(
|
||||
RawSocketOption.levelSocket,
|
||||
8, // SO_RCVBUF for Android/iOS
|
||||
2 * 1024 * 1024, // 2MB receive buffer
|
||||
),
|
||||
);
|
||||
if (AppPlatform.isAndroid) {
|
||||
socket.setRawOption(
|
||||
RawSocketOption.fromInt(
|
||||
RawSocketOption.levelSocket,
|
||||
8, // SO_RCVBUF for Android/iOS
|
||||
2 * 1024 * 1024, // 2MB receive buffer
|
||||
),
|
||||
);
|
||||
|
||||
// 设置发送缓冲区大小 (SO_SNDBUF = 7)
|
||||
socket.setRawOption(
|
||||
RawSocketOption.fromInt(
|
||||
RawSocketOption.levelSocket,
|
||||
7, // SO_SNDBUF for Android/iOS
|
||||
2 * 1024 * 1024, // 2MB send buffer
|
||||
),
|
||||
);
|
||||
// 设置发送缓冲区大小 (SO_SNDBUF = 7)
|
||||
socket.setRawOption(
|
||||
RawSocketOption.fromInt(
|
||||
RawSocketOption.levelSocket,
|
||||
7, // SO_SNDBUF for Android/iOS
|
||||
2 * 1024 * 1024, // 2MB send buffer
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_udpSocket = socket;
|
||||
|
||||
|
||||
@ -106,9 +106,9 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
||||
state.isLoading.value = true;
|
||||
// 创建解码器配置
|
||||
final config = VideoDecoderConfig(
|
||||
width: StartChartManage().videoWidth,
|
||||
width: 864,
|
||||
// 实际视频宽度
|
||||
height: StartChartManage().videoHeight,
|
||||
height: 480,
|
||||
codecType: 'h264',
|
||||
);
|
||||
// 初始化解码器并获取textureId
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user