QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsAbstractDescriptor Class Referenceabstract

Abstract base class for MPEG PSI/SI descriptors. More...

Inheritance diagram for QtsAbstractDescriptor:
QtsPrivateDataSpecifierDescriptor QtsTeletextDescriptor

Public Member Functions

virtual ~QtsAbstractDescriptor ()
 Virtual destructor. More...
 
virtual bool deserialize (const QtsDescriptor &descriptor)=0
 This abstract method deserializes a binary descriptor. More...
 
void invalidate ()
 Invalidate the descriptor. More...
 
bool isValid () const
 Check if the descriptor is valid. More...
 
virtual bool serialize (QtsDescriptor &descriptor) const =0
 This abstract method serializes a descriptor. More...
 
QtsDescTag tag () const
 Get the descriptor tag. More...
 

Protected Member Functions

 QtsAbstractDescriptor (QtsDescTag tag)
 Protected constructor for subclasses. More...
 
bool deserializeInit (const QtsDescriptor &descriptor, const quint8 *&payload, int &payloadSize)
 Deserialization helper: Start the deserialization. More...
 
bool serializeEnd (QtsDescriptor &descriptor, QtlByteBlock &data) const
 Serialization helper: Terminate a binary descriptor. More...
 
bool serializeInit (QtsDescriptor &descriptor, QtlByteBlock &data) const
 Serialization helper: Start a new binary descriptor. More...
 

Protected Attributes

QtsDescTag _descTag
 Descriptor tag, can be modified by subclasses. More...
 
bool _isValid
 Validity flag. More...
 

Private Member Functions

 QtsAbstractDescriptor () Q_DECL_EQ_DELETE
 

Detailed Description

Abstract base class for MPEG PSI/SI descriptors.

Constructor & Destructor Documentation

◆ ~QtsAbstractDescriptor()

virtual QtsAbstractDescriptor::~QtsAbstractDescriptor ( )
inlinevirtual

Virtual destructor.

◆ QtsAbstractDescriptor() [1/2]

QtsAbstractDescriptor::QtsAbstractDescriptor ( QtsDescTag  tag)
inlineprotected

Protected constructor for subclasses.

Parameters
[in]tagDescriptor tag.

◆ QtsAbstractDescriptor() [2/2]

QtsAbstractDescriptor::QtsAbstractDescriptor ( )
private

Member Function Documentation

◆ isValid()

bool QtsAbstractDescriptor::isValid ( ) const
inline

Check if the descriptor is valid.

Returns
True if the descriptor is valid.

◆ invalidate()

void QtsAbstractDescriptor::invalidate ( )
inline

Invalidate the descriptor.

The descriptor must be rebuilt.

◆ tag()

QtsDescTag QtsAbstractDescriptor::tag ( ) const
inline

Get the descriptor tag.

Returns
The descriptor tag.

◆ serialize()

virtual bool QtsAbstractDescriptor::serialize ( QtsDescriptor descriptor) const
pure virtual

This abstract method serializes a descriptor.

Parameters
[out]descriptorReplaced with a binary representation of this object.
Returns
True on success, false on error (invalid descriptor, data too large, etc.)

Implemented in QtsPrivateDataSpecifierDescriptor, and QtsTeletextDescriptor.

◆ deserialize()

virtual bool QtsAbstractDescriptor::deserialize ( const QtsDescriptor descriptor)
pure virtual

This abstract method deserializes a binary descriptor.

Parameters
[in]descriptorBinary descriptor to deserialize. If the binary descriptor is not a valid representation of the QtsAbstractDescriptor subclass, this object is invalid.
Returns
True on success, false on error (invalid data, etc.)

Implemented in QtsPrivateDataSpecifierDescriptor, and QtsTeletextDescriptor.

◆ serializeInit()

bool QtsAbstractDescriptor::serializeInit ( QtsDescriptor descriptor,
QtlByteBlock data 
) const
protected

Serialization helper: Start a new binary descriptor.

Parameters
[out]descriptorThe binary descriptor into which this object will be serialized. We invalidate it initially.
[out]dataA byte block which receives the descriptor header. The descriptor_length field is set to zero.
Returns
True on success, false on error (invalid descriptor, etc.)

◆ serializeEnd()

bool QtsAbstractDescriptor::serializeEnd ( QtsDescriptor descriptor,
QtlByteBlock data 
) const
protected

Serialization helper: Terminate a binary descriptor.

Parameters
[out]descriptorThe serialized descriptor. Set only if the binary descriptor is valid.
[in,out]dataA byte block which received the descriptor data. The descriptor_length field is updated.
Returns
True if the descriptor is valid, false otherwise. When false is returned, descriptor is invalidated.

◆ deserializeInit()

bool QtsAbstractDescriptor::deserializeInit ( const QtsDescriptor descriptor,
const quint8 *&  payload,
int &  payloadSize 
)
protected

Deserialization helper: Start the deserialization.

This object is marked as invalid. The deserialize() method shall set it to true later if the serialization succeeds.

Parameters
[in]descriptorBinary descriptor to deserialize.
[out]payloadReceive the address of the descriptor payload.
[out]payloadSizeReceive the descriptor payload size.
Returns
True if the input is valid and deserialization may continue. False if the binary descriptor is invalid or has the wrong tag.

Member Data Documentation

◆ _descTag

QtsDescTag QtsAbstractDescriptor::_descTag
protected

Descriptor tag, can be modified by subclasses.

◆ _isValid

bool QtsAbstractDescriptor::_isValid
protected

Validity flag.

It is the responsibility of the subclasses to set the valid flag.


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