-
Notifications
You must be signed in to change notification settings - Fork 3
RDKTV-37684: New sync up logic for updateAVoutputTVParam #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -21,6 +21,7 @@ | |||||||||||||||||
#include "AVOutputTV.h" | ||||||||||||||||||
#include "UtilsIarm.h" | ||||||||||||||||||
#include "rfcapi.h" | ||||||||||||||||||
#include <thread> | ||||||||||||||||||
|
||||||||||||||||||
#define CAPABLITY_FILE_NAME "pq_capabilities.ini" | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -944,7 +945,7 @@ namespace Plugin { | |||||||||||||||||
return ret; | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
int AVOutputTV::updateAVoutputTVParam( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level ) | ||||||||||||||||||
int AVOutputTV::updateAVoutputTVParamImplementation( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level ) | ||||||||||||||||||
{ | ||||||||||||||||||
LOGINFO("Entry : %s\n",__FUNCTION__); | ||||||||||||||||||
valueVectors_t values; | ||||||||||||||||||
|
@@ -1137,6 +1138,59 @@ namespace Plugin { | |||||||||||||||||
return ret; | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
int AVOutputTV::updateAVoutputTVParam( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level ) | ||||||||||||||||||
{ | ||||||||||||||||||
LOGINFO("Entry : %s\n",__FUNCTION__); | ||||||||||||||||||
|
||||||||||||||||||
int ret = 0; | ||||||||||||||||||
tvError_t retVal = tvERROR_NONE; | ||||||||||||||||||
std::string currentPicMode; | ||||||||||||||||||
std::string currentSource; | ||||||||||||||||||
std::string currentFormat; | ||||||||||||||||||
tvVideoSrcType_t sourceIndex = VIDEO_SOURCE_IP; | ||||||||||||||||||
char picMode[PIC_MODE_NAME_MAX]={0}; | ||||||||||||||||||
|
||||||||||||||||||
//GetCurrent pqmode | ||||||||||||||||||
if(!getCurrentPictureMode(picMode)) { | ||||||||||||||||||
LOGERR("Failed to get the current picture mode\n"); | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
currentPicMode = picMode; //Convert to string | ||||||||||||||||||
|
||||||||||||||||||
//GetCurrentVideoSource | ||||||||||||||||||
retVal = GetCurrentVideoSource(&sourceIndex); | ||||||||||||||||||
if(retVal != tvERROR_NONE) { | ||||||||||||||||||
LOGERR("%s : GetCurrentVideoSource( ) Failed\n",__FUNCTION__); | ||||||||||||||||||
return false; | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function return type is int but returning false (boolean). This should return an integer error code instead.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
} | ||||||||||||||||||
currentSource = convertSourceIndexToString(sourceIndex); | ||||||||||||||||||
|
||||||||||||||||||
//GetCurrentFormat | ||||||||||||||||||
tvVideoFormatType_t formatIndex = VIDEO_FORMAT_NONE; | ||||||||||||||||||
GetCurrentVideoFormat(&formatIndex); | ||||||||||||||||||
if ( formatIndex == VIDEO_FORMAT_NONE) { | ||||||||||||||||||
formatIndex = VIDEO_FORMAT_SDR; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
+1172
to
+1173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent indentation - uses tabs instead of spaces like the rest of the code.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Comment on lines
+1172
to
+1173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent indentation - uses tabs instead of spaces like the rest of the code.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
currentFormat = convertVideoFormatToString(formatIndex); | ||||||||||||||||||
|
||||||||||||||||||
LOGINFO("%s: Entry param : %s Action : %s pqmode : %s source :%s format :%s color:%s component:%s control:%s currentPicMode = %s currentSource = %s currentFormat = %s\n", | ||||||||||||||||||
__FUNCTION__,tr181ParamName.c_str(),action.c_str(),info.pqmode.c_str(),info.source.c_str(),info.format.c_str(),info.color.c_str(),info.component.c_str(),info.control.c_str(), | ||||||||||||||||||
currentPicMode.c_str(), currentSource.c_str(), currentFormat.c_str()); | ||||||||||||||||||
|
||||||||||||||||||
if(currentPicMode == info.pqmode && currentSource == info.source && currentFormat == info.format) | ||||||||||||||||||
{ | ||||||||||||||||||
ret = updateAVoutputTVParamImplementation( action, tr181ParamName, info, pqParamIndex, level); | ||||||||||||||||||
} | ||||||||||||||||||
else | ||||||||||||||||||
{ | ||||||||||||||||||
LOGINFO("Starting thread : %s\n",__FUNCTION__); | ||||||||||||||||||
std::thread updateAVoutputTVParam_thread(&WPEFramework::Plugin::AVOutputTV::updateAVoutputTVParamImplementation, this, action, tr181ParamName, info, pqParamIndex, level); | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using detached threads without proper lifecycle management can lead to issues if the AVOutputTV object is destroyed while the thread is still running. Consider using a thread pool or ensuring proper cleanup. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
updateAVoutputTVParam_thread.detach(); | ||||||||||||||||||
|
||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When executing in thread mode (else branch), ret remains 0 but the actual operation result is lost since the thread is detached. Consider returning a different value to indicate async execution or implement a callback mechanism.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
} | ||||||||||||||||||
return ret; | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
tvError_t AVOutputTV::syncAvoutputTVParamsToHAL(std::string pqmode,std::string source,std::string format) | ||||||||||||||||||
{ | ||||||||||||||||||
int level={0}; | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation - uses tabs instead of spaces like the rest of the code.
Copilot uses AI. Check for mistakes.