gi-gstbase-1.0.20: GStreamerBase bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.GstBase.Structs.BitWriter

Contents

Description

BitWriter 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.

Synopsis

Exported types

newtype BitWriter Source #

Memory-managed wrapper type.

Constructors

BitWriter (ManagedPtr BitWriter) 
Instances
WrappedPtr BitWriter Source # 
Instance details

Defined in GI.GstBase.Structs.BitWriter

tag ~ AttrSet => Constructible BitWriter tag Source # 
Instance details

Defined in GI.GstBase.Structs.BitWriter

Methods

new :: MonadIO m => (ManagedPtr BitWriter -> BitWriter) -> [AttrOp BitWriter tag] -> m BitWriter

newZeroBitWriter :: MonadIO m => m BitWriter Source #

Construct a BitWriter struct initialized to zero.

noBitWriter :: Maybe BitWriter Source #

A convenience alias for Nothing :: Maybe BitWriter.

Methods

alignBytes

bitWriterAlignBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word8

trailingBit: trailing bits of last byte, 0 or 1

-> m Bool

Returns: True if successful, False otherwise.

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

free

bitWriterFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: BitWriter instance

-> m () 

Frees bitwriter and the allocated data inside.

freeAndGetBuffer

bitWriterFreeAndGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: BitWriter instance

-> m Buffer

Returns: a new allocated Buffer wrapping the data inside. gst_buffer_unref() after usage.

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

Free-function: gst_buffer_unref

getData

bitWriterGetData Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> m Word8

Returns: data pointer

Get written data pointer

getRemaining

bitWriterGetRemaining :: (HasCallStack, MonadIO m) => BitWriter -> m Word32 Source #

No description available in the introspection data.

getSize

bitWriterGetSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> m Word32

Returns: size of bits written in data

Get size of written data

putBitsUint16

bitWriterPutBitsUint16 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word16

value: value of guint16 to write

-> Word32

nbits: number of bits to write

-> m Bool

Returns: True if successful, False otherwise.

Write nbits bits of value to BitWriter.

putBitsUint32

bitWriterPutBitsUint32 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word32

value: value of guint32 to write

-> Word32

nbits: number of bits to write

-> m Bool

Returns: True if successful, False otherwise.

Write nbits bits of value to BitWriter.

putBitsUint64

bitWriterPutBitsUint64 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word64

value: value of guint64 to write

-> Word32

nbits: number of bits to write

-> m Bool

Returns: True if successful, False otherwise.

Write nbits bits of value to BitWriter.

putBitsUint8

bitWriterPutBitsUint8 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word8

value: value of guint8 to write

-> Word32

nbits: number of bits to write

-> m Bool

Returns: True if successful, False otherwise.

Write nbits bits of value to BitWriter.

putBytes

bitWriterPutBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> Word8

data: pointer of data to write

-> Word32

nbytes: number of bytes to write

-> m Bool

Returns: True if successful, False otherwise.

Write nbytes bytes of data to BitWriter.

reset

bitWriterReset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: BitWriter instance

-> m () 

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

resetAndGetBuffer

bitWriterResetAndGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitWriter

bitwriter: a BitWriter instance

-> m Buffer

Returns: a new allocated Buffer wrapping the current data. gst_buffer_unref() after usage.

Resets bitwriter and returns the current data as Buffer.

Free-function: gst_buffer_unref

setPos

bitWriterSetPos :: (HasCallStack, MonadIO m) => BitWriter -> Word32 -> m Bool Source #

No description available in the introspection data.

Properties

bitSize

Size of written data in bits

getBitWriterBitSize :: MonadIO m => BitWriter -> m Word32 Source #

Get the value of the “bit_size” field. When overloading is enabled, this is equivalent to

get bitWriter #bitSize

setBitWriterBitSize :: MonadIO m => BitWriter -> Word32 -> m () Source #

Set the value of the “bit_size” field. When overloading is enabled, this is equivalent to

set bitWriter [ #bitSize := value ]

data

Allocated data for bit writer to write

getBitWriterData :: MonadIO m => BitWriter -> m Word8 Source #

Get the value of the “data” field. When overloading is enabled, this is equivalent to

get bitWriter #data

setBitWriterData :: MonadIO m => BitWriter -> Word8 -> m () Source #

Set the value of the “data” field. When overloading is enabled, this is equivalent to

set bitWriter [ #data := value ]