Skip to content

Commit e0c3ea3

Browse files
authored
Update AVInput.cpp
1 parent 8ae173d commit e0c3ea3

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

AVInput/AVInput.cpp

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#define AVINPUT_METHOD_GET_EDID_VERSION "getEdidVersion"
4949
#define AVINPUT_METHOD_SET_EDID_ALLM_SUPPORT "setEdid2AllmSupport"
5050
#define AVINPUT_METHOD_GET_EDID_ALLM_SUPPORT "getEdid2AllmSupport"
51+
#define AVINPUT_METHOD_SET_VRR_SUPPORT "setVRRSupport"
52+
#define AVINPUT_METHOD_GET_VRR_SUPPORT "getVRRSupport"
5153
#define AVINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION "getHdmiVersion"
5254
#define AVINPUT_METHOD_SET_MIXER_LEVELS "setMixerLevels"
5355
#define AVINPUT_METHOD_START_INPUT "startInput"
@@ -65,7 +67,6 @@
6567
#define AVINPUT_EVENT_ON_GAME_FEATURE_STATUS_CHANGED "gameFeatureStatusUpdate"
6668
#define AVINPUT_EVENT_ON_AVI_CONTENT_TYPE_CHANGED "aviContentTypeUpdate"
6769

68-
//demo
6970
static bool isAudioBalanceSet = false;
7071
static int planeType = 0;
7172

@@ -232,6 +233,8 @@ void AVInput::RegisterAll()
232233
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_SET_MIXER_LEVELS), &AVInput::setMixerLevels, this);
233234
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_SET_EDID_ALLM_SUPPORT), &AVInput::setEdid2AllmSupportWrapper, this);
234235
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_GET_EDID_ALLM_SUPPORT), &AVInput::getEdid2AllmSupportWrapper, this);
236+
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_SET_VRR_SUPPORT), &AVInput::setVRRSupportWrapper, this);
237+
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_GET_VRR_SUPPORT), &AVInput::getVRRSupportWrapper, this);
235238
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_GET_HDMI_COMPATIBILITY_VERSION), &AVInput::getHdmiVersionWrapper, this);
236239
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_START_INPUT), &AVInput::startInput, this);
237240
Register<JsonObject, JsonObject>(_T(AVINPUT_METHOD_STOP_INPUT), &AVInput::stopInput, this);
@@ -1364,6 +1367,77 @@ uint32_t AVInput::getEdid2AllmSupportWrapper(const JsonObject& parameters, JsonO
13641367
}
13651368
}
13661369

1370+
bool getVRRSupport(int portId,bool *vrrSupportValue)
1371+
{
1372+
bool ret = true;
1373+
//To implement
1374+
return ret;
1375+
}
1376+
1377+
uint32_t AVInput::getVRRSupportWrapper(const JsonObject& parameters, JsonObject& response)
1378+
{
1379+
LOGINFOMETHOD();
1380+
string sPortId = parameters["portId"].String();
1381+
1382+
int portId = 0;
1383+
bool vrrSupport = true;
1384+
returnIfParamNotFound(parameters, "portId");
1385+
1386+
try {
1387+
portId = stoi(sPortId);
1388+
}catch (const std::exception& err) {
1389+
LOGWARN("sPortId invalid paramater: %s ", sPortId.c_str());
1390+
returnResponse(false);
1391+
}
1392+
1393+
bool result = getVRRSupport(portId, &allmSupport);
1394+
if(result == true)
1395+
{
1396+
response["vrrSupport"] = vrrSupport;
1397+
returnResponse(true);
1398+
}
1399+
else
1400+
{
1401+
returnResponse(false);
1402+
}
1403+
}
1404+
1405+
bool setVRRSupport(int portId, bool vrrSupport)
1406+
{
1407+
bool ret = true;
1408+
//To implement
1409+
return ret;
1410+
}
1411+
1412+
uint32_t AVInput::setVRRSupportWrapper(const JsonObject& parameters, JsonObject& response)
1413+
{
1414+
LOGINFOMETHOD();
1415+
1416+
returnIfParamNotFound(parameters, "portId");
1417+
returnIfParamNotFound(parameters, "vrrSupport");
1418+
1419+
int portId = 0;
1420+
string sPortId = parameters["portId"].String();
1421+
bool vrrSupport = parameters["vrrSupport"].Boolean();
1422+
1423+
try {
1424+
portId = stoi(sPortId);
1425+
}catch (const std::exception& err) {
1426+
LOGWARN("sPortId invalid paramater: %s ", sPortId.c_str());
1427+
returnResponse(false);
1428+
}
1429+
1430+
bool result = setVRRSupport(portId, vrrSupport);
1431+
if(result == true)
1432+
{
1433+
returnResponse(true);
1434+
}
1435+
else
1436+
{
1437+
returnResponse(false);
1438+
}
1439+
}
1440+
13671441
uint32_t AVInput::setEdidVersionWrapper(const JsonObject& parameters, JsonObject& response)
13681442
{
13691443
LOGINFOMETHOD();

0 commit comments

Comments
 (0)