Skip to content

Commit cd9c306

Browse files
RDKTV-37684: New sync up logic for updateAVoutputTVParam
Reason for change: moved the updateAVoutputTVParam to thread if sync/reset Test Procedure: as per JIRA Risks: None Priority: P1 Signed-off-by: Ashish Rai <[email protected]>
1 parent 7abaec3 commit cd9c306

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

AVOutput/AVOutputTV.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ class AVOutputTV : public AVOutputBase {
318318
*/
319319
int updateAVoutputTVParam( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level );
320320

321+
int updateAVoutputTVParamImplementation( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level );
322+
321323
/* Every bootup this function is called to sync TR181 to TVSettings HAL for saving the value */
322324
tvError_t syncAvoutputTVParamsToHAL(std::string pqmode, std::string source, std::string format);
323325
/* Every Bootup this function is called to sync TR181 to TVSettings HAL for saving the picture mode assiocation to source */

AVOutput/AVOutputTVHelper.cpp

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "AVOutputTV.h"
2222
#include "UtilsIarm.h"
2323
#include "rfcapi.h"
24+
#include <thread>
2425

2526
#define CAPABLITY_FILE_NAME "pq_capabilities.ini"
2627

@@ -944,7 +945,7 @@ namespace Plugin {
944945
return ret;
945946
}
946947

947-
int AVOutputTV::updateAVoutputTVParam( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level )
948+
int AVOutputTV::updateAVoutputTVParamImplementation( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level )
948949
{
949950
LOGINFO("Entry : %s\n",__FUNCTION__);
950951
valueVectors_t values;
@@ -1137,6 +1138,59 @@ namespace Plugin {
11371138
return ret;
11381139
}
11391140

1141+
int AVOutputTV::updateAVoutputTVParam( std::string action, std::string tr181ParamName, capDetails_t info, tvPQParameterIndex_t pqParamIndex, int level )
1142+
{
1143+
LOGINFO("Entry : %s\n",__FUNCTION__);
1144+
1145+
int ret = 0;
1146+
tvError_t retVal = tvERROR_NONE;
1147+
std::string currentPicMode;
1148+
std::string currentSource;
1149+
std::string currentFormat;
1150+
tvVideoSrcType_t sourceIndex = VIDEO_SOURCE_IP;
1151+
char picMode[PIC_MODE_NAME_MAX]={0};
1152+
1153+
//GetCurrent pqmode
1154+
if(!getCurrentPictureMode(picMode)) {
1155+
LOGERR("Failed to get the current picture mode\n");
1156+
}
1157+
1158+
currentPicMode = picMode; //Convert to string
1159+
1160+
//GetCurrentVideoSource
1161+
retVal = GetCurrentVideoSource(&sourceIndex);
1162+
if(retVal != tvERROR_NONE) {
1163+
LOGERR("%s : GetCurrentVideoSource( ) Failed\n",__FUNCTION__);
1164+
return false;
1165+
}
1166+
currentSource = convertSourceIndexToString(sourceIndex);
1167+
1168+
//GetCurrentFormat
1169+
tvVideoFormatType_t formatIndex = VIDEO_FORMAT_NONE;
1170+
GetCurrentVideoFormat(&formatIndex);
1171+
if ( formatIndex == VIDEO_FORMAT_NONE) {
1172+
formatIndex = VIDEO_FORMAT_SDR;
1173+
}
1174+
currentFormat = convertVideoFormatToString(formatIndex);
1175+
1176+
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",
1177+
__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(),
1178+
currentPicMode.c_str(), currentSource.c_str(), currentFormat.c_str());
1179+
1180+
if(currentPicMode == info.pqmode && currentSource == info.source && currentFormat == info.format)
1181+
{
1182+
ret = updateAVoutputTVParamImplementation( action, tr181ParamName, info, pqParamIndex, level);
1183+
}
1184+
else
1185+
{
1186+
LOGINFO("Starting thread : %s\n",__FUNCTION__);
1187+
std::thread updateAVoutputTVParam_thread(&WPEFramework::Plugin::AVOutputTV::updateAVoutputTVParamImplementation, this, action, tr181ParamName, info, pqParamIndex, level);
1188+
updateAVoutputTVParam_thread.detach();
1189+
1190+
}
1191+
return ret;
1192+
}
1193+
11401194
tvError_t AVOutputTV::syncAvoutputTVParamsToHAL(std::string pqmode,std::string source,std::string format)
11411195
{
11421196
int level={0};

0 commit comments

Comments
 (0)