Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 35 additions & 16 deletions AAMP-UVE-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2716,28 +2716,47 @@ XREReceiver.onEvent("onDecoderAvailable", { decoderHandle: null });

## Inband (CEA608/708) Closed Caption Management (modern UVE/AAMP API)

Configure nativeCCRendering to true to signal use of subtec for caption rendering.
```
player.initConfig( { nativeCCRendering: true } );
Whether AAMP manages CC visibility and styles directly depends on the platform.
On **X1 devices**, CC is owned by **XREReceiver**, which runs independently of AAMP.
`nativeCCRendering` must remain `false` (the default) so AAMP does not interfere with
XREReceiver's trickplay muting, parental control gating, or style management.
On **platforms without XREReceiver**, the app must set `nativeCCRendering: true` to
hand AAMP ownership of the CC lifecycle via `PlayerCCManager`. Apps must refrain from
using AAMP CC APIs when `nativeCCRendering` is set to false.

### Platform Summary

| Device Class | `nativeCCRendering` | `player.setTextStyleOptions` |
|---|---|---|
| X1 (XREReceiver present) | `false` (default — do not set to true) | Do **not** call AAMP CC APIs; XREReceiver owns CC visibility and styling and applies guide-configured styles automatically |
| Non-XRE but pre-ENT-OS | `true` (must be explicitly enabled) | Required to apply caption styling; guide settings are not automatically propagated |
| ENT-OS (with Text Track plugin) | `true` | Not required; Text Track plugin automatically maps guide-configured caption styling |

### Configuration

For non-XRE platforms, opt AAMP into managing CC before calling `load()`:
```js
player.initConfig( { nativeCCRendering: true } );
```
Toggle CC display on or off at runtime:
```
player.setClosedCaptionStatus(true); // show captions (off by default)
player.setClosedCaptionStatus(false); // mute captions
```
Get/Set CC track at runtime:
```
player.getTextTrack(); // returns json object listing track attributes
player.setTextTrack(trackIdentifier);

Get/Set CC style options at runtime
### Runtime CC Control

Toggle CC display on or off:
```js
player.setClosedCaptionStatus(true); // show captions (off by default)
player.setClosedCaptionStatus(false); // hide captions
```
player.getTextStyleOptions(); // returns JSON object reflecting currently styling options
player.setTextStyleOptions(options); // TODO: include examples known to work with RDK CC Manager and/or subtec

On newer devices there is no need to call setTextStyleOptions, as the Text Track plugin will automatically map guide-configured caption styling.
Get/Set CC track:
```js
player.getTextTrack(); // returns JSON object listing track attributes
player.setTextTrack(trackIdentifier);
```

Get/Set CC style options:
```js
player.getTextStyleOptions(); // returns JSON object reflecting current styling options
player.setTextStyleOptions(options); // set styling options (see setTextStyleOptions API for format)
```

---
Expand Down
13 changes: 12 additions & 1 deletion AampConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,18 @@ typedef enum
eAAMPConfig_BulkTimedMetaReport, /**< Enabled Bulk event reporting for TimedMetadata*/
eAAMPConfig_BulkTimedMetaReportLive, /**< Enabled Bulk TimedMetadata event reporting for live stream */
eAAMPConfig_AvgBWForABR, /**< Enables usage of AverageBandwidth if available for ABR */
eAAMPConfig_NativeCCRendering, /**< If native CC rendering to be supported */
eAAMPConfig_NativeCCRendering, /**< Controls whether AAMP manages CC visibility/styles
directly via PlayerCCManager (true), or defers to an
external CC controller such as XREReceiver (false).
Default: false.
On X1 platforms XREReceiver owns CC; set to false so
AAMP does not interfere with trickplay muting, parental
control gating, or CC track selection.
On platforms without XREReceiver, set to true so AAMP
takes over the full CC lifecycle.
Note: Regardless of this flag, AAMP's CC APIs still
route through PlayerCCManager and apps must refrain from
using them when the flag is set to false.*/
Comment on lines +155 to +166
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config’s doc says it controls whether AAMP “manages CC visibility/styles directly”, but the runtime gating for eAAMPConfig_NativeCCRendering is primarily around automatic lifecycle/policy integration (e.g., SetTrickplayStatus, SetParentalControlStatus, Release on stop, and a limited CEAPreferred override). Style/status/track APIs still call into PlayerCCManager regardless of this flag. Please update the comment to reflect the actual behaviors gated by the config so the header documentation matches runtime behavior.

Suggested change
eAAMPConfig_NativeCCRendering, /**< Controls whether AAMP manages CC visibility/styles
directly via PlayerCCManager (true), or defers to an
external CC controller such as XREReceiver (false).
Default: false.
On X1 platforms XREReceiver owns CC; set to false so
AAMP does not interfere with trickplay muting, parental
control gating, or CC track selection.
On platforms without XREReceiver, set to true so AAMP
takes over the full CC lifecycle.
Note: Regardless of this flag, AAMP's CC APIs still
route through PlayerCCManager and apps must refrain from
using them when the flag is set to false.*/
eAAMPConfig_NativeCCRendering, /**< Controls whether AAMP integrates PlayerCCManager with
the core playback lifecycle and platform CC policy.
When true, AAMP automatically propagates trickplay
status (SetTrickplayStatus), parental control status
(SetParentalControlStatus), and stop/release events
to PlayerCCManager, and may apply a limited CEA
preferred service override.
When false, these automatic lifecycle/policy updates
are suppressed so an external controller (for example,
XREReceiver on X1) can own CC lifecycle and policy.
Note: CC style/status/track APIs still route through
PlayerCCManager regardless of this flag; it does not
disable those APIs or directly control CC styling or
visibility.*/

Copilot uses AI. Check for mistakes.
eAAMPConfig_Subtec_subtitle, /**< Enable subtec-based subtitles */
eAAMPConfig_WebVTTNative, /**< Enable subtec-based subtitles */
eAAMPConfig_AsyncTune, /**< To enable Asynchronous tune */
Expand Down
22 changes: 21 additions & 1 deletion main_aamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,27 @@ std::string PlayerInstanceAAMP::GetAppName()
}

/**
* @brief Enable/disable the native CC rendering feature
* @brief Enable or disable AAMP-managed CC rendering.
*
* When enable is true, AAMP takes ownership of the CC rendering lifecycle
* via PlayerCCManager: initialization on first frame, trickplay muting,
* parental control gating (SERVICE_PIN_LOCKED events), CEA-608/708 track
* selection, and session teardown on stop.
Comment on lines +2817 to +2819
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “enable is true” section lists “initialization on first frame” as part of the gated behavior, but CC initialization happens unconditionally (e.g., PrivateInstanceAAMP::InitializeCC always calls PlayerCCManager::Init). Consider adjusting the wording so it’s clear this flag gates AAMP’s additional lifecycle/policy integration (trickplay status, parental control, release/teardown, etc.), not whether initialization occurs at all.

Suggested change
* via PlayerCCManager: initialization on first frame, trickplay muting,
* parental control gating (SERVICE_PIN_LOCKED events), CEA-608/708 track
* selection, and session teardown on stop.
* via PlayerCCManager: integrating CC with playback on first-frame
* presentation, applying trickplay muting, enforcing parental control
* gating (SERVICE_PIN_LOCKED events), driving CEA-608/708 track
* selection, and performing CC-specific session teardown on stop.
* Note that underlying CC components (e.g. PlayerCCManager::Init) are
* initialised unconditionally; this flag controls AAMP's additional
* lifecycle and policy integration, not whether CC is initialised.

Copilot uses AI. Check for mistakes.
*
* When enable is false (the default), AAMP does not drive CC rendering
* behaviour or policy decisions (e.g. trickplay muting, parental-control
* integration, or CC-specific teardown). Internal components such as
* PlayerCCManager may still be initialised but internally it will be
Comment on lines +2822 to +2824
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling is inconsistent with the rest of the codebase’s American English usage: “behaviour”/“initialised” should be “behavior”/“initialized”.

Suggested change
* behaviour or policy decisions (e.g. trickplay muting, parental-control
* integration, or CC-specific teardown). Internal components such as
* PlayerCCManager may still be initialised but internally it will be
* behavior or policy decisions (e.g. trickplay muting, parental-control
* integration, or CC-specific teardown). Internal components such as
* PlayerCCManager may still be initialized but internally it will be

Copilot uses AI. Check for mistakes.
* using PlayerFakeCCManager.
Comment thread
Vinish100 marked this conversation as resolved.
*
* This is the correct setting for X1 platforms where XREReceiver controls
* CC independently of AAMP. Enabling it on X1 would cause AAMP to overlap
* with XREReceiver's CC management responsibilities.
*
* Must be called before Tune() to take effect for a given session.
*
* @param[in] enable true — AAMP manages CC (platforms without XREReceiver)
* false — external controller manages CC (X1 / XREReceiver)
*/
void PlayerInstanceAAMP::SetNativeCCRendering(bool enable)
{
Expand Down
Loading