|
21 | 21 | #include "AVOutputTV.h"
|
22 | 22 | #include "UtilsIarm.h"
|
23 | 23 | #include "rfcapi.h"
|
| 24 | +#include <thread> |
24 | 25 |
|
25 | 26 | #define CAPABLITY_FILE_NAME "pq_capabilities.ini"
|
26 | 27 |
|
@@ -944,7 +945,7 @@ namespace Plugin {
|
944 | 945 | return ret;
|
945 | 946 | }
|
946 | 947 |
|
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 ) |
948 | 949 | {
|
949 | 950 | LOGINFO("Entry : %s\n",__FUNCTION__);
|
950 | 951 | valueVectors_t values;
|
@@ -1137,6 +1138,59 @@ namespace Plugin {
|
1137 | 1138 | return ret;
|
1138 | 1139 | }
|
1139 | 1140 |
|
| 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 | + |
1140 | 1194 | tvError_t AVOutputTV::syncAvoutputTVParamsToHAL(std::string pqmode,std::string source,std::string format)
|
1141 | 1195 | {
|
1142 | 1196 | int level={0};
|
|
0 commit comments