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:24
dtvchannel.h
IPTVChannel::m_streamData
MPEGStreamData * m_streamData
Definition: iptvchannel.h:69
IPTVChannel::OpenStreamHandler
void OpenStreamHandler(void)
Definition: iptvchannel.cpp:101
IPTVChannel::~IPTVChannel
~IPTVChannel() override
Definition: iptvchannel.cpp:34
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:102
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:95
IPTVChannel::CloseStreamHandler
void CloseStreamHandler(void)
Definition: iptvchannel.cpp:120
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:85
IPTVTuningData
Definition: iptvtuningdata.h:21
IPTVChannel
Definition: iptvchannel.h:24
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:18
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:154
IPTVChannel::SetStreamData
void SetStreamData(MPEGStreamData *sd)
Definition: iptvchannel.cpp:61
IPTVChannel::Close
void Close(void) override
Closes the channel changing hardware to use.
Definition: iptvchannel.cpp:89
IPTVChannel::IPTVChannel
IPTVChannel(TVRec *rec, QString videodev)
Definition: iptvchannel.cpp:28
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:142
IPTVChannel::GetDevice
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: iptvchannel.h:46
IPTVStreamHandler
Definition: iptvstreamhandler.h:79
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:33
IPTVChannel::Open
bool Open(void) override
Opens the channel changing hardware for use.
Definition: iptvchannel.cpp:40
iptvstreamhandler.h
IPTVChannel::m_tuneLock
QMutex m_tuneLock
Definition: iptvchannel.h:64
IPTVChannel::Tune
bool Tune(const IPTVTuningData &tuning, bool scanning) override
Performs IPTV Tuning. Only implemented by IPTVChannel.
Definition: iptvchannel.cpp:165