TSDuck Version 3.15-964 (TSDuck - The MPEG Transport Stream Toolkit)
ts::TunerParameters Class Referenceabstract

Abstract base class for DVB tuners parameters. More...

Inheritance diagram for ts::TunerParameters:
Collaboration diagram for ts::TunerParameters:

Classes

class  IncompatibleTunerParametersError
 Exception thrown when assigning incompatible parameter types. More...
 

Public Member Functions

virtual ~TunerParameters ()
 Virtual destructor.
 
virtual bool convertToDektecModulation (int &modulation_type, int &param0, int &param1, int &param2) const
 Attempt to convert the tuning parameters in modulation parameters for Dektec modulator cards. More...
 
virtual void copy (const TunerParameters &params)=0
 Virtual assignment. More...
 
virtual void displayParameters (std::ostream &strm, const UString &margin=UString(), bool verbose=false) const =0
 Display a description of the modulation paramters on a stream, line by line. More...
 
bool fromTunerArgs (const TunerArgs &args, Report &report)
 Extract options from a TunerArgs, applying defaults when necessary. More...
 
virtual bool fromZapFormat (const UString &zap)=0
 Decode a Linux DVB "zap" specification. More...
 
virtual UString shortDescription (int strength=-1, int quality=-1) const =0
 Format a short description (frequency and essential parameters). More...
 
virtual BitRate theoreticalBitrate () const =0
 Theoretical bitrate computation. More...
 
virtual UString toPluginOptions (bool no_local=false) const =0
 Format the tuner parameters as a list of options for the "dvb" tsp plugin. More...
 
virtual UString toZapFormat () const =0
 Format the tuner parameters according to the Linux DVB "zap" format. More...
 
TunerType tunerType () const
 Get the tuner type (depends on subclass). More...
 
virtual size_t zapFieldCount () const =0
 Expected number of fields (separated by ':') in a Linux DVB "zap" specification. More...
 

Static Public Member Functions

static void EraseFromRepository (const UString &name)
 Erase an object from the static thread-safe repository. More...
 
static TunerParametersFactory (TunerType type)
 Allocate a TunerParameters of the appropriate subclass, based on a tuner type. More...
 
static ObjectPtr RetrieveFromRepository (const UString &name)
 Get the safe pointer to an Object in the static thread-safe repository. More...
 
static ObjectPtr StoreInRepository (const UString &name, const ObjectPtr &value)
 Store a safe pointer to an Object in a static thread-safe repository. More...
 

Protected Member Functions

 TunerParameters (TunerType tuner_type)
 Constructor for subclasses. More...
 
virtual bool fromArgs (const TunerArgs &args, Report &report)=0
 Subclass-specific part of fromTunerArgs(). More...
 

Static Protected Member Functions

static BitRate TheoreticalBitrateForModulation (Modulation mod, InnerFEC fec, uint32_t symbol_rate)
 Theoretical useful bitrate for QPSK or QAM modulation. More...
 

Protected Attributes

TunerType _tuner_type
 The tuner type is set by subclasses.
 

Detailed Description

Abstract base class for DVB tuners parameters.

Constructor & Destructor Documentation

◆ TunerParameters()

ts::TunerParameters::TunerParameters ( TunerType  tuner_type)
inlineprotected

Constructor for subclasses.

Parameters
[in]tuner_typeTuner type.

Member Function Documentation

◆ tunerType()

TunerType ts::TunerParameters::tunerType ( ) const
inline

Get the tuner type (depends on subclass).

Returns
The tuner type.

◆ theoreticalBitrate()

virtual BitRate ts::TunerParameters::theoreticalBitrate ( ) const
pure virtual

Theoretical bitrate computation.

Must be implemented by subclasses.

Returns
The theoretical useful bitrate of a transponder, based on 188-bytes packets, in bits/second. If the characteristics of the transponder are not sufficient to compute the bitrate, return 0.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ convertToDektecModulation()

virtual bool ts::TunerParameters::convertToDektecModulation ( int &  modulation_type,
int &  param0,
int &  param1,
int &  param2 
) const
inlinevirtual

Attempt to convert the tuning parameters in modulation parameters for Dektec modulator cards.

This is an optional method.

Parameters
[out]modulation_typeModulation type (DTAPI_MOD_* value).
[out]param0Modulation-specific paramter 0.
[out]param1Modulation-specific paramter 1.
[out]param2Modulation-specific paramter 2.
Returns
True on success, false on error (includes unsupported operation).

Reimplemented in ts::TunerParametersDVBS.

◆ shortDescription()

virtual UString ts::TunerParameters::shortDescription ( int  strength = -1,
int  quality = -1 
) const
pure virtual

Format a short description (frequency and essential parameters).

Parameters
[in]strengthSignal strength in percent. Ignored if negative.
[in]qualitySignal quality in percent. Ignored if negative.
Returns
A description string.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ toZapFormat()

virtual UString ts::TunerParameters::toZapFormat ( ) const
pure virtual

Format the tuner parameters according to the Linux DVB "zap" format.

Returns
A string in Linux DVB "zap" format.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ toPluginOptions()

virtual UString ts::TunerParameters::toPluginOptions ( bool  no_local = false) const
pure virtual

Format the tuner parameters as a list of options for the "dvb" tsp plugin.

Parameters
[in]no_localWhen true, the "local" options are not included. The local options are related to the local equipment (–lnb for instance) and may vary from one system to another for the same transponder.
Returns
A string containing a command line options for the "dvb" tsp plugin.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ displayParameters()

virtual void ts::TunerParameters::displayParameters ( std::ostream &  strm,
const UString margin = UString(),
bool  verbose = false 
) const
pure virtual

Display a description of the modulation paramters on a stream, line by line.

Parameters
[in,out]strmWhere to display the parameters.
[in]marginLeft margin to display.
[in]verboseWhen false, display only essentials parameters. When true, display all parameters.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ fromZapFormat()

virtual bool ts::TunerParameters::fromZapFormat ( const UString zap)
pure virtual

Decode a Linux DVB "zap" specification.

And set the corresponding values in the tuner parameters.

Parameters
[in]zapA line of a Linux DVB "zap" file.
Returns
True on success, false on unsupported format.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ zapFieldCount()

virtual size_t ts::TunerParameters::zapFieldCount ( ) const
pure virtual

Expected number of fields (separated by ':') in a Linux DVB "zap" specification.

Returns
Expected number of fields in a Linux DVB "zap" specification.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ fromTunerArgs()

bool ts::TunerParameters::fromTunerArgs ( const TunerArgs args,
Report report 
)

Extract options from a TunerArgs, applying defaults when necessary.

Parameters with irrelevant values (auto, none, etc) are not displayed.

Parameters
[in]argsTuner arguments.
[in,out]reportWhere to report errors.
Returns
True on success, false on error (missing mandatory parameter, inconsistent values, etc.).

◆ copy()

virtual void ts::TunerParameters::copy ( const TunerParameters params)
pure virtual

Virtual assignment.

Parameters
[in]paramsOther instance of a subclass of TunerParameters to copy.
Exceptions
IncompatibleTunerParametersErrorWhen params is from an incompatible type.

Implemented in ts::TunerParametersDVBS, ts::TunerParametersBitrateDiffDVBT, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ Factory()

static TunerParameters* ts::TunerParameters::Factory ( TunerType  type)
static

Allocate a TunerParameters of the appropriate subclass, based on a tuner type.

Parameters
[in]typeTuner type.
Returns
A newly allocated instance of a subclass of TunerParameters. The parameters have their default values. Return zero if there is no implementation of the parameters for the given tuner type.

◆ fromArgs()

virtual bool ts::TunerParameters::fromArgs ( const TunerArgs args,
Report report 
)
protectedpure virtual

Subclass-specific part of fromTunerArgs().

Parameters
[in]argsTuner arguments.
[in,out]reportWhere to report errors.
Returns
True on success, false on error (missing mandatory parameter, inconsistent values, etc.).

Implemented in ts::TunerParametersDVBS, ts::TunerParametersDVBT, ts::TunerParametersDVBC, and ts::TunerParametersATSC.

◆ TheoreticalBitrateForModulation()

static BitRate ts::TunerParameters::TheoreticalBitrateForModulation ( Modulation  mod,
InnerFEC  fec,
uint32_t  symbol_rate 
)
staticprotected

Theoretical useful bitrate for QPSK or QAM modulation.

This protected static method computes the theoretical useful bitrate of a transponder, based on 188-bytes packets, for QPSK or QAM modulation.

Parameters
[in]modModulation type.
[in]fecInner FEC.
[in]symbol_rateSymbol rate.
Returns
Theoretical useful bitrate in bits/second or zero on error.

◆ StoreInRepository()

static ObjectPtr ts::Object::StoreInRepository ( const UString name,
const ObjectPtr value 
)
staticinherited

Store a safe pointer to an Object in a static thread-safe repository.

Parameters
[in]nameEach stored pointer is associated to a name.
[in]valueSafe-pointer to the object to store.
Returns
The previous value which was associated to that name or a null pointer when not previously assigned.

◆ RetrieveFromRepository()

static ObjectPtr ts::Object::RetrieveFromRepository ( const UString name)
staticinherited

Get the safe pointer to an Object in the static thread-safe repository.

Parameters
[in]nameName which is associated to the object.
Returns
A safe-pointer to the stored object or a null pointer when not found.

◆ EraseFromRepository()

static void ts::Object::EraseFromRepository ( const UString name)
staticinherited

Erase an object from the static thread-safe repository.

Parameters
[in]nameName which is associated to the object to erase.

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