add dovi_rpu_set_cmv40_default for appending CMv4.0 to CMv2.9 RPUs#393
Conversation
|
I don't understand why you're excluding the alignment padding, it should be present when you append DM v2 payload. |
|
Also, can't we just implement the insertion here instead? I would only add this temporarily.. |
|
Well, this is a direct implementation of the patch @cpm-code did, which I derived from. I just caught what you said on AVS and thought I'd PR the changes. Let me actually review whether this makes sense. |
|
Yeah, the alignment subtraction is wrong and doing the insertion in libdovi makes more sense. I can take a crack at implementing it if you have an idea for how the API should look, or just close this if you'd rather do it yourself. |
|
Up to you, we already have logic for adding CM v4.0 but I think it doesn't add all the blocks you do. |
Right. Checking! |
|
There isn't really much usable, I guess I can work it. |
Adds CmV40DmData::new_with_default_blocks() with static L3/L9/L11/L254 extension blocks, and DoviRpu::set_cmv40_default_metadata() to set it on an RPU that only has CMv2.9 metadata. Exposed via C API as dovi_rpu_set_cmv40_default(). Returns 1 if added, 0 if CMv4.0 already present, -1 on error. After calling this, the RPU can be written back with dovi_write_unspec62_nalu() and will include the CMv4.0 section.
f83d105 to
2667a67
Compare
|
Does that work for you? |
|
Yeah that's OK, I made some extra adjustments locally that should work on top of this, mostly refactoring and some better names. |
|
I've renamed the function to |
When generating, include all the safe default metadata blocks. Little refactoring and renaming. tests: update generated CM v4.0 test files
8cd95fd to
293fbd6
Compare
|
Looks good! |
For feature parity since #393
Rewrote this based on your feedback. Instead of exposing a raw bit offset, this adds a proper API to set CMv4.0 metadata on a parsed RPU.
New:
CmV40DmData::new_with_default_blocks()— creates CMv4.0 with L3 (neutral offsets), L9 (primary index 0), L11 (cinema content type), L254 (dm_version_index=2)DoviRpu::set_cmv40_default_metadata()— sets the above on an RPU if cmv40_metadata is not already presentdovi_rpu_set_cmv40_default()C API — returns 1 if added, 0 if already present, -1 on errorOn our side (Kodi/CoreELEC on Amlogic), the flow becomes: parse RPU, call this, write it back. No more bitstream surgery.
The block values are the static defaults used by Amlogic DV processors. If you think any of them should be different, or if you'd rather have a more flexible API (e.g. letting the caller pick which blocks to include), let me know.