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.

Constructors

this
this(GstBitWriter* gstBitWriter, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new, empty #GstBitWriter instance.

this
this(ubyte* data, uint size, bool initialized)

Creates a new #GstBitWriter instance with the given memory area. If @initialized is %TRUE it is possible to read @size bits from the #GstBitWriter from the beginnig.

this
this(uint size, bool fixed)

Creates a #GstBitWriter instance with the given initial data size.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

alignBytes
bool alignBytes(ubyte trailingBit)

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

free
void free()

Frees @bitwriter and the allocated data inside.

freeAndGetBuffer
Buffer freeAndGetBuffer()

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

freeAndGetData
ubyte[] freeAndGetData()

Frees @bitwriter without destroying the internal data, which is returned.

getBitWriterStruct
GstBitWriter* getBitWriterStruct(bool transferOwnership)

Get the main Gtk struct

getData
ubyte* getData()

Get written data pointer

getRemaining
uint getRemaining()
getSize
uint getSize()

Get size of written @data

getStruct
void* getStruct()

the main Gtk struct as a void*

init
void init()

Initializes @bitwriter to an empty instance.

initWithData
void initWithData(ubyte[] data, bool initialized)

Initializes @bitwriter with the given memory area @data. IF @initialized is %TRUE it is possible to read @size bits from the #GstBitWriter from the beginning.

initWithSize
void initWithSize(uint size, bool fixed)

Initializes a #GstBitWriter instance and allocates the given data @size.

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, uint nbytes)

Write @nbytes bytes of @data to #GstBitWriter.

reset
void reset()

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

resetAndGetBuffer
Buffer resetAndGetBuffer()

Resets @bitwriter and returns the current data as #GstBuffer.

resetAndGetData
ubyte[] resetAndGetData()

Resets @bitwriter and returns the current data.

setPos
bool setPos(uint pos)

Variables

gstBitWriter
GstBitWriter* gstBitWriter;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta