MythTV
master
|
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2. More...
#include <v4lchannel.h>
Public Member Functions | |
V4LChannel (TVRec *parent, const QString &videodevice, const QString &audiodevice="") | |
virtual | ~V4LChannel (void) |
bool | Init (QString &startchannel, bool setchan) override |
bool | Open (void) override |
Opens the channel changing hardware for use. More... | |
void | Close (void) override |
Closes the channel changing hardware to use. More... | |
bool | Tune (const DTVMultiplex &tuning) override |
This performs the actual frequency tuning and in some cases input switching. More... | |
bool | Tune (uint64_t frequency) override |
Tunes to a specific frequency (Hz) on a particular input. More... | |
bool | Tune (const QString &freqid, int finetune) override |
This tunes on the frequency Identification parameter for hardware that supports it. More... | |
bool | Retune (void) override |
Retunes to last tuned frequency. More... | |
void | SetFd (int fd) override |
Sets file descriptor. More... | |
void | SetFormat (const QString &format) override |
Initializes tuner and modulator variables. More... | |
int | SetDefaultFreqTable (const QString &name) |
bool | IsOpen (void) const override |
Reports whether channel is already open. More... | |
int | GetFd (void) const override |
Returns file descriptor, -1 if it does not exist. More... | |
QString | GetDevice (void) const override |
Returns String representing device, useful for debugging. More... | |
QString | GetAudioDevice (void) const |
QString | GetSIStandard (void) const |
bool | InitPictureAttributes (void) override |
int | GetPictureAttribute (PictureAttribute) const override |
int | ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool up) 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 (const QString &freqid, int finetune) override |
This tunes on the frequency Identification parameter for hardware that supports it. More... | |
virtual bool | Tune (uint64_t frequency) |
![]() | |
DTVChannel (TVRec *parent) | |
virtual | ~DTVChannel () |
bool | SetChannelByString (const QString &chan) 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 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... | |
virtual bool | EnterPowerSavingMode (void) |
Enters power saving mode if the card supports it. More... | |
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 vector< DTVTunerType > | GetTunerTypes (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... | |
virtual bool | IsPIDTuningSupported (void) const |
virtual bool | IsIPTV (void) const |
bool | HasGeneratedPAT (void) const |
bool | HasGeneratedPMT (void) const |
const ProgramAssociationTable * | GetGeneratedPAT (void) const |
const ProgramMapTable * | GetGeneratedPMT (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... | |
![]() | |
ChannelBase (TVRec *parent) | |
virtual | ~ChannelBase (void) |
virtual bool | IsTunable (const QString &channum) const |
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 void | StoreInputChannels (void) |
Saves current channel as the default channel for the current input. More... | |
bool | CheckChannel (const QString &channum) const |
void | SetInputID (uint _inputid) |
int | GetMajorID (void) |
Protected Member Functions | |
bool | IsExternalChannelChangeSupported (void) override |
![]() | |
void | SetSIStandard (const QString &) |
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 |
![]() | |
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) |
Private Member Functions | |
void | SetFreqTable (const int index) |
int | SetFreqTable (const QString &name) override |
bool | SetInputAndFormat (int inputNum, const QString &newFmt) |
int | GetCurrentChannelNum (const QString &channame) |
QString | GetFormatForChannel (const QString &channum, const QString &inputname) |
bool | InitPictureAttribute (const QString &db_col_name) |
bool | InitializeInputs (void) |
This enumerates the inputs, converts the format string to something the hardware understands, and if the parent pointer is valid retrieves the channels from the database. More... | |
Private Attributes | |
QString | m_device |
QString | m_audio_device |
int | m_videofd {-1} |
QString | m_device_name |
QString | m_driver_name |
QMap< QString, int > | m_pict_attr_default |
struct CHANLIST * | m_curList {nullptr} |
int | m_totalChannels {0} |
bool | m_has_stream_io {false} |
bool | m_has_std_io {false} |
bool | m_has_async_io {false} |
bool | m_has_tuner {false} |
bool | m_has_sliced_vbi {false} |
int | m_defaultFreqTable {1} |
int | m_inputNumV4L {0} |
int | m_videoModeV4L2 {0} |
Additional Inherited Members | |
![]() | |
using | DTVChannelP = DTVChannel * |
![]() | |
static DTVChannel * | GetMasterLock (const QString &key) |
static void | ReturnMasterLock (DTVChannelP &) |
![]() | |
static ChannelBase * | CreateChannel (TVRec *tvrec, const GeneralDBOptions &genOpt, const DVBDBOptions &dvbOpt, const FireWireDBOptions &fwOpt, const QString &startchannel, bool enter_power_save_mode, QString &rbFileExt, bool setchan) |
![]() | |
using | MasterMap = QMap< QString, QList< DTVChannel * > > |
![]() | |
QMutex | m_dtvinfo_lock |
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} |
ProgramAssociationTable * | m_genPAT {nullptr} |
This is a generated PAT for RAW pid tuning. More... | |
ProgramMapTable * | m_genPMT {nullptr} |
This is a generated PMT for RAW pid tuning. More... | |
![]() | |
TVRec * | m_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_system_lock |
MythSystemLegacy * | m_system {nullptr} |
uint | m_system_status {0} |
These get mapped from the GENERIC_EXIT_* to these values for use with the signalmonitor code. More... | |
![]() | |
static QReadWriteLock | s_master_map_lock |
static MasterMap | s_master_map |
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
This class supports a wide range of tuning hardware including frame grabbers (whose output requires encoding), hardware encoders, digital cameras, and non-encoding hardware which simply records pre-encoded broadcast streams.
Definition at line 32 of file v4lchannel.h.
|
inline |
Definition at line 35 of file v4lchannel.h.
|
virtual |
Definition at line 37 of file v4lchannel.cpp.
Reimplemented from ChannelBase.
Definition at line 42 of file v4lchannel.cpp.
|
overridevirtual |
Opens the channel changing hardware for use.
Implements ChannelBase.
Definition at line 52 of file v4lchannel.cpp.
|
overridevirtual |
Closes the channel changing hardware to use.
Implements ChannelBase.
Definition at line 107 of file v4lchannel.cpp.
Referenced by ~V4LChannel().
|
overridevirtual |
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 377 of file v4lchannel.cpp.
|
overridevirtual |
Tunes to a specific frequency (Hz) on a particular input.
frequency | Frequency in Hz, this is divided by 62.5 kHz or 62.5 Hz depending on the modulator and sent to the hardware. |
Reimplemented from DTVChannel.
Definition at line 391 of file v4lchannel.cpp.
|
overridevirtual |
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.
Reimplemented from DTVChannel.
Definition at line 356 of file v4lchannel.cpp.
|
overridevirtual |
Retunes to last tuned frequency.
NOTE: This only works for V4L2 and only for analog tuning.
Reimplemented from ChannelBase.
Definition at line 448 of file v4lchannel.cpp.
|
overridevirtual |
Sets file descriptor.
Reimplemented from ChannelBase.
Definition at line 114 of file v4lchannel.cpp.
|
overridevirtual |
Initializes tuner and modulator variables.
format | One of twelve formats: "NTSC", "NTSC-JP", "ATSC", "SECAM", "PAL", "PAL-BG", "PAL-DK", "PAL-I", "PAL-60", "PAL-NC", "PAL-M", or "PAL-N" |
Reimplemented from DTVChannel.
Definition at line 271 of file v4lchannel.cpp.
int V4LChannel::SetDefaultFreqTable | ( | const QString & | name | ) |
Definition at line 293 of file v4lchannel.cpp.
|
inlineoverridevirtual |
Reports whether channel is already open.
Implements ChannelBase.
Definition at line 57 of file v4lchannel.h.
|
inlineoverridevirtual |
Returns file descriptor, -1 if it does not exist.
Reimplemented from ChannelBase.
Definition at line 59 of file v4lchannel.h.
|
inlineoverridevirtual |
Returns String representing device, useful for debugging.
Reimplemented from ChannelBase.
Definition at line 61 of file v4lchannel.h.
Referenced by V4L2encRecorder::Open().
|
inline |
Definition at line 63 of file v4lchannel.h.
Referenced by V4L2encRecorder::Open().
|
inline |
Definition at line 64 of file v4lchannel.h.
|
overridevirtual |
Reimplemented from ChannelBase.
Definition at line 667 of file v4lchannel.cpp.
|
overridevirtual |
Reimplemented from ChannelBase.
Definition at line 675 of file v4lchannel.cpp.
|
overridevirtual |
Reimplemented from ChannelBase.
Definition at line 754 of file v4lchannel.cpp.
|
inlineoverrideprotectedvirtual |
Reimplemented from ChannelBase.
Definition at line 73 of file v4lchannel.h.
|
private |
Definition at line 299 of file v4lchannel.cpp.
|
overrideprivatevirtual |
Reimplemented from ChannelBase.
Definition at line 305 of file v4lchannel.cpp.
|
private |
Definition at line 496 of file v4lchannel.cpp.
|
private |
Definition at line 341 of file v4lchannel.cpp.
|
private |
Definition at line 473 of file v4lchannel.cpp.
|
private |
Definition at line 593 of file v4lchannel.cpp.
|
private |
This enumerates the inputs, converts the format string to something the hardware understands, and if the parent pointer is valid retrieves the channels from the database.
Definition at line 225 of file v4lchannel.cpp.
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.
|
inline |
Performs IPTV Tuning. Only implemented by IPTVChannel.
Definition at line 59 of file dtvchannel.h.
|
inline |
Leave it up to the implementation to map the channnum appropriately.
Used by the ExternalRecorder.
Definition at line 64 of file dtvchannel.h.
|
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 76 of file dtvchannel.h.
|
inline |
Definition at line 82 of file dtvchannel.h.
|
private |
Definition at line 93 of file v4lchannel.h.
|
private |
Definition at line 94 of file v4lchannel.h.
|
private |
Definition at line 95 of file v4lchannel.h.
|
private |
Definition at line 96 of file v4lchannel.h.
|
private |
Definition at line 97 of file v4lchannel.h.
|
private |
Definition at line 98 of file v4lchannel.h.
|
private |
Definition at line 100 of file v4lchannel.h.
|
private |
Definition at line 101 of file v4lchannel.h.
Definition at line 103 of file v4lchannel.h.
Definition at line 104 of file v4lchannel.h.
Definition at line 105 of file v4lchannel.h.
Definition at line 106 of file v4lchannel.h.
Definition at line 107 of file v4lchannel.h.
|
private |
Definition at line 109 of file v4lchannel.h.
|
private |
Definition at line 110 of file v4lchannel.h.
|
private |
Definition at line 111 of file v4lchannel.h.