{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstBase.Structs.BitReader
(
BitReader(..) ,
newZeroBitReader ,
#if defined(ENABLE_OVERLOADING)
ResolveBitReaderMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BitReaderFreeMethodInfo ,
#endif
bitReaderFree ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetBitsUint16MethodInfo ,
#endif
bitReaderGetBitsUint16 ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetBitsUint32MethodInfo ,
#endif
bitReaderGetBitsUint32 ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetBitsUint64MethodInfo ,
#endif
bitReaderGetBitsUint64 ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetBitsUint8MethodInfo ,
#endif
bitReaderGetBitsUint8 ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetPosMethodInfo ,
#endif
bitReaderGetPos ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetRemainingMethodInfo ,
#endif
bitReaderGetRemaining ,
#if defined(ENABLE_OVERLOADING)
BitReaderGetSizeMethodInfo ,
#endif
bitReaderGetSize ,
#if defined(ENABLE_OVERLOADING)
BitReaderInitMethodInfo ,
#endif
bitReaderInit ,
#if defined(ENABLE_OVERLOADING)
BitReaderPeekBitsUint16MethodInfo ,
#endif
bitReaderPeekBitsUint16 ,
#if defined(ENABLE_OVERLOADING)
BitReaderPeekBitsUint32MethodInfo ,
#endif
bitReaderPeekBitsUint32 ,
#if defined(ENABLE_OVERLOADING)
BitReaderPeekBitsUint64MethodInfo ,
#endif
bitReaderPeekBitsUint64 ,
#if defined(ENABLE_OVERLOADING)
BitReaderPeekBitsUint8MethodInfo ,
#endif
bitReaderPeekBitsUint8 ,
#if defined(ENABLE_OVERLOADING)
BitReaderSetPosMethodInfo ,
#endif
bitReaderSetPos ,
#if defined(ENABLE_OVERLOADING)
BitReaderSkipMethodInfo ,
#endif
bitReaderSkip ,
#if defined(ENABLE_OVERLOADING)
BitReaderSkipToByteMethodInfo ,
#endif
bitReaderSkipToByte ,
#if defined(ENABLE_OVERLOADING)
bitReader_bit ,
#endif
getBitReaderBit ,
setBitReaderBit ,
#if defined(ENABLE_OVERLOADING)
bitReader_byte ,
#endif
getBitReaderByte ,
setBitReaderByte ,
#if defined(ENABLE_OVERLOADING)
bitReader_size ,
#endif
getBitReaderSize ,
setBitReaderSize ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
newtype BitReader = BitReader (SP.ManagedPtr BitReader)
deriving (BitReader -> BitReader -> Bool
(BitReader -> BitReader -> Bool)
-> (BitReader -> BitReader -> Bool) -> Eq BitReader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BitReader -> BitReader -> Bool
$c/= :: BitReader -> BitReader -> Bool
== :: BitReader -> BitReader -> Bool
$c== :: BitReader -> BitReader -> Bool
Eq)
instance SP.ManagedPtrNewtype BitReader where
toManagedPtr :: BitReader -> ManagedPtr BitReader
toManagedPtr (BitReader ManagedPtr BitReader
p) = ManagedPtr BitReader
p
instance BoxedPtr BitReader where
boxedPtrCopy :: BitReader -> IO BitReader
boxedPtrCopy = \BitReader
p -> BitReader -> (Ptr BitReader -> IO BitReader) -> IO BitReader
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BitReader
p (Int -> Ptr BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
56 (Ptr BitReader -> IO (Ptr BitReader))
-> (Ptr BitReader -> IO BitReader) -> Ptr BitReader -> IO BitReader
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr BitReader -> BitReader)
-> Ptr BitReader -> IO BitReader
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr BitReader -> BitReader
BitReader)
boxedPtrFree :: BitReader -> IO ()
boxedPtrFree = \BitReader
x -> BitReader -> (Ptr BitReader -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr BitReader
x Ptr BitReader -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr BitReader where
boxedPtrCalloc :: IO (Ptr BitReader)
boxedPtrCalloc = Int -> IO (Ptr BitReader)
forall a. Int -> IO (Ptr a)
callocBytes Int
56
newZeroBitReader :: MonadIO m => m BitReader
newZeroBitReader :: forall (m :: * -> *). MonadIO m => m BitReader
newZeroBitReader = IO BitReader -> m BitReader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BitReader -> m BitReader) -> IO BitReader -> m BitReader
forall a b. (a -> b) -> a -> b
$ IO (Ptr BitReader)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr BitReader)
-> (Ptr BitReader -> IO BitReader) -> IO BitReader
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr BitReader -> BitReader)
-> Ptr BitReader -> IO BitReader
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr BitReader -> BitReader
BitReader
instance tag ~ 'AttrSet => Constructible BitReader tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr BitReader -> BitReader)
-> [AttrOp BitReader tag] -> m BitReader
new ManagedPtr BitReader -> BitReader
_ [AttrOp BitReader tag]
attrs = do
BitReader
o <- m BitReader
forall (m :: * -> *). MonadIO m => m BitReader
newZeroBitReader
BitReader -> [AttrOp BitReader 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set BitReader
o [AttrOp BitReader tag]
[AttrOp BitReader 'AttrSet]
attrs
BitReader -> m BitReader
forall (m :: * -> *) a. Monad m => a -> m a
return BitReader
o
getBitReaderSize :: MonadIO m => BitReader -> m Word32
getBitReaderSize :: forall (m :: * -> *). MonadIO m => BitReader -> m Word32
getBitReaderSize BitReader
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO Word32) -> IO Word32)
-> (Ptr BitReader -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setBitReaderSize :: MonadIO m => BitReader -> Word32 -> m ()
setBitReaderSize :: forall (m :: * -> *). MonadIO m => BitReader -> Word32 -> m ()
setBitReaderSize BitReader
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO ()) -> IO ())
-> (Ptr BitReader -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data BitReaderSizeFieldInfo
instance AttrInfo BitReaderSizeFieldInfo where
type AttrBaseTypeConstraint BitReaderSizeFieldInfo = (~) BitReader
type AttrAllowedOps BitReaderSizeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint BitReaderSizeFieldInfo = (~) Word32
type AttrTransferTypeConstraint BitReaderSizeFieldInfo = (~)Word32
type AttrTransferType BitReaderSizeFieldInfo = Word32
type AttrGetType BitReaderSizeFieldInfo = Word32
type AttrLabel BitReaderSizeFieldInfo = "size"
type AttrOrigin BitReaderSizeFieldInfo = BitReader
attrGet = getBitReaderSize
attrSet = setBitReaderSize
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.size"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#g:attr:size"
})
bitReader_size :: AttrLabelProxy "size"
bitReader_size = AttrLabelProxy
#endif
getBitReaderByte :: MonadIO m => BitReader -> m Word32
getBitReaderByte :: forall (m :: * -> *). MonadIO m => BitReader -> m Word32
getBitReaderByte BitReader
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO Word32) -> IO Word32)
-> (Ptr BitReader -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setBitReaderByte :: MonadIO m => BitReader -> Word32 -> m ()
setBitReaderByte :: forall (m :: * -> *). MonadIO m => BitReader -> Word32 -> m ()
setBitReaderByte BitReader
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO ()) -> IO ())
-> (Ptr BitReader -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data BitReaderByteFieldInfo
instance AttrInfo BitReaderByteFieldInfo where
type AttrBaseTypeConstraint BitReaderByteFieldInfo = (~) BitReader
type AttrAllowedOps BitReaderByteFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint BitReaderByteFieldInfo = (~) Word32
type AttrTransferTypeConstraint BitReaderByteFieldInfo = (~)Word32
type AttrTransferType BitReaderByteFieldInfo = Word32
type AttrGetType BitReaderByteFieldInfo = Word32
type AttrLabel BitReaderByteFieldInfo = "byte"
type AttrOrigin BitReaderByteFieldInfo = BitReader
attrGet = getBitReaderByte
attrSet = setBitReaderByte
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.byte"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#g:attr:byte"
})
bitReader_byte :: AttrLabelProxy "byte"
bitReader_byte = AttrLabelProxy
#endif
getBitReaderBit :: MonadIO m => BitReader -> m Word32
getBitReaderBit :: forall (m :: * -> *). MonadIO m => BitReader -> m Word32
getBitReaderBit BitReader
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO Word32) -> IO Word32)
-> (Ptr BitReader -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setBitReaderBit :: MonadIO m => BitReader -> Word32 -> m ()
setBitReaderBit :: forall (m :: * -> *). MonadIO m => BitReader -> Word32 -> m ()
setBitReaderBit BitReader
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ BitReader -> (Ptr BitReader -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr BitReader
s ((Ptr BitReader -> IO ()) -> IO ())
-> (Ptr BitReader -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr BitReader
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BitReader
ptr Ptr BitReader -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data BitReaderBitFieldInfo
instance AttrInfo BitReaderBitFieldInfo where
type AttrBaseTypeConstraint BitReaderBitFieldInfo = (~) BitReader
type AttrAllowedOps BitReaderBitFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint BitReaderBitFieldInfo = (~) Word32
type AttrTransferTypeConstraint BitReaderBitFieldInfo = (~)Word32
type AttrTransferType BitReaderBitFieldInfo = Word32
type AttrGetType BitReaderBitFieldInfo = Word32
type AttrLabel BitReaderBitFieldInfo = "bit"
type AttrOrigin BitReaderBitFieldInfo = BitReader
attrGet = getBitReaderBit
attrSet = setBitReaderBit
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bit"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#g:attr:bit"
})
bitReader_bit :: AttrLabelProxy "bit"
bitReader_bit = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BitReader
type instance O.AttributeList BitReader = BitReaderAttributeList
type BitReaderAttributeList = ('[ '("size", BitReaderSizeFieldInfo), '("byte", BitReaderByteFieldInfo), '("bit", BitReaderBitFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_bit_reader_free" gst_bit_reader_free ::
Ptr BitReader ->
IO ()
bitReaderFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> m ()
bitReaderFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> m ()
bitReaderFree BitReader
reader = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr BitReader -> IO ()
gst_bit_reader_free Ptr BitReader
reader'
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BitReaderFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod BitReaderFreeMethodInfo BitReader signature where
overloadedMethod = bitReaderFree
instance O.OverloadedMethodInfo BitReaderFreeMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderFree"
})
#endif
foreign import ccall "gst_bit_reader_get_bits_uint16" gst_bit_reader_get_bits_uint16 ::
Ptr BitReader ->
Ptr Word16 ->
Word32 ->
IO CInt
bitReaderGetBitsUint16 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word16))
bitReaderGetBitsUint16 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word16)
bitReaderGetBitsUint16 BitReader
reader Word32
nbits = IO (Bool, Word16) -> m (Bool, Word16)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word16) -> m (Bool, Word16))
-> IO (Bool, Word16) -> m (Bool, Word16)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word16
val <- IO (Ptr Word16)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word16)
CInt
result <- Ptr BitReader -> Ptr Word16 -> Word32 -> IO CInt
gst_bit_reader_get_bits_uint16 Ptr BitReader
reader' Ptr Word16
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word16
val' <- Ptr Word16 -> IO Word16
forall a. Storable a => Ptr a -> IO a
peek Ptr Word16
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word16 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word16
val
(Bool, Word16) -> IO (Bool, Word16)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word16
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderGetBitsUint16MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word16))), MonadIO m) => O.OverloadedMethod BitReaderGetBitsUint16MethodInfo BitReader signature where
overloadedMethod = bitReaderGetBitsUint16
instance O.OverloadedMethodInfo BitReaderGetBitsUint16MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetBitsUint16",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetBitsUint16"
})
#endif
foreign import ccall "gst_bit_reader_get_bits_uint32" gst_bit_reader_get_bits_uint32 ::
Ptr BitReader ->
Ptr Word32 ->
Word32 ->
IO CInt
bitReaderGetBitsUint32 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word32))
bitReaderGetBitsUint32 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word32)
bitReaderGetBitsUint32 BitReader
reader Word32
nbits = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word32
val <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr BitReader -> Ptr Word32 -> Word32 -> IO CInt
gst_bit_reader_get_bits_uint32 Ptr BitReader
reader' Ptr Word32
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
val' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
val
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderGetBitsUint32MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word32))), MonadIO m) => O.OverloadedMethod BitReaderGetBitsUint32MethodInfo BitReader signature where
overloadedMethod = bitReaderGetBitsUint32
instance O.OverloadedMethodInfo BitReaderGetBitsUint32MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetBitsUint32",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetBitsUint32"
})
#endif
foreign import ccall "gst_bit_reader_get_bits_uint64" gst_bit_reader_get_bits_uint64 ::
Ptr BitReader ->
Ptr Word64 ->
Word32 ->
IO CInt
bitReaderGetBitsUint64 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word64))
bitReaderGetBitsUint64 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word64)
bitReaderGetBitsUint64 BitReader
reader Word32
nbits = IO (Bool, Word64) -> m (Bool, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word64) -> m (Bool, Word64))
-> IO (Bool, Word64) -> m (Bool, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word64
val <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
CInt
result <- Ptr BitReader -> Ptr Word64 -> Word32 -> IO CInt
gst_bit_reader_get_bits_uint64 Ptr BitReader
reader' Ptr Word64
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word64
val' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
val
(Bool, Word64) -> IO (Bool, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word64
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderGetBitsUint64MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word64))), MonadIO m) => O.OverloadedMethod BitReaderGetBitsUint64MethodInfo BitReader signature where
overloadedMethod = bitReaderGetBitsUint64
instance O.OverloadedMethodInfo BitReaderGetBitsUint64MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetBitsUint64",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetBitsUint64"
})
#endif
foreign import ccall "gst_bit_reader_get_bits_uint8" gst_bit_reader_get_bits_uint8 ::
Ptr BitReader ->
Ptr Word8 ->
Word32 ->
IO CInt
bitReaderGetBitsUint8 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word8))
bitReaderGetBitsUint8 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word8)
bitReaderGetBitsUint8 BitReader
reader Word32
nbits = IO (Bool, Word8) -> m (Bool, Word8)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word8) -> m (Bool, Word8))
-> IO (Bool, Word8) -> m (Bool, Word8)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word8
val <- IO (Ptr Word8)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word8)
CInt
result <- Ptr BitReader -> Ptr Word8 -> Word32 -> IO CInt
gst_bit_reader_get_bits_uint8 Ptr BitReader
reader' Ptr Word8
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word8
val' <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek Ptr Word8
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
val
(Bool, Word8) -> IO (Bool, Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word8
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderGetBitsUint8MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word8))), MonadIO m) => O.OverloadedMethod BitReaderGetBitsUint8MethodInfo BitReader signature where
overloadedMethod = bitReaderGetBitsUint8
instance O.OverloadedMethodInfo BitReaderGetBitsUint8MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetBitsUint8",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetBitsUint8"
})
#endif
foreign import ccall "gst_bit_reader_get_pos" gst_bit_reader_get_pos ::
Ptr BitReader ->
IO Word32
bitReaderGetPos ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> m Word32
bitReaderGetPos :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> m Word32
bitReaderGetPos BitReader
reader = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Word32
result <- Ptr BitReader -> IO Word32
gst_bit_reader_get_pos Ptr BitReader
reader'
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BitReaderGetPosMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod BitReaderGetPosMethodInfo BitReader signature where
overloadedMethod = bitReaderGetPos
instance O.OverloadedMethodInfo BitReaderGetPosMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetPos",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetPos"
})
#endif
foreign import ccall "gst_bit_reader_get_remaining" gst_bit_reader_get_remaining ::
Ptr BitReader ->
IO Word32
bitReaderGetRemaining ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> m Word32
bitReaderGetRemaining :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> m Word32
bitReaderGetRemaining BitReader
reader = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Word32
result <- Ptr BitReader -> IO Word32
gst_bit_reader_get_remaining Ptr BitReader
reader'
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BitReaderGetRemainingMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod BitReaderGetRemainingMethodInfo BitReader signature where
overloadedMethod = bitReaderGetRemaining
instance O.OverloadedMethodInfo BitReaderGetRemainingMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetRemaining",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetRemaining"
})
#endif
foreign import ccall "gst_bit_reader_get_size" gst_bit_reader_get_size ::
Ptr BitReader ->
IO Word32
bitReaderGetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> m Word32
bitReaderGetSize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> m Word32
bitReaderGetSize BitReader
reader = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Word32
result <- Ptr BitReader -> IO Word32
gst_bit_reader_get_size Ptr BitReader
reader'
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BitReaderGetSizeMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod BitReaderGetSizeMethodInfo BitReader signature where
overloadedMethod = bitReaderGetSize
instance O.OverloadedMethodInfo BitReaderGetSizeMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderGetSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderGetSize"
})
#endif
foreign import ccall "gst_bit_reader_init" gst_bit_reader_init ::
Ptr BitReader ->
Ptr Word8 ->
Word32 ->
IO ()
bitReaderInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> ByteString
-> m ()
bitReaderInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> ByteString -> m ()
bitReaderInit BitReader
reader ByteString
data_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let size :: Word32
size = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
data_
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word8
data_' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
data_
Ptr BitReader -> Ptr Word8 -> Word32 -> IO ()
gst_bit_reader_init Ptr BitReader
reader' Ptr Word8
data_' Word32
size
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
data_'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BitReaderInitMethodInfo
instance (signature ~ (ByteString -> m ()), MonadIO m) => O.OverloadedMethod BitReaderInitMethodInfo BitReader signature where
overloadedMethod = bitReaderInit
instance O.OverloadedMethodInfo BitReaderInitMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderInit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderInit"
})
#endif
foreign import ccall "gst_bit_reader_peek_bits_uint16" gst_bit_reader_peek_bits_uint16 ::
Ptr BitReader ->
Ptr Word16 ->
Word32 ->
IO CInt
bitReaderPeekBitsUint16 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word16))
bitReaderPeekBitsUint16 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word16)
bitReaderPeekBitsUint16 BitReader
reader Word32
nbits = IO (Bool, Word16) -> m (Bool, Word16)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word16) -> m (Bool, Word16))
-> IO (Bool, Word16) -> m (Bool, Word16)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word16
val <- IO (Ptr Word16)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word16)
CInt
result <- Ptr BitReader -> Ptr Word16 -> Word32 -> IO CInt
gst_bit_reader_peek_bits_uint16 Ptr BitReader
reader' Ptr Word16
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word16
val' <- Ptr Word16 -> IO Word16
forall a. Storable a => Ptr a -> IO a
peek Ptr Word16
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word16 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word16
val
(Bool, Word16) -> IO (Bool, Word16)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word16
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderPeekBitsUint16MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word16))), MonadIO m) => O.OverloadedMethod BitReaderPeekBitsUint16MethodInfo BitReader signature where
overloadedMethod = bitReaderPeekBitsUint16
instance O.OverloadedMethodInfo BitReaderPeekBitsUint16MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderPeekBitsUint16",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderPeekBitsUint16"
})
#endif
foreign import ccall "gst_bit_reader_peek_bits_uint32" gst_bit_reader_peek_bits_uint32 ::
Ptr BitReader ->
Ptr Word32 ->
Word32 ->
IO CInt
bitReaderPeekBitsUint32 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word32))
bitReaderPeekBitsUint32 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word32)
bitReaderPeekBitsUint32 BitReader
reader Word32
nbits = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word32
val <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr BitReader -> Ptr Word32 -> Word32 -> IO CInt
gst_bit_reader_peek_bits_uint32 Ptr BitReader
reader' Ptr Word32
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
val' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
val
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderPeekBitsUint32MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word32))), MonadIO m) => O.OverloadedMethod BitReaderPeekBitsUint32MethodInfo BitReader signature where
overloadedMethod = bitReaderPeekBitsUint32
instance O.OverloadedMethodInfo BitReaderPeekBitsUint32MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderPeekBitsUint32",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderPeekBitsUint32"
})
#endif
foreign import ccall "gst_bit_reader_peek_bits_uint64" gst_bit_reader_peek_bits_uint64 ::
Ptr BitReader ->
Ptr Word64 ->
Word32 ->
IO CInt
bitReaderPeekBitsUint64 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word64))
bitReaderPeekBitsUint64 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word64)
bitReaderPeekBitsUint64 BitReader
reader Word32
nbits = IO (Bool, Word64) -> m (Bool, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word64) -> m (Bool, Word64))
-> IO (Bool, Word64) -> m (Bool, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word64
val <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
CInt
result <- Ptr BitReader -> Ptr Word64 -> Word32 -> IO CInt
gst_bit_reader_peek_bits_uint64 Ptr BitReader
reader' Ptr Word64
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word64
val' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
val
(Bool, Word64) -> IO (Bool, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word64
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderPeekBitsUint64MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word64))), MonadIO m) => O.OverloadedMethod BitReaderPeekBitsUint64MethodInfo BitReader signature where
overloadedMethod = bitReaderPeekBitsUint64
instance O.OverloadedMethodInfo BitReaderPeekBitsUint64MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderPeekBitsUint64",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderPeekBitsUint64"
})
#endif
foreign import ccall "gst_bit_reader_peek_bits_uint8" gst_bit_reader_peek_bits_uint8 ::
Ptr BitReader ->
Ptr Word8 ->
Word32 ->
IO CInt
bitReaderPeekBitsUint8 ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m ((Bool, Word8))
bitReaderPeekBitsUint8 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m (Bool, Word8)
bitReaderPeekBitsUint8 BitReader
reader Word32
nbits = IO (Bool, Word8) -> m (Bool, Word8)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word8) -> m (Bool, Word8))
-> IO (Bool, Word8) -> m (Bool, Word8)
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
Ptr Word8
val <- IO (Ptr Word8)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word8)
CInt
result <- Ptr BitReader -> Ptr Word8 -> Word32 -> IO CInt
gst_bit_reader_peek_bits_uint8 Ptr BitReader
reader' Ptr Word8
val Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word8
val' <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek Ptr Word8
val
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
val
(Bool, Word8) -> IO (Bool, Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word8
val')
#if defined(ENABLE_OVERLOADING)
data BitReaderPeekBitsUint8MethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word8))), MonadIO m) => O.OverloadedMethod BitReaderPeekBitsUint8MethodInfo BitReader signature where
overloadedMethod = bitReaderPeekBitsUint8
instance O.OverloadedMethodInfo BitReaderPeekBitsUint8MethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderPeekBitsUint8",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderPeekBitsUint8"
})
#endif
foreign import ccall "gst_bit_reader_set_pos" gst_bit_reader_set_pos ::
Ptr BitReader ->
Word32 ->
IO CInt
bitReaderSetPos ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m Bool
bitReaderSetPos :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m Bool
bitReaderSetPos BitReader
reader Word32
pos = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
CInt
result <- Ptr BitReader -> Word32 -> IO CInt
gst_bit_reader_set_pos Ptr BitReader
reader' Word32
pos
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BitReaderSetPosMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m) => O.OverloadedMethod BitReaderSetPosMethodInfo BitReader signature where
overloadedMethod = bitReaderSetPos
instance O.OverloadedMethodInfo BitReaderSetPosMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderSetPos",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderSetPos"
})
#endif
foreign import ccall "gst_bit_reader_skip" gst_bit_reader_skip ::
Ptr BitReader ->
Word32 ->
IO CInt
bitReaderSkip ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> Word32
-> m Bool
bitReaderSkip :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> Word32 -> m Bool
bitReaderSkip BitReader
reader Word32
nbits = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
CInt
result <- Ptr BitReader -> Word32 -> IO CInt
gst_bit_reader_skip Ptr BitReader
reader' Word32
nbits
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BitReaderSkipMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m) => O.OverloadedMethod BitReaderSkipMethodInfo BitReader signature where
overloadedMethod = bitReaderSkip
instance O.OverloadedMethodInfo BitReaderSkipMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderSkip",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderSkip"
})
#endif
foreign import ccall "gst_bit_reader_skip_to_byte" gst_bit_reader_skip_to_byte ::
Ptr BitReader ->
IO CInt
bitReaderSkipToByte ::
(B.CallStack.HasCallStack, MonadIO m) =>
BitReader
-> m Bool
bitReaderSkipToByte :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BitReader -> m Bool
bitReaderSkipToByte BitReader
reader = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr BitReader
reader' <- BitReader -> IO (Ptr BitReader)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BitReader
reader
CInt
result <- Ptr BitReader -> IO CInt
gst_bit_reader_skip_to_byte Ptr BitReader
reader'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
BitReader -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BitReader
reader
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BitReaderSkipToByteMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod BitReaderSkipToByteMethodInfo BitReader signature where
overloadedMethod = bitReaderSkipToByte
instance O.OverloadedMethodInfo BitReaderSkipToByteMethodInfo BitReader where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Structs.BitReader.bitReaderSkipToByte",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Structs-BitReader.html#v:bitReaderSkipToByte"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveBitReaderMethod (t :: Symbol) (o :: *) :: * where
ResolveBitReaderMethod "free" o = BitReaderFreeMethodInfo
ResolveBitReaderMethod "init" o = BitReaderInitMethodInfo
ResolveBitReaderMethod "peekBitsUint16" o = BitReaderPeekBitsUint16MethodInfo
ResolveBitReaderMethod "peekBitsUint32" o = BitReaderPeekBitsUint32MethodInfo
ResolveBitReaderMethod "peekBitsUint64" o = BitReaderPeekBitsUint64MethodInfo
ResolveBitReaderMethod "peekBitsUint8" o = BitReaderPeekBitsUint8MethodInfo
ResolveBitReaderMethod "skip" o = BitReaderSkipMethodInfo
ResolveBitReaderMethod "skipToByte" o = BitReaderSkipToByteMethodInfo
ResolveBitReaderMethod "getBitsUint16" o = BitReaderGetBitsUint16MethodInfo
ResolveBitReaderMethod "getBitsUint32" o = BitReaderGetBitsUint32MethodInfo
ResolveBitReaderMethod "getBitsUint64" o = BitReaderGetBitsUint64MethodInfo
ResolveBitReaderMethod "getBitsUint8" o = BitReaderGetBitsUint8MethodInfo
ResolveBitReaderMethod "getPos" o = BitReaderGetPosMethodInfo
ResolveBitReaderMethod "getRemaining" o = BitReaderGetRemainingMethodInfo
ResolveBitReaderMethod "getSize" o = BitReaderGetSizeMethodInfo
ResolveBitReaderMethod "setPos" o = BitReaderSetPosMethodInfo
ResolveBitReaderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBitReaderMethod t BitReader, O.OverloadedMethod info BitReader p) => OL.IsLabel t (BitReader -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveBitReaderMethod t BitReader, O.OverloadedMethod info BitReader p, R.HasField t BitReader p) => R.HasField t BitReader p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBitReaderMethod t BitReader, O.OverloadedMethodInfo info BitReader) => OL.IsLabel t (O.MethodProxy info BitReader) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif