Пример #1
0
bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
{
  debug9("%s (%d, %d) [device %u]", __PRETTY_FUNCTION__, channelP ? channelP->Number() : -1, liveViewP, deviceIndexM);
  if (channelP) {
     cDvbTransponderParameters dtp(channelP->Parameters());
     cString params = GetTransponderUrlParameters(channelP);
     if (isempty(params)) {
        error("Unrecognized channel parameters: %s [device %u]", channelP->Parameters(), deviceIndexM);
        return false;
        }
     cString address;
     cSatipServer *server = cSatipDiscover::GetInstance()->AssignServer(deviceIndexM, channelP->Source(), channelP->Transponder(), dtp.System());
     if (!server) {
        debug9("%s No suitable server found [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
        return false;
        }
     if (pTunerM && pTunerM->SetSource(server, channelP->Transponder(), *params, deviceIndexM)) {
        channelM = *channelP;
        deviceNameM = cString::sprintf("%s %d %s", *DeviceType(), deviceIndexM, *cSatipDiscover::GetInstance()->GetServerString(server));
        return true;
        }
     }
  else if (pTunerM) {
     pTunerM->SetSource(NULL, 0, NULL, deviceIndexM);
     return true;
     }
  return false;
}
Пример #2
0
bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
{
  if (channelP) {
     cDvbTransponderParameters dtp(channelP->Parameters());
     cString params = GetTransponderUrlParameters(channelP);
     if (isempty(params)) {
        error("Unrecognized SAT>IP channel parameters: %s", channelP->Parameters());
        return false;
        }
     cString address;
     cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), dtp.System());
     if (!server) {
        debug("cSatipDevice::%s(%u): no suitable server found", __FUNCTION__, deviceIndexM);
        return false;
        }
     if (pTunerM && pTunerM->SetSource(server, *params, deviceIndexM)) {
        deviceNameM = cString::sprintf("%s %d %s", *DeviceType(), deviceIndexM, *cSatipDiscover::GetInstance()->GetServerString(server));
        channelM = *channelP;
        return true;
        }
     }
  return false;
}