@@ -1281,9 +1281,6 @@ namespace Plugin {
1281
1281
updateAVoutputTVParamV2 (" sync" , " ColorTemp" , paramJson, PQ_PARAM_COLOR_TEMPERATURE,level);
1282
1282
}
1283
1283
1284
- // HDRMode
1285
- updateAVoutputTVParam (" sync" , " HDRMode" , info, PQ_PARAM_DOLBY_MODE, level);
1286
-
1287
1284
// DimmingMode
1288
1285
m_dimmingModeStatus = GetTVDimmingModeCaps (&m_dimmingModes, &m_numdimmingModes, &m_dimmingModeCaps);
1289
1286
LOGINFO (" GetTVDimmingModeCaps returned status: %d, numdimmingModes: %d" , m_dimmingModeStatus, m_numdimmingModes);
@@ -1297,27 +1294,7 @@ namespace Plugin {
1297
1294
LOGINFO (" Calling GetBacklightCaps..." );
1298
1295
m_backlightStatus = GetBacklightCaps (&m_maxBacklight, &m_backlightCaps);
1299
1296
LOGINFO (" GetBacklightCaps returned status: %d, maxBacklight: %d" , m_backlightStatus, m_maxBacklight);
1300
- #if DEBUG
1301
- if (m_backlightCaps)
1302
- {
1303
- LOGINFO (" Backlight caps pointer is valid. Num contexts: %zu" , m_backlightCaps->num_contexts );
1304
- for (size_t i = 0 ; i < m_backlightCaps->num_contexts ; ++i) {
1305
- const auto & context = m_backlightCaps->contexts [i];
1306
- std::string pqModeStr = AVOutputTV::pqModeMap.count (context.pq_mode ) ?
1307
- AVOutputTV::pqModeMap.at (context.pq_mode ) : " Unknown" ;
1308
- std::string formatStr = AVOutputTV::videoFormatMap.count (context.videoFormatType ) ?
1309
- AVOutputTV::videoFormatMap.at (context.videoFormatType ) : " Unknown" ;
1310
- std::string srcStr = AVOutputTV::videoSrcMap.count (context.videoSrcType ) ?
1311
- AVOutputTV::videoSrcMap.at (context.videoSrcType ) : " Unknown" ;
1312
- LOGINFO (" Context[%zu]: PQMode = %s (%d), Format = %s (%d), Source = %s (%d)" ,
1313
- i, pqModeStr.c_str (), context.pq_mode ,
1314
- formatStr.c_str (), context.videoFormatType ,
1315
- srcStr.c_str (), context.videoSrcType );
1316
- }
1317
- } else {
1318
- LOGWARN (" Backlight caps pointer is null." );
1319
- }
1320
- #endif
1297
+
1321
1298
if (m_backlightStatus == tvERROR_OPERATION_NOT_SUPPORTED) {
1322
1299
updateAVoutputTVParam (" sync" , " Backlight" , info, PQ_PARAM_BACKLIGHT, level);
1323
1300
} else {
@@ -1398,11 +1375,14 @@ namespace Plugin {
1398
1375
syncCMSParams ();
1399
1376
}
1400
1377
1401
- syncWBParams ();
1378
+ // syncWBParams(); Enable once Get2PointWBCaps is implemented
1402
1379
1380
+ if (m_pictureModeStatus == tvERROR_OPERATION_NOT_SUPPORTED)
1381
+ {
1403
1382
// Dolby Vision Mode
1404
1383
info.format = " DV" ; // Sync only for Dolby
1405
1384
updateAVoutputTVParam (" sync" , " DolbyVisionMode" , info, PQ_PARAM_DOLBY_MODE, level);
1385
+ }
1406
1386
1407
1387
LOGINFO (" Exit %s : pqmode : %s source : %s format : %s\n " , __FUNCTION__, pqmode.c_str (), source.c_str (), format.c_str ());
1408
1388
return tvERROR_NONE;
@@ -1464,9 +1444,7 @@ namespace Plugin {
1464
1444
break ;
1465
1445
}
1466
1446
}
1467
- #if DEBUG
1468
- LOGINFO (" Got mode string from TR181: %s -> index=%d" , modeStr.c_str (), modeIndex);
1469
- #endif
1447
+
1470
1448
tvError_t tv_err = SaveSourcePictureMode (ctx.videoSrcType , ctx.videoFormatType , modeIndex);
1471
1449
if (tv_err != tvERROR_NONE) {
1472
1450
LOGWARN (" Failed SaveSourcePictureMode for %s / %s\n " , sourceStr.c_str (), formatStr.c_str ());
@@ -2182,6 +2160,11 @@ namespace Plugin {
2182
2160
inputInfo.source = source;
2183
2161
inputInfo.format = format;
2184
2162
2163
+ JsonObject paramJson;
2164
+ paramJson[" pictureMode" ] = inputInfo.pqmode ;
2165
+ paramJson[" videoSource" ] = inputInfo.source ;
2166
+ paramJson[" videoFormat" ] = inputInfo.format ;
2167
+
2185
2168
memset (¶m, 0 , sizeof (param));
2186
2169
tr181ErrorCode_t err = getLocalParam (rfc_caller_id, AVOUTPUT_ASPECTRATIO_RFC_PARAM, ¶m);
2187
2170
if ( tr181Success == err ) {
@@ -2226,14 +2209,17 @@ namespace Plugin {
2226
2209
LOGERR (" AspectRatio set failed: %s\n " ,getErrorString (ret).c_str ());
2227
2210
}
2228
2211
else {
2229
- // Save DisplayMode to ssm_data
2230
- int retval=updateAVoutputTVParam (" set" ," ZoomMode" ,inputInfo,PQ_PARAM_ASPECT_RATIO,mode);
2231
-
2232
- if (retval != 0 ) {
2212
+ if (m_aspectRatioStatus == tvERROR_OPERATION_NOT_SUPPORTED) {
2213
+ int retval=updateAVoutputTVParam (" set" ," ZoomMode" ,inputInfo,PQ_PARAM_ASPECT_RATIO,mode);
2214
+ if (retval != 0 ) {
2233
2215
LOGERR (" Failed to Save DisplayMode to ssm_data\n " );
2234
2216
ret = tvERROR_GENERAL;
2217
+ }
2218
+ LOGINFO (" Aspect Ratio initialized successfully, value: %s\n " , param.value );
2219
+ }
2220
+ else {
2221
+ updateAVoutputTVParamV2 (" set" , " ZoomMode" , paramJson, PQ_PARAM_ASPECT_RATIO,mode);
2235
2222
}
2236
- LOGINFO (" Aspect Ratio initialized successfully, value: %s\n " , param.value );
2237
2223
}
2238
2224
2239
2225
}
@@ -2760,10 +2746,7 @@ namespace Plugin {
2760
2746
if (caps && caps->num_contexts > 0 ) {
2761
2747
for (size_t i = 0 ; i < caps->num_contexts ; ++i) {
2762
2748
const tvConfigContext_t& available = caps->contexts [i];
2763
- #if DEBUG
2764
- LOGINFO (" Context[%zu]: PQMode=%d, Format=%d, Source=%d" , i,
2765
- available.pq_mode , available.videoFormatType , available.videoSrcType );
2766
- #endif
2749
+
2767
2750
if (available.videoSrcType == validContext.videoSrcType &&
2768
2751
available.videoFormatType == validContext.videoFormatType &&
2769
2752
available.pq_mode == validContext.pq_mode ) {
@@ -2975,22 +2958,7 @@ namespace Plugin {
2975
2958
const auto resolvedPicModes = resolveParam (" pictureMode" , curPicMode);
2976
2959
const auto resolvedFormats = resolveParam (" videoFormat" , curFormat);
2977
2960
const auto resolvedSources = resolveParam (" videoSource" , curSource);
2978
- #if DEBUG
2979
- // Helper function to log vector content
2980
- auto logResolvedValues = [&](const std::string& label, const std::vector<std::string>& values) {
2981
- std::string joined;
2982
- for (const auto & val : values) {
2983
- if (!joined.empty ()) joined += " , " ;
2984
- joined += val;
2985
- }
2986
- LOGINFO (" Resolved %s: [%s]" , label.c_str (), joined.c_str ());
2987
- };
2988
2961
2989
- // Debug logs
2990
- logResolvedValues (" pictureMode" , resolvedPicModes);
2991
- logResolvedValues (" videoSource" , resolvedSources);
2992
- logResolvedValues (" videoFormat" , resolvedFormats);
2993
- #endif
2994
2962
2995
2963
// Check if current combination exists in resolved sets
2996
2964
for (const auto & pm : resolvedPicModes) {
@@ -3135,25 +3103,15 @@ namespace Plugin {
3135
3103
const JsonObject& parameters,
3136
3104
tvPQParameterIndex_t pqParamIndex,int level)
3137
3105
{
3138
- #if DEBUG
3139
3106
LOGINFO (" Entry %s: Action: %s, Param: %s, Level: %d" , __FUNCTION__, action.c_str (), tr181ParamName.c_str (), level);
3140
- #endif
3141
3107
int ret = 0 ;
3142
3108
const bool isSet = (action == " set" );
3143
3109
const bool isReset = (action == " reset" );
3144
3110
const bool isSync = (action == " sync" );
3145
3111
3146
3112
std::vector<tvConfigContext_t> validContexts = getValidContextsFromParameters (parameters, tr181ParamName);
3147
3113
LOGINFO (" %s: Number of validContexts = %zu" , __FUNCTION__, validContexts.size ());
3148
- #if DEBUG
3149
- for (const auto & ctx : validContexts) {
3150
3114
3151
- std::string pqStr = pqModeMap.count (ctx.pq_mode ) ? pqModeMap.at (ctx.pq_mode ) : std::to_string (ctx.pq_mode );
3152
- std::string fmtStr = videoFormatMap.count (ctx.videoFormatType ) ? videoFormatMap.at (ctx.videoFormatType ) : std::to_string (ctx.videoFormatType );
3153
- std::string srcStr = videoSrcMap.count (ctx.videoSrcType ) ? videoSrcMap.at (ctx.videoSrcType ) : std::to_string (ctx.videoSrcType );
3154
- LOGINFO (" Valid Context - PQMode: %s, Format: %s, Source: %s" , pqStr.c_str (), fmtStr.c_str (), srcStr.c_str ());
3155
- }
3156
- #endif
3157
3115
if (validContexts.empty ()) {
3158
3116
LOGWARN (" %s: No valid contexts found for parameters" , __FUNCTION__);
3159
3117
return (int )tvERROR_GENERAL;
@@ -3182,9 +3140,7 @@ namespace Plugin {
3182
3140
for (const auto & ctx : validContexts) {
3183
3141
for (const auto & colorStr : colors) {
3184
3142
for (const auto & componentStr : components) {
3185
- #if DEBUG
3186
- LOGINFO (" %s: Processing Color: %s, Component: %s" , __FUNCTION__, colorStr.c_str (), componentStr.c_str ());
3187
- #endif
3143
+
3188
3144
tvPQParameterIndex_t pqIndex;
3189
3145
if (convertCMSParamToPQEnum (componentStr, colorStr, pqIndex) != 0 ) {
3190
3146
LOGERR (" %s: convertCMSParamToPQEnum failed for color: %s, component: %s" ,
0 commit comments