TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::MPEG2AudioAttributes Class Reference

Audio attributes for MPEG-1 / MPEG-2 audio. More...

#include <tsMPEG2AudioAttributes.h>

Inheritance diagram for ts::MPEG2AudioAttributes:
Collaboration diagram for ts::MPEG2AudioAttributes:

Public Member Functions

 MPEG2AudioAttributes ()=default
 Default constructor.
 
BitRate bitrate () const
 Bitrate in bits/second.
 
void invalidate ()
 Invalidate the content of this instance.
 
bool isValid () const
 Check if the values in the object are valid.
 
int layer () const
 MPEG audio layer.
 
UString layerName () const
 MPEG audio layer name.
 
virtual bool moreBinaryData (const uint8_t *, size_t) override
 Provides an audio/video binary data to be analyzed by this instance.
 
int samplingFrequency () const
 Sampling frequency in Hz.
 
UString stereoDescription () const
 Mono/stereo mode name.
 
int stereoMode () const
 Get the mono/stereo mode.
 
int stereoModeExtension () const
 Get the mono/stereo mode extension.
 
virtual UString toString () const override
 Convert to a string object.
 

Protected Attributes

bool _is_valid = false
 A flag which indicates if the content of this object is valid.
 

Detailed Description

Audio attributes for MPEG-1 / MPEG-2 audio.

An MPEG2AudioAttributes object is built by transmitting audio frames from PES payloads. Initially, an AudioAttributes object is invalid.

Member Function Documentation

◆ moreBinaryData()

virtual bool ts::MPEG2AudioAttributes::moreBinaryData ( const uint8_t *  addr,
size_t  size 
)
overridevirtual

Provides an audio/video binary data to be analyzed by this instance.

The type of data (complete PES payload or some type of "frame" or "access unit") depends on the type of audio/video.

Parameters
[in]addrAddress of data to be analyzed.
[in]sizeSize of data to be analyzed.
Returns
True if the attributes object becomes valid or has new values.

Implements ts::AbstractAudioVideoAttributes.

◆ toString()

virtual UString ts::MPEG2AudioAttributes::toString ( ) const
overridevirtual

Convert to a string object.

Returns
This object, converted as a string.

Implements ts::StringifyInterface.

◆ layer()

int ts::MPEG2AudioAttributes::layer ( ) const
inline

MPEG audio layer.

Returns
The MPEG audio layer (1-3, 0 if unknown).

◆ layerName()

UString ts::MPEG2AudioAttributes::layerName ( ) const

MPEG audio layer name.

Returns
A string describing the MPEG audio layer.

◆ bitrate()

BitRate ts::MPEG2AudioAttributes::bitrate ( ) const
inline

Bitrate in bits/second.

Returns
The bitrate in bits/second (0 if variable bitrate).

◆ samplingFrequency()

int ts::MPEG2AudioAttributes::samplingFrequency ( ) const
inline

Sampling frequency in Hz.

Returns
The sampling frequency in Hz.

◆ stereoMode()

int ts::MPEG2AudioAttributes::stereoMode ( ) const
inline

Get the mono/stereo mode.

Returns
The mono/stereo mode (see ISO 11172-3).

◆ stereoModeExtension()

int ts::MPEG2AudioAttributes::stereoModeExtension ( ) const
inline

Get the mono/stereo mode extension.

Returns
The mono/stereo mode extension (see ISO 11172-3).

◆ stereoDescription()

UString ts::MPEG2AudioAttributes::stereoDescription ( ) const

Mono/stereo mode name.

Returns
A string describing the mono/stereo mode .

◆ isValid()

bool ts::AbstractAudioVideoAttributes::isValid ( ) const
inlineinherited

Check if the values in the object are valid.

Returns
True if the values in the object are valid.

◆ invalidate()

void ts::AbstractAudioVideoAttributes::invalidate ( )
inlineinherited

Invalidate the content of this instance.

It must be rebuilt using audio/video binary data.

Member Data Documentation

◆ _is_valid

bool ts::AbstractAudioVideoAttributes::_is_valid = false
protectedinherited

A flag which indicates if the content of this object is valid.

It is the responsibility of the subclasses to set it.


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