QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsDescriptor Class Reference

Representation of a binary MPEG PSI/SI descriptor. More...

Public Member Functions

 QtsDescriptor ()
 Default constructor. More...
 
 QtsDescriptor (const QtsDescriptor &other)
 Copy constructor. More...
 
 QtsDescriptor (const void *addr, int size)
 Constructor from full binary content. More...
 
 QtsDescriptor (const QtlByteBlock &content)
 Constructor from full binary content. More...
 
const quint8 * content () const
 Get the address of the full binary content of the descriptor. More...
 
void invalidate ()
 Invalidate the descriptor content. More...
 
bool isValid () const
 Check if a descriptor has valid content. More...
 
bool operator!= (const QtsDescriptor &other) const
 Difference operator. More...
 
const QtsDescriptoroperator= (const QtsDescriptor &other)
 Assignment operator. More...
 
bool operator== (const QtsDescriptor &other) const
 Comparison operator. More...
 
const quint8 * payload () const
 Get the address of the descriptor payload. More...
 
quint8 * payload ()
 Get the address of the descriptor payload for payload update. More...
 
int payloadSize () const
 Get the size of the descriptor payload. More...
 
void replacePayload (const void *addr, int size)
 Replace the payload of the descriptor. More...
 
void replacePayload (const QtlByteBlock &payload)
 Replace the payload of the descriptor. More...
 
void resizePayload (int size)
 Resize (truncate or extend) the payload of the descriptor. More...
 
int size () const
 Get the size of the full binary content of the descriptor. More...
 
QtsDescTag tag () const
 Get the descriptor tag. More...
 

Private Attributes

QtlByteBlock _data
 Full binary content of the descriptor. More...
 

Detailed Description

Representation of a binary MPEG PSI/SI descriptor.

Data from descriptors are not deeply copied thanks to the implicit sharing mechanism of the Qt containers. Whenever a descriptor is modified, then a copy-on-write occurs.

Constructor & Destructor Documentation

◆ QtsDescriptor() [1/4]

QtsDescriptor::QtsDescriptor ( )
inline

Default constructor.

◆ QtsDescriptor() [2/4]

QtsDescriptor::QtsDescriptor ( const QtsDescriptor other)
inline

Copy constructor.

Parameters
[in]otherOther instance to copy.

◆ QtsDescriptor() [3/4]

QtsDescriptor::QtsDescriptor ( const void *  addr,
int  size 
)

Constructor from full binary content.

The content is copied into the descriptor if valid.

Parameters
[in]addrContent address.
[in]sizeContent size.

◆ QtsDescriptor() [4/4]

QtsDescriptor::QtsDescriptor ( const QtlByteBlock content)

Constructor from full binary content.

The content is copied into the descriptor if valid.

Parameters
[in]contentBinary content.

Member Function Documentation

◆ operator=()

const QtsDescriptor & QtsDescriptor::operator= ( const QtsDescriptor other)

Assignment operator.

Parameters
[in]otherOther instance to copy.

◆ isValid()

bool QtsDescriptor::isValid ( ) const

Check if a descriptor has valid content.

Returns
True if a descriptor has valid content.

◆ invalidate()

void QtsDescriptor::invalidate ( )
inline

Invalidate the descriptor content.

◆ tag()

QtsDescTag QtsDescriptor::tag ( ) const
inline

Get the descriptor tag.

Returns
The descriptor tag or zero (reserved value) if invalid.

◆ content()

const quint8* QtsDescriptor::content ( ) const
inline

Get the address of the full binary content of the descriptor.

Returns
The address of the full binary content of the descriptor or zero if the descriptor is invalid. Do not modify the content. May be invalidated after modification in the descriptor.

◆ size()

int QtsDescriptor::size ( ) const
inline

Get the size of the full binary content of the descriptor.

Returns
The size of the full binary content of the descriptor.

◆ payload() [1/2]

const quint8* QtsDescriptor::payload ( ) const
inline

Get the address of the descriptor payload.

Returns
The address of the descriptor payload or zero if the descriptor is invalid. Do not modify the content. May be invalidated after modification in the descriptor.

◆ payload() [2/2]

quint8* QtsDescriptor::payload ( )
inline

Get the address of the descriptor payload for payload update.

Returns
The address of the descriptor payload or zero if the descriptor is invalid. May be invalidated after modification in the descriptor.

◆ payloadSize()

int QtsDescriptor::payloadSize ( ) const
inline

Get the size of the descriptor payload.

Returns
The size of the descriptor payload.

◆ replacePayload() [1/2]

void QtsDescriptor::replacePayload ( const void *  addr,
int  size 
)

Replace the payload of the descriptor.

The tag is unchanged, the size is adjusted.

Parameters
[in]addrNew payload content address.
[in]sizeNew payload content size.

◆ replacePayload() [2/2]

void QtsDescriptor::replacePayload ( const QtlByteBlock payload)
inline

Replace the payload of the descriptor.

The tag is unchanged, the size is adjusted.

Parameters
[in]payloadNew payload content.

◆ resizePayload()

void QtsDescriptor::resizePayload ( int  size)

Resize (truncate or extend) the payload of the descriptor.

The tag is unchanged, the size is adjusted. If the payload is extended, new bytes are zeroes.

Parameters
[in]sizeNew payload size.

◆ operator==()

bool QtsDescriptor::operator== ( const QtsDescriptor other) const
inline

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if the descriptos are identical, false otherwise.

◆ operator!=()

bool QtsDescriptor::operator!= ( const QtsDescriptor other) const
inline

Difference operator.

Parameters
[in]otherOther instance to compare.
Returns
True if the descriptos are different, false otherwise.

Member Data Documentation

◆ _data

QtlByteBlock QtsDescriptor::_data
private

Full binary content of the descriptor.


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