Feature/test pr 1#409
Conversation
…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
There was a problem hiding this comment.
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/Releasedhandling in HdmiCecSink and emit new JSON-RPC notifications (onKeyPressEvent/onKeyReleaseEvent). - Integrate HdmiCecSink with
org.rdk.UserSettingsto 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 usesisoLang.data()when constructingLanguage. Since this project builds with C++11,data()is not guaranteed to be null-terminated; usec_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_currentLanguageis no longer initialized (previous default "eng" assignment was removed).CECDeviceParamsdefaults this to an emptyLanguage, sosendMenuLanguage()/SetMenuLanguagemay 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.
| 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())); |
| 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 |
Coverity Issue - Parse warningtype qualifier on return type is meaningless Low Impact, CWE-398 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Uninitialized scalar fieldNon-static class member "m_isRequested" is not initialized in this constructor nor in any functions that it calls. Medium Impact, CWE-457 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Parse warningtype qualifier on return type is meaningless Low Impact, CWE-398 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Uninitialized pointer fieldNon-static class member "msgFrameListener" is not initialized in this constructor nor in any functions that it calls. Medium Impact, CWE-457 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
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 How to fixUse "std::move(""addr"")" instead of "addr". Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Check of thread-shared field evades lock acquisitionThread1 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 How to fixGuard the modification of "m_currentArcRoutingState" and the read used to decide whether to modify "m_currentArcRoutingState" with the same set of locks. Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Dereference after null checkDereferencing null pointer "WPEFramework::Plugin::HdmiCecSourceImplementation::_instance". Medium Impact, CWE-476 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Uninitialized scalar variableUsing 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 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Parse warningtype qualifier on return type is meaningless Low Impact, CWE-398 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
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 How to fixUse "std::move(""logicalAddrDeviceType"")" instead of "logicalAddrDeviceType". Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
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 How to fixUse "std::move(""hdmiPort"")" instead of "hdmiPort". Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Uninitialized pointer fieldNon-static class member "msgFrameListener" is not initialized in this constructor nor in any functions that it calls. Medium Impact, CWE-457 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Waiting while holding a lockCall to "usleep" might sleep while holding lock "lock._M_device". Medium Impact, CWE-667 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Parse warningtype qualifier on return type is meaningless Low Impact, CWE-398 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
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 How to fixUse "std::move(""audiodescriptor"")" instead of "audiodescriptor". Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Data race conditionA 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 How to fixCheck the wait condition in a loop, with the lock held. The lock must not be released between the condition and the wait. Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
Coverity Issue - Dereference before null checkNull-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 Issue locationThis issue was discovered outside the diff for this Pull Request. You can find it at: |
No description provided.