feat(streaming): 添加自编码串流模式切换功能

This commit is contained in:
2026-07-23 12:01:08 +08:00
parent a1c29246d7
commit e56723a010
20 changed files with 1684 additions and 16 deletions

View File

@@ -39,6 +39,7 @@ class ControlMessage extends $pb.GeneratedMessage {
$core.int? width,
$core.int? height,
$core.int? fps,
$core.int? streamMode,
}) {
final result = create();
if (action != null) result.action = action;
@@ -55,6 +56,7 @@ class ControlMessage extends $pb.GeneratedMessage {
if (width != null) result.width = width;
if (height != null) result.height = height;
if (fps != null) result.fps = fps;
if (streamMode != null) result.streamMode = streamMode;
return result;
}
@@ -86,6 +88,7 @@ class ControlMessage extends $pb.GeneratedMessage {
..aI(12, _omitFieldNames ? '' : 'width')
..aI(13, _omitFieldNames ? '' : 'height')
..aI(14, _omitFieldNames ? '' : 'fps')
..aI(15, _omitFieldNames ? '' : 'stream_mode')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -240,6 +243,17 @@ class ControlMessage extends $pb.GeneratedMessage {
$core.bool hasFps() => $_has(13);
@$pb.TagNumber(14)
void clearFps() => $_clearField(14);
/// 串流模式SET_STREAM_MODE / REPORT_STREAM_MODE
/// 0 = WebRTC 全托管1 = 自编码(自建 MediaCodec 编解码 + video DataChannel
@$pb.TagNumber(15)
$core.int get streamMode => $_getIZ(14);
@$pb.TagNumber(15)
set streamMode($core.int value) => $_setSignedInt32(14, value);
@$pb.TagNumber(15)
$core.bool hasStreamMode() => $_has(14);
@$pb.TagNumber(15)
void clearStreamMode() => $_clearField(15);
}
const $core.bool _omitFieldNames =

View File

@@ -29,6 +29,10 @@ class Action extends $pb.ProtobufEnum {
Action._(6, _omitEnumNames ? '' : 'SET_RESOLUTION');
static const Action REPORT_RESOLUTION =
Action._(7, _omitEnumNames ? '' : 'REPORT_RESOLUTION');
static const Action SET_STREAM_MODE =
Action._(8, _omitEnumNames ? '' : 'SET_STREAM_MODE');
static const Action REPORT_STREAM_MODE =
Action._(9, _omitEnumNames ? '' : 'REPORT_STREAM_MODE');
static const $core.List<Action> values = <Action>[
ACTION_UNKNOWN,
@@ -39,10 +43,12 @@ class Action extends $pb.ProtobufEnum {
MOTION_EVENT,
SET_RESOLUTION,
REPORT_RESOLUTION,
SET_STREAM_MODE,
REPORT_STREAM_MODE,
];
static final $core.List<Action?> _byValue =
$pb.ProtobufEnum.$_initByValueList(values, 7);
$pb.ProtobufEnum.$_initByValueList(values, 9);
static Action? valueOf($core.int value) =>
value < 0 || value >= _byValue.length ? null : _byValue[value];