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

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

#include <tsMPEG2VideoAttributes.h>

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

Public Member Functions

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

Protected Attributes

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

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

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

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