libgpac
Documentation of the core library of GPAC
|
import"core.idl";
Public Member Functions | |
Bitstream () | |
Bitstream (ArrayBuffer buffer, optional boolean write_mode=false) | |
Bitstream (File file, optional boolean write_mode=false) | |
unsigned long | get_u8 () |
unsigned long | get_s8 () |
unsigned long | get_u16 () |
unsigned long | get_u16_le () |
unsigned long | get_s16 () |
unsigned long | get_u24 () |
unsigned long | get_u32 () |
unsigned long | get_u32_le () |
unsigned long | get_s32 () |
unsigned long | get_u64 () |
unsigned long | get_u64_le () |
unsigned long | get_s64 () |
unsigned long | get_bits (unsigned long nb_bits) |
double | get_float () |
double | get_double () |
unsigned long | get_data (ArrayBuffer buffer, optional unsigned long nb_bytes=0) |
DOMString | get_string () |
DOMString | get_4cc () |
void | put_u8 (unsigned long value) |
void | put_s8 (signed long value) |
void | put_u16 (unsigned long value) |
void | put_u16_le (unsigned long value) |
void | put_s16 (signed long value) |
void | put_u24 (unsigned long value) |
void | put_u32 (unsigned long value) |
void | put_u32_le (unsigned long value) |
void | put_s32 (signed long value) |
void | put_u64 (unsigned long long value) |
void | put_u64_le (unsigned long long value) |
void | put_s64 (signed long long value) |
void | put_bits (unsigned long long value, unsigned long nb_bits) |
void | put_float (double value) |
void | put_double (double value) |
unsigned long | put_data (ArrayBuffer buffer, optional unsigned long nb_bytes=0) |
void | put_4cc (DOMString fcc) |
void | put_string (DOMString str) |
void | insert_data (ArrayBuffer buffer, optional unsigned long nb_bytes=0, optional unsigned long offset=0) |
boolean | is_align () |
void | align () |
void | truncate () |
ArrayBuffer | get_content () |
void | transfer (Bitstream *src_bs, optional boolean keep_src=false) |
unsigned long | peek (unsigned long nb_bits, optional unsigned long byte_offset=0) |
void | skip (unsigned long nb_bytes) |
void | flush () |
void | epb_mode (boolean enable) |
Data Fields | |
attribute unsigned long long | pos |
attribute readonly unsigned long long | available |
attribute readonly unsigned long long | size |
attribute readonly unsigned long | bit_offset |
attribute readonly unsigned long | bit_position |
attribute readonly unsigned long | bits_available |
attribute readonly unsigned long long | refreshed_size |
attribute readonly boolean | overflow |
Bitstream object
Bitstream::Bitstream | ( | ) |
constructor for a dynamic allocated write bitstream
Bitstream::Bitstream | ( | ArrayBuffer | buffer, |
optional boolean | write_mode = false |
||
) |
constructor for a static allocated bitstream
buffer | the array buffer to use for bitstream operations |
write_mode | if set to true, the bitstream is created in write mode, otherwise in read mode |
Bitstream::Bitstream | ( | File | file, |
optional boolean | write_mode = false |
||
) |
constructor for a bitstream wrapping a file - see gf_bs_from_file
file | the File object to use for bitstream operations |
write_mode | if set to true, the bitstream is created in write mode, otherwise in read mode. This mode shall be compatible with the file open mode |
unsigned long Bitstream::get_u8 | ( | ) |
get 8-bits unsigned integer, byte-aligned
unsigned long Bitstream::get_s8 | ( | ) |
get 8-bits signed integer, byte-aligned
unsigned long Bitstream::get_u16 | ( | ) |
get 16-bits unsigned integer, byte-aligned, big-endian
unsigned long Bitstream::get_u16_le | ( | ) |
get 16-bits unsigned integer, byte-aligned, little-endian
unsigned long Bitstream::get_s16 | ( | ) |
get 16-bits signed integer, byte-aligned, big-endian
unsigned long Bitstream::get_u24 | ( | ) |
get 24-bits unsigned integer, byte-aligned, big-endian
unsigned long Bitstream::get_u32 | ( | ) |
get 32-bits unsigned integer, byte-aligned, big-endian
unsigned long Bitstream::get_u32_le | ( | ) |
get 32-bits unsigned integer, byte-aligned, little-endian
unsigned long Bitstream::get_s32 | ( | ) |
get 32-bits signed integer, byte-aligned, big-endian
unsigned long Bitstream::get_u64 | ( | ) |
get 64-bits unsigned integer, byte-aligned, big-endian
unsigned long Bitstream::get_u64_le | ( | ) |
get 64-bits unsigned integer, byte-aligned, little-endian
unsigned long Bitstream::get_s64 | ( | ) |
get 64-bits signed integer, byte-aligned, big-endian
unsigned long Bitstream::get_bits | ( | unsigned long | nb_bits | ) |
get n-bits unsigned integer, big-endian
nb_bits | number of bits to read |
double Bitstream::get_float | ( | ) |
get float 32 bits value
double Bitstream::get_double | ( | ) |
get float 64 bits value
unsigned long Bitstream::get_data | ( | ArrayBuffer | buffer, |
optional unsigned long | nb_bytes = 0 |
||
) |
reads bytes in an array buffer
buffer | target read buffer |
nb_bytes | number of bytes to read - if 0, uses array buffer size. If more than array buffer size, truncated to array buffer size |
DOMString Bitstream::get_string | ( | ) |
get utf8 string
DOMString Bitstream::get_4cc | ( | ) |
reads 4CC
void Bitstream::put_u8 | ( | unsigned long | value | ) |
write 8-bit unsigned value
value | value to write |
void Bitstream::put_s8 | ( | signed long | value | ) |
write 8-bit signed value
value | value to write |
void Bitstream::put_u16 | ( | unsigned long | value | ) |
write 16-bit unsigned value, big-endian
value | value to write |
void Bitstream::put_u16_le | ( | unsigned long | value | ) |
write 8-bit unsigned value, little-endian
value | value to write |
void Bitstream::put_s16 | ( | signed long | value | ) |
write 16-bit signed value, big-endian
value | value to write |
void Bitstream::put_u24 | ( | unsigned long | value | ) |
write 24-bit unsigned value
value | value to write |
void Bitstream::put_u32 | ( | unsigned long | value | ) |
write 32-bit unsigned value, big-endian
value | value to write |
void Bitstream::put_u32_le | ( | unsigned long | value | ) |
write 32-bit unsigned value, little-endian
value | value to write |
void Bitstream::put_s32 | ( | signed long | value | ) |
write 32-bit signed value, big-endian
value | value to write |
void Bitstream::put_u64 | ( | unsigned long long | value | ) |
write 64-bit unsigned value, big-endian
value | value to write |
void Bitstream::put_u64_le | ( | unsigned long long | value | ) |
write 64-bit unsigned value, little-endian
value | value to write |
void Bitstream::put_s64 | ( | signed long long | value | ) |
write 64-bit signed value, big-endian
value | value to write |
void Bitstream::put_bits | ( | unsigned long long | value, |
unsigned long | nb_bits | ||
) |
write n-bit unsigned value
value | value to write |
nb_bits | number of bits to use when writing |
void Bitstream::put_float | ( | double | value | ) |
write 32-bit float value
value | value to write |
void Bitstream::put_double | ( | double | value | ) |
write 64-bit float value
value | value to write |
unsigned long Bitstream::put_data | ( | ArrayBuffer | buffer, |
optional unsigned long | nb_bytes = 0 |
||
) |
write data
buffer | source of data to write |
nb_bytes | number of bytes to write - if 0, uses array buffer size. If more than array buffer size, truncated to array buffer size |
void Bitstream::put_4cc | ( | DOMString | fcc | ) |
write 4CC
fcc | four-character code to write |
void Bitstream::put_string | ( | DOMString | str | ) |
write UTF-8 string
str | string to write |
void Bitstream::insert_data | ( | ArrayBuffer | buffer, |
optional unsigned long | nb_bytes = 0 , |
||
optional unsigned long | offset = 0 |
||
) |
write 64-bit float value
buffer | buffer to write |
nb_bytes | number of bytes to write - if 0, uses array buffer size. If more than array buffer size, truncated to array buffer size |
offset | byte offset at which data must be inserted |
boolean Bitstream::is_align | ( | ) |
check if bitsream is byte-aligned - see gf_bs_is_align
void Bitstream::align | ( | ) |
set bitsream byte-aligned - see gf_bs_align
void Bitstream::truncate | ( | ) |
truncate bitsream - see gf_bs_truncate
ArrayBuffer Bitstream::get_content | ( | ) |
get content of the bitstream - see gf_bs_get_content
void Bitstream::transfer | ( | Bitstream * | src_bs, |
optional boolean | keep_src = false |
||
) |
transfer bitstream into another - see gf_bs_transfer
src_bs | source bitstream for bytes to transfer |
keep_src | if true, the source bitstream will not be reset |
unsigned long Bitstream::peek | ( | unsigned long | nb_bits, |
optional unsigned long | byte_offset = 0 |
||
) |
peek bits without changing bitstream state - see gf_bs_peek_bits
nb_bits | the number of bits to peek |
byte_offset | the position of the first byte after the current position to start peek |
void Bitstream::skip | ( | unsigned long | nb_bytes | ) |
skips given amount of bytes
nb_bytes | number of bytes to skip |
void Bitstream::flush | ( | ) |
flush underlying file object if any
void Bitstream::epb_mode | ( | boolean | enable | ) |
enable emulation preventio byte removal - see gf_bs_enable_emulation_byte_removal
enable | if true, EPB is removed in read operations |
attribute unsigned long long Bitstream::pos |
position of bitstream - see gf_bs_get_position and gf_bs_seek
attribute readonly unsigned long long Bitstream::available |
check if bytes are available for read/write - see gf_bs_available
attribute readonly unsigned long long Bitstream::size |
size of bitstream - see gf_bs_get_size
attribute readonly unsigned long Bitstream::bit_offset |
bit offset in bitstream - see gf_bs_get_bit_offset
attribute readonly unsigned long Bitstream::bit_position |
bit position in bitstream - see gf_bs_get_bit_position
attribute readonly unsigned long Bitstream::bits_available |
bit available till end of byte - see gf_bs_bits_available
attribute readonly unsigned long long Bitstream::refreshed_size |
gets refreshed size of bitstream - see gf_bs_get_refreshed_size
attribute readonly boolean Bitstream::overflow |
checks if bitstream read has overflown - see gf_bs_is_overflow