camera.startSession
启动在固定时间间隔后超时的会话。将相机锁定到
发出请求,并确保摄像头保持唤醒状态。请注意,从
都应该始终允许进行新会话如果已有会话
在开始新会话之前,相机应自动关闭。
此命令已在 API 级别 2 中弃用。
参数
- timeout:(可选)请求的会话超时(以秒为单位)。
如果省略(HTTP 请求没有正文),相机应确定合理的
超时。
结果
- sessionId::字符串类型的唯一会话标识符。
- 超时:已确认的会话超时(以秒为单位)。
错误
- invalidParameterName:输入参数名称无法识别。
- invalidParameterValue::可以识别输入参数名称,但将
传递的值无效;例如,值超出范围或其数据
类型不正确。
命令 I/O |
命令输入 |
{ "parameters": { "timeout": 50 } } |
命令输出 |
{ "results": { "sessionId": "12ABC3", "timeout": 50 } } |
命令输出(错误) |
{ "error": { "code": "cameraInExclusiveUse", "message": "Camera already in exclusive use, new session can't be started." } } |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["Starts a session that locks the camera to the requesting client and keeps it awake, timing out after a specified or default interval."],["A new session can always be started, automatically closing any existing session."],["This command, deprecated in API level 2, returns a unique session ID and the confirmed timeout duration."],["Possible errors include invalid parameter names or values, or the camera already being in exclusive use."]]],["The core action initiates a timed camera session, locking the camera to the client and ensuring it remains active. A new session is always permitted, automatically ending any existing session. The user can optionally specify a session timeout in seconds; otherwise, the camera sets a default. The output includes a unique session ID and the confirmed timeout. Errors can occur if parameter names or values are invalid. This command has been deprecated after API level 2.\n"]]