Skip to content

Commit

Permalink
Merge pull request #2102 from ksanth850/sprint/2201
Browse files Browse the repository at this point in the history
DELIA-53757: SIGABRT in getvideodevices
  • Loading branch information
anand-ky authored Jan 12, 2022
2 parents a17a463 + cc8b4c0 commit a002604
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion DisplaySettings/DisplaySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,12 @@ namespace WPEFramework {
vector<string> supportedSettopResolutions;
try
{
if (device::Host::getInstance().getVideoDevices().size() < 1)
{
LOGINFO("DSMGR_NOT_RUNNING");
returnResponse(false);
}

device::VideoDevice &device = device::Host::getInstance().getVideoDevices().at(0);
list<string> resolutions;
device.getSettopSupportedResolutions(resolutions);
Expand Down Expand Up @@ -1157,21 +1163,30 @@ namespace WPEFramework {
{ //sample servicemanager response:
LOGINFOMETHOD();
string zoomSetting = "unknown";

bool success = true;
try
{
if (device::Host::getInstance().getVideoDevices().size() < 1)
{
LOGINFO("DSMGR_NOT_RUNNING");
returnResponse(false);
}

// TODO: why is this always the first one in the list
device::VideoDevice &decoder = device::Host::getInstance().getVideoDevices().at(0);
zoomSetting = decoder.getDFC().getName();
}
catch(const device::Exception& err)
{
LOG_DEVICE_EXCEPTION0();
success = false;
}
#ifdef USE_IARM
zoomSetting = iarm2svc(zoomSetting);
#endif
response["zoomSetting"] = zoomSetting;
returnResponse(true);
returnResponse(success);
}

uint32_t DisplaySettings::setZoomSetting(const JsonObject& parameters, JsonObject& response)
Expand All @@ -1187,6 +1202,12 @@ namespace WPEFramework {
#ifdef USE_IARM
zoomSetting = svc2iarm(zoomSetting);
#endif
if (device::Host::getInstance().getVideoDevices().size() < 1)
{
LOGINFO("DSMGR_NOT_RUNNING");
returnResponse(false);
}

// TODO: why is this always the first one in the list?
device::VideoDevice &decoder = device::Host::getInstance().getVideoDevices().at(0);
decoder.setDFC(zoomSetting);
Expand Down Expand Up @@ -1725,6 +1746,12 @@ namespace WPEFramework {

try
{
if (device::Host::getInstance().getVideoDevices().size() < 1)
{
LOGINFO("DSMGR_NOT_RUNNING");
returnResponse(false);
}

device::VideoDevice &device = device::Host::getInstance().getVideoDevices().at(0);
device.getHDRCapabilities(&capabilities);
}
Expand Down Expand Up @@ -4714,6 +4741,12 @@ namespace WPEFramework {

try
{
if (device::Host::getInstance().getVideoDevices().size() < 1)
{
LOGINFO("DSMGR_NOT_RUNNING");
return videoFormats;
}

device::VideoDevice &device = device::Host::getInstance().getVideoDevices().at(0);
device.getHDRCapabilities(&capabilities);
}
Expand Down

0 comments on commit a002604

Please sign in to comment.