mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Add a preliminary ATSC support.
This commit is contained in:
parent
19e3057f34
commit
a3fa5865f3
58
param.c
58
param.c
@ -59,6 +59,10 @@ static const tSatipParameterMap SatipCodeRateValues[] = {
|
||||
static const tSatipParameterMap SatipModulationValues[] = {
|
||||
{ QPSK, "&mtype=qpsk" },
|
||||
{ PSK_8, "&mtype=8psk" },
|
||||
{ APSK_16, "&mtype=16apsk" },
|
||||
{ APSK_32, "&mtype=32apsk" },
|
||||
{ VSB_8, "&mtype=8vsb" },
|
||||
{ VSB_16, "&mtype=16vsb" },
|
||||
{ QAM_16, "&mtype=16qam" },
|
||||
{ QAM_64, "&mtype=64qam" },
|
||||
{ QAM_128, "&mtype=128qam" },
|
||||
@ -85,6 +89,11 @@ static const tSatipParameterMap SatipSystemValuesCable[] = {
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static const tSatipParameterMap SatipSystemValuesAtsc[] = {
|
||||
{ 0, "&msys=atsc" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static const tSatipParameterMap SatipTransmissionValues[] = {
|
||||
{ TRANSMISSION_MODE_1K, "&tmode=1k" },
|
||||
{ TRANSMISSION_MODE_2K, "&tmode=2k" },
|
||||
@ -165,31 +174,34 @@ cString GetTransponderUrlParameters(const cChannel *channelP)
|
||||
}
|
||||
if ((channelP->Rid() % 100) > 0)
|
||||
q += snprintf(q, STBUFLEFT, "&fe=%d", channelP->Rid() % 100);
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&src=%d", ((src > 0) && (src <= 255)) ? src : 1);
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&src=%d", ((src > 0) && (src <= 255)) ? src : 1);
|
||||
if (freq >= 0L)
|
||||
q += snprintf(q, STBUFLEFT, "&freq=%s", *dtoa(freq, "%lg"));
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&pol=%c", tolower(dtp.Polarization()));
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.RollOff(), SatipRollOffValues);
|
||||
ST("C 2") q += snprintf(q, STBUFLEFT, "&c2tft=%d", C2TuningFrequencyType);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues);
|
||||
ST("C 2") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesSat);
|
||||
ST("C *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesCable);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesTerrestrial);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Transmission(), SatipTransmissionValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST("C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.Pilot(), SatipPilotValues);
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate());
|
||||
ST("C 1") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate());
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Guard(), SatipGuardValues);
|
||||
ST("CST*") q += PrintUrlString(q, STBUFLEFT, dtp.CoderateH(), SatipCodeRateValues);
|
||||
ST("C 2") q += snprintf(q, STBUFLEFT, "&ds=%d", DataSlice);
|
||||
ST("C T2") q += snprintf(q, STBUFLEFT, "&plp=%d", dtp.StreamId());
|
||||
ST(" T2") q += snprintf(q, STBUFLEFT, "&t2id=%d", dtp.T2SystemId());
|
||||
ST(" T2") q += PrintUrlString(q, STBUFLEFT, dtp.SisoMiso(), SatipSisoMisoValues);
|
||||
ST("C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Inversion(), SatipInversionValues);
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&pol=%c", tolower(dtp.Polarization()));
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.RollOff(), SatipRollOffValues);
|
||||
ST(" C 2") q += snprintf(q, STBUFLEFT, "&c2tft=%d", C2TuningFrequencyType);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues);
|
||||
ST(" C 2") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesSat);
|
||||
ST(" C *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesCable);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesTerrestrial);
|
||||
ST("A *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesAtsc);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Transmission(), SatipTransmissionValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST(" C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST("A *") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues);
|
||||
ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.Pilot(), SatipPilotValues);
|
||||
ST(" S *") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate());
|
||||
ST(" C 1") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate());
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Guard(), SatipGuardValues);
|
||||
ST(" CST*") q += PrintUrlString(q, STBUFLEFT, dtp.CoderateH(), SatipCodeRateValues);
|
||||
ST(" C 2") q += snprintf(q, STBUFLEFT, "&ds=%d", DataSlice);
|
||||
ST(" C T2") q += snprintf(q, STBUFLEFT, "&plp=%d", dtp.StreamId());
|
||||
ST(" T2") q += snprintf(q, STBUFLEFT, "&t2id=%d", dtp.T2SystemId());
|
||||
ST(" T2") q += PrintUrlString(q, STBUFLEFT, dtp.SisoMiso(), SatipSisoMisoValues);
|
||||
ST(" C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Inversion(), SatipInversionValues);
|
||||
ST("A *") q += PrintUrlString(q, STBUFLEFT, dtp.Inversion(), SatipInversionValues);
|
||||
#undef ST
|
||||
return &buffer[1];
|
||||
}
|
||||
|
18
server.c
18
server.c
@ -206,6 +206,11 @@ cSatipServer::cSatipServer(const char *srcAddressP, const char *addressP, const
|
||||
for (int i = 1; i <= count; ++i)
|
||||
frontendsM[eSatipFrontendDVBC2].Add(new cSatipFrontend(i, "DVB-C2"));
|
||||
}
|
||||
else if (c = strstr(r, "ATSC-")) {
|
||||
int count = atoi(c + 5);
|
||||
for (int i = 1; i <= count; ++i)
|
||||
frontendsM[eSatipFrontendATSC].Add(new cSatipFrontend(i, "ATSC"));
|
||||
}
|
||||
r = strtok_r(NULL, ",", &s);
|
||||
}
|
||||
FREE_POINTER(p);
|
||||
@ -258,6 +263,8 @@ bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transpond
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
else if (cSource::IsType(sourceP, 'A'))
|
||||
result = frontendsM[eSatipFrontendATSC].Assign(deviceIdP, transponderP);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -271,6 +278,8 @@ bool cSatipServer::Matches(int sourceP)
|
||||
return GetModulesDVBT() || GetModulesDVBT2();
|
||||
else if (cSource::IsType(sourceP, 'C'))
|
||||
return GetModulesDVBC() || GetModulesDVBC2();
|
||||
else if (cSource::IsType(sourceP, 'A'))
|
||||
return GetModulesATSC();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -293,6 +302,8 @@ bool cSatipServer::Matches(int deviceIdP, int sourceP, int systemP, int transpon
|
||||
else
|
||||
result = frontendsM[eSatipFrontendDVBC].Matches(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Matches(deviceIdP, transponderP);
|
||||
}
|
||||
else if (cSource::IsType(sourceP, 'A'))
|
||||
result = frontendsM[eSatipFrontendATSC].Matches(deviceIdP, transponderP);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -338,6 +349,11 @@ int cSatipServer::GetModulesDVBC2(void)
|
||||
return frontendsM[eSatipFrontendDVBC2].Count();
|
||||
}
|
||||
|
||||
int cSatipServer::GetModulesATSC(void)
|
||||
{
|
||||
return frontendsM[eSatipFrontendATSC].Count();
|
||||
}
|
||||
|
||||
// --- cSatipServers ----------------------------------------------------------
|
||||
|
||||
cSatipServer *cSatipServers::Find(cSatipServer *serverP)
|
||||
@ -519,6 +535,8 @@ int cSatipServers::NumProvidedSystems(void)
|
||||
count += s->GetModulesDVBC() * 3;
|
||||
// DVB-C2: qam16, qam32, qam64, qam128, qam256
|
||||
count += s->GetModulesDVBC2() * 5;
|
||||
// ATSC: 8vbs, 16vbs, qam256
|
||||
count += s->GetModulesATSC() * 3;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
2
server.h
2
server.h
@ -52,6 +52,7 @@ private:
|
||||
eSatipFrontendDVBT2,
|
||||
eSatipFrontendDVBC,
|
||||
eSatipFrontendDVBC2,
|
||||
eSatipFrontendATSC,
|
||||
eSatipFrontendCount
|
||||
};
|
||||
enum {
|
||||
@ -98,6 +99,7 @@ public:
|
||||
int GetModulesDVBT2(void);
|
||||
int GetModulesDVBC(void);
|
||||
int GetModulesDVBC2(void);
|
||||
int GetModulesATSC(void);
|
||||
void Activate(bool onOffP) { activeM = onOffP; }
|
||||
const char *SrcAddress(void) { return *srcAddressM; }
|
||||
const char *Address(void) { return *addressM; }
|
||||
|
Loading…
Reference in New Issue
Block a user