Common descriptor tools.
More...
Go to the source code of this file.
Common descriptor tools.
>
- Author
- Arnaud de Bossoreille de Ribou bozo@.nosp@m.via..nosp@m.ecp.f.nosp@m.r
Descriptor structure and its Manipulation tools.
NOTE: Descriptor generators and decoder functions return a pointer on success and NULL on error. They do not use a dvbpsi_t handle as first argument.
◆ dvbpsi_descriptor_t
dvbpsi_descriptor_t type definition.
The common descriptor header and its payload is contained in this structure. The payload is the raw descriptor data and its interpretation depends on the the p_descriptor::i_tag value.
After passing the descriptor to a dvbpsi_DecodeXXXXDr function the raw descriptor data is interpreted and decoded into a descriptor specific structure. This structure is stored in the p_descriptor::p_decoded member by the dvbpsi_DecodeXXXXDr function.
NOTE: It is mandatory to add a decoded descriptor to the 'p_decoded' member of this struct. Failing to do so will result in memory leakage when deleting descriptor with
- See also
- dvbpsi_DeleteDescriptor.
◆ dvbpsi_AddDescriptor()
Add a descriptor to the end of descriptor list.
- Parameters
-
p_list | the first descriptor in the descriptor list. |
p_descriptor | the descriptor to add to the list |
- Returns
- a pointer to the first element in the descriptor list.
◆ dvbpsi_CanDecodeAsDescriptor()
Checks if descriptor tag matches.
- Parameters
-
p_descriptor | pointer to descriptor allocated with |
- See also
- dvbpsi_NewDescriptor
- Parameters
-
i_tag | descriptor tag to evaluate against |
- Returns
- true if descriptor can be decoded, false if not.
◆ dvbpsi_DeleteDescriptors()
Destruction of a dvbpsi_descriptor_t structure together with the decoded descriptor, if present.
- Parameters
-
p_descriptor | pointer to the first descriptor structure |
- Returns
- nothing.
◆ dvbpsi_DuplicateDecodedDescriptor()
void * dvbpsi_DuplicateDecodedDescriptor |
( |
void * | p_decoded, |
|
|
ssize_t | i_size ) |
Duplicate a decoded descriptor. The caller is responsible for releasing the associated memory.
- Parameters
-
p_decoded | pointer to decoded descriptor obtained with dvbpsi_Decode* function |
i_size | the sizeof decoded descriptor |
- Returns
- pointer to duplicated descriptor, NULL on error.
◆ dvbpsi_IsDescriptorDecoded()
Checks if descriptor was already decoded.
- Parameters
-
p_descriptor | pointer to descriptor allocated with |
- See also
- dvbpsi_NewDescriptor
- Returns
- true if descriptor can be decoded, false if already decoded.
◆ dvbpsi_NewDescriptor()
dvbpsi_descriptor_t * dvbpsi_NewDescriptor |
( |
uint8_t | i_tag, |
|
|
uint8_t | i_length, |
|
|
uint8_t * | p_data ) |
Creation of a new dvbpsi_descriptor_t structure.
- Parameters
-
i_tag | descriptor's tag |
i_length | descriptor's length |
p_data | descriptor's data |
- Returns
- a pointer to the descriptor.