[misc/player] Introduce output ability to announce supported formats

Also introduce default output format and selected device format, should the
user want another format.

As part of this, change enum player_format in player.h to enum media_format in
misc.h so that it is akin to struct media_quality.

Modify json API to support this.
This commit is contained in:
ejurgensen
2024-01-07 23:12:03 +01:00
parent 9f719ca155
commit 62b42ce354
21 changed files with 209 additions and 104 deletions

View File

@@ -342,6 +342,7 @@ GET /api/outputs
| needs_auth_key | boolean | `true` if output requires an authorization key (device verification) |
| volume | integer | Volume in percent (0 - 100) |
| format | string | Stream format |
| supported_formats | array | Array of formats supported by output |
**Example**
@@ -361,7 +362,8 @@ curl -X GET "http://localhost:3689/api/outputs"
"requires_auth": false,
"needs_auth_key": false,
"volume": 0,
"format": "alac"
"format": "alac",
"supported_formats": [ "alac" ]
},
{
"id": "0",
@@ -372,7 +374,8 @@ curl -X GET "http://localhost:3689/api/outputs"
"requires_auth": false,
"needs_auth_key": false,
"volume": 19,
"format": "pcm"
"format": "pcm",
"supported_formats": [ "pcm" ]
},
{
"id": "100",
@@ -383,7 +386,8 @@ curl -X GET "http://localhost:3689/api/outputs"
"requires_auth": false,
"needs_auth_key": false,
"volume": 0,
"format": "pcm"
"format": "pcm",
"supported_formats": [ "pcm" ]
}
]
}
@@ -453,6 +457,7 @@ curl -X GET "http://localhost:3689/api/outputs/0"
"needs_auth_key": false,
"volume": 3
"format": "pcm",
"supported_formats": [ "pcm" ]
}
```