MythTV  master
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
IPTVChannel Class Reference

#include <iptvchannel.h>

Inheritance diagram for IPTVChannel:
Inheritance graph
[legend]
Collaboration diagram for IPTVChannel:
Collaboration graph
[legend]

Public Member Functions

 IPTVChannel (TVRec *rec, QString videodev)
 
 ~IPTVChannel () override
 
bool Open (void) override
 Opens the channel changing hardware for use. More...
 
bool Tune (const IPTVTuningData &tuning, bool scanning) override
 Performs IPTV Tuning. Only implemented by IPTVChannel. More...
 
bool Tune (const DTVMultiplex &) override
 This performs the actual frequency tuning and in some cases input switching. More...
 
void SetStreamData (MPEGStreamData *sd)
 
bool IsOpen (void) const override
 Reports whether channel is already open. More...
 
QString GetDevice (void) const override
 Returns String representing device, useful for debugging. More...
 
IPTVStreamHandlerGetStreamHandler (void) const
 
bool IsIPTV (void) const override
 
bool IsPIDTuningSupported (void) const override
 
virtual bool Tune (const DTVMultiplex &tuning)=0
 This performs the actual frequency tuning and in some cases input switching. More...
 
virtual bool Tune (const IPTVTuningData &, bool)
 Performs IPTV Tuning. Only implemented by IPTVChannel. More...
 
virtual bool Tune (const QString &)
 Leave it up to the implementation to map the channnum appropriately. More...
 
bool Tune ([[maybe_unused]] const QString &freqid,[[maybe_unused]] int finetune) override
 This tunes on the frequency Identification parameter for hardware that supports it. More...
 
virtual bool Tune ([[maybe_unused]] uint64_t frequency)
 
- Public Member Functions inherited from DTVChannel
 DTVChannel (TVRec *parent)
 
 ~DTVChannel () override
 
bool SetChannelByString (const QString &chan) override
 
void SetFormat (const QString &format) override
 
QString GetFormat (void)
 
virtual bool TuneMultiplex (uint mplexid, const QString &inputname)
 To be used by the channel scanner and possibly the EIT scanner. More...
 
virtual bool Tune (const QString &)
 Leave it up to the implementation to map the channnum appropriately. More...
 
bool Tune ([[maybe_unused]] const QString &freqid, [[maybe_unused]] int finetune) override
 This tunes on the frequency Identification parameter for hardware that supports it. More...
 
virtual bool Tune ([[maybe_unused]] uint64_t frequency)
 
int GetProgramNumber (void) const
 Returns program number in PAT, -1 if unknown. More...
 
uint GetMajorChannel (void) const
 Returns major channel, 0 if unknown. More...
 
uint GetMinorChannel (void) const
 Returns minor channel, 0 if unknown. More...
 
uint GetOriginalNetworkID (void) const
 Returns DVB original_network_id, 0 if unknown. More...
 
uint GetTransportID (void) const
 Returns DVB transport_stream_id, 0 if unknown. More...
 
QString GetSIStandard (void) const
 Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable. More...
 
QString GetSuggestedTuningMode (bool is_live_tv) const
 Returns suggested tuning mode: "mpeg", "dvb", or "atsc". More...
 
QString GetTuningMode (void) const
 Returns tuning mode last set by SetTuningMode(). More...
 
virtual std::vector< DTVTunerTypeGetTunerTypes (void) const
 Returns a vector of supported tuning types. More...
 
void GetCachedPids (pid_cache_t &pid_cache) const
 Returns cached MPEG PIDs for last tuned channel. More...
 
void RegisterForMaster (const QString &key)
 
void DeregisterForMaster (const QString &key)
 
virtual bool IsMaster (void) const
 Returns true if this is the first of a number of multi-rec devs. More...
 
bool HasGeneratedPAT (void) const
 
bool HasGeneratedPMT (void) const
 
const ProgramAssociationTableGetGeneratedPAT (void) const
 
const ProgramMapTableGetGeneratedPMT (void) const
 
void SetTuningMode (const QString &tuning_mode)
 Sets tuning mode: "mpeg", "dvb", "atsc", etc. More...
 
void SaveCachedPids (const pid_cache_t &pid_cache) const
 Saves MPEG PIDs to cache to database. More...
 
- Public Member Functions inherited from ChannelBase
 ChannelBase (TVRec *parent)
 
virtual ~ChannelBase (void)
 
virtual bool Init (QString &startchannel, bool setchan)
 
virtual bool IsTunable (const QString &channum) const
 
virtual int SetFreqTable (const QString &)
 
virtual void SetFd (int fd)
 Sets file descriptor. More...
 
virtual int GetFd (void) const
 Returns file descriptor, -1 if it does not exist. More...
 
virtual bool Tune (const QString &, int)
 
virtual bool IsExternalChannelChangeInUse (void)
 
virtual uint GetNextChannel (uint chanid, ChannelChangeDirection direction) const
 
virtual uint GetNextChannel (const QString &channum, ChannelChangeDirection direction) const
 
virtual QString GetChannelName (void) const
 
virtual int GetChanID (void) const
 
virtual int GetInputID (void) const
 
virtual QString GetInputName (void) const
 
virtual uint GetSourceID (void) const
 
bool IsCommercialFree (void) const
 Returns true iff commercial detection is not required. More...
 
virtual void Renumber (uint sourceid, const QString &oldChanNum, const QString &newChanNum)
 Changes a channum if we have it cached anywhere. More...
 
virtual bool InitializeInput (void)
 Fills in input map from DB. More...
 
virtual bool Retune (void)
 
virtual void StoreInputChannels (void)
 Saves current channel as the default channel for the current input. More...
 
virtual bool InitPictureAttributes (void)
 
virtual int GetPictureAttribute (PictureAttribute) const
 
virtual int ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool)
 
bool CheckChannel (const QString &channum) const
 
void SetInputID (uint _inputid)
 
int GetMajorID (void)
 

Protected Member Functions

void Close (void) override
 Closes the channel changing hardware to use. More...
 
bool EnterPowerSavingMode (void) override
 Enters power saving mode if the card supports it. More...
 
bool IsExternalChannelChangeSupported (void) override
 
- Protected Member Functions inherited from DTVChannel
void SetSIStandard (const QString &si_std)
 Sets PSIP table standard: MPEG, DVB, ATSC, or OpenCable. More...
 
void SetDTVInfo (uint atsc_major, uint atsc_minor, uint dvb_orig_netid, uint mpeg_tsid, int mpeg_pnum)
 
void ClearDTVInfo (void)
 
virtual void CheckOptions (DTVMultiplex &) const
 Checks tuning for problems, and tries to fix them. More...
 
void HandleScriptEnd (bool ok) override
 
- Protected Member Functions inherited from ChannelBase
virtual bool IsInputAvailable (uint &mplexid_restriction, uint &chanid_restriction) const
 Switches to another input on hardware, and sets the channel is setstarting is true. More...
 
bool KillScript (void)
 
void HandleScript (const QString &freqid)
 
uint GetScriptStatus (bool holding_lock=false)
 
bool ChangeExternalChannel (const QString &changer, const QString &freqid)
 
bool ChangeInternalChannel (const QString &freqid, uint cardinputid) const
 

Private Member Functions

void OpenStreamHandler (void)
 
void CloseStreamHandler (void)
 

Private Attributes

QMutex m_tuneLock
 
volatile bool m_firstTune {true}
 
IPTVTuningData m_lastTuning
 
QMutex m_streamLock
 
IPTVStreamHandlerm_streamHandler {nullptr}
 
MPEGStreamDatam_streamData {nullptr}
 
QString m_videoDev
 

Friends

class IPTVRecorder
 

Additional Inherited Members

- Public Types inherited from DTVChannel
using DTVChannelP = DTVChannel *
 
- Static Public Member Functions inherited from DTVChannel
static DTVChannelGetMasterLock (const QString &key)
 
static void ReturnMasterLock (DTVChannelP &chan)
 
- Static Public Member Functions inherited from ChannelBase
static ChannelBaseCreateChannel (TVRec *tvrec, const GeneralDBOptions &genOpt, const DVBDBOptions &dvbOpt, const FireWireDBOptions &fwOpt, const QString &startchannel, bool enter_power_save_mode, QString &rbFileExt, bool setchan)
 
- Protected Types inherited from DTVChannel
using MasterMap = QMap< QString, QList< DTVChannel * > >
 
- Protected Attributes inherited from DTVChannel
QMutex m_dtvinfoLock
 
DTVTunerType m_tunerType {DTVTunerType::kTunerTypeUnknown}
 
QString m_sistandard {"mpeg"}
 PSIP table standard: MPEG, DVB, ATSC, OpenCable. More...
 
QString m_tuningMode
 
QString m_tvFormat
 
int m_currentProgramNum {-1}
 
uint m_currentATSCMajorChannel {0}
 
uint m_currentATSCMinorChannel {0}
 
uint m_currentTransportID {0}
 
uint m_currentOriginalNetworkID {0}
 
ProgramAssociationTablem_genPAT {nullptr}
 This is a generated PAT for RAW pid tuning. More...
 
ProgramMapTablem_genPMT {nullptr}
 This is a generated PMT for RAW pid tuning. More...
 
- Protected Attributes inherited from ChannelBase
TVRecm_pParent {nullptr}
 
QString m_curChannelName
 
bool m_commFree {false}
 
uint m_inputId {0}
 
uint m_sourceId {0}
 
QString m_name
 
QString m_startChanNum
 
QString m_externalChanger
 
QString m_tuneToChannel
 
ChannelInfoList m_channels
 channels across all inputs More...
 
QMutex m_systemLock
 
MythSystemLegacym_system {nullptr}
 
uint m_systemStatus {0}
 These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code. More...
 
- Static Protected Attributes inherited from DTVChannel
static QReadWriteLock s_master_map_lock
 
static MasterMap s_master_map
 

Detailed Description

Definition at line 24 of file iptvchannel.h.

Constructor & Destructor Documentation

◆ IPTVChannel()

IPTVChannel::IPTVChannel ( TVRec rec,
QString  videodev 
)

Definition at line 28 of file iptvchannel.cpp.

◆ ~IPTVChannel()

IPTVChannel::~IPTVChannel ( )
override

Definition at line 34 of file iptvchannel.cpp.

Member Function Documentation

◆ Open()

bool IPTVChannel::Open ( void  )
overridevirtual

Opens the channel changing hardware for use.

Implements ChannelBase.

Definition at line 40 of file iptvchannel.cpp.

Referenced by IPTVRecorder::Open().

◆ Tune() [1/7]

bool IPTVChannel::Tune ( const IPTVTuningData ,
bool   
)
overridevirtual

Performs IPTV Tuning. Only implemented by IPTVChannel.

Reimplemented from DTVChannel.

Definition at line 165 of file iptvchannel.cpp.

◆ Tune() [2/7]

bool IPTVChannel::Tune ( const DTVMultiplex tuning)
inlineoverridevirtual

This performs the actual frequency tuning and in some cases input switching.

In rare cases such as ASI this does nothing since all the channels are in the same MPTS stream on the same input. But generally you will need to implement this when adding support for new hardware.

Implements DTVChannel.

Definition at line 38 of file iptvchannel.h.

◆ SetStreamData()

void IPTVChannel::SetStreamData ( MPEGStreamData sd)

◆ IsOpen()

bool IPTVChannel::IsOpen ( void  ) const
overridevirtual

Reports whether channel is already open.

Implements ChannelBase.

Definition at line 154 of file iptvchannel.cpp.

Referenced by IPTVRecorder::IsOpen(), Open(), and IPTVSignalMonitor::UpdateValues().

◆ GetDevice()

QString IPTVChannel::GetDevice ( void  ) const
inlineoverridevirtual

Returns String representing device, useful for debugging.

Reimplemented from ChannelBase.

Definition at line 46 of file iptvchannel.h.

◆ GetStreamHandler()

IPTVStreamHandler* IPTVChannel::GetStreamHandler ( void  ) const
inline

Definition at line 48 of file iptvchannel.h.

◆ IsIPTV()

bool IPTVChannel::IsIPTV ( void  ) const
inlineoverridevirtual

Reimplemented from DTVChannel.

Definition at line 49 of file iptvchannel.h.

◆ IsPIDTuningSupported()

bool IPTVChannel::IsPIDTuningSupported ( void  ) const
inlineoverridevirtual

Reimplemented from DTVChannel.

Definition at line 50 of file iptvchannel.h.

◆ Close()

void IPTVChannel::Close ( void  )
overrideprotectedvirtual

Closes the channel changing hardware to use.

Implements ChannelBase.

Definition at line 89 of file iptvchannel.cpp.

Referenced by IPTVRecorder::Close(), Open(), and ~IPTVChannel().

◆ EnterPowerSavingMode()

bool IPTVChannel::EnterPowerSavingMode ( void  )
overrideprotectedvirtual

Enters power saving mode if the card supports it.

Reimplemented from DTVChannel.

Definition at line 95 of file iptvchannel.cpp.

◆ IsExternalChannelChangeSupported()

bool IPTVChannel::IsExternalChannelChangeSupported ( void  )
inlineoverrideprotectedvirtual

Reimplemented from ChannelBase.

Definition at line 56 of file iptvchannel.h.

◆ OpenStreamHandler()

void IPTVChannel::OpenStreamHandler ( void  )
private

Definition at line 101 of file iptvchannel.cpp.

Referenced by SetStreamData(), and Tune().

◆ CloseStreamHandler()

void IPTVChannel::CloseStreamHandler ( void  )
private

Definition at line 120 of file iptvchannel.cpp.

Referenced by Close(), EnterPowerSavingMode(), and Tune().

◆ Tune() [3/7]

virtual bool DTVChannel::Tune

This performs the actual frequency tuning and in some cases input switching.

In rare cases such as ASI this does nothing since all the channels are in the same MPTS stream on the same input. But generally you will need to implement this when adding support for new hardware.

◆ Tune() [4/7]

virtual bool DTVChannel::Tune
inline

Performs IPTV Tuning. Only implemented by IPTVChannel.

Definition at line 58 of file dtvchannel.h.

◆ Tune() [5/7]

virtual bool DTVChannel::Tune
inline

Leave it up to the implementation to map the channnum appropriately.

Used by the ExternalRecorder.

Definition at line 63 of file dtvchannel.h.

◆ Tune() [6/7]

bool DTVChannel::Tune
inlineoverride

This tunes on the frequency Identification parameter for hardware that supports it.

This is only called when there is no frequency set. This is used to implement "Channel Numbers" in analog tuning scenarios and to implement "Virtual Channels" in the OCUR and Firewire tuners.

Definition at line 75 of file dtvchannel.h.

◆ Tune() [7/7]

virtual bool DTVChannel::Tune
inline

Definition at line 81 of file dtvchannel.h.

Friends And Related Function Documentation

◆ IPTVRecorder

friend class IPTVRecorder
friend

Definition at line 27 of file iptvchannel.h.

Member Data Documentation

◆ m_tuneLock

QMutex IPTVChannel::m_tuneLock
mutableprivate

Definition at line 64 of file iptvchannel.h.

Referenced by Open(), and Tune().

◆ m_firstTune

volatile bool IPTVChannel::m_firstTune {true}
private

Definition at line 65 of file iptvchannel.h.

Referenced by Tune().

◆ m_lastTuning

IPTVTuningData IPTVChannel::m_lastTuning
private

Definition at line 66 of file iptvchannel.h.

Referenced by GetDevice(), IsOpen(), OpenStreamHandler(), and Tune().

◆ m_streamLock

QMutex IPTVChannel::m_streamLock
mutableprivate

Definition at line 67 of file iptvchannel.h.

Referenced by CloseStreamHandler(), IsOpen(), and SetStreamData().

◆ m_streamHandler

IPTVStreamHandler* IPTVChannel::m_streamHandler {nullptr}
private

◆ m_streamData

MPEGStreamData* IPTVChannel::m_streamData {nullptr}
private

Definition at line 69 of file iptvchannel.h.

Referenced by CloseStreamHandler(), Open(), SetStreamData(), and Tune().

◆ m_videoDev

QString IPTVChannel::m_videoDev
private

Definition at line 70 of file iptvchannel.h.


The documentation for this class was generated from the following files: