BitWriter

#GstBitWriter provides a bit writer that can write any number of bits into a memory buffer. It provides functions for writing any number of bits into 8, 16, 32 and 64 bit variables.

Members

Functions

alignBytes
bool alignBytes(ubyte trailingBit)

Write trailing bit to align last byte of data. trailing_bit can only be 1 or 0.

freeAndGetBuffer
gst.buffer.Buffer freeAndGetBuffer()

Frees bitwriter without destroying the internal data, which is returned as #GstBuffer.

getRemaining
uint getRemaining()
getSize
uint getSize()

Get size of written data

putBitsUint16
bool putBitsUint16(ushort value, uint nbits)

Write nbits bits of value to #GstBitWriter.

putBitsUint32
bool putBitsUint32(uint value, uint nbits)

Write nbits bits of value to #GstBitWriter.

putBitsUint64
bool putBitsUint64(ulong value, uint nbits)

Write nbits bits of value to #GstBitWriter.

putBitsUint8
bool putBitsUint8(ubyte value, uint nbits)

Write nbits bits of value to #GstBitWriter.

putBytes
bool putBytes(ubyte[] data)

Write nbytes bytes of data to #GstBitWriter.

reset
void reset()

Resets bitwriter and frees the data if it's owned by bitwriter.

resetAndGetBuffer
gst.buffer.Buffer resetAndGetBuffer()

Resets bitwriter and returns the current data as #GstBuffer.

setPos
bool setPos(uint pos)