Skip to content

Commit

Permalink
feat: Add support for HDMI Select
Browse files Browse the repository at this point in the history
  • Loading branch information
satlead committed Nov 9, 2023
1 parent 9915d7b commit a46e354
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 4 deletions.
40 changes: 39 additions & 1 deletion requirements/specifications/hardware/hdmi-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL
- [8.2. Auto Low Latency Mode Signalled](#82-auto-low-latency-mode-signalled)
- [8.3. Port Auto Low Latency Mode Capable](#83-port-auto-low-latency-mode-capable)
- [8.3.1. Port Auto Low Latency Mode Capable Changed Notification](#831-port-auto-low-latency-mode-capable-changed-notification)

- [9. Port Selection](#9-hdmi-port-selection)
## 3. All Ports
The `HDMIInput` module **MUST** have a `ports` method that lists all physical HDMI input ports on the device.

Expand Down Expand Up @@ -286,3 +286,41 @@ HDMIInput.autoLowLatencyModeCapableChanged((data) => {
`port` - the HDMI port that had an E-EDID ALLM advertisement change.

The `onAutoLowLatencyModeCapableChanged` API requires `use` access to the `xrn:firebolt:capability:inputs:hdmi` capability.


## 9. HDMI Port Selection

The `HDMIInput` module **MUST** have a `select` method that manages the selection of on a single HDMI port for playback.

The `HDMIInput.select` **MUST** include a `port` field complying to the schema of `HDMIPortId`

The `HDMIInput.select` **MUST** include a `type` field complying to the schema of `HDMISelectType`

The `select` API **MUST** return an `empty` object for a successful selection, if there was an error the response **Must** contain the details of the error.
```javascript
HDMIInput.select('HDMI1','start').then(() => {
console.log("Successfully selected HDMI1 port");
})
```

The `select` API requires `manage` access to the `xrn:firebolt:capability:inputs:hdmi` capability.

Below is an example of stopping an existing HDMI Port selection
```javascript
HDMIInput.select('HDMI1','stop').then(() => {
console.log("Successfully un selected HDMI1 port");
})
```


### 9.2 HDMI Select Preview Mode

Most of the modern system ui applications support showcasing the preview of the HDMI player within the tile. To support such feature we need the platform to create a `Hole Punch` around the Hdmi Video playback. To support this feature `HDMInput.select` api offers a `HDMIPreviewOptions` schema structure.

The `HDMIPreviewOptions` schema **MUST** be specified with the `holePunch` field.
If the `holePunch` field is set to `true` then the parameters **MUST** include the `dimensions` field for the `HDMIPreviewOptions`.
```javascript
HDMIInput.select('HDMI1','start', {"holdPunch": true, "dimensions": {"x":10, y: 10, "width":100, "height": 100}}).then(() => {
console.log("Successfully selected HDMI1 port");
})
```
203 changes: 200 additions & 3 deletions src/openrpc/hdmi-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,131 @@
}
]
},
{
"name": "select",
"tags": [
{
"name": "capabilities",
"x-manages": [
"xrn:firebolt:capability:inputs:hdmi"
]
}
],
"summary": "Selects the HDMI Port for active input",
"params": [
{
"name": "portId",
"schema": {
"$ref": "#/components/schemas/HDMIPortId"
},
"required": true
},
{
"name": "type",
"schema": {
"$ref": "#/components/schemas/HDMISelectType"
},
"required": true
},
{
"name": "options",
"schema": {
"$ref": "#/components/schemas/HDMIPreviewOptions"
}
}
],
"result": {
"name": "port",
"schema": {
"const": null
}
},
"examples": [
{
"name": "Default Example for start",
"params": [
{
"name": "portId",
"value": "HDMI1"
},
{
"name": "type",
"value": "start"
}
],
"result": {
"name": "port",
"value": null
}
},
{
"name": "Default Example for stop",
"params": [
{
"name": "portId",
"value": "HDMI1"
},
{
"name": "type",
"value": "stop"
}
],
"result": {
"name": "port",
"value": null
}
},
{
"name": "Default Example for preview",
"params": [
{
"name": "portId",
"value": "HDMI1"
},
{
"name": "type",
"value": "start"
},
{
"name": "options",
"value": {
"dimensions": {
"x": 40,
"y": 50,
"w": 100,
"h": 100
},
"holePunch": true
}
}
],
"result": {
"name": "ports",
"value": null
}
},
{
"name": "Default Example for stop preview",
"params": [
{
"name": "portId",
"value": "HDMI1"
},
{
"name": "type",
"value": "stop"
},
{
"name": "options",
"value": {
"holePunch": false
}
}
],
"result": null
}
]
},
{
"name": "onConnectionChanged",
"tags": [
Expand Down Expand Up @@ -413,9 +538,7 @@
"properties": {
"edidVersion": {
"type": "string",
"enum": [
"1.4", "unknown"
]
"value":true
}
}
},
Expand Down Expand Up @@ -489,6 +612,80 @@
"type": "boolean"
}
}
},
"HDMISelectType": {
"title": "HDMISelectType",
"type": "string",
"enum": [
"start",
"stop"
]
},
"HDMIPreviewOptions": {
"title": "HDMIPreviewOptions",
"type": "object",
"required": [
"holePunch"
],
"properties": {
"dimensions" : {
"$ref": "#/components/schemas/HDMIVideoDimension"
},
"holePunch": {
"description": "Used during preview modes where the player is showcased in a smaller dimension overlayed by the existing system ui application",
"type": "boolean"
}
},
"if": {
"properties": {
"holePunch": {
"const": true
}
}
},
"then": {
"properties": {
"dimensions": {
"required": true
}
}
}
},
"HDMIVideoDimension": {
"title": "HDMIVideoDimension",
"type": "object",
"required": [
"x",
"y",
"width",
"height"
],
"properties": {
"x": {
"type": "number",
"description": "x co-ordinate of the prevew",
"default": 0,
"minimum": 0
},
"y": {
"type": "number",
"description": "y co-ordinate of the prevew",
"default": 0,
"minimum": 0
},
"width": {
"type": "number",
"description": "width of the preview ",
"default": 10,
"minimum": 10
},
"height": {
"type": "number",
"description": "width of the preview ",
"default": 10,
"minimum": 10
}
}
}
}
}
Expand Down

0 comments on commit a46e354

Please sign in to comment.