Gjsify LogoGjsify Logo

#GstByteWriter provides a byte writer and reader that can write/read different integer and floating point types to/from a memory buffer. It provides functions for writing/reading signed/unsigned, little/big endian integers of 8, 16, 24, 32 and 64 bits and functions for reading little/big endian floating points numbers of 32 and 64 bits. It also provides functions to write/read NUL-terminated strings in various character encodings.

record

Hierarchy

  • ByteWriter

Index

Constructors

Properties

alloc_size: number

Allocation size of the data

field
fixed: boolean

If %TRUE no reallocations are allowed

field
owned: boolean

If %FALSE no reallocations are allowed and copies of data are returned

field

#GstByteReader parent

field
name: string

Methods

  • ensure_free_space(size: number): boolean
  • Checks if enough free space from the current write cursor is available and reallocates if necessary.

    Parameters

    • size: number

      Number of bytes that should be available

    Returns boolean

  • fill(value: number, size: number): boolean
  • Writes size bytes containing value to writer.

    Parameters

    • value: number

      Value to be written

    • size: number

      Number of bytes to be written

    Returns boolean

  • free(): void
  • free_and_get_data(): number
  • Frees writer and all memory allocated by it except the current data, which is returned.

    Free-function: g_free

    Returns number

  • get_remaining(): number
  • Returns the remaining size of data that can still be written. If -1 is returned the remaining size is only limited by system resources.

    Returns number

  • init(): void
  • init_with_data(data: Uint8Array, initialized: boolean): void
  • Initializes writer with the given memory area. If initialized is %TRUE it is possible to read size bytes from the #GstByteWriter from the beginning.

    Parameters

    • data: Uint8Array

      Memory area for writing

    • initialized: boolean

      If %TRUE the complete data can be read from the beginning

    Returns void

  • init_with_size(size: number, fixed: boolean): void
  • Initializes writer with the given initial data size.

    Parameters

    • size: number

      Initial size of data

    • fixed: boolean

      If %TRUE the data can't be reallocated

    Returns void

  • put_buffer(buffer: Gst.Buffer, offset: number, size: number): boolean
  • Writes size bytes of data to writer.

    Parameters

    • buffer: Gst.Buffer

      source #GstBuffer

    • offset: number

      offset to copy from

    • size: number

      total size to copy. If -1, all data is copied

    Returns boolean

  • put_data(data: Uint8Array): boolean
  • put_float32_be(val: number): boolean
  • put_float32_le(val: number): boolean
  • put_float64_be(val: number): boolean
  • put_float64_le(val: number): boolean
  • put_int16_be(val: number): boolean
  • put_int16_le(val: number): boolean
  • put_int24_be(val: number): boolean
  • put_int24_le(val: number): boolean
  • put_int32_be(val: number): boolean
  • put_int32_le(val: number): boolean
  • put_int64_be(val: number): boolean
  • put_int64_le(val: number): boolean
  • put_int8(val: number): boolean
  • put_string_utf16(data: number[]): boolean
  • Writes a NUL-terminated UTF16 string to writer (including the terminator).

    Parameters

    • data: number[]

      UTF16 string to write

    Returns boolean

  • put_string_utf32(data: number[]): boolean
  • Writes a NUL-terminated UTF32 string to writer (including the terminator).

    Parameters

    • data: number[]

      UTF32 string to write

    Returns boolean

  • put_string_utf8(data: string): boolean
  • Writes a NUL-terminated UTF8 string to writer (including the terminator).

    Parameters

    • data: string

      UTF8 string to write

    Returns boolean

  • put_uint16_be(val: number): boolean
  • put_uint16_le(val: number): boolean
  • put_uint24_be(val: number): boolean
  • put_uint24_le(val: number): boolean
  • put_uint32_be(val: number): boolean
  • put_uint32_le(val: number): boolean
  • put_uint64_be(val: number): boolean
  • put_uint64_le(val: number): boolean
  • put_uint8(val: number): boolean
  • reset(): void
  • reset_and_get_data(): Uint8Array

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method