List of MPEG PSI/SI descriptors. More...
Classes | |
struct | Element |
Each entry contains a descriptor and its corresponding private data specifier. More... | |
Public Member Functions | |
QtsDescriptorList () | |
Default constructor: empty list. More... | |
QtsDescriptorList (const QtsDescriptorList &other) | |
Copy constructor: the descriptors objects are shared between the two lists. More... | |
bool | append (const QtsDescriptorPtr &desc) |
Append one descriptor at end of list. More... | |
bool | append (const QtsAbstractDescriptor &desc) |
Append one descriptor at end of list. More... | |
void | append (const QtsDescriptorList &list) |
Append another list of descriptors at end of list. More... | |
bool | append (const void *addr, int size) |
Append all descriptors from a memory area at end of list. More... | |
bool | append (const void *addr) |
Append one descriptor from a memory area at end of list. More... | |
bool | appendFromLength (const quint8 *&addr, int &size) |
Append all descriptors from a memory area at end of list. More... | |
void | appendPrivateDataSpecifier (QtsPrivDataSpec pds) |
Append a private_data_specifier if necessary at end of list. More... | |
int | binarySize () const |
Evaluate the total number of bytes that is required to serialize the list of descriptors. More... | |
void | clear () |
Clear the content of the descriptor list. More... | |
int | lengthSerialize (quint8 *&addr, int &size, int startIndex=0) const |
Serialize the content of the descriptor list. More... | |
int | lengthSerialize (QtlByteBlock &data, int maxDataSize, int startIndex=0) const |
Serialize the content of the descriptor list. More... | |
bool | operator!= (const QtsDescriptorList &other) const |
Difference operator. More... | |
bool | operator== (const QtsDescriptorList &other) const |
Comparison operator. More... | |
const QtsDescriptorPtr & | operator[] (int index) const |
Return a reference to the descriptor at specified index. More... | |
QtsPrivDataSpec | privateDataSpecifier (int index) const |
Return the "private data specifier" associated to the descriptor at the specified index. More... | |
bool | removeByIndex (int index) |
Remove the descriptor at the specified index in the list. More... | |
int | removeByTag (QtsDescTag tag, QtsPrivDataSpec pds=0) |
Remove all descriptors with the specified tag. More... | |
int | removeInvalidPrivateDescriptors () |
Remove all private descriptors without preceding private_data_specifier_descriptor. More... | |
int | search (QtsDescTag tag, int startIndex=0, QtsPrivDataSpec pds=0) const |
Search a descriptor with the specified tag. More... | |
int | serialize (quint8 *&addr, int &size, int startIndex=0) const |
Serialize the content of the descriptor list. More... | |
int | serialize (QtlByteBlock &data, int maxDataSize, int startIndex=0) const |
Serialize the content of the descriptor list. More... | |
int | size () const |
Get the number of descriptors in the list. More... | |
Private Types | |
typedef QList< Element > | ElementList |
List of elements. More... | |
Private Member Functions | |
bool | prepareRemovePds (int index) |
Prepare the removal of a private_data_specifier descriptor. More... | |
Private Attributes | |
ElementList | _list |
The only data field is a list of elements. More... | |
List of MPEG PSI/SI descriptors.
|
private |
List of elements.
|
inline |
Default constructor: empty list.
|
inline |
Copy constructor: the descriptors objects are shared between the two lists.
[in] | other | Other instance to copy. |
|
inline |
Get the number of descriptors in the list.
bool QtsDescriptorList::operator== | ( | const QtsDescriptorList & | other | ) | const |
Comparison operator.
[in] | other | Other instance to copy. |
|
inline |
Difference operator.
[in] | other | Other instance to copy. |
|
inline |
Return a reference to the descriptor at specified index.
[in] | index | Index of descriptor in the list. Valid index are 0 to size()-1. Undefined behavior otherwise. |
|
inline |
Return the "private data specifier" associated to the descriptor at the specified index.
[in] | index | Index of descriptor in the list. Valid index are 0 to size()-1. Undefined behavior otherwise. |
bool QtsDescriptorList::append | ( | const QtsDescriptorPtr & | desc | ) |
Append one descriptor at end of list.
[in] | desc | A smart pointer to a binary descriptor. The pointed binary descriptor is shared with the list. |
bool QtsDescriptorList::append | ( | const QtsAbstractDescriptor & | desc | ) |
Append one descriptor at end of list.
[in] | desc | A descriptor. A binary copy of the descriptor is stored in the list. |
|
inline |
Append another list of descriptors at end of list.
The descriptors objects are shared between the two lists.
[in] | list | A list of descriptors to append. |
bool QtsDescriptorList::append | ( | const void * | addr, |
int | size | ||
) |
Append all descriptors from a memory area at end of list.
Stop when an invalid descriptor is encountered.
[in] | addr | Address of memory area. |
[in] | size | Size in bytes of memory area. |
bool QtsDescriptorList::appendFromLength | ( | const quint8 *& | addr, |
int & | size | ||
) |
Append all descriptors from a memory area at end of list.
Same as append(const void*,int), but read a 2-byte length field before the descriptor list. The 2-byte length field has 4 reserved bits (all '1') and 12 bits for the length of the descriptor list.
[in,out] | addr | Address where to start reading the list. addr is updated to point after the last deserialized descriptor. |
[in,out] | size | Size of the memory area from which to read descriptors. size is updated with the remaining space after the last deserialized descriptor. |
|
inline |
Append one descriptor from a memory area at end of list.
The size is extracted from the descriptor header.
[in] | addr | Address of memory area. |
void QtsDescriptorList::appendPrivateDataSpecifier | ( | QtsPrivDataSpec | pds | ) |
Append a private_data_specifier if necessary at end of list.
If the current private data specified at end of list is already pds, do nothing.
[in] | pds | Private data descriptor value. |
bool QtsDescriptorList::removeByIndex | ( | int | index | ) |
Remove the descriptor at the specified index in the list.
A private_data_specifier descriptor can be removed only if it is not necessary (no private descriptor ahead).
[in] | index | Index of descriptor in the list. |
int QtsDescriptorList::removeByTag | ( | QtsDescTag | tag, |
QtsPrivDataSpec | pds = 0 |
||
) |
Remove all descriptors with the specified tag.
If pds is non-zero and tag is >= 0x80, remove only descriptors with the corresponding "private data specifier". A private_data_specifier descriptor can be removed only if it is not necessary (no private descriptor ahead).
[in] | tag | Tag of descriptors to remove. |
[in] | pds | Optional associated private data descriptor. |
int QtsDescriptorList::removeInvalidPrivateDescriptors | ( | ) |
Remove all private descriptors without preceding private_data_specifier_descriptor.
|
inline |
Clear the content of the descriptor list.
int QtsDescriptorList::search | ( | QtsDescTag | tag, |
int | startIndex = 0 , |
||
QtsPrivDataSpec | pds = 0 |
||
) | const |
Search a descriptor with the specified tag.
If pds is non-zero and tag is >= 0x80, search only descriptors with the corresponding "private data specifier".
[in] | tag | Tag of descriptor to search. |
[in] | startIndex | Start searching at that index in the list. |
[in] | pds | Optional associated private data descriptor. |
int QtsDescriptorList::binarySize | ( | ) | const |
Evaluate the total number of bytes that is required to serialize the list of descriptors.
int QtsDescriptorList::serialize | ( | quint8 *& | addr, |
int & | size, | ||
int | startIndex = 0 |
||
) | const |
Serialize the content of the descriptor list.
Descriptors are written one by one until either the end of the list or until one descriptor does not fit in the memory area.
[in,out] | addr | Address where to start writing descriptors. addr is updated to point after the last written descriptor. |
[in,out] | size | Size of the memory area to write descriptors. size is updated with the remaining free space after the list. |
[in] | startIndex | Start serializing at that index in the list. |
int QtsDescriptorList::serialize | ( | QtlByteBlock & | data, |
int | maxDataSize, | ||
int | startIndex = 0 |
||
) | const |
Serialize the content of the descriptor list.
Descriptors are written one by one until either the end of the list or until one descriptor does not fit in the byte block.
[in,out] | data | Byte block into which the descriptor list is appended. |
[in] | maxDataSize | Maximum size of the byte block to write descriptors. |
[in] | startIndex | Start serializing at that index in the list. |
int QtsDescriptorList::lengthSerialize | ( | quint8 *& | addr, |
int & | size, | ||
int | startIndex = 0 |
||
) | const |
Serialize the content of the descriptor list.
Same as serialize(), but prepend a 2-byte length field before the descriptor list. The 2-byte length field has 4 reserved bits (all '1') and 12 bits for the length of the descriptor list.
[in,out] | addr | Address where to start writing descriptors. addr is updated to point after the last written descriptor. |
[in,out] | size | Size of the memory area to write descriptors. size is updated with the remaining free space after the list. |
[in] | startIndex | Start serializing at that index in the list. |
int QtsDescriptorList::lengthSerialize | ( | QtlByteBlock & | data, |
int | maxDataSize, | ||
int | startIndex = 0 |
||
) | const |
Serialize the content of the descriptor list.
Same as serialize(), but prepend a 2-byte length field before the descriptor list. The 2-byte length field has 4 reserved bits (all '1') and 12 bits for the length of the descriptor list.
[in,out] | data | Byte block into which the descriptor list is appended. |
[in] | maxDataSize | Maximum size of the byte block to write descriptors. |
[in] | startIndex | Start serializing at that index in the list. |
|
private |
Prepare the removal of a private_data_specifier descriptor.
Return true if can be removed, false if it cannot (private descriptors ahead). When it can be removed, the current PDS of all subsequent descriptors is updated.
[in] | index | Index in the list of the private_data_specifier descriptor is about to be removed. |
|
private |
The only data field is a list of elements.