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
20class IPTVTuningData;
21class IPTVRecorder;
22class MPEGStreamData;
23
24class 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
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: */
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:34
virtual bool Tune(const DTVMultiplex &tuning)=0
This performs the actual frequency tuning and in some cases input switching.
void Close(void) override
Closes the channel changing hardware to use.
Definition: iptvchannel.cpp:89
IPTVTuningData m_lastTuning
Definition: iptvchannel.h:66
~IPTVChannel() override
Definition: iptvchannel.cpp:34
bool IsPIDTuningSupported(void) const override
Definition: iptvchannel.h:50
bool IsIPTV(void) const override
Definition: iptvchannel.h:49
QString m_videoDev
Definition: iptvchannel.h:70
bool Tune(const IPTVTuningData &tuning, bool scanning) override
Performs IPTV Tuning. Only implemented by IPTVChannel.
IPTVChannel(TVRec *rec, QString videodev)
Definition: iptvchannel.cpp:28
void SetStreamData(MPEGStreamData *sd)
Definition: iptvchannel.cpp:61
void OpenStreamHandler(void)
QMutex m_tuneLock
Definition: iptvchannel.h:64
bool EnterPowerSavingMode(void) override
Enters power saving mode if the card supports it.
Definition: iptvchannel.cpp:95
void CloseStreamHandler(void)
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
Definition: iptvchannel.h:46
IPTVStreamHandler * m_streamHandler
Definition: iptvchannel.h:68
bool Open(void) override
Opens the channel changing hardware for use.
Definition: iptvchannel.cpp:40
QMutex m_streamLock
Definition: iptvchannel.h:67
volatile bool m_firstTune
Definition: iptvchannel.h:65
bool IsExternalChannelChangeSupported(void) override
Definition: iptvchannel.h:56
IPTVStreamHandler * GetStreamHandler(void) const
Definition: iptvchannel.h:48
bool IsOpen(void) const override
Reports whether channel is already open.
bool Tune(const DTVMultiplex &) override
This performs the actual frequency tuning and in some cases input switching.
Definition: iptvchannel.h:38
MPEGStreamData * m_streamData
Definition: iptvchannel.h:69
QString GetDeviceKey(void) const
Encapsulates data about MPEG stream and emits events for each table.
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143