Binarization using XML in GPAC
GPAC uses a special node name BS (for BitSequence) in XML documents to transform text data into sequences of bits. This function inspects all child elements of the node and converts children node names BS into bits. BS take the following attributes:
- bits: value gives the number of bits used to code a value or a length
- value: value is a 32 bit signed value
- dataOffset: value gives an offset into a file
- dataLength: value gives the number of bits bytes to copy in a file
- dataFile: value gives the name of the source file
- textmode: indicates whether the file shall be opened in text or binary mode before reading
- text: or string: value gives a string (length is first coded on number of bits in bits attribute)
- fcc: value gives a four character code, coded on 32 bits
- ID128: value gives a 128 bit vlue in hexadecimal
- data64: value gives data coded as base64
- data: value gives data coded in hexa
◆ gf_xml_parse_bit_sequence()
GF_Err gf_xml_parse_bit_sequence |
( |
GF_XMLNode * |
bsroot, |
|
|
const char * |
parent_url, |
|
|
u8 ** |
out_data, |
|
|
u32 * |
out_data_size |
|
) |
| |
- Parameters
-
bsroot | the root node of XML document describing the bitstream to create |
parent_url | URL of the parent document |
out_data | pointer to output buffer allocated by the function to store the result |
out_data_size | pointer to output buffer size allocated by the function to store the result |
- Returns
- error code if any or GF_OK
◆ gf_xml_parse_bit_sequence_bs()
GF_Err gf_xml_parse_bit_sequence_bs |
( |
GF_XMLNode * |
bsroot, |
|
|
const char * |
parent_url, |
|
|
const char * |
base_media, |
|
|
GF_BitStream * |
bs |
|
) |
| |
Parses XML bit sequence in an existing bitstream object. The syntax for the XML is the same as in gf_xml_parse_bit_sequence
- Parameters
-
bsroot | the root node of XML document describing the bitstream to create |
parent_url | URL of the parent document |
base_media | URL of base media file if any, relative to parent url. May be NULL |
bs | target bitstream to write the result into. The bitstream must be a dynamic write bitstream object |
- Returns
- error code or GF_OK