- Rust: 新增 media::stream 访问单元队列与分片重组,FFI 增加 ttstd_video_next/pending/stats(ABI 2) - Windows: runner 内嵌 Media Foundation 解码纹理插件(NV12/RGB32→BGRA),开启 CODECAPI_AVLowLatencyMode 消除约 36 帧积压,按显示区域裁掉 16 对齐补齐行 - Android: 大帧按 1200 字节分片发送;csd(SPS/PPS) 随每个关键帧重发,修复先投屏后连接时只收到 P 帧导致的黑屏 - Flutter: 独立 ttstd/video 通道获取 textureId 与统计,VideoView 渲染 Texture 并显示分辨率/PTS/失败原因 - 诊断: stats 增加 format/auBytes/keyframes/submitHr;缺插件、缺 SPS/PPS 显式提示;TTSTD_DUMP_VIDEO 可抓码流配合 ffprobe 定位 - 发现与服务检查: mDNS 发现客户端、服务地址探测、设置页与连接状态卡片(启动本机监听/停止) - 工具与文档: video_feed 推流示例、一键打包脚本、DEMO 出画面排查表与实测截图
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
import 'dart:async';
|
|
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'models.dart';
|
|
|
|
class DiscoveryClient {
|
|
static Future<List<DeviceInfo>> listDevices(
|
|
String signalingUrl, {
|
|
Duration timeout = const Duration(seconds: 2),
|
|
}) async {
|
|
final trimmed = signalingUrl.trim();
|
|
if (trimmed.isEmpty) return const <DeviceInfo>[];
|
|
final client = HttpClient()..connectionTimeout = timeout;
|
|
try {
|
|
final base = Uri.parse(trimmed);
|
|
final path = base.path.endsWith('/')
|
|
? '${base.path}list'
|
|
: '${base.path}/list';
|
|
final request = await client.getUrl(base.replace(path: path)).timeout(timeout);
|
|
final response = await request.close().timeout(timeout);
|
|
final body = await utf8.decoder.bind(response).join().timeout(timeout);
|
|
if (response.statusCode != HttpStatus.ok) return const <DeviceInfo>[];
|
|
final value = jsonDecode(body);
|
|
if (value is! Map) return const <DeviceInfo>[];
|
|
return DeviceInfo.listFromJson(value['devices']);
|
|
} on Object {
|
|
return const <DeviceInfo>[];
|
|
} finally {
|
|
client.close(force: true);
|
|
}
|
|
}
|
|
}
|