供应商特定
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
OSC API 规范的 API 级别 1 侧重于图像类型,API 级别 2 中添加了视频支持。我们鼓励相机制造商定义自定义命令和/或根据需要扩展标准命令的参数集。这些参数称为“供应商命令”和“供应商参数”。
供应商特定命令和参数的名称必须是字母数字,且带有下划线 ( _ ) 前缀。
供应商特定的功能可能出现在以下四个地点:
- /osc/info API 的输出
- /osc/state API 的输出
- OSC API 规范,适用于 /osc/commands/execute 的命令
- OSC API 规范,命令参数;例如
setOptions
和 getOptions
命令的参数。
示例 |
请求 (API 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"sessionId": "12ABC3",
"iso": 200,
"exposureCompensation": -2,
"captureMode": "_video"
}
} |
答案 |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.setOptions",
"state": "done"
} |
请求 |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera._startRecording",
"parameters": {
"sessionId": "12ABC3",
...
}
} |
答案 |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera._startRecording",
"state": "done"
} |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe Open Spherical Camera (OSC) API Specification starts with image support in API level 1 and adds video support in API level 2.\u003c/p\u003e\n"],["\u003cp\u003eCamera manufacturers can define custom commands and parameters, called Vendor Commands and Vendor Parameters, by prefixing them with an underscore (_).\u003c/p\u003e\n"],["\u003cp\u003eVendor-specific functionality can be implemented within the output of /osc/info and /osc/state APIs, as well as within OSC API commands and parameters.\u003c/p\u003e\n"],["\u003cp\u003eVendor Commands and Parameters must have alphanumeric names.\u003c/p\u003e\n"]]],["OSC API level 1 supports images, while level 2 adds video. Manufacturers can define custom commands and parameters (Vendor Commands/Parameters), which must be alphanumeric and prefixed with an underscore. Vendor-specific functionality can be found in the output of /osc/info and /osc/state APIs, in the commands for /osc/commands/execute, and in command parameters. Examples demonstrate `setOptions` with vendor-specific parameter `_video`, and a vendor-specific command, `_startRecording`.\n"],null,["# Vendor-Specific\n\nAPI level 1 of the OSC API Specification focuses on image type, and video support is added in API level 2. Camera manufacturers are encouraged to define custom commands and/or extend the parameter set of standard commands if needed. These are known as *Vendor Commands* and *Vendor Parameters*.\n\nThe name of the Vendor-specific commands and parameters must be alphanumeric and prefixed with an underscore ( _ ).\n\nVendor-specific functionality can happen in four places as follows:\n\n- [Output](/streetview/open-spherical-camera/guides/osc/info#output) of /osc/info API\n- [Output](/streetview/open-spherical-camera/guides/osc/state#output) of /osc/state API\n- [OSC API Specification](/streetview/open-spherical-camera/reference/camera), commands for /osc/commands/execute\n- [OSC API Specification](/streetview/open-spherical-camera/reference/camera), command parameters; for example, parameters for the `setOptions` and `getOptions` commands.\n\n| Example ------- ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Request (API 1)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.setOptions\", \"parameters\": { \"sessionId\": \"12ABC3\", \"iso\": 200, \"exposureCompensation\": -2, \"captureMode\": \"_video\" } } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera.setOptions\", \"state\": \"done\" } ``` |\n| **Request** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera._startRecording\", \"parameters\": { \"sessionId\": \"12ABC3\", ... } } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera._startRecording\", \"state\": \"done\" } ``` |"]]