Skip to content

RDKEMW-16714: refactor hard-coded array-based approach to a generic#239

Open
yuvaramachandran-gurusamy wants to merge 13 commits intodevelopfrom
topic/RDKEMW-16714
Open

RDKEMW-16714: refactor hard-coded array-based approach to a generic#239
yuvaramachandran-gurusamy wants to merge 13 commits intodevelopfrom
topic/RDKEMW-16714

Conversation

@yuvaramachandran-gurusamy
Copy link
Copy Markdown
Contributor

RDKEMW-16714: refactor hard-coded array-based approach to a generic

Signed-off-by: yuvaramachandran_gurusamy yuvaramachandran_gurusamy@comcast.com

Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings April 15, 2026 03:05
@yuvaramachandran-gurusamy yuvaramachandran-gurusamy requested a review from a team as a code owner April 15, 2026 03:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the video frame-rate handling from a fixed, array-indexed approach to a map-based representation, and wires initialization/teardown into the device settings Manager lifecycle.

Changes:

  • Add global frame-rate map init/dump/deinit helpers and expose them via frameRate.hpp.
  • Rework FrameRate implementation to use a std::map<dsVideoFrameRate_t, FrameRateInfo> rather than hard-coded arrays.
  • Call frame-rate init/dump during Manager::Initialize() and clear it during Manager::DeInitialize().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
ds/manager.cpp Initializes and deinitializes the new frame-rate map as part of Manager lifecycle.
ds/include/frameRate.hpp Exposes new init/dump/deinit functions for the frame-rate map.
ds/frameRate.cpp Replaces array-based frame-rate data with a map and adds init/dump/deinit + updated lookup/constructors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp Outdated
Comment thread ds/manager.cpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 03:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp Outdated
Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…statements

Agent-Logs-Url: https://github.com/rdkcentral/devicesettings/sessions/2a1df342-47cc-4d33-85c0-b0963487d4a5

Co-authored-by: yuvaramachandran-gurusamy <123441336+yuvaramachandran-gurusamy@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 03:52
@yuvaramachandran-gurusamy yuvaramachandran-gurusamy review requested due to automatic review settings April 15, 2026 03:52
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…ings into topic/RDKEMW-16714

Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings April 15, 2026 11:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copilot AI review requested due to automatic review settings April 17, 2026 18:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/include/frameRate.hpp
Comment thread ds/frameRate.cpp
Comment thread ds/videoOutputPortConfig.cpp Outdated
Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/videoOutputPortConfig.cpp Outdated
Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/frameRate.cpp
Comment thread ds/frameRate.cpp
Comment thread ds/manager.cpp
Comment thread ds/frameRate.cpp
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
@yuvaramachandran-gurusamy yuvaramachandran-gurusamy marked this pull request as ready for review April 20, 2026 18:54
Copilot AI review requested due to automatic review settings April 20, 2026 18:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ds/manager.cpp
Comment on lines +118 to +120
// initialize the frame rates map with supported frame rates. This is required to be done before loading the video port configs as some of the frame rate related APIs depend on this map to return the supported frame rates and its values.
initializeFrameRates();

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

initializeFrameRates() is used here but manager.cpp doesn’t include frameRate.hpp directly, relying on transitive includes via other headers. This is brittle (future include refactors can break compilation). Please include frameRate.hpp explicitly in this file to make the dependency clear.

Copilot uses AI. Check for mistakes.
Comment thread ds/frameRate.cpp
Comment on lines +277 to +282
FrameRate::FrameRate(float value) : _value(value){
for (const auto& frameRate : _frameRates) {
// check if the value matches with any of the supported frame rates in the map, if found initialize the FrameRate object with corresponding name and id
if (std::fabs(frameRate.second.value - value) < std::numeric_limits<float>::epsilon()) {
_id = frameRate.first;
_name = frameRate.second.name;
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

FrameRate(float) compares float values using std::numeric_limits<float>::epsilon(), which is effectively an exact-equality check and is too strict for values like 23.98/29.97 that may come from calculations or external APIs with small rounding differences. Use a practical tolerance (absolute or relative), or compare against the enum id rather than float equality to avoid spurious IllegalArgumentException throws.

Copilot uses AI. Check for mistakes.
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.

3 participants