TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::MPEG2VideoAttributes Class Reference

Video attributes for MPEG-1 and MPEG-2. More...

Inheritance diagram for ts::MPEG2VideoAttributes:
Collaboration diagram for ts::MPEG2VideoAttributes:

Public Member Functions

 MPEG2VideoAttributes ()
 Default constructor.
 
uint8_t aspectRatioCode () const
 Get display aspect ratio. More...
 
UString aspectRatioName () const
 Get display aspect ratio name. More...
 
uint8_t chromaFormat () const
 Get chroma format. More...
 
UString chromaFormatName () const
 Get chroma format name. More...
 
size_t frameRate () const
 Get frame rate: approximate value per second. More...
 
size_t frameRate100 () const
 Get frame rate per 100 seconds. More...
 
size_t frameRateDivider () const
 Get frame rate divider. More...
 
UString frameRateName () const
 Get frame rate name. More...
 
size_t frameRateNumerator () const
 Get frame rate numerator. More...
 
size_t horizontalSize () const
 Get video horizontal size in pixels. More...
 
bool interlaced () const
 Check if refresh mode is interlaced. More...
 
void invalidate ()
 Invalidate the content of this instance. More...
 
bool isValid () const
 Check if the values in the object are valid. More...
 
uint32_t maximumBitRate () const
 Maximum bitrate. More...
 
virtual bool moreBinaryData (const uint8_t *, size_t) override
 Provides an audio/video binary data to be analyzed by this instance. More...
 
bool progressive () const
 Check if refresh mode is progressive. More...
 
UString refreshModeName () const
 Get the refresh mode name. More...
 
virtual UString toString () const override
 Convert to a string object. More...
 
size_t vbvSize () const
 Video Buffering Verifier size in bits. More...
 
size_t verticalSize () const
 Get video vertical size in pixels. More...
 

Protected Attributes

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

Detailed Description

Video attributes for MPEG-1 and MPEG-2.

A VideoAttributes object is built by transmitting video units (starting with a 00 00 01 xx start code). The state of the object may change after adding a "sequence header" unit and its following unit. When the later is a "sequence extension" unit, this is MPEG-2 video. Initially, a VideoAttributes is invalid.

Member Function Documentation

◆ moreBinaryData()

virtual bool ts::MPEG2VideoAttributes::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::MPEG2VideoAttributes::toString ( ) const
overridevirtual

Convert to a string object.

Returns
This object, converted as a string.

Implements ts::StringifyInterface.

◆ horizontalSize()

size_t ts::MPEG2VideoAttributes::horizontalSize ( ) const
inline

Get video horizontal size in pixels.

Returns
Video horizontal size in pixels.

◆ verticalSize()

size_t ts::MPEG2VideoAttributes::verticalSize ( ) const
inline

Get video vertical size in pixels.

Returns
Video vertical size in pixels.

◆ aspectRatioCode()

uint8_t ts::MPEG2VideoAttributes::aspectRatioCode ( ) const
inline

Get display aspect ratio.

Returns
Display aspect ratio, code values are AR_* from tsMPEG.h.

◆ aspectRatioName()

UString ts::MPEG2VideoAttributes::aspectRatioName ( ) const
inline

Get display aspect ratio name.

Returns
Display aspect ratio as a string.

◆ progressive()

bool ts::MPEG2VideoAttributes::progressive ( ) const
inline

Check if refresh mode is progressive.

Returns
True if refresh mode is progressive. Note that progressive() and interlaced() can return false both if the refresh mode is unspecifed.

◆ interlaced()

bool ts::MPEG2VideoAttributes::interlaced ( ) const
inline

Check if refresh mode is interlaced.

Returns
True if refresh mode is interlaced. Note that progressive() and interlaced() can return false both if the refresh mode is unspecifed.

◆ refreshModeName()

UString ts::MPEG2VideoAttributes::refreshModeName ( ) const

Get the refresh mode name.

Returns
The refresh mode as a string.

◆ chromaFormat()

uint8_t ts::MPEG2VideoAttributes::chromaFormat ( ) const
inline

Get chroma format.

Returns
Chroma format, code values are CHROMA_* from tsMPEG.h, 0 if unknown.

◆ chromaFormatName()

UString ts::MPEG2VideoAttributes::chromaFormatName ( ) const
inline

Get chroma format name.

Returns
Chroma format as a string.

◆ frameRate()

size_t ts::MPEG2VideoAttributes::frameRate ( ) const
inline

Get frame rate: approximate value per second.

Returns
Approximate frame rate per second. Example: return 30 for NTSC (actual NTSC rate is 30/1.001 = 29.97).

◆ frameRate100()

size_t ts::MPEG2VideoAttributes::frameRate100 ( ) const
inline

Get frame rate per 100 seconds.

Returns
Frame rate per 100 second. Example: return 2997 for NTSC (actual NTSC rate is 30/1.001 = 29.97).

◆ frameRateNumerator()

size_t ts::MPEG2VideoAttributes::frameRateNumerator ( ) const
inline

Get frame rate numerator.

Returns
Frame rate numerator. Example: return 30000 for NTSC (actual NTSC rate is 30/1.001 = 29.97).

◆ frameRateDivider()

size_t ts::MPEG2VideoAttributes::frameRateDivider ( ) const
inline

Get frame rate divider.

Returns
Frame rate divider. Example: return 1001 for NTSC (actual NTSC rate is 30/1.001 = 29.97).

◆ frameRateName()

UString ts::MPEG2VideoAttributes::frameRateName ( ) const

Get frame rate name.

Returns
Frame rate as a string. Example: return "@29.97 Hz" for NTSC (actual NTSC rate is 30/1.001 = 29.97).

◆ maximumBitRate()

uint32_t ts::MPEG2VideoAttributes::maximumBitRate ( ) const
inline

Maximum bitrate.

Returns
Maximum bitrate in bits/second.

◆ vbvSize()

size_t ts::MPEG2VideoAttributes::vbvSize ( ) const
inline

Video Buffering Verifier size in bits.

Returns
Video Buffering Verifier size in bits.

◆ 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
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: