Skip to content

Commit

Permalink
moving shared objects to separate schemas file
Browse files Browse the repository at this point in the history
  • Loading branch information
alkalinecoffee committed May 3, 2024
1 parent f4fcedc commit 62a0846
Show file tree
Hide file tree
Showing 7 changed files with 861 additions and 363 deletions.
120 changes: 64 additions & 56 deletions requirements/specifications/media/media-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See [Firebolt Requirements Governance](../../governance.md) for more info.
## 1. Overview
App developers need to know which audio and video formats can be successfully played on a Firebolt device.

Video formats include...
Video formats include...

**TODO**: Rewrite this section.
**TODO**: check Farhan's emails!!
Expand Down Expand Up @@ -70,34 +70,35 @@ I want to know what my device *would* support if i upgraded my AV peripherals:
- I want to know what resolutions and framerates *would* be supported with upgraded peripherals. (e.g. 1080p60).

## 2. Table of Contents
- [1. Overview](#1-overview)
- [1.1. User Stories](#11-user-stories)
- [1.2. As an OTT App developer](#12-as-an-ott-app-developer)
- [1.3. As a first-party App developer](#13-as-a-first-party-app-developer)
- [2. Table of Contents](#2-table-of-contents)
- [3. Format MimeTypes](#3-format-mimetypes)
- [Resolutions](#resolutions)
- [4. Device Media Support](#4-device-media-support)
- [4.1. Negotiated Media Support](#41-negotiated-media-support)
- [4.1.1. Video Format Supported](#411-video-format-supported)
- [4.1.2. Audio Format Supported](#412-audio-format-supported)
- [4.2.3. Hdr Supported](#423-hdr-supported)
- [5. Display Properties](#5-display-properties)
- [5.1. Color Information...](#51-color-information)
- [5.2. Display Width and Height](#52-display-width-and-height)
- [5.3. Current and Optimal Resolution](#53-current-and-optimal-resolution)
- [5.4. Supported Resolutions](#54-supported-resolutions)
- [5.5. Device Supported Resolutions](#55-device-supported-resolutions)
- [5.7. Use Source Framerate](#57-use-source-framerate)
- [6. Audio Output Properties](#6-audio-output-properties)
- [6.1. Mode](#61-mode)
- [7. Media Info](#7-media-info)
- [7.1. MediaInfo for current app](#71-mediainfo-for-current-app)
- [7.1.1. Video Format](#711-video-format)
- [7.1.2. Audio Format](#712-audio-format)
- [7.2. Global MediaInfo](#72-global-mediainfo)
- [7.2.1. Active Video Formats](#721-active-video-formats)
- [7.2.2. Active Audio Formats](#722-active-audio-formats)
- [Media Info Requirements](#media-info-requirements)
- [1. Overview](#1-overview)
- [1.1. User Stories](#11-user-stories)
- [1.2. As an OTT App developer](#12-as-an-ott-app-developer)
- [1.3. As a first-party App developer](#13-as-a-first-party-app-developer)
- [2. Table of Contents](#2-table-of-contents)
- [3. Format MimeTypes](#3-format-mimetypes)
- [Resolutions](#resolutions)
- [4. Device Media Support](#4-device-media-support)
- [4.1. Negotiated Media Support](#41-negotiated-media-support)
- [4.1.1. Video Format Supported](#411-video-format-supported)
- [4.1.2. Audio Format Supported](#412-audio-format-supported)
- [4.2.3. Hdr Supported](#423-hdr-supported)
- [5. Display Properties](#5-display-properties)
- [5.1. Color Information...](#51-color-information)
- [5.2. Display Width and Height](#52-display-width-and-height)
- [5.3. Current and Optimal Resolution](#53-current-and-optimal-resolution)
- [5.4. Supported Resolutions](#54-supported-resolutions)
- [5.5. Device Supported Resolutions](#55-device-supported-resolutions)
- [5.7. Use Source Framerate](#57-use-source-framerate)
- [6. Audio Output Properties](#6-audio-output-properties)
- [6.1. Mode](#61-mode)
- [7. Media Info](#7-media-info)
- [7.1. MediaInfo for current app](#71-mediainfo-for-current-app)
- [7.1.1. Video Format](#711-video-format)
- [7.1.2. Audio Format](#712-audio-format)
- [7.2. Global MediaInfo](#72-global-mediainfo)
- [7.2.1. Active Video Formats](#721-active-video-formats)
- [7.2.2. Active Audio Formats](#722-active-audio-formats)

## 3. Format MimeTypes
The Firebolt `Media` module **MUST** have a `Formats` enumeration audio and video formats:
Expand All @@ -111,10 +112,10 @@ The Firebolt `Media` module **MUST** have a `Formats` enumeration audio and vide
| `AUDIO_DTS` | `audio/vnd.dts` |
| `AUDIO_DTS_X` | `audio/vnd.dts.uhd;profile=p2` |
| `AUDIO_EAC3` | `audio/eac3` | Note we call this AC3+ in RDK... |
| `AUDIO_MPEG` | `audio/mpeg` |
| `AUDIO_MPEG1` | `audio/mpeg-L1` |
| `AUDIO_MPEG2` | `audio/mpeg-L2` |
| `AUDIO_MPEG4` | `audio/mp4` |
| `AUDIO_MPEG` | `audio/mpeg` |
| `AUDIO_MPEG1` | `audio/mpeg-L1` |
| `AUDIO_MPEG2` | `audio/mpeg-L2` |
| `AUDIO_MPEG4` | `audio/mp4` |
| `AUDIO_OPUS` | `audio/opus` |
| `AUDIO_OGG` | `audio/ogg` |
| `AUDIO_TRUEHD` | `audio/true-hd` |
Expand Down Expand Up @@ -190,16 +191,18 @@ const hdr10plusWithVP9 = videoFormatSupported(Media.Formats.VIDEO_VP9_P2)

When calling videoFormatSupported with a `resolution` parameter, then the Display support for that resolution is factored into the response.

The `audioFormatSupported` API **MUST** have an `options` parameter
The `videoFormatSupported` API **MUST** have an `options` parameter
which **MUST** be an object with zero or more of the following properties:

| Property | Type | Description |
|----------|------|-------------|
| codec | `string` | the Code |
| profile | `string` | the Codec profile: <br>**h.265**: "main", "high", "main10"<br>**vp9**: "p0", "p2"<br>**AAC**: "mp2lc", "mp4he" |
| level | `string` | the Codec level: <br>**h.265**: "4.1", "4.2", "5.0", "5.1"<br>**vp9**:"3.0", "3.1", "4.0", "4.1", "5.0", "5.1" || atmos | `boolean` | Whether or not Dolby Atmos support for the given format is being requested |
|------------|------|-------------|
| atmos | `boolean` | Whether or not Dolby Atmos support for the given format is being requested |
| codec | `string` | the Codec |
| container | `string` | the video container format
| hdr | `DynamicRangeProfile` | The HDR profile that support is being checked for. |
| level | `string` | the Codec level: <br>**h.265**: "4.1", "4.2", "5.0", "5.1"<br>**vp9**:"3.0", "3.1", "4.0", "4.1", "5.0", "5.1" |
| profile | `string` | the Codec profile: <br>**h.265**: "main", "high", "main10"<br>**vp9**: "p0", "p2"<br>**AAC**: "mp2lc", "mp4he" |
| resolution | `Display.Resolution` | The Resolution, e.g. `1080p` of the support being requested. |
| hdr | HDRProfile | The HDR profile that support is being checked for. |

```javascript
videoFormatSupported('', {})
Expand All @@ -213,18 +216,23 @@ The `codec` property **MUST** be one of the following values:
- `VIDEO_H264`
- `VIDEO_H265`
- `VIDEO_MPEG`
- `VIDEO_VC1`
- `VIDEO_VP10`
- `VIDEO_VP8`
- `VIDEO_VP9`
- `VIDEO_VP9_P2`
- `VIDEO_VP10`
- `VIDEO_VC1`
- `VIDEO_VP9`

The `container` property **MUST** be one of the following values:

**TODO**: Add HDRProfile
**TODO**: Roku also has: Container
- `dash`
- `hls`
- `ism`
- `mkv`
- `mp4`
- `ts`

The `videoFormatSupported` API **MUST NOT**
return `true` unless the format specified is supported with **all** of the properties specified
by `options` *all at the same time*.
return `true` unless the format specified is supported with **all** of the properties specified by `options` *all at the same time*.

Use of the `videoFormatSupported` API requires access to the `use` role of the
`xrn:firebolt:capability:device:info` capability.
Expand All @@ -242,15 +250,15 @@ The `audioFormatSupported` API **MUST** have a required `format` parameter which
- `AUDIO_AC3`
- `AUDIO_AC4`
- `AUDIO_DOLBY_MAT`
- `AUDIO_DTS`
- `AUDIO_DTS_X`
- `AUDIO_DTS`
- `AUDIO_EAC3`
- `AUDIO_MPEG`
- `AUDIO_MPEG1`
- `AUDIO_MPEG2`
- `AUDIO_MPEG4`
- `AUDIO_OPUS`
- `AUDIO_OGG`
- `AUDIO_OPUS`
- `AUDIO_TRUEHD`
- `AUDIO_WAV`

Expand All @@ -268,19 +276,19 @@ which **MUST** be an object with zero or more of the following properties:
| Property | Type | Description |
|----------|------|-------------|
| profile | `string` | the Codec profile: <br>**AAC**: "mp2lc", "mp4he" |
| level | `string | the Codec level. |
| level | `string` | the Codec level. |
| atmos | `boolean` | Whether or not Dolby Atmos support for the given format is being requested |
| channels | `int` | Required number of audio channels |
| sampleRate | `int` | The sample rate being requested. |
| mode | `AudioOutput.Mode` | Specify which mode should be used to evaluate the reqeuest. Defaults to the current mode if not specified. |
| mode | `AudioOutput.Mode` | Specify which mode should be used to evaluate the request. Defaults to the current mode if not specified. |

**TODO**: Roku also has: Container, Bitrate

If the `options` parameter is provided, then the `audioFormatSupported` API **MUST NOT**
return `true` unless the format specified is supported with **all** of the properties specified
by `options` *all at the same time*.

Use of the `videoFormatSupported` API requires access to the `use` role of the
Use of the `audioFormatSupported` API requires access to the `use` role of the
`xrn:firebolt:capability:device:info` capability.

#### 4.2.3. Hdr Supported
Expand Down Expand Up @@ -317,7 +325,7 @@ The `optimalResolution` **MUST** come from the HDMI edid.
For built-in displays `optimalResolution` **MUST** also be provided.

### 5.4. Supported Resolutions

The `Display` module **MUST** have a `supportedResolutions` method that returns an array of valid resolutions that the display supports.

This method **MUST** return a value from the `Display.Resolution` enum.
Expand Down Expand Up @@ -358,7 +366,7 @@ about any media actively being decoded by the Media Pipeline or an active HDMI i

### 7.1. MediaInfo for current app

Apps need a way to query the media info for media currently being played
Apps need a way to query the media info for media currently being played
by the app. All of the following methods take a single `pipeline`
parameter, which identifies the Media Pipeline in the current app's scope
that is being queried, e.g.:
Expand All @@ -378,10 +386,10 @@ The `pipeline` parameter is required for the JSON-RPC request, however, the Fire
For example:

```javascript
MediaInfo.videoCodec()
MediaInfo.videoFormat()
```

Would query the video codec for the app's pipeline `1` in JavaScript, which supports default values for parameters.
Would query the video format for the app's pipeline `1` in JavaScript, which supports default values for parameters.

#### 7.1.1. Video Format

Expand Down Expand Up @@ -507,7 +515,7 @@ const isDolbyAtmos:boolean = await MediaInfo.activeAudioFormats().find(f => f.ty

MediaInfo.activeVideoFormats((active) => {
const dolbyAtmos = active.find(f => f.type === Media.Formats.AUDIO_DOLBY_MAT)
console.log('Dolby Vision is now ' + (dolbyAtmos ? 'active' : 'inactive') + '.')
console.log('Dolby atmos is now ' + (dolbyAtmos ? 'active' : 'inactive') + '.')
})
```

Expand Down
35 changes: 18 additions & 17 deletions requirements/specifications/media/media-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TODO: we need a few additions to support Netflix:
- loudness eq
The audioSettings **MUST** include an `atmosOutputLock` boolean property.

The audioSettings **MUST** include an `audioLoundnessEquivalence` boolean property.
The audioSettings **MUST** include an `audioLoudnessEquivalence` boolean property.

The audioSettings API **MUST** be a Firebolt `property:readonly` API, and
have a corresponding `onAudioSettingsChanged` notification.
Expand All @@ -56,22 +56,23 @@ to the `use` role of the `xrn:firebolt:capability:device:audio-settings` capabil
generated](../../../../requirements/images/specifications/media/media-pipeline/media/image1.png)

## 2. Table of Contents
- [1. Overview](#1-overview)
- [2. Table of Contents](#2-table-of-contents)
- [3. Media Pipeline](#3-media-pipeline)
- [3.1. Media Pipeline Commands](#31-media-pipeline-commands)
- [3.2. MediaPipeline Notifications](#32-mediapipeline-notifications)
- [3.3. Media Pipeline Management](#33-media-pipeline-management)
- [4. W3C Media APIs](#4-w3c-media-apis)
- [4.1. MediaSource](#41-mediasource)
- [4.2. MediaElement](#42-mediaelement)
- [5. Supported Media](#5-supported-media)
- [5.1. Container formats](#51-container-formats)
- [5.2. Video codecs](#52-video-codecs)
- [5.3. Audio codecs](#53-audio-codecs)
- [6. Supported Decryption](#6-supported-decryption)
- [6.1. DRM Key Systems](#61-drm-key-systems)
- [6.2. Decryption Schemes](#62-decryption-schemes)
- [Media Pipeline Requirements](#media-pipeline-requirements)
- [1. Overview](#1-overview)
- [2. Table of Contents](#2-table-of-contents)
- [3. Media Pipeline](#3-media-pipeline)
- [3.1. Media Pipeline Commands](#31-media-pipeline-commands)
- [3.2. MediaPipeline Notifications](#32-mediapipeline-notifications)
- [3.3. Media Pipeline Management](#33-media-pipeline-management)
- [4. W3C Media APIs](#4-w3c-media-apis)
- [4.1. MediaSource](#41-mediasource)
- [4.2. MediaElement](#42-mediaelement)
- [5. Supported Media](#5-supported-media)
- [5.1. Container formats](#51-container-formats)
- [5.2. Video codecs](#52-video-codecs)
- [5.3. Audio codecs](#53-audio-codecs)
- [6. Supported Decryption](#6-supported-decryption)
- [6.1. DRM Key Systems](#61-drm-key-systems)
- [6.2. Decryption Schemes](#62-decryption-schemes)

## 3. Media Pipeline

Expand Down
25 changes: 3 additions & 22 deletions src/openrpc/audio_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "audioMode",
"summary": "The audio mode supported by the platform.",
"schema": {
"$ref": "#/components/schemas/AudioMode"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/media#/definitions/AudioOutputMode"
}
},
"examples": [
Expand All @@ -31,29 +31,10 @@
"params": [],
"result": {
"name": "Default Result",
"value": "Stereo"
"value": "stereo"
}
}
]
}
],
"components": {
"schemas": {
"AudioMode": {
"title": "AudioMode",
"type": "string",
"enum": [
"Mono",
"Stereo",
"Surround",
"Passthrough",
"Auto",
"StereoSurroundMatFollow",
"Unknown",
"None"
],
"description": "The audio output mode supported by the platform"
}
}
}
]
}
Loading

0 comments on commit 62a0846

Please sign in to comment.