@@ -414,6 +414,11 @@ namespace Plugin {
414
414
registerMethod (" getAISuperResolutionCaps" , &AVOutputTV::getAISuperResolutionCaps, this );
415
415
registerMethod (" getMEMCCaps" , &AVOutputTV::getMEMCCaps, this );
416
416
417
+ registerMethod (" getAISuperResolution" , &AVOutputTV::getAISuperResolution, this );
418
+ registerMethod (" setAISuperResolution" , &AVOutputTV::setAISuperResolution, this );
419
+ registerMethod (" resetAISuperResolution" , &AVOutputTV::resetAISuperResolution, this );
420
+
421
+
417
422
LOGINFO (" Exit\n " );
418
423
}
419
424
@@ -547,8 +552,6 @@ namespace Plugin {
547
552
548
553
bool AVOutputTV::getPQParamV2 (const JsonObject& parameters,
549
554
const std::string& paramName,
550
- tvContextCaps_t*& capStore,
551
- int & maxCap,
552
555
tvPQParameterIndex_t paramType,
553
556
int & outValue)
554
557
{
@@ -579,7 +582,7 @@ namespace Plugin {
579
582
return false ;
580
583
}
581
584
582
- bool AVOutputTV::setPQParamV2 (const JsonObject& parameters, const std::string& paramName,
585
+ bool AVOutputTV::applyPictureSetting (const JsonObject& parameters, const std::string& paramName,
583
586
tvPQParameterIndex_t pqType, tvSetFunction halSetter, int maxCap)
584
587
{
585
588
LOGINFO (" Entry: %s\n " , paramName.c_str ());
@@ -1316,6 +1319,83 @@ namespace Plugin {
1316
1319
}
1317
1320
}
1318
1321
1322
+ uint32_t AVOutputTV::resetAISuperResolution (const JsonObject& parameters, JsonObject& response)
1323
+ {
1324
+ returnResponse (false );
1325
+ }
1326
+
1327
+ uint32_t AVOutputTV::getAISuperResolution (const JsonObject& parameters, JsonObject& response)
1328
+ {
1329
+ LOGINFO (" Entry" );
1330
+ int aiSuperResolution = 0 ;
1331
+ bool success = getPQParamV2 (parameters,
1332
+ " AISuperResolution" ,
1333
+ PQ_PARAM_AI_SUPER_RESOLUTION,
1334
+ aiSuperResolution);
1335
+ if (success) {
1336
+ response[" AISuperResolution" ] = aiSuperResolution;
1337
+ }
1338
+ returnResponse (success);
1339
+ }
1340
+
1341
+ uint32_t AVOutputTV::setAISuperResolution (const JsonObject& parameters, JsonObject& response)
1342
+ {
1343
+ LOGINFO (" Entry" );
1344
+ std::string value;
1345
+ int aiSuperResolution;
1346
+ tvError_t ret = tvERROR_NONE;
1347
+
1348
+ value = parameters.HasLabel (" AISuperResolution" ) ? parameters[" AISuperResolution" ].String () : " " ;
1349
+ returnIfParamNotFound (parameters, " AISuperResolution" );
1350
+ aiSuperResolution = std::stoi (value);
1351
+
1352
+ // Validate the aiSuperResolution value
1353
+ if (aiSuperResolution < 0 || aiSuperResolution > m_maxAISuperResolution)
1354
+ {
1355
+ LOGERR (" Input value %d is out of range for aiSuperResolution" , aiSuperResolution);
1356
+ returnResponse (false );
1357
+ }
1358
+
1359
+ tvVideoSrcType_t currentSrc = VIDEO_SOURCE_IP;
1360
+ tvVideoFormatType_t currentFmt = VIDEO_FORMAT_SDR;
1361
+ tvPQModeIndex_t currentPQMode = PQ_MODE_STANDARD;
1362
+ GetCurrentVideoSource (¤tSrc);
1363
+ GetCurrentVideoFormat (¤tFmt);
1364
+ if (currentFmt == VIDEO_FORMAT_NONE)
1365
+ currentFmt = VIDEO_FORMAT_SDR;
1366
+ char picMode[PIC_MODE_NAME_MAX]={0 };
1367
+ if (!getCurrentPictureMode (picMode)) {
1368
+ LOGERR (" Failed to get the Current picture mode\n " );
1369
+ }
1370
+ else {
1371
+ std::string local = picMode;
1372
+ currentPQMode = static_cast <tvPQModeIndex_t>(getPictureModeIndex (local));
1373
+ }
1374
+ LOGINFO (" currentPQMode %d, currentFmt %d, currentSrc %d " ,currentPQMode, currentFmt, currentSrc);
1375
+ // Call HAL setter for AISuperResolution
1376
+ if (isSetRequiredForParam (" AISuperResolution" , parameters)) {
1377
+ // ret = SetAISuperResolution(currentSrc, currentPQMode, currentFmt, aiSuperResolution);
1378
+ ret = tvERROR_NONE;
1379
+ }
1380
+ if (ret != tvERROR_NONE)
1381
+ {
1382
+ LOGERR (" Failed to set AISuperResolution\n " );
1383
+ returnResponse (false );
1384
+ }
1385
+ else
1386
+ {
1387
+ // Update the TV parameter
1388
+ int retval = updateAVoutputTVParamV2 (" set" , " AISuperResolution" , parameters, PQ_PARAM_AI_SUPER_RESOLUTION, aiSuperResolution);
1389
+ if (retval != 0 )
1390
+ {
1391
+ LOGERR (" Failed to Save AISuperResolution to ssm_data\n " );
1392
+ returnResponse (false );
1393
+ }
1394
+ LOGINFO (" Exit : AISuperResolution successful to value: %d\n " , aiSuperResolution);
1395
+ returnResponse (true );
1396
+ }
1397
+ }
1398
+
1319
1399
uint32_t AVOutputTV::getBacklight (const JsonObject& parameters, JsonObject& response)
1320
1400
{
1321
1401
LOGINFO (" Entry" );
@@ -1354,7 +1434,7 @@ namespace Plugin {
1354
1434
{
1355
1435
int backlight = 0 ;
1356
1436
bool success = getPQParamV2 (parameters,
1357
- " Backlight" , m_backlightCaps, m_maxBacklight,
1437
+ " Backlight" ,
1358
1438
PQ_PARAM_BACKLIGHT,
1359
1439
backlight);
1360
1440
if (success) {
@@ -1419,12 +1499,13 @@ namespace Plugin {
1419
1499
}
1420
1500
else
1421
1501
{
1422
- bool success = setPQParamV2 (parameters, " Backlight" , PQ_PARAM_BACKLIGHT, SetBacklight, m_maxBacklight);
1502
+ bool success = applyPictureSetting (parameters, " Backlight" , PQ_PARAM_BACKLIGHT, SetBacklight, m_maxBacklight);
1423
1503
returnResponse (success);
1424
1504
}
1425
1505
1426
1506
}
1427
- bool AVOutputTV::resetPQParamV2 (const JsonObject& parameters,
1507
+
1508
+ bool AVOutputTV::resetPictureParamToDefault (const JsonObject& parameters,
1428
1509
const std::string& paramName,
1429
1510
tvPQParameterIndex_t pqIndex,
1430
1511
tvSetFunction halSetter)
@@ -1529,7 +1610,7 @@ namespace Plugin {
1529
1610
}
1530
1611
else
1531
1612
{
1532
- bool success= resetPQParamV2 (parameters, " Backlight" , PQ_PARAM_BACKLIGHT, SetBacklight);
1613
+ bool success= resetPictureParamToDefault (parameters, " Backlight" , PQ_PARAM_BACKLIGHT, SetBacklight);
1533
1614
returnResponse (success);
1534
1615
}
1535
1616
}
@@ -1613,7 +1694,7 @@ namespace Plugin {
1613
1694
{
1614
1695
int brightness = 0 ;
1615
1696
bool success = getPQParamV2 (parameters,
1616
- " Brightness" , m_brightnessCaps, m_maxBrightness,
1697
+ " Brightness" ,
1617
1698
PQ_PARAM_BRIGHTNESS,
1618
1699
brightness);
1619
1700
if (success) {
@@ -1673,7 +1754,7 @@ namespace Plugin {
1673
1754
}
1674
1755
else
1675
1756
{
1676
- bool success = setPQParamV2 (parameters, " Brightness" , PQ_PARAM_BRIGHTNESS, SetBrightness, m_maxBrightness);
1757
+ bool success = applyPictureSetting (parameters, " Brightness" , PQ_PARAM_BRIGHTNESS, SetBrightness, m_maxBrightness);
1677
1758
returnResponse (success);
1678
1759
}
1679
1760
}
@@ -1734,7 +1815,7 @@ namespace Plugin {
1734
1815
}
1735
1816
else
1736
1817
{
1737
- bool success = resetPQParamV2 (parameters, " Brightness" , PQ_PARAM_BRIGHTNESS, SetBrightness);
1818
+ bool success = resetPictureParamToDefault (parameters, " Brightness" , PQ_PARAM_BRIGHTNESS, SetBrightness);
1738
1819
returnResponse (success);
1739
1820
}
1740
1821
}
@@ -1817,7 +1898,7 @@ namespace Plugin {
1817
1898
{
1818
1899
int contrast = 0 ;
1819
1900
bool success = getPQParamV2 (parameters,
1820
- " Contrast" , m_contrastCaps, m_maxContrast,
1901
+ " Contrast" ,
1821
1902
PQ_PARAM_CONTRAST,
1822
1903
contrast);
1823
1904
if (success) {
@@ -1878,7 +1959,7 @@ namespace Plugin {
1878
1959
}
1879
1960
else
1880
1961
{
1881
- bool success = setPQParamV2 (parameters, " Contrast" , PQ_PARAM_CONTRAST, SetContrast, m_maxContrast);
1962
+ bool success = applyPictureSetting (parameters, " Contrast" , PQ_PARAM_CONTRAST, SetContrast, m_maxContrast);
1882
1963
returnResponse (success);
1883
1964
}
1884
1965
}
@@ -1938,7 +2019,7 @@ namespace Plugin {
1938
2019
}
1939
2020
else
1940
2021
{
1941
- bool success= resetPQParamV2 (parameters, " Contrast" , PQ_PARAM_CONTRAST, SetContrast);
2022
+ bool success= resetPictureParamToDefault (parameters, " Contrast" , PQ_PARAM_CONTRAST, SetContrast);
1942
2023
returnResponse (success);
1943
2024
1944
2025
}
@@ -2023,7 +2104,7 @@ namespace Plugin {
2023
2104
{
2024
2105
int saturation = 0 ;
2025
2106
bool success = getPQParamV2 (parameters,
2026
- " saturation" , m_saturationCaps, m_maxSaturation,
2107
+ " saturation" ,
2027
2108
PQ_PARAM_SATURATION,
2028
2109
saturation);
2029
2110
if (success) {
@@ -2084,7 +2165,7 @@ namespace Plugin {
2084
2165
}
2085
2166
else
2086
2167
{
2087
- bool success = setPQParamV2 (parameters, " Saturation" , PQ_PARAM_SATURATION, SetSaturation, m_maxSaturation);
2168
+ bool success = applyPictureSetting (parameters, " Saturation" , PQ_PARAM_SATURATION, SetSaturation, m_maxSaturation);
2088
2169
returnResponse (success);
2089
2170
}
2090
2171
}
@@ -2143,7 +2224,7 @@ namespace Plugin {
2143
2224
}
2144
2225
else
2145
2226
{
2146
- bool success= resetPQParamV2 (parameters, " Saturation" , PQ_PARAM_SATURATION, SetSaturation);
2227
+ bool success= resetPictureParamToDefault (parameters, " Saturation" , PQ_PARAM_SATURATION, SetSaturation);
2147
2228
returnResponse (success);
2148
2229
2149
2230
}
@@ -2229,7 +2310,7 @@ namespace Plugin {
2229
2310
{
2230
2311
int sharpness = 0 ;
2231
2312
bool success = getPQParamV2 (parameters,
2232
- " Sharpness" , m_sharpnessCaps, m_maxSharpness,
2313
+ " Sharpness" ,
2233
2314
PQ_PARAM_SHARPNESS,
2234
2315
sharpness);
2235
2316
if (success) {
@@ -2290,7 +2371,7 @@ namespace Plugin {
2290
2371
}
2291
2372
else
2292
2373
{
2293
- bool success = setPQParamV2 (parameters, " Sharpness" , PQ_PARAM_SHARPNESS, SetSharpness, m_maxSharpness);
2374
+ bool success = applyPictureSetting (parameters, " Sharpness" , PQ_PARAM_SHARPNESS, SetSharpness, m_maxSharpness);
2294
2375
returnResponse (success);
2295
2376
}
2296
2377
}
@@ -2350,7 +2431,7 @@ namespace Plugin {
2350
2431
}
2351
2432
else
2352
2433
{
2353
- bool success= resetPQParamV2 (parameters, " Sharpness" , PQ_PARAM_SHARPNESS, SetSharpness);
2434
+ bool success= resetPictureParamToDefault (parameters, " Sharpness" , PQ_PARAM_SHARPNESS, SetSharpness);
2354
2435
returnResponse (success);
2355
2436
2356
2437
}
@@ -2436,7 +2517,7 @@ namespace Plugin {
2436
2517
{
2437
2518
int hue = 0 ;
2438
2519
bool success = getPQParamV2 (parameters,
2439
- " Hue" , m_hueCaps, m_maxHue,
2520
+ " Hue" ,
2440
2521
PQ_PARAM_HUE,
2441
2522
hue);
2442
2523
if (success) {
@@ -2497,7 +2578,7 @@ namespace Plugin {
2497
2578
}
2498
2579
else
2499
2580
{
2500
- bool success = setPQParamV2 (parameters, " Hue" , PQ_PARAM_HUE, SetHue, m_maxHue);
2581
+ bool success = applyPictureSetting (parameters, " Hue" , PQ_PARAM_HUE, SetHue, m_maxHue);
2501
2582
returnResponse (success);
2502
2583
}
2503
2584
}
@@ -2557,7 +2638,7 @@ namespace Plugin {
2557
2638
}
2558
2639
else
2559
2640
{
2560
- bool success= resetPQParamV2 (parameters, " Hue" , PQ_PARAM_HUE, SetHue);
2641
+ bool success= resetPictureParamToDefault (parameters, " Hue" , PQ_PARAM_HUE, SetHue);
2561
2642
returnResponse (success);
2562
2643
2563
2644
}
0 commit comments