Skip to content

Feature/test pr 1#409

Open
DakshayaniMV wants to merge 4 commits into
developfrom
feature/test_pr_1
Open

Feature/test pr 1#409
DakshayaniMV wants to merge 4 commits into
developfrom
feature/test_pr_1

Conversation

@DakshayaniMV
Copy link
Copy Markdown

No description provided.

hgfell683 and others added 4 commits February 23, 2026 15:06
* RDKEMW-10804: reduce logs for hdmicec componeent

Signed-off-by: apatel859 <Amit_Patel5@comcast.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: apatel859 <48992974+apatel859@users.noreply.github.com>
…Apple TV via HDMI (CEC FeatureAbort: CEC Version) (#401)

* RDKEMW-16812 : [EntOS] [A4K] Mute Fails During YouTube Playback with Apple TV via HDMI (CEC FeatureAbort: CEC Version)

* Address copilot review comments
* RDKEMW-11398: Implement HdmiCecSink & UserSettings communication

* Update HdmiCecSink.cpp
Copilot AI review requested due to automatic review settings May 20, 2026 14:22
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

This PR updates the HDMI CEC plugins by removing verbose header-print logging, adding JSON-RPC notifications for received CEC user-control key events, and integrating with the UserSettings plugin to track presentation-language changes and send SetMenuLanguage.

Changes:

  • Remove printHeader() debug logging from HdmiCec Source/Sink message processors.
  • Add CEC UserControlPressed/Released handling in HdmiCecSink and emit new JSON-RPC notifications (onKeyPressEvent / onKeyReleaseEvent).
  • Integrate HdmiCecSink with org.rdk.UserSettings to fetch/track presentation language and map BCP47 → ISO-639-2.

Reviewed changes

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

Show a summary per file
File Description
Tests/L2Tests/tests/AVOutputTV_L2Test.cpp Minor comment tweak in the L2 test file.
HdmiCecSource/HdmiCecSourceImplementation.h Removes inline printHeader() helper.
HdmiCecSource/HdmiCecSourceImplementation.cpp Removes printHeader() calls from message processing.
HdmiCecSink/HdmiCecSink.h Adds IUserSettings integration types, new processor handlers, and helper declarations.
HdmiCecSink/HdmiCecSink.cpp Adds new events + notifications, UserSettings initialization/uninitialization, language mapping, and key press/release wrappers.
Comments suppressed due to low confidence (2)

HdmiCecSink/HdmiCecSink.cpp:960

  • onPresentationLanguageChanged() also uses isoLang.data() when constructing Language. Since this project builds with C++11, data() is not guaranteed to be null-terminated; use c_str() to avoid undefined behavior.
	   string isoLang = mapToIso639_2(presentationLanguage);
	   LOGINFO("OnPresentationLanguageChanged - language BCP47: %s, ISO 639-2: %s", presentationLanguage.c_str(), isoLang.c_str());
	   setCurrentLanguage(Language(isoLang.data()));
           sendMenuLanguage();

HdmiCecSink/HdmiCecSink.cpp:2833

  • After logical-address allocation, m_currentLanguage is no longer initialized (previous default "eng" assignment was removed). CECDeviceParams defaults this to an empty Language, so sendMenuLanguage()/SetMenuLanguage may transmit an invalid/empty language unless an external call sets it. Please set a sensible default (e.g., "eng") here, or apply the cached UserSettings language once allocation succeeds.
                            			_instance->deviceList[_instance->m_logicalAddressAllocated].update(physical_addr);
						    _instance->deviceList[_instance->m_logicalAddressAllocated].m_cecVersion = Version::V_1_4;
						    _instance->deviceList[_instance->m_logicalAddressAllocated].m_vendorID = appVendorId;
						    _instance->deviceList[_instance->m_logicalAddressAllocated].m_powerStatus = PowerStatus(powerState);
						    _instance->deviceList[_instance->m_logicalAddressAllocated].m_osdName = osdName.toString().c_str();

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

Comment on lines +815 to +819
if (status == Core::ERROR_NONE) {
isoLang = mapToIso639_2(presentationLanguage);
LOGINFO("Successfully retrieved the Presentation language from the userSettings plugin - BCP47: %s, ISO 639-2: %s", presentationLanguage.c_str(), isoLang.c_str());
setCurrentLanguage(Language(isoLang.data()));
sendMenuLanguage();
if (status == Core::ERROR_NONE) {
isoLang = mapToIso639_2(presentationLanguage);
LOGINFO("Successfully retrieved the Presentation language from the userSettings plugin - BCP47: %s, ISO 639-2: %s", presentationLanguage.c_str(), isoLang.c_str());
setCurrentLanguage(Language(isoLang.data()));
Comment on lines +1971 to +1976
std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower);

if (lang.length() == 3)
return lang;

static const std::unordered_map<std::string, std::string> iso639_1_to_2 = {
}

} // namespace Plugin
} // namespace WPEFrameworklk
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:900

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Uninitialized scalar field

Non-static class member "m_isRequested" is not initialized in this constructor nor in any functions that it calls.

Medium Impact, CWE-457
UNINIT_CTOR

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.h:161

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.h:282

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Uninitialized pointer field

Non-static class member "msgFrameListener" is not initialized in this constructor nor in any functions that it calls.

Medium Impact, CWE-457
UNINIT_CTOR

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:672

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Variable copied when it could be moved

"addr" is copied in call to copy assignment for class "LogicalAddress", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""addr"")" instead of "addr".

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.cpp:1161

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Check of thread-shared field evades lock acquisition

Thread1 sets "m_currentArcRoutingState" to a new value. Now the two threads have an inconsistent view of "m_currentArcRoutingState" and updates to fields correlated with "m_currentArcRoutingState" may be lost.

High Impact, CWE-543
LOCK_EVASION

How to fix

Guard the modification of "m_currentArcRoutingState" and the read used to decide whether to modify "m_currentArcRoutingState" with the same set of locks.

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:1049

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Dereference after null check

Dereferencing null pointer "WPEFramework::Plugin::HdmiCecSourceImplementation::_instance".

Medium Impact, CWE-476
FORWARD_NULL

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.cpp:739

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Uninitialized scalar variable

Using uninitialized value "hdmiPort". Field "hdmiPort.m_logicalAddr.impl" is uninitialized when calling "push_back". [Note: The source code implementation of the function has been overridden by a builtin model.]

High Impact, CWE-457
UNINIT

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:785

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.cpp:707

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Variable copied when it could be moved

"logicalAddrDeviceType" is copied in call to copy assignment for class "std::string", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""logicalAddrDeviceType"")" instead of "logicalAddrDeviceType".

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.cpp:1162

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Variable copied when it could be moved

"hdmiPort" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<WPEFramework::Plugin::HdmiPortMap, std::allocatorWPEFramework::Plugin::HdmiPortMap >::push_back(std::vector<WPEFramework::Plugin::HdmiPortMap, std::allocatorWPEFramework::Plugin::HdmiPortMap >::value_type const &)", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""hdmiPort"")" instead of "hdmiPort".

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:785

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Uninitialized pointer field

Non-static class member "msgFrameListener" is not initialized in this constructor nor in any functions that it calls.

Medium Impact, CWE-457
UNINIT_CTOR

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSource/HdmiCecSourceImplementation.cpp:352

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Waiting while holding a lock

Call to "usleep" might sleep while holding lock "lock._M_device".

Medium Impact, CWE-667
SLEEP

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:3153

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.h:735

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Variable copied when it could be moved

"audiodescriptor" is passed-by-value as parameter to "WPEFramework::Core::JSON::ArrayTypeWPEFramework::Core::JSON::Variant::ArrayType(WPEFramework::Core::JSON::ArrayTypeWPEFramework::Core::JSON::Variant const &)", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""audiodescriptor"")" instead of "audiodescriptor".

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:1111

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Data race condition

A wait is performed without a loop. If there is a spurious wakeup, the condition may not be satisfied. [Note: The source code implementation of the function has been overridden by a builtin model.]

Medium Impact, CWE-none
BAD_CHECK_OF_WAIT_COND

How to fix

Check the wait condition in a loop, with the lock held. The lock must not be released between the condition and the wait.

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:3013

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

Coverity Issue - Dereference before null check

Null-checking "this->smConnection" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Medium Impact, CWE-476
REVERSE_INULL

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
HdmiCecSink/HdmiCecSink.cpp:3121

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.

7 participants