RDKEMW-15473: Add FrameRate support and remove static assert#233
RDKEMW-15473: Add FrameRate support and remove static assert#233
Conversation
….12.0 Remove unsupported framerates and only include framerates supported by all platforms Remove static assert which breaks compilation
There was a problem hiding this comment.
Pull request overview
This PR removes compile-time static_assert checks in the Device Settings FrameRate implementation to avoid a compilation break.
Changes:
- Removed two
static_asserts that verified_values/_namesarray sizes againstdsVIDEO_FRAMERATE_MAX.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| namespace device { | ||
| static_assert(dsUTL_DIM(_values) == dsVIDEO_FRAMERATE_MAX, "Frame rate values array size mismatch"); | ||
| static_assert(dsUTL_DIM(_names) == dsVIDEO_FRAMERATE_MAX, "Frame rate values array size mismatch"); | ||
|
|
||
| const int FrameRate::kUnknown = dsVIDEO_FRAMERATE_UNKNOWN; |
There was a problem hiding this comment.
Removing the compile-time size checks for _values/_names drops the only guard that these lookup tables stay in sync with dsVIDEO_FRAMERATE_MAX. If the HAL adds a new frame-rate ID and dsVideoPortFrameRate_isValid() returns true for it, FrameRate(int id) will index past the end of these arrays.
Instead of deleting the checks, consider rewriting them in a way that compiles in this environment (e.g., use a sizeof(array)/sizeof(array[0]) expression or a small local constexpr helper) so mismatches are caught at build time.
| namespace device { | ||
| static_assert(dsUTL_DIM(_values) == dsVIDEO_FRAMERATE_MAX, "Frame rate values array size mismatch"); | ||
| static_assert(dsUTL_DIM(_names) == dsVIDEO_FRAMERATE_MAX, "Frame rate values array size mismatch"); | ||
|
|
||
| const int FrameRate::kUnknown = dsVIDEO_FRAMERATE_UNKNOWN; |
There was a problem hiding this comment.
PR title mentions "Add FrameRate support", but this change only removes two static_asserts. If additional FrameRate support changes are intended, they may be missing from this PR; otherwise, the title/description should be updated to reflect the actual change.
RDKEMW-15473: Remove static assert which breaks compilation