gi-gstbase-1.0.22: GStreamerBase bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.GstBase.Structs.BitReader

Description

BitReader provides a bit reader that can read any number of bits from a memory buffer. It provides functions for reading any number of bits into 8, 16, 32 and 64 bit variables.

Synopsis

Exported types

newtype BitReader Source #

Memory-managed wrapper type.

newZeroBitReader :: MonadIO m => m BitReader Source #

Construct a BitReader struct initialized to zero.

noBitReader :: Maybe BitReader Source #

A convenience alias for Nothing :: Maybe BitReader.

Methods

Overloaded methods

free

bitReaderFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> m () 

Frees a BitReader instance, which was previously allocated by gst_bit_reader_new().

getBitsUint16

bitReaderGetBitsUint16 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word16)

Returns: True if successful, False otherwise.

Read nbits bits into val and update the current position.

getBitsUint32

bitReaderGetBitsUint32 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word32)

Returns: True if successful, False otherwise.

Read nbits bits into val and update the current position.

getBitsUint64

bitReaderGetBitsUint64 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word64)

Returns: True if successful, False otherwise.

Read nbits bits into val and update the current position.

getBitsUint8

bitReaderGetBitsUint8 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word8)

Returns: True if successful, False otherwise.

Read nbits bits into val and update the current position.

getPos

bitReaderGetPos Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> m Word32

Returns: The current position of reader in bits.

Returns the current position of a BitReader instance in bits.

getRemaining

bitReaderGetRemaining Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> m Word32

Returns: The remaining number of bits of reader instance.

Returns the remaining number of bits of a BitReader instance.

getSize

bitReaderGetSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> m Word32

Returns: The total number of bits of reader instance.

Returns the total number of bits of a BitReader instance.

init

bitReaderInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> ByteString

data: data from which the bit reader should read

-> m () 

Initializes a BitReader instance to read from data. This function can be called on already initialized instances.

peekBitsUint16

bitReaderPeekBitsUint16 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word16)

Returns: True if successful, False otherwise.

Read nbits bits into val but keep the current position.

peekBitsUint32

bitReaderPeekBitsUint32 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word32)

Returns: True if successful, False otherwise.

Read nbits bits into val but keep the current position.

peekBitsUint64

bitReaderPeekBitsUint64 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word64)

Returns: True if successful, False otherwise.

Read nbits bits into val but keep the current position.

peekBitsUint8

bitReaderPeekBitsUint8 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: number of bits to read

-> m (Bool, Word8)

Returns: True if successful, False otherwise.

Read nbits bits into val but keep the current position.

setPos

bitReaderSetPos Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

pos: The new position in bits

-> m Bool

Returns: True if the position could be set successfully, False otherwise.

Sets the new position of a BitReader instance to pos in bits.

skip

bitReaderSkip Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> Word32

nbits: the number of bits to skip

-> m Bool

Returns: True if nbits bits could be skipped, False otherwise.

Skips nbits bits of the BitReader instance.

skipToByte

bitReaderSkipToByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BitReader

reader: a BitReader instance

-> m Bool

Returns: True if successful, False otherwise.

Skips until the next byte.

Properties

bit

Bit position in the current byte

getBitReaderBit :: MonadIO m => BitReader -> m Word32 Source #

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

get bitReader #bit

setBitReaderBit :: MonadIO m => BitReader -> Word32 -> m () Source #

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

set bitReader [ #bit := value ]

byte

Current byte position

getBitReaderByte :: MonadIO m => BitReader -> m Word32 Source #

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

get bitReader #byte

setBitReaderByte :: MonadIO m => BitReader -> Word32 -> m () Source #

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

set bitReader [ #byte := value ]

size

Size of data in bytes

getBitReaderSize :: MonadIO m => BitReader -> m Word32 Source #

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

get bitReader #size

setBitReaderSize :: MonadIO m => BitReader -> Word32 -> m () Source #

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

set bitReader [ #size := value ]