Don't wait for all responses of getStreamIdList() before invoking getStreamConfig(); similarly for devices too - this change should simplify session file open

This commit is contained in:
Srivats P 2016-04-26 20:23:50 +05:30
parent e75ed87dd7
commit 2426632055
2 changed files with 43 additions and 56 deletions

View File

@ -776,25 +776,18 @@ void PortGroup::processStreamIdList(int portIndex, PbRpcController *controller)
mPorts[portIndex]->insertStream(streamId);
}
// Are we done for all ports?
if (numPorts() && portIndex >= (numPorts()-1))
{
// FIXME(HI): some way to reset streammodel
getStreamConfigList();
}
getStreamConfigList(portIndex);
_exit:
delete controller;
}
void PortGroup::getStreamConfigList()
void PortGroup::getStreamConfigList(int portIndex)
{
qDebug("requesting stream config list ...");
for (int portIndex = 0; portIndex < numPorts(); portIndex++)
{
if (mPorts[portIndex]->numStreams() == 0)
continue;
return;
qDebug("requesting stream config list (port %d)...", portIndex);
OstProto::StreamIdList *streamIdList = new OstProto::StreamIdList;
OstProto::StreamConfigList *streamConfigList
@ -812,7 +805,6 @@ void PortGroup::getStreamConfigList()
serviceStub->getStreamConfig(controller, streamIdList, streamConfigList,
NewCallback(this, &PortGroup::processStreamConfigList,
portIndex, controller));
}
}
void PortGroup::processStreamConfigList(int portIndex,
@ -919,26 +911,22 @@ void PortGroup::processDeviceGroupIdList(
mPorts[portIndex]->when_syncComplete();
// Are we done for all ports?
if (numPorts() && portIndex >= (numPorts()-1))
getDeviceGroupConfigList();
getDeviceGroupConfigList(portIndex);
_exit:
delete controller;
}
void PortGroup::getDeviceGroupConfigList()
void PortGroup::getDeviceGroupConfigList(int portIndex)
{
using OstProto::DeviceGroupId;
using OstProto::DeviceGroupIdList;
using OstProto::DeviceGroupConfigList;
qDebug("requesting device group config list ...");
for (int portIndex = 0; portIndex < numPorts(); portIndex++)
{
if (mPorts[portIndex]->numDeviceGroups() == 0)
continue;
return;
qDebug("requesting device group config list (port %d) ...", portIndex);
DeviceGroupIdList *devGrpIdList = new DeviceGroupIdList;
DeviceGroupConfigList *devGrpCfgList = new DeviceGroupConfigList;
@ -957,7 +945,6 @@ void PortGroup::getDeviceGroupConfigList()
devGrpIdList, devGrpCfgList,
NewCallback(this, &PortGroup::processDeviceGroupConfigList,
portIndex, controller));
}
}
void PortGroup::processDeviceGroupConfigList(int portIndex,

View File

@ -127,14 +127,14 @@ public:
void getStreamIdList();
void processStreamIdList(int portIndex, PbRpcController *controller);
void getStreamConfigList();
void getStreamConfigList(int portIndex);
void processStreamConfigList(int portIndex, PbRpcController *controller);
void processModifyStreamAck(OstProto::Ack *ack);
void getDeviceGroupIdList();
void processDeviceGroupIdList(int portIndex, PbRpcController *controller);
void getDeviceGroupConfigList();
void getDeviceGroupConfigList(int portIndex);
void processDeviceGroupConfigList(
int portIndex,
PbRpcController *controller);