RDKEMW-16104: Updated the Framerates 59 and 23 to fix crash issue#234
RDKEMW-16104: Updated the Framerates 59 and 23 to fix crash issue#234apatel859 merged 9 commits intosupport/8.5.3.0from
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for additional video frame rate enums (59 and 23) in the Device Settings FrameRate wrapper to address a crash caused by missing enum-to-name/value mappings.
Changes:
- Introduces
FrameRate::k59andFrameRate::k23constants in the public header. - Extends internal
_values/_nameslookup tables to include 59 and 23 and adds an upper-bound guard inisValid(). - Adjusts constant assignments in
ds/frameRate.cppfor new frame rate IDs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| ds/include/frameRate.hpp | Exposes new FrameRate constants for 59 and 23. |
| ds/frameRate.cpp | Updates frame rate lookup tables and validity gating; adds new constant mappings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 200, | ||
| 239.79, | ||
| 240, |
There was a problem hiding this comment.
The 239.x entry here looks incorrect/inconsistent: elsewhere dsVIDEO_FRAMERATE_239dot76 is rendered as "239.76" (see ds/hdmiIn.cpp), but this mapping table uses 239.79. This can cause incorrect reporting/selection for that frame rate; align the value/name with 239.76.
| "120", | ||
| "200", | ||
| "239.79", | ||
| "240", |
There was a problem hiding this comment.
This string table uses "239.79" which conflicts with the dsVIDEO_FRAMERATE_239dot76 naming/usage elsewhere (rendered as "239.76"). Keeping these consistent avoids confusing UI/log output and prevents mismatches between string<->id conversions.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static const int k59; //!< Indicates video frame rate of 59 fps. | ||
| static const int k23; //!< Indicates video frame rate of 23 fps. |
There was a problem hiding this comment.
The docstrings for the newly added frame rates are incorrect: k59 should describe 59 fps (not 59.94), and k23 should describe 23 fps (currently also says 59.94). Please correct these comments so they match the actual enum/value meaning.
| #define MAX_VIDEO_FRAMERATE_SUPPORTED 18 | ||
|
|
||
| namespace { | ||
| const float _values[] = { | ||
| const float _values[MAX_VIDEO_FRAMERATE_SUPPORTED] = { |
There was a problem hiding this comment.
MAX_VIDEO_FRAMERATE_SUPPORTED is hardcoded to 18 while the rest of the code (e.g., FrameRate::kMax / config loading) uses dsVIDEO_FRAMERATE_MAX. Please avoid duplicated sources of truth by deriving this size from dsVIDEO_FRAMERATE_MAX (or from the array size) and consider adding a compile-time check to ensure the arrays stay in sync with the enum range.
| 200, | ||
| 239.79, | ||
| 240, |
There was a problem hiding this comment.
The mapping for the 239.xx frame rate appears inconsistent: this table uses 239.79 (value and string), but elsewhere the enum is named dsVIDEO_FRAMERATE_239dot76 and is rendered as "239.76" (see ds/hdmiIn.cpp). Please align _values/_names with the actual enum meaning to avoid incorrect reporting/selection of this frame rate.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 120, | ||
| 200, | ||
| 239.76, | ||
| 240, | ||
| 59, | ||
| 23, | ||
| 0 |
There was a problem hiding this comment.
PR title/description says this change is about adding 59 and 23 fps enums, but this hunk also changes the 239.xx mapping (239.79 -> 239.76) and adds a new hard limit + sentinel entries in the lookup tables. Please confirm these extra behavior changes are intended and update the PR description accordingly so reviewers/release notes capture them.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else if (_value == 59.94) { | ||
| _id = dsVIDEO_FRAMERATE_59dot94; | ||
| } | ||
| } |
There was a problem hiding this comment.
FrameRate(float) still only recognizes up to 59.94 and will throw IllegalArgumentException for newly added framerates like 59.0 and 23.0 (even though FrameRate::k59/k23 are now part of the public API). Add explicit handling for 59 and 23 (and ensure _name resolves correctly for those IDs).
| } | |
| } | |
| else if (_value == 59.0) { | |
| _id = dsVIDEO_FRAMERATE_59; | |
| } | |
| else if (_value == 23.0) { | |
| _id = dsVIDEO_FRAMERATE_23; | |
| } |
| FrameRate::FrameRate(float value) : _value(value){ | ||
| if (_value == 24.0) { | ||
| _id = dsVIDEO_FRAMERATE_24; | ||
| } | ||
| else if (_value == 24.0) { | ||
| else if (_value == 25.0) { |
There was a problem hiding this comment.
There are existing Boost tests for frame-rate constants via VideoOutputPortConfig, but the updated FrameRate(float) mapping logic (including the corrected 25/30/60 branches and the new 59/23 support) is not covered. Add unit tests that construct FrameRate from float values and assert the expected ID/name for supported framerates.
RDKEMW-16104: Add dsVIDEO_FRAMERATE_59 and dsVIDEO_FRAMERATE_23 enums
Signed-off-by: Yuvaramachandran Gurusamy [yuvaramachandran_gurusamy@comcast.com]