MythTV  master
iptvchannel.h
Go to the documentation of this file.
1 
10 #ifndef IPTV_CHANNEL_H
11 #define IPTV_CHANNEL_H
12 
13 // Qt headers
14 #include <QMutex>
15 
16 // MythTV headers
17 #include "dtvchannel.h"
18 #include "iptvstreamhandler.h"
19 
20 class IPTVTuningData;
21 class IPTVRecorder;
22 class MPEGStreamData;
23 
24 class IPTVChannel : QObject, public DTVChannel
25 {
26  Q_OBJECT
27  friend class IPTVRecorder;
28 
29  public:
30  IPTVChannel(TVRec *rec, QString videodev);
31  ~IPTVChannel() override;
32 
33  // Commands
34  bool Open(void) override; // ChannelBase
35 
36  using DTVChannel::Tune;
37  bool Tune(const IPTVTuningData &tuning, bool scanning) override ; // DTVChannel
38  bool Tune(const DTVMultiplex &/*tuning*/) override // DTVChannel
39  { return false; }
40 
41  // Sets
42  void SetStreamData(MPEGStreamData *sd);
43 
44  // Gets
45  bool IsOpen(void) const override; // ChannelBase
46  QString GetDevice(void) const override // ChannelBase
47  { return m_lastTuning.GetDeviceKey(); }
49  bool IsIPTV(void) const override { return true; } // DTVChannel
50  bool IsPIDTuningSupported(void) const override // DTVChannel
51  { return true; }
52 
53  protected:
54  void Close(void) override; // ChannelBase
55  bool EnterPowerSavingMode(void) override; // DTVChannel
56  bool IsExternalChannelChangeSupported(void) override // ChannelBase
57  { return true; }
58 
59  private:
60  void OpenStreamHandler(void);
61  void CloseStreamHandler(void);
62 
63  private:
64  mutable QMutex m_tuneLock;
65  volatile bool m_firstTune {true};
67  mutable QMutex m_streamLock;
70  QString m_videoDev;
71 };
72 
73 #endif // IPTV_CHANNEL_H
74 
75 /* vim: set expandtab tabstop=4 shiftwidth=4: */
DTVMultiplex
Definition: dtvmultiplex.h:25
dtvchannel.h
IPTVChannel::m_streamData
MPEGStreamData * m_streamData
Definition: iptvchannel.h:69
IPTVChannel::OpenStreamHandler
void OpenStreamHandler(void)
Definition: iptvchannel.cpp:100
IPTVChannel::~IPTVChannel
~IPTVChannel() override
Definition: iptvchannel.cpp:33
IPTVChannel::Tune
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
IPTVChannel::m_streamHandler
IPTVStreamHandler * m_streamHandler
Definition: iptvchannel.h:68
IPTVChannel::IsPIDTuningSupported
bool IsPIDTuningSupported(void) const override
Definition: iptvchannel.h:50
DTVChannel::Tune
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
IPTVChannel::Tune
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
Definition: iptvchannel.h:38
IPTVChannel::IsExternalChannelChangeSupported
bool IsExternalChannelChangeSupported(void) override
Definition: iptvchannel.h:56
IPTVTuningData::GetDeviceKey
QString GetDeviceKey(void) const
Definition: iptvtuningdata.h:97
IPTVChannel::GetStreamHandler
IPTVStreamHandler * GetStreamHandler(void) const
Definition: iptvchannel.h:48
IPTVChannel::EnterPowerSavingMode
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
Definition: iptvchannel.cpp:94
IPTVChannel::CloseStreamHandler
void CloseStreamHandler(void)
Definition: iptvchannel.cpp:119
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:86
IPTVTuningData
Definition: iptvtuningdata.h:17
IPTVChannel
Definition: iptvchannel.h:25
IPTVChannel::IsIPTV
bool IsIPTV(void) const override
Definition: iptvchannel.h:49
IPTVChannel::m_videoDev
QString m_videoDev
Definition: iptvchannel.h:70
IPTVRecorder
Definition: iptvrecorder.h:19
IPTVChannel::m_firstTune
volatile bool m_firstTune
Definition: iptvchannel.h:65
IPTVChannel::IsOpen
bool IsOpen(void) const override
Reports whether channel is already open.
Definition: iptvchannel.cpp:153
IPTVChannel::SetStreamData
void SetStreamData(MPEGStreamData *sd)
Definition: iptvchannel.cpp:60
IPTVChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: iptvchannel.cpp:88
IPTVChannel::IPTVChannel
IPTVChannel(TVRec *rec, QString videodev)
Definition: iptvchannel.cpp:27
IPTVChannel::m_streamLock
QMutex m_streamLock
Definition: iptvchannel.h:67
IPTVChannel::m_lastTuning
IPTVTuningData m_lastTuning
Definition: iptvchannel.h:66
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
IPTVChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: iptvchannel.h:46
IPTVStreamHandler
Definition: iptvstreamhandler.h:82
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:35
IPTVChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: iptvchannel.cpp:39
iptvstreamhandler.h
IPTVChannel::m_tuneLock
QMutex m_tuneLock
Definition: iptvchannel.h:64