mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
115 lines
3.5 KiB
Diff
115 lines
3.5 KiB
Diff
diff --git a/device.h b/device.h
|
|
index e61edd0..dc2ea5f 100644
|
|
--- a/device.h
|
|
+++ b/device.h
|
|
@@ -24,6 +24,8 @@
|
|
#include "spu.h"
|
|
#include "thread.h"
|
|
#include "tools.h"
|
|
+#include <asm/types.h>
|
|
+#include <linux/dvb/frontend.h>
|
|
|
|
#define MAXDEVICES 16 // the maximum number of devices in the system
|
|
#define MAXPIDHANDLES 64 // the maximum number of different PIDs per device
|
|
@@ -331,7 +333,7 @@ public:
|
|
virtual bool HasProgramme(void);
|
|
///< Returns true if the device is currently showing any programme to
|
|
///< the user, either through replaying or live.
|
|
-
|
|
+ virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd) {return false;}
|
|
// PID handle facilities
|
|
|
|
private:
|
|
diff --git a/dvbdevice.c b/dvbdevice.c
|
|
index 65e9a4b..53a4a22 100644
|
|
--- a/dvbdevice.c
|
|
+++ b/dvbdevice.c
|
|
@@ -285,6 +285,7 @@ class cDvbTuner : public cThread {
|
|
private:
|
|
static cMutex bondMutex;
|
|
enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
|
|
+ bool SendDiseqc;
|
|
const cDvbDevice *device;
|
|
int fd_frontend;
|
|
int adapter, frontend;
|
|
@@ -300,6 +301,7 @@ private:
|
|
cMutex mutex;
|
|
cCondVar locked;
|
|
cCondVar newSet;
|
|
+ dvb_diseqc_master_cmd diseqc_cmd;
|
|
cDvbTuner *bondedTuner;
|
|
bool bondedMaster;
|
|
bool bondedMasterFailed;
|
|
@@ -322,6 +324,7 @@ public:
|
|
uint32_t SubsystemId(void) const { return subsystemId; }
|
|
bool IsTunedTo(const cChannel *Channel) const;
|
|
void SetChannel(const cChannel *Channel);
|
|
+ bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
|
|
bool Locked(int TimeoutMs = 0);
|
|
int GetSignalStrength(void) const;
|
|
int GetSignalQuality(void) const;
|
|
@@ -333,6 +336,7 @@ cDvbTuner::cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int
|
|
{
|
|
device = Device;
|
|
fd_frontend = Fd_Frontend;
|
|
+ SendDiseqc=false;
|
|
adapter = Adapter;
|
|
frontend = Frontend;
|
|
subsystemId = cDvbDeviceProbe::GetSubsystemId(adapter, frontend);
|
|
@@ -860,6 +864,10 @@ void cDvbTuner::Action(void)
|
|
Status = NewStatus;
|
|
cMutexLock MutexLock(&mutex);
|
|
int WaitTime = 1000;
|
|
+ if (SendDiseqc) {
|
|
+ CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &diseqc_cmd));
|
|
+ SendDiseqc=false;
|
|
+ }
|
|
switch (tunerStatus) {
|
|
case tsIdle:
|
|
break;
|
|
@@ -913,6 +921,20 @@ void cDvbTuner::Action(void)
|
|
}
|
|
}
|
|
|
|
+bool cDvbTuner::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
|
|
+{
|
|
+ cMutexLock MutexLock(&mutex);
|
|
+ cDvbTransponderParameters dtp(channel.Parameters());
|
|
+ // Determine the required frontend type:
|
|
+ int frontendType = GetRequiredDeliverySystem(&channel, &dtp);
|
|
+ if ((frontendType!=SYS_DVBS2 && frontendType!=SYS_DVBS) || SendDiseqc)
|
|
+ return false;
|
|
+ diseqc_cmd=cmd;
|
|
+ SendDiseqc=true;
|
|
+ newSet.Broadcast();
|
|
+ return true;
|
|
+}
|
|
+
|
|
// --- cDvbSourceParam -------------------------------------------------------
|
|
|
|
class cDvbSourceParam : public cSourceParam {
|
|
@@ -1534,6 +1556,11 @@ bool cDvbDevice::HasLock(int TimeoutMs)
|
|
return dvbTuner ? dvbTuner->Locked(TimeoutMs) : false;
|
|
}
|
|
|
|
+bool cDvbDevice::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
|
|
+{
|
|
+ return dvbTuner->SendDiseqcCmd(cmd);
|
|
+}
|
|
+
|
|
void cDvbDevice::SetTransferModeForDolbyDigital(int Mode)
|
|
{
|
|
setTransferModeForDolbyDigital = Mode;
|
|
diff --git a/dvbdevice.h b/dvbdevice.h
|
|
index c53a208..4ffcb91 100644
|
|
--- a/dvbdevice.h
|
|
+++ b/dvbdevice.h
|
|
@@ -192,6 +192,7 @@ protected:
|
|
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
|
|
public:
|
|
virtual bool HasLock(int TimeoutMs = 0);
|
|
+ virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
|
|
|
|
// PID handle facilities
|
|
|