TSDuck Version 3.19-1462 (TSDuck - The MPEG Transport Stream Toolkit)
ts::DTVProperties Class Reference

Encapsulation of Linux DVB property lists. More...

Public Member Functions

 DTVProperties ()
 Default constructor.
 
virtual ~DTVProperties ()
 Destructor.
 
size_t add (uint32_t cmd, uint32_t data=-1)
 Add a new property. More...
 
template<typename ENUM , typename std::enable_if< std::is_integral< ENUM >::value||std::is_enum< ENUM >::value >::type * = nullptr>
void addVar (uint32_t cmd, const Variable< ENUM > &data)
 Add a new property if a variable is set. More...
 
void clear ()
 Clear all previously added commands.
 
size_t count () const
 Get the number of properties in the buffer. More...
 
uint32_t getByCommand (uint32_t cmd) const
 Get the value of a property in the buffer. More...
 
uint32_t getByIndex (size_t index) const
 Get the value of the property at a specified index. More...
 
::dtv_properties * getIoctlParam ()
 Get the address of the dtv_properties structure for ioctl() call. More...
 
const ::dtv_properties * getIoctlParam () const
 Get the address of the dtv_properties structure for ioctl() call. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value||std::is_enum< INT >::value >::type * = nullptr>
void getValuesByCommand (std::set< INT > &values, uint32_t cmd) const
 Get the multiple values of a property in the buffer. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value||std::is_enum< INT >::value >::type * = nullptr>
void getValuesByIndex (std::set< INT > &values, size_t index) const
 Get the multiple values of a property at a specified index. More...
 
void report (Report &report, int severity) const
 Display the content of the object (for debug purpose). More...
 
size_t search (uint32_t cmd) const
 Search a property in the buffer. More...
 

Static Public Member Functions

static const char * CommandName (uint32_t cmd)
 Return the name of a command. More...
 

Static Public Attributes

static constexpr uint32_t UNKNOWN = ~0U
 Returned value for unknown data.
 

Detailed Description

Encapsulation of Linux DVB property lists.

Member Function Documentation

◆ count()

size_t ts::DTVProperties::count ( ) const
inline

Get the number of properties in the buffer.

Returns
The number of properties in the buffer.

◆ add()

size_t ts::DTVProperties::add ( uint32_t  cmd,
uint32_t  data = -1 
)

Add a new property.

Parameters
[in]cmdCommand code.
[in]dataOptional command data.
Returns
The index in property buffer.

◆ addVar()

template<typename ENUM , typename std::enable_if< std::is_integral< ENUM >::value||std::is_enum< ENUM >::value >::type * = nullptr>
void ts::DTVProperties::addVar ( uint32_t  cmd,
const Variable< ENUM > &  data 
)
inline

Add a new property if a variable is set.

Parameters
[in]cmdCommand code.
[in]dataOptional command data.

◆ search()

size_t ts::DTVProperties::search ( uint32_t  cmd) const

Search a property in the buffer.

Parameters
[in]cmdCommand code.
Returns
The index of cmd in buffer or count() if not found.

◆ getByCommand()

uint32_t ts::DTVProperties::getByCommand ( uint32_t  cmd) const

Get the value of a property in the buffer.

Parameters
[in]cmdCommand code.
Returns
The data value of cmd in buffer or UNKNOWN if not found.

◆ getByIndex()

uint32_t ts::DTVProperties::getByIndex ( size_t  index) const

Get the value of the property at a specified index.

Parameters
[in]indexIndex in buffer.
Returns
The data value at index or UNKNOWN if out of range.

◆ getValuesByCommand()

template<typename INT , typename std::enable_if< std::is_integral< INT >::value||std::is_enum< INT >::value >::type * = nullptr>
void ts::DTVProperties::getValuesByCommand ( std::set< INT > &  values,
uint32_t  cmd 
) const

Get the multiple values of a property in the buffer.

To be used with properties which return a set of integer values.

Template Parameters
INTAn integer or enum type, any size, signed or unsigned.
Parameters
[out]valuesA set receiving all integer values.
[in]cmdCommand code.

◆ getValuesByIndex()

template<typename INT , typename std::enable_if< std::is_integral< INT >::value||std::is_enum< INT >::value >::type * = nullptr>
void ts::DTVProperties::getValuesByIndex ( std::set< INT > &  values,
size_t  index 
) const

Get the multiple values of a property at a specified index.

To be used with properties which return a set of integer values.

Template Parameters
INTAn integer or enum type, any size, signed or unsigned.
Parameters
[out]valuesA set receiving all integer values.
[in]indexIndex in buffer.

◆ getIoctlParam() [1/2]

const ::dtv_properties* ts::DTVProperties::getIoctlParam ( ) const
inline

Get the address of the dtv_properties structure for ioctl() call.

Returns
The address of the dtv_properties structure.

◆ getIoctlParam() [2/2]

::dtv_properties* ts::DTVProperties::getIoctlParam ( )
inline

Get the address of the dtv_properties structure for ioctl() call.

Returns
The address of the dtv_properties structure.

◆ report()

void ts::DTVProperties::report ( Report report,
int  severity 
) const

Display the content of the object (for debug purpose).

Parameters
[in,out]reportWhere to display the content.
[in]severitySeverity level of messages (typically a debug level).

◆ CommandName()

static const char* ts::DTVProperties::CommandName ( uint32_t  cmd)
static

Return the name of a command.

Parameters
[in]cmdCommand code.
Returns
A name for cmd or zero if unknown.

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