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*, const QString&);
31  ~IPTVChannel();
32 
33  // Commands
34  bool Open(void) override; // ChannelBase
35 
36  using DTVChannel::Tune;
37  bool Tune(const IPTVTuningData&, bool scanning) override ; // DTVChannel
38  bool Tune(const DTVMultiplex&) override // DTVChannel
39  { return false; }
40 
41  // Sets
43 
44  // Gets
45  bool IsOpen(void) const override; // ChannelBase
46  QString GetDevice(void) const override // ChannelBase
47  { return m_last_tuning.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_tune_lock;
65  volatile bool m_firsttune {true};
67  mutable QMutex m_stream_lock;
70  QString m_videodev;
71 };
72 
73 #endif // _IPTV_CHANNEL_H_
74 
75 /* vim: set expandtab tabstop=4 shiftwidth=4: */
QMutex m_tune_lock
Definition: iptvchannel.h:64
IPTVChannel(TVRec *, const QString &)
Definition: iptvchannel.cpp:24
bool IsExternalChannelChangeSupported(void) override
Definition: iptvchannel.h:56
QString m_videodev
Definition: iptvchannel.h:70
void OpenStreamHandler(void)
Definition: iptvchannel.cpp:97
bool Tune(const IPTVTuningData &, bool scanning) override
Performs IPTV Tuning. Only implemented by IPTVChannel.
bool IsPIDTuningSupported(void) const override
Definition: iptvchannel.h:50
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
Definition: iptvchannel.h:38
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:34
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:150
MPEGStreamData * m_stream_data
Definition: iptvchannel.h:69
bool IsOpen(void) const override
Reports whether channel is already open.
IPTVStreamHandler * GetStreamHandler(void) const
Definition: iptvchannel.h:48
bool IsIPTV(void) const override
Definition: iptvchannel.h:49
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
Definition: iptvchannel.cpp:91
void CloseStreamHandler(void)
volatile bool m_firsttune
Definition: iptvchannel.h:65
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
IPTVStreamHandler * m_stream_handler
Definition: iptvchannel.h:68
QString GetDeviceKey(void) const
void SetStreamData(MPEGStreamData *)
Definition: iptvchannel.cpp:57
bool Open(void) override
Opens the channel changing hardware for use.
Definition: iptvchannel.cpp:36
void Close(void) override
Closes the channel changing hardware to use.
Definition: iptvchannel.cpp:85
IPTVTuningData m_last_tuning
Definition: iptvchannel.h:66
QMutex m_stream_lock
Definition: iptvchannel.h:67
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: iptvchannel.h:46
Encapsulates data about MPEG stream and emits events for each table.