added support for VDR 1.7.19 SignalStrength/SignalQuality

This commit is contained in:
Frank Schmirler
2011-07-06 09:13:50 +02:00
parent 673fbae2e2
commit 2c8377d42a
9 changed files with 74 additions and 0 deletions

View File

@@ -840,6 +840,7 @@ bool cConnectionVTP::Command(char *Cmd)
else if (strcasecmp(Cmd, "TUNE") == 0) return CmdTUNE(param);
else if (strcasecmp(Cmd, "PLAY") == 0) return CmdPLAY(param);
else if (strcasecmp(Cmd, "PRIO") == 0) return CmdPRIO(param);
else if (strcasecmp(Cmd, "SGNL") == 0) return CmdSGNL(param);
else if (strcasecmp(Cmd, "ADDP") == 0) return CmdADDP(param);
else if (strcasecmp(Cmd, "DELP") == 0) return CmdDELP(param);
else if (strcasecmp(Cmd, "ADDF") == 0) return CmdADDF(param);
@@ -1155,6 +1156,18 @@ bool cConnectionVTP::CmdPRIO(char *Opts)
return Respond(550, "Priority not applicable");
}
bool cConnectionVTP::CmdSGNL(char *Opts)
{
if (m_LiveStreamer) {
int devnum = -1;
int signal = -1;
int quality = -1;
m_LiveStreamer->GetSignal(&devnum, &signal, &quality);
return Respond(220, "%d %d:%d", devnum, signal, quality);
}
return Respond(550, "Signal not applicable");
}
bool cConnectionVTP::CmdADDP(char *Opts)
{
int pid;

View File

@@ -65,6 +65,7 @@ public:
bool CmdTUNE(char *Opts);
bool CmdPLAY(char *Opts);
bool CmdPRIO(char *Opts);
bool CmdSGNL(char *Opts);
bool CmdADDP(char *Opts);
bool CmdDELP(char *Opts);
bool CmdADDF(char *Opts);

View File

@@ -440,6 +440,17 @@ void cStreamdevLiveStreamer::SetPriority(int Priority)
StartReceiver();
}
void cStreamdevLiveStreamer::GetSignal(int *DevNum, int *Strength, int *Quality) const
{
if (m_Device) {
*DevNum = m_Device->DeviceNumber() + 1;
#if APIVERSNUM >= 10719
*Strength = m_Device->SignalStrength();
*Quality = m_Device->SignalQuality();
#endif
}
}
void cStreamdevLiveStreamer::StartReceiver(void)
{
if (m_NumPids > 0) {

View File

@@ -39,6 +39,7 @@ public:
bool SetPids(int Pid, const int *Pids1 = NULL, const int *Pids2 = NULL, const int *Pids3 = NULL);
bool SetChannel(const cChannel *Channel, eStreamType StreamType, const int* Apid = NULL, const int* Dpid = NULL);
void SetPriority(int Priority);
void GetSignal(int *DevNum, int *Strength, int *Quality) const;
virtual int Put(const uchar *Data, int Count);
virtual uchar *Get(int &Count);