@@ -555,8 +555,17 @@ namespace Plugin {
555
555
return Core::ERROR_NONE;
556
556
}
557
557
558
- Core::hresult AVInputImplementation::StartInput (const int portId, const string& typeOfInput, const bool requestAudioMix, const int plane, const bool topMost, SuccessResult& successResult)
558
+ Core::hresult AVInputImplementation::StartInput (const string& portId, const string& typeOfInput, const bool requestAudioMix, const int plane, const bool topMost, SuccessResult& successResult)
559
559
{
560
+ int id;
561
+
562
+ try {
563
+ id = stoi (portId);
564
+ } catch (const std::exception& err) {
565
+ LOGERR (" StartInput: Invalid paramater: portId: %s " , portId);
566
+ return Core::ERROR_GENERAL;
567
+ }
568
+
560
569
successResult.success = true ;
561
570
562
571
try {
@@ -693,16 +702,33 @@ namespace Plugin {
693
702
return Core::ERROR_NONE;
694
703
}
695
704
696
- Core::hresult AVInputImplementation::WriteEDID (const int portId, const string& message, SuccessResult& successResult)
705
+ Core::hresult AVInputImplementation::WriteEDID (const string& portId, const string& message, SuccessResult& successResult)
697
706
{
698
- printf (" *** _DEBUG: AVInputImplementation::WriteEDID: entry" );
707
+ int id;
708
+
709
+ try {
710
+ id = stoi (portId);
711
+ } catch (const std::exception& err) {
712
+ LOGERR (" WriteEDID: Invalid paramater: portId: %s " , portId);
713
+ return Core::ERROR_GENERAL;
714
+ }
715
+
699
716
// TODO: This wasn't implemented in the original code, do we want to implement it?
700
717
successResult.success = true ;
701
718
return Core::ERROR_NONE;
702
719
}
703
720
704
- Core::hresult AVInputImplementation::ReadEDID (const int portId, string& EDID, bool & success)
721
+ Core::hresult AVInputImplementation::ReadEDID (const string& portId, string& EDID, bool & success)
705
722
{
723
+ int id;
724
+
725
+ try {
726
+ id = stoi (portId);
727
+ } catch (const std::exception& err) {
728
+ LOGERR (" ReadEDID: Invalid paramater: portId: %s " , portId);
729
+ return Core::ERROR_GENERAL;
730
+ }
731
+
706
732
vector<uint8_t > edidVec ({ ' u' , ' n' , ' k' , ' n' , ' o' , ' w' , ' n' });
707
733
708
734
try {
@@ -1072,9 +1098,17 @@ namespace Plugin {
1072
1098
return Core::ERROR_NONE;
1073
1099
}
1074
1100
1075
- Core::hresult AVInputImplementation::GetGameFeatureStatus (const int portId, const string& gameFeature, bool & mode, bool & success)
1101
+ Core::hresult AVInputImplementation::GetGameFeatureStatus (const string& portId, const string& gameFeature, bool & mode, bool & success)
1076
1102
{
1077
- printf (" *** _DEBUG: AVInputImplementation::GetGameFeatureStatus: entry" );
1103
+ int id;
1104
+
1105
+ try {
1106
+ id = stoi (portId);
1107
+ } catch (const std::exception& err) {
1108
+ LOGERR (" GetGameFeatureStatus: Invalid paramater: portId: %s " , portId);
1109
+ return Core::ERROR_GENERAL;
1110
+ }
1111
+
1078
1112
if (gameFeature == STR_ALLM) {
1079
1113
mode = getALLMStatus (portId);
1080
1114
} else if (gameFeature == VRR_TYPE_HDMI) {
@@ -1129,8 +1163,17 @@ namespace Plugin {
1129
1163
return ret;
1130
1164
}
1131
1165
1132
- Core::hresult AVInputImplementation::GetVRRFrameRate (const int portId, double & currentVRRVideoFrameRate, bool & success)
1166
+ Core::hresult AVInputImplementation::GetVRRFrameRate (const string& portId, double & currentVRRVideoFrameRate, bool & success)
1133
1167
{
1168
+ int id;
1169
+
1170
+ try {
1171
+ id = stoi (portId);
1172
+ } catch (const std::exception& err) {
1173
+ LOGERR (" GetVRRFrameRate: Invalid paramater: portId: %s " , portId);
1174
+ return Core::ERROR_GENERAL;
1175
+ }
1176
+
1134
1177
dsHdmiInVrrStatus_t vrrStatus;
1135
1178
vrrStatus.vrrAmdfreesyncFramerate_Hz = 0 ;
1136
1179
@@ -1143,9 +1186,19 @@ namespace Plugin {
1143
1186
return Core::ERROR_NONE;
1144
1187
}
1145
1188
1146
- Core::hresult AVInputImplementation::GetRawSPD (const int portId, string& HDMISPD, bool & success)
1189
+ Core::hresult AVInputImplementation::GetRawSPD (const string& portId, string& HDMISPD, bool & success)
1147
1190
{
1148
- LOGINFO (" AVInputImplementation::getSPDInfo" );
1191
+ LOGINFO (" AVInputImplementation::GetRawSPD" );
1192
+
1193
+ int id;
1194
+
1195
+ try {
1196
+ id = stoi (portId);
1197
+ } catch (const std::exception& err) {
1198
+ LOGERR (" GetRawSPD: Invalid paramater: portId: %s " , portId);
1199
+ return Core::ERROR_GENERAL;
1200
+ }
1201
+
1149
1202
vector<uint8_t > spdVect ({ ' u' , ' n' , ' k' , ' n' , ' o' , ' w' , ' n' });
1150
1203
HDMISPD.clear ();
1151
1204
try {
@@ -1180,22 +1233,30 @@ namespace Plugin {
1180
1233
return Core::ERROR_NONE;
1181
1234
}
1182
1235
1183
- Core::hresult AVInputImplementation::GetSPD (const int portId, string& HDMISPD, bool & success)
1236
+ Core::hresult AVInputImplementation::GetSPD (const string& portId, string& HDMISPD, bool & success)
1184
1237
{
1238
+ int id;
1239
+
1240
+ try {
1241
+ id = stoi (portId);
1242
+ } catch (const std::exception& err) {
1243
+ LOGERR (" GetSPD: Invalid paramater: portId: %s " , portId);
1244
+ return Core::ERROR_GENERAL;
1245
+ }
1246
+
1185
1247
vector<uint8_t > spdVect ({ ' u' , ' n' , ' k' , ' n' , ' o' , ' w' , ' n' });
1186
1248
1187
- LOGINFO (" AVInputImplementation::getSPDInfo " );
1249
+ LOGINFO (" AVInputImplementation::GetSPD " );
1188
1250
1189
1251
try {
1190
- LOGWARN (" AVInputImplementation::getSPDInfo" );
1191
1252
vector<uint8_t > spdVect2;
1192
1253
device::HdmiInput::getInstance ().getHDMISPDInfo (portId, spdVect2);
1193
1254
spdVect = spdVect2; // edidVec must be "unknown" unless we successfully get to this line
1194
1255
1195
1256
// convert to base64
1196
1257
uint16_t size = min (spdVect.size (), (size_t )numeric_limits<uint16_t >::max ());
1197
1258
1198
- LOGWARN (" AVInputImplementation::getSPD size:%d spdVec.size:%zu" , size, spdVect.size ());
1259
+ LOGWARN (" AVInputImplementation::GetSPD size:%d spdVec.size:%zu" , size, spdVect.size ());
1199
1260
1200
1261
if (spdVect.size () > (size_t )numeric_limits<uint16_t >::max ()) {
1201
1262
LOGERR (" Size too large to use ToString base64 wpe api" );
@@ -1243,8 +1304,17 @@ namespace Plugin {
1243
1304
return Core::ERROR_NONE;
1244
1305
}
1245
1306
1246
- Core::hresult AVInputImplementation::SetEdid2AllmSupport (const int portId, const bool allmSupport, SuccessResult& successResult)
1307
+ Core::hresult AVInputImplementation::SetEdid2AllmSupport (const string& portId, const bool allmSupport, SuccessResult& successResult)
1247
1308
{
1309
+ int id;
1310
+
1311
+ try {
1312
+ id = stoi (portId);
1313
+ } catch (const std::exception& err) {
1314
+ LOGERR (" SetEdid2AllmSupport: Invalid paramater: portId: %s " , portId);
1315
+ return Core::ERROR_GENERAL;
1316
+ }
1317
+
1248
1318
successResult.success = true ;
1249
1319
1250
1320
try {
@@ -1282,8 +1352,17 @@ namespace Plugin {
1282
1352
return Core::ERROR_NONE;
1283
1353
}
1284
1354
1285
- Core::hresult AVInputImplementation::GetVRRSupport (const int portId, bool & vrrSupport)
1355
+ Core::hresult AVInputImplementation::GetVRRSupport (const string& portId, bool & vrrSupport)
1286
1356
{
1357
+ int id;
1358
+
1359
+ try {
1360
+ id = stoi (portId);
1361
+ } catch (const std::exception& err) {
1362
+ LOGERR (" GetVRRSupport: Invalid paramater: portId: %s " , portId);
1363
+ return Core::ERROR_GENERAL;
1364
+ }
1365
+
1287
1366
Core::hresult ret = Core::ERROR_NONE;
1288
1367
1289
1368
try {
@@ -1296,8 +1375,17 @@ namespace Plugin {
1296
1375
return ret;
1297
1376
}
1298
1377
1299
- Core::hresult AVInputImplementation::SetVRRSupport (const int portId, const bool vrrSupport)
1378
+ Core::hresult AVInputImplementation::SetVRRSupport (const string& portId, const bool vrrSupport)
1300
1379
{
1380
+ int id;
1381
+
1382
+ try {
1383
+ id = stoi (portId);
1384
+ } catch (const std::exception& err) {
1385
+ LOGERR (" SetVRRSupport: Invalid paramater: portId: %s " , portId);
1386
+ return Core::ERROR_GENERAL;
1387
+ }
1388
+
1301
1389
Core::hresult ret = Core::ERROR_NONE;
1302
1390
try {
1303
1391
device::HdmiInput::getInstance ().setVRRSupport (portId, vrrSupport);
@@ -1309,8 +1397,17 @@ namespace Plugin {
1309
1397
return ret;
1310
1398
}
1311
1399
1312
- Core::hresult AVInputImplementation::GetHdmiVersion (const int portId, string& HdmiCapabilityVersion, bool & success)
1400
+ Core::hresult AVInputImplementation::GetHdmiVersion (const string& portId, string& HdmiCapabilityVersion, bool & success)
1313
1401
{
1402
+ int id;
1403
+
1404
+ try {
1405
+ id = stoi (portId);
1406
+ } catch (const std::exception& err) {
1407
+ LOGERR (" GetHdmiVersion: Invalid paramater: portId: %s " , portId);
1408
+ return Core::ERROR_GENERAL;
1409
+ }
1410
+
1314
1411
dsHdmiMaxCapabilityVersion_t hdmiCapVersion = HDMI_COMPATIBILITY_VERSION_14;
1315
1412
1316
1413
try {
@@ -1347,8 +1444,17 @@ namespace Plugin {
1347
1444
return Core::ERROR_NONE;
1348
1445
}
1349
1446
1350
- Core::hresult AVInputImplementation::SetEdidVersion (const int portId, const string& edidVersion, SuccessResult& successResult)
1447
+ Core::hresult AVInputImplementation::SetEdidVersion (const string& portId, const string& edidVersion, SuccessResult& successResult)
1351
1448
{
1449
+ int id;
1450
+
1451
+ try {
1452
+ id = stoi (portId);
1453
+ } catch (const std::exception& err) {
1454
+ LOGERR (" SetEdidVersion: Invalid paramater: portId: %s " , portId);
1455
+ return Core::ERROR_GENERAL;
1456
+ }
1457
+
1352
1458
int edidVer = -1 ;
1353
1459
successResult.success = true ;
1354
1460
@@ -1373,8 +1479,17 @@ namespace Plugin {
1373
1479
return Core::ERROR_NONE;
1374
1480
}
1375
1481
1376
- Core::hresult AVInputImplementation::GetEdidVersion (const int portId, string& edidVersion, bool & success)
1482
+ Core::hresult AVInputImplementation::GetEdidVersion (const string& portId, string& edidVersion, bool & success)
1377
1483
{
1484
+ int id;
1485
+
1486
+ try {
1487
+ id = stoi (portId);
1488
+ } catch (const std::exception& err) {
1489
+ LOGERR (" GetEdidVersion: Invalid paramater: portId: %s " , portId);
1490
+ return Core::ERROR_GENERAL;
1491
+ }
1492
+
1378
1493
success = true ;
1379
1494
int version = -1 ;
1380
1495
0 commit comments