Files
VibeCoding/WebRTCController/app/src/main/proto/control_message.proto
TongTongStudio 362b9f238a feat: 支持手动切换采集帧率
在 Android、Web 及 Flutter 控制端新增帧率选择 UI,被控端按屏幕刷新率生成支持的帧率档位并上报,允许在保持分辨率不变的情况下仅切换帧率。

另附带更新信号服务器的数据库配置。
2026-07-31 03:26:40 +08:00

58 lines
1.9 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
syntax = "proto3";
package com.ttstd.control;
option java_package = "com.ttstd.control";
option java_multiple_files = true;
// 控制指令类型,对应原 JSON 字段 action。
enum Action {
ACTION_UNKNOWN = 0;
TOUCH = 1;
SWIPE = 2;
KEY = 3;
LONG_PRESS = 4;
MOTION_EVENT = 5;
SET_RESOLUTION = 6; // 控制端请求被控端切换屏幕采集分辨率
REPORT_RESOLUTION = 7; // 被控端上报当前实际采集分辨率(含连接建立后的初始值)
SET_STREAM_MODE = 8; // 控制端请求被控端切换屏幕串流模式
REPORT_STREAM_MODE = 9; // 被控端上报当前生效的串流模式
}
// 通过 RTCDataChannel 传输的控制指令protobuf 二进制)。
// 坐标 x/y/x1/y1/x2/y2 均为相对屏幕的百分比,取值范围 0.0 ~ 1.0。
message ControlMessage {
// 指令类型
Action action = 1;
// 单点坐标TOUCH / LONG_PRESS / MOTION_EVENT
double x = 2;
double y = 3;
// 滑动起止坐标SWIPE
double x1 = 4;
double y1 = 5;
double x2 = 6;
double y2 = 7;
int64 duration = 8;
// 按键KEYkey_action 0=按下 1=抬起(对应 Android KeyEvent ACTION_DOWN/UP
int32 key_code = 9;
int32 key_action = 10;
// 原始动作MOTION_EVENT对应 Android MotionEvent ACTION_*0=DOWN 1=UP 2=MOVE
int32 motion_action = 11;
// 分辨率切换SET_RESOLUTION
// width 为目标长边/宽度;<=0 表示使用被控端原始native分辨率。
// height 为目标高度;<=0 时按被控端屏幕宽高比基于 width 计算(保留原始比例)。
// fps 为目标帧率;<=0 表示沿用当前帧率。
int32 width = 12;
int32 height = 13;
int32 fps = 14;
int32 stream_mode = 15; // 串流模式0=WebRTC 内置媒体流1=自编码(MediaCodec 硬编 + DataChannel 透传)
// 被控端支持的帧率档位列表REPORT_RESOLUTION 上报,按屏幕刷新率筛选,升序)。
repeated int32 supported_fps = 16;
}