Skip to content

capi: add dovi_rpu_remove_cmv40_metadata (strip CMv4.0 to CMv2.9)#400

Open
pannal wants to merge 1 commit into
quietvoid:mainfrom
pannal:feat/remove-cmv40-metadata-capi
Open

capi: add dovi_rpu_remove_cmv40_metadata (strip CMv4.0 to CMv2.9)#400
pannal wants to merge 1 commit into
quietvoid:mainfrom
pannal:feat/remove-cmv40-metadata-capi

Conversation

@pannal

@pannal pannal commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Exposes the existing DoviRpu::remove_cmv40_extension_metadata() through the C API. It mirrors dovi_rpu_add_cmv40_safe_default_metadata from #393.

It strips the CMv4.0 extension metadata from a parsed RPU and leaves a CMv2.9-only RPU. No-op when no CMv4.0 is present. Returns 0 on success and -1 on error, same as dovi_rpu_remove_mapping.

Why

On Amlogic (CoreELEC/Kodi), some old Dolby Vision TVs do not fall back from CMv4.0 and just black-screen on CMv4.0 content. Handing them a plain CMv2.9 RPU (parse, remove, write back) gets them a picture, and it keeps the bitstream work inside libdovi like the append path does.

Notes

  • Thin wrapper. The underlying remove_cmv40_extension_metadata() already exists and is covered by the editor --remove-cmv4 path (rpu::editor::remove_cmv4). Nothing existing changes.
  • Tested locally with cargo build --features capi and cargo test --no-default-features --features internal-font --test mod editor (8/8, including remove_cmv4).
  • I followed your add_*/remove_* naming, but rename it if you would rather, same as add dovi_rpu_set_cmv40_default for appending CMv4.0 to CMv2.9 RPUs #393.

@quietvoid

Copy link
Copy Markdown
Owner

Seems OK after rustfmt is fixed.

Exposes the existing DoviRpu::remove_cmv40_extension_metadata() via the C
API, mirroring dovi_rpu_add_cmv40_safe_default_metadata. Strips CMv4.0
extension metadata from a parsed RPU, leaving a CMv2.9-only RPU; no-op if
CMv4.0 is not present. Returns 0 on success, -1 on error, following the
dovi_rpu_remove_mapping convention.

Consumer: CoreELEC/Kodi on Amlogic, for old DV TVs that fail to fall back
from CMv4.0 and black-screen on CMv4.0 content.
@pannal pannal force-pushed the feat/remove-cmv40-metadata-capi branch from 86a742a to 17ebb13 Compare June 7, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants