{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gst.Objects.BufferPool
(
BufferPool(..) ,
IsBufferPool ,
toBufferPool ,
noBufferPool ,
#if defined(ENABLE_OVERLOADING)
ResolveBufferPoolMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BufferPoolAcquireBufferMethodInfo ,
#endif
bufferPoolAcquireBuffer ,
bufferPoolConfigAddOption ,
bufferPoolConfigGetAllocator ,
bufferPoolConfigGetOption ,
bufferPoolConfigGetParams ,
bufferPoolConfigHasOption ,
bufferPoolConfigNOptions ,
bufferPoolConfigSetAllocator ,
bufferPoolConfigSetParams ,
bufferPoolConfigValidateParams ,
#if defined(ENABLE_OVERLOADING)
BufferPoolGetConfigMethodInfo ,
#endif
bufferPoolGetConfig ,
#if defined(ENABLE_OVERLOADING)
BufferPoolGetOptionsMethodInfo ,
#endif
bufferPoolGetOptions ,
#if defined(ENABLE_OVERLOADING)
BufferPoolHasOptionMethodInfo ,
#endif
bufferPoolHasOption ,
#if defined(ENABLE_OVERLOADING)
BufferPoolIsActiveMethodInfo ,
#endif
bufferPoolIsActive ,
bufferPoolNew ,
#if defined(ENABLE_OVERLOADING)
BufferPoolReleaseBufferMethodInfo ,
#endif
bufferPoolReleaseBuffer ,
#if defined(ENABLE_OVERLOADING)
BufferPoolSetActiveMethodInfo ,
#endif
bufferPoolSetActive ,
#if defined(ENABLE_OVERLOADING)
BufferPoolSetConfigMethodInfo ,
#endif
bufferPoolSetConfig ,
#if defined(ENABLE_OVERLOADING)
BufferPoolSetFlushingMethodInfo ,
#endif
bufferPoolSetFlushing ,
) 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.ManagedPtr as B.ManagedPtr
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 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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Objects.Allocator as Gst.Allocator
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Structs.AllocationParams as Gst.AllocationParams
import {-# SOURCE #-} qualified GI.Gst.Structs.Buffer as Gst.Buffer
import {-# SOURCE #-} qualified GI.Gst.Structs.BufferPoolAcquireParams as Gst.BufferPoolAcquireParams
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.Structure as Gst.Structure
newtype BufferPool = BufferPool (ManagedPtr BufferPool)
deriving (BufferPool -> BufferPool -> Bool
(BufferPool -> BufferPool -> Bool)
-> (BufferPool -> BufferPool -> Bool) -> Eq BufferPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferPool -> BufferPool -> Bool
$c/= :: BufferPool -> BufferPool -> Bool
== :: BufferPool -> BufferPool -> Bool
$c== :: BufferPool -> BufferPool -> Bool
Eq)
foreign import ccall "gst_buffer_pool_get_type"
c_gst_buffer_pool_get_type :: IO GType
instance GObject BufferPool where
gobjectType :: IO GType
gobjectType = IO GType
c_gst_buffer_pool_get_type
instance B.GValue.IsGValue BufferPool where
toGValue :: BufferPool -> IO GValue
toGValue o :: BufferPool
o = do
GType
gtype <- IO GType
c_gst_buffer_pool_get_type
BufferPool -> (Ptr BufferPool -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BufferPool
o (GType
-> (GValue -> Ptr BufferPool -> IO ())
-> Ptr BufferPool
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr BufferPool -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO BufferPool
fromGValue gv :: GValue
gv = do
Ptr BufferPool
ptr <- GValue -> IO (Ptr BufferPool)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr BufferPool)
(ManagedPtr BufferPool -> BufferPool)
-> Ptr BufferPool -> IO BufferPool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr BufferPool -> BufferPool
BufferPool Ptr BufferPool
ptr
class (GObject o, O.IsDescendantOf BufferPool o) => IsBufferPool o
instance (GObject o, O.IsDescendantOf BufferPool o) => IsBufferPool o
instance O.HasParentTypes BufferPool
type instance O.ParentTypes BufferPool = '[Gst.Object.Object, GObject.Object.Object]
toBufferPool :: (MonadIO m, IsBufferPool o) => o -> m BufferPool
toBufferPool :: o -> m BufferPool
toBufferPool = IO BufferPool -> m BufferPool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferPool -> m BufferPool)
-> (o -> IO BufferPool) -> o -> m BufferPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr BufferPool -> BufferPool) -> o -> IO BufferPool
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr BufferPool -> BufferPool
BufferPool
noBufferPool :: Maybe BufferPool
noBufferPool :: Maybe BufferPool
noBufferPool = Maybe BufferPool
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveBufferPoolMethod (t :: Symbol) (o :: *) :: * where
ResolveBufferPoolMethod "acquireBuffer" o = BufferPoolAcquireBufferMethodInfo
ResolveBufferPoolMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveBufferPoolMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBufferPoolMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBufferPoolMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveBufferPoolMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBufferPoolMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBufferPoolMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBufferPoolMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveBufferPoolMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveBufferPoolMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveBufferPoolMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveBufferPoolMethod "hasOption" o = BufferPoolHasOptionMethodInfo
ResolveBufferPoolMethod "isActive" o = BufferPoolIsActiveMethodInfo
ResolveBufferPoolMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBufferPoolMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBufferPoolMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBufferPoolMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveBufferPoolMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBufferPoolMethod "releaseBuffer" o = BufferPoolReleaseBufferMethodInfo
ResolveBufferPoolMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveBufferPoolMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBufferPoolMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBufferPoolMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBufferPoolMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveBufferPoolMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveBufferPoolMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBufferPoolMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveBufferPoolMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveBufferPoolMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBufferPoolMethod "getConfig" o = BufferPoolGetConfigMethodInfo
ResolveBufferPoolMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveBufferPoolMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveBufferPoolMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBufferPoolMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveBufferPoolMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveBufferPoolMethod "getOptions" o = BufferPoolGetOptionsMethodInfo
ResolveBufferPoolMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveBufferPoolMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveBufferPoolMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBufferPoolMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBufferPoolMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveBufferPoolMethod "setActive" o = BufferPoolSetActiveMethodInfo
ResolveBufferPoolMethod "setConfig" o = BufferPoolSetConfigMethodInfo
ResolveBufferPoolMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveBufferPoolMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveBufferPoolMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveBufferPoolMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBufferPoolMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBufferPoolMethod "setFlushing" o = BufferPoolSetFlushingMethodInfo
ResolveBufferPoolMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveBufferPoolMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveBufferPoolMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBufferPoolMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBufferPoolMethod t BufferPool, O.MethodInfo info BufferPool p) => OL.IsLabel t (BufferPool -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BufferPool
type instance O.AttributeList BufferPool = BufferPoolAttributeList
type BufferPoolAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList BufferPool = BufferPoolSignalList
type BufferPoolSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_buffer_pool_new" gst_buffer_pool_new ::
IO (Ptr BufferPool)
bufferPoolNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m BufferPool
bufferPoolNew :: m BufferPool
bufferPoolNew = IO BufferPool -> m BufferPool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferPool -> m BufferPool) -> IO BufferPool -> m BufferPool
forall a b. (a -> b) -> a -> b
$ do
Ptr BufferPool
result <- IO (Ptr BufferPool)
gst_buffer_pool_new
Text -> Ptr BufferPool -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "bufferPoolNew" Ptr BufferPool
result
BufferPool
result' <- ((ManagedPtr BufferPool -> BufferPool)
-> Ptr BufferPool -> IO BufferPool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr BufferPool -> BufferPool
BufferPool) Ptr BufferPool
result
BufferPool -> IO BufferPool
forall (m :: * -> *) a. Monad m => a -> m a
return BufferPool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_acquire_buffer" gst_buffer_pool_acquire_buffer ::
Ptr BufferPool ->
Ptr (Ptr Gst.Buffer.Buffer) ->
Ptr Gst.BufferPoolAcquireParams.BufferPoolAcquireParams ->
IO CInt
bufferPoolAcquireBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> Maybe (Gst.BufferPoolAcquireParams.BufferPoolAcquireParams)
-> m ((Gst.Enums.FlowReturn, Gst.Buffer.Buffer))
bufferPoolAcquireBuffer :: a -> Maybe BufferPoolAcquireParams -> m (FlowReturn, Buffer)
bufferPoolAcquireBuffer pool :: a
pool params :: Maybe BufferPoolAcquireParams
params = IO (FlowReturn, Buffer) -> m (FlowReturn, Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (FlowReturn, Buffer) -> m (FlowReturn, Buffer))
-> IO (FlowReturn, Buffer) -> m (FlowReturn, Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
Ptr (Ptr Buffer)
buffer <- IO (Ptr (Ptr Buffer))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
Ptr BufferPoolAcquireParams
maybeParams <- case Maybe BufferPoolAcquireParams
params of
Nothing -> Ptr BufferPoolAcquireParams -> IO (Ptr BufferPoolAcquireParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BufferPoolAcquireParams
forall a. Ptr a
nullPtr
Just jParams :: BufferPoolAcquireParams
jParams -> do
Ptr BufferPoolAcquireParams
jParams' <- BufferPoolAcquireParams -> IO (Ptr BufferPoolAcquireParams)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferPoolAcquireParams
jParams
Ptr BufferPoolAcquireParams -> IO (Ptr BufferPoolAcquireParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BufferPoolAcquireParams
jParams'
CInt
result <- Ptr BufferPool
-> Ptr (Ptr Buffer) -> Ptr BufferPoolAcquireParams -> IO CInt
gst_buffer_pool_acquire_buffer Ptr BufferPool
pool' Ptr (Ptr Buffer)
buffer Ptr BufferPoolAcquireParams
maybeParams
let result' :: FlowReturn
result' = (Int -> FlowReturn
forall a. Enum a => Int -> a
toEnum (Int -> FlowReturn) -> (CInt -> Int) -> CInt -> FlowReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
Ptr Buffer
buffer' <- Ptr (Ptr Buffer) -> IO (Ptr Buffer)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Buffer)
buffer
Buffer
buffer'' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer) Ptr Buffer
buffer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Maybe BufferPoolAcquireParams
-> (BufferPoolAcquireParams -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe BufferPoolAcquireParams
params BufferPoolAcquireParams -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (Ptr Buffer) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Buffer)
buffer
(FlowReturn, Buffer) -> IO (FlowReturn, Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return (FlowReturn
result', Buffer
buffer'')
#if defined(ENABLE_OVERLOADING)
data BufferPoolAcquireBufferMethodInfo
instance (signature ~ (Maybe (Gst.BufferPoolAcquireParams.BufferPoolAcquireParams) -> m ((Gst.Enums.FlowReturn, Gst.Buffer.Buffer))), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolAcquireBufferMethodInfo a signature where
overloadedMethod = bufferPoolAcquireBuffer
#endif
foreign import ccall "gst_buffer_pool_get_config" gst_buffer_pool_get_config ::
Ptr BufferPool ->
IO (Ptr Gst.Structure.Structure)
bufferPoolGetConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> m Gst.Structure.Structure
bufferPoolGetConfig :: a -> m Structure
bufferPoolGetConfig pool :: a
pool = IO Structure -> m Structure
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Structure -> m Structure) -> IO Structure -> m Structure
forall a b. (a -> b) -> a -> b
$ do
Ptr BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
Ptr Structure
result <- Ptr BufferPool -> IO (Ptr Structure)
gst_buffer_pool_get_config Ptr BufferPool
pool'
Text -> Ptr Structure -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "bufferPoolGetConfig" Ptr Structure
result
Structure
result' <- ((ManagedPtr Structure -> Structure)
-> Ptr Structure -> IO Structure
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Structure -> Structure
Gst.Structure.Structure) Ptr Structure
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Structure -> IO Structure
forall (m :: * -> *) a. Monad m => a -> m a
return Structure
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolGetConfigMethodInfo
instance (signature ~ (m Gst.Structure.Structure), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolGetConfigMethodInfo a signature where
overloadedMethod = bufferPoolGetConfig
#endif
foreign import ccall "gst_buffer_pool_get_options" gst_buffer_pool_get_options ::
Ptr BufferPool ->
IO (Ptr CString)
bufferPoolGetOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> m [T.Text]
bufferPoolGetOptions :: a -> m [Text]
bufferPoolGetOptions pool :: a
pool = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
Ptr CString
result <- Ptr BufferPool -> IO (Ptr CString)
gst_buffer_pool_get_options Ptr BufferPool
pool'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "bufferPoolGetOptions" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolGetOptionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolGetOptionsMethodInfo a signature where
overloadedMethod = bufferPoolGetOptions
#endif
foreign import ccall "gst_buffer_pool_has_option" gst_buffer_pool_has_option ::
Ptr BufferPool ->
CString ->
IO CInt
bufferPoolHasOption ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> T.Text
-> m Bool
bufferPoolHasOption :: a -> Text -> m Bool
bufferPoolHasOption pool :: a
pool option :: Text
option = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
CString
option' <- Text -> IO CString
textToCString Text
option
CInt
result <- Ptr BufferPool -> CString -> IO CInt
gst_buffer_pool_has_option Ptr BufferPool
pool' CString
option'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolHasOptionMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolHasOptionMethodInfo a signature where
overloadedMethod = bufferPoolHasOption
#endif
foreign import ccall "gst_buffer_pool_is_active" gst_buffer_pool_is_active ::
Ptr BufferPool ->
IO CInt
bufferPoolIsActive ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> m Bool
bufferPoolIsActive :: a -> m Bool
bufferPoolIsActive pool :: a
pool = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
CInt
result <- Ptr BufferPool -> IO CInt
gst_buffer_pool_is_active Ptr BufferPool
pool'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolIsActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolIsActiveMethodInfo a signature where
overloadedMethod = bufferPoolIsActive
#endif
foreign import ccall "gst_buffer_pool_release_buffer" gst_buffer_pool_release_buffer ::
Ptr BufferPool ->
Ptr Gst.Buffer.Buffer ->
IO ()
bufferPoolReleaseBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> Gst.Buffer.Buffer
-> m ()
bufferPoolReleaseBuffer :: a -> Buffer -> m ()
bufferPoolReleaseBuffer pool :: a
pool buffer :: Buffer
buffer = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Buffer
buffer
Ptr BufferPool -> Ptr Buffer -> IO ()
gst_buffer_pool_release_buffer Ptr BufferPool
pool' Ptr Buffer
buffer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BufferPoolReleaseBufferMethodInfo
instance (signature ~ (Gst.Buffer.Buffer -> m ()), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolReleaseBufferMethodInfo a signature where
overloadedMethod = bufferPoolReleaseBuffer
#endif
foreign import ccall "gst_buffer_pool_set_active" gst_buffer_pool_set_active ::
Ptr BufferPool ->
CInt ->
IO CInt
bufferPoolSetActive ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> Bool
-> m Bool
bufferPoolSetActive :: a -> Bool -> m Bool
bufferPoolSetActive pool :: a
pool active :: Bool
active = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
let active' :: CInt
active' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
active
CInt
result <- Ptr BufferPool -> CInt -> IO CInt
gst_buffer_pool_set_active Ptr BufferPool
pool' CInt
active'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolSetActiveMethodInfo
instance (signature ~ (Bool -> m Bool), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolSetActiveMethodInfo a signature where
overloadedMethod = bufferPoolSetActive
#endif
foreign import ccall "gst_buffer_pool_set_config" gst_buffer_pool_set_config ::
Ptr BufferPool ->
Ptr Gst.Structure.Structure ->
IO CInt
bufferPoolSetConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> Gst.Structure.Structure
-> m Bool
bufferPoolSetConfig :: a -> Structure -> m Bool
bufferPoolSetConfig pool :: a
pool config :: Structure
config = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Structure
config
CInt
result <- Ptr BufferPool -> Ptr Structure -> IO CInt
gst_buffer_pool_set_config Ptr BufferPool
pool' Ptr Structure
config'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BufferPoolSetConfigMethodInfo
instance (signature ~ (Gst.Structure.Structure -> m Bool), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolSetConfigMethodInfo a signature where
overloadedMethod = bufferPoolSetConfig
#endif
foreign import ccall "gst_buffer_pool_set_flushing" gst_buffer_pool_set_flushing ::
Ptr BufferPool ->
CInt ->
IO ()
bufferPoolSetFlushing ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferPool a) =>
a
-> Bool
-> m ()
bufferPoolSetFlushing :: a -> Bool -> m ()
bufferPoolSetFlushing pool :: a
pool flushing :: Bool
flushing = 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 BufferPool
pool' <- a -> IO (Ptr BufferPool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pool
let flushing' :: CInt
flushing' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
flushing
Ptr BufferPool -> CInt -> IO ()
gst_buffer_pool_set_flushing Ptr BufferPool
pool' CInt
flushing'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pool
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BufferPoolSetFlushingMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBufferPool a) => O.MethodInfo BufferPoolSetFlushingMethodInfo a signature where
overloadedMethod = bufferPoolSetFlushing
#endif
foreign import ccall "gst_buffer_pool_config_add_option" gst_buffer_pool_config_add_option ::
Ptr Gst.Structure.Structure ->
CString ->
IO ()
bufferPoolConfigAddOption ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> T.Text
-> m ()
bufferPoolConfigAddOption :: Structure -> Text -> m ()
bufferPoolConfigAddOption config :: Structure
config option :: Text
option = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
CString
option' <- Text -> IO CString
textToCString Text
option
Ptr Structure -> CString -> IO ()
gst_buffer_pool_config_add_option Ptr Structure
config' CString
option'
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_get_allocator" gst_buffer_pool_config_get_allocator ::
Ptr Gst.Structure.Structure ->
Ptr (Ptr Gst.Allocator.Allocator) ->
Ptr Gst.AllocationParams.AllocationParams ->
IO CInt
bufferPoolConfigGetAllocator ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> m ((Bool, Gst.Allocator.Allocator, Gst.AllocationParams.AllocationParams))
bufferPoolConfigGetAllocator :: Structure -> m (Bool, Allocator, AllocationParams)
bufferPoolConfigGetAllocator config :: Structure
config = IO (Bool, Allocator, AllocationParams)
-> m (Bool, Allocator, AllocationParams)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Allocator, AllocationParams)
-> m (Bool, Allocator, AllocationParams))
-> IO (Bool, Allocator, AllocationParams)
-> m (Bool, Allocator, AllocationParams)
forall a b. (a -> b) -> a -> b
$ do
Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Ptr (Ptr Allocator)
allocator <- IO (Ptr (Ptr Allocator))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gst.Allocator.Allocator))
Ptr AllocationParams
params <- Int -> IO (Ptr AllocationParams)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 64 :: IO (Ptr Gst.AllocationParams.AllocationParams)
CInt
result <- Ptr Structure
-> Ptr (Ptr Allocator) -> Ptr AllocationParams -> IO CInt
gst_buffer_pool_config_get_allocator Ptr Structure
config' Ptr (Ptr Allocator)
allocator Ptr AllocationParams
params
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Ptr Allocator
allocator' <- Ptr (Ptr Allocator) -> IO (Ptr Allocator)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Allocator)
allocator
Allocator
allocator'' <- ((ManagedPtr Allocator -> Allocator)
-> Ptr Allocator -> IO Allocator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Allocator -> Allocator
Gst.Allocator.Allocator) Ptr Allocator
allocator'
AllocationParams
params' <- ((ManagedPtr AllocationParams -> AllocationParams)
-> Ptr AllocationParams -> IO AllocationParams
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AllocationParams -> AllocationParams
Gst.AllocationParams.AllocationParams) Ptr AllocationParams
params
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Ptr (Ptr Allocator) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Allocator)
allocator
(Bool, Allocator, AllocationParams)
-> IO (Bool, Allocator, AllocationParams)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Allocator
allocator'', AllocationParams
params')
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_get_option" gst_buffer_pool_config_get_option ::
Ptr Gst.Structure.Structure ->
Word32 ->
IO CString
bufferPoolConfigGetOption ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> Word32
-> m T.Text
bufferPoolConfigGetOption :: Structure -> Word32 -> m Text
bufferPoolConfigGetOption config :: Structure
config index :: Word32
index = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
CString
result <- Ptr Structure -> Word32 -> IO CString
gst_buffer_pool_config_get_option Ptr Structure
config' Word32
index
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "bufferPoolConfigGetOption" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_get_params" gst_buffer_pool_config_get_params ::
Ptr Gst.Structure.Structure ->
Ptr (Ptr Gst.Caps.Caps) ->
Ptr Word32 ->
Ptr Word32 ->
Ptr Word32 ->
IO CInt
bufferPoolConfigGetParams ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> m ((Bool, Gst.Caps.Caps, Word32, Word32, Word32))
bufferPoolConfigGetParams :: Structure -> m (Bool, Caps, Word32, Word32, Word32)
bufferPoolConfigGetParams config :: Structure
config = IO (Bool, Caps, Word32, Word32, Word32)
-> m (Bool, Caps, Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Caps, Word32, Word32, Word32)
-> m (Bool, Caps, Word32, Word32, Word32))
-> IO (Bool, Caps, Word32, Word32, Word32)
-> m (Bool, Caps, Word32, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Ptr (Ptr Caps)
caps <- IO (Ptr (Ptr Caps))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gst.Caps.Caps))
Ptr Word32
size <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Word32
minBuffers <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Word32
maxBuffers <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Structure
-> Ptr (Ptr Caps)
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> IO CInt
gst_buffer_pool_config_get_params Ptr Structure
config' Ptr (Ptr Caps)
caps Ptr Word32
size Ptr Word32
minBuffers Ptr Word32
maxBuffers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Ptr Caps
caps' <- Ptr (Ptr Caps) -> IO (Ptr Caps)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Caps)
caps
Caps
caps'' <- ((ManagedPtr Caps -> Caps) -> Ptr Caps -> IO Caps
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Caps -> Caps
Gst.Caps.Caps) Ptr Caps
caps'
Word32
size' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
size
Word32
minBuffers' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
minBuffers
Word32
maxBuffers' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
maxBuffers
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Ptr (Ptr Caps) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Caps)
caps
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
size
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
minBuffers
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
maxBuffers
(Bool, Caps, Word32, Word32, Word32)
-> IO (Bool, Caps, Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Caps
caps'', Word32
size', Word32
minBuffers', Word32
maxBuffers')
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_has_option" gst_buffer_pool_config_has_option ::
Ptr Gst.Structure.Structure ->
CString ->
IO CInt
bufferPoolConfigHasOption ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> T.Text
-> m Bool
bufferPoolConfigHasOption :: Structure -> Text -> m Bool
bufferPoolConfigHasOption config :: Structure
config option :: Text
option = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
CString
option' <- Text -> IO CString
textToCString Text
option
CInt
result <- Ptr Structure -> CString -> IO CInt
gst_buffer_pool_config_has_option Ptr Structure
config' CString
option'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_n_options" gst_buffer_pool_config_n_options ::
Ptr Gst.Structure.Structure ->
IO Word32
bufferPoolConfigNOptions ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> m Word32
bufferPoolConfigNOptions :: Structure -> m Word32
bufferPoolConfigNOptions config :: Structure
config = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Word32
result <- Ptr Structure -> IO Word32
gst_buffer_pool_config_n_options Ptr Structure
config'
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_set_allocator" gst_buffer_pool_config_set_allocator ::
Ptr Gst.Structure.Structure ->
Ptr Gst.Allocator.Allocator ->
Ptr Gst.AllocationParams.AllocationParams ->
IO ()
bufferPoolConfigSetAllocator ::
(B.CallStack.HasCallStack, MonadIO m, Gst.Allocator.IsAllocator a) =>
Gst.Structure.Structure
-> Maybe (a)
-> Maybe (Gst.AllocationParams.AllocationParams)
-> m ()
bufferPoolConfigSetAllocator :: Structure -> Maybe a -> Maybe AllocationParams -> m ()
bufferPoolConfigSetAllocator config :: Structure
config allocator :: Maybe a
allocator params :: Maybe AllocationParams
params = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Ptr Allocator
maybeAllocator <- case Maybe a
allocator of
Nothing -> Ptr Allocator -> IO (Ptr Allocator)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Allocator
forall a. Ptr a
nullPtr
Just jAllocator :: a
jAllocator -> do
Ptr Allocator
jAllocator' <- a -> IO (Ptr Allocator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jAllocator
Ptr Allocator -> IO (Ptr Allocator)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Allocator
jAllocator'
Ptr AllocationParams
maybeParams <- case Maybe AllocationParams
params of
Nothing -> Ptr AllocationParams -> IO (Ptr AllocationParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AllocationParams
forall a. Ptr a
nullPtr
Just jParams :: AllocationParams
jParams -> do
Ptr AllocationParams
jParams' <- AllocationParams -> IO (Ptr AllocationParams)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AllocationParams
jParams
Ptr AllocationParams -> IO (Ptr AllocationParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AllocationParams
jParams'
Ptr Structure -> Ptr Allocator -> Ptr AllocationParams -> IO ()
gst_buffer_pool_config_set_allocator Ptr Structure
config' Ptr Allocator
maybeAllocator Ptr AllocationParams
maybeParams
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
allocator a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe AllocationParams -> (AllocationParams -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe AllocationParams
params AllocationParams -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_set_params" gst_buffer_pool_config_set_params ::
Ptr Gst.Structure.Structure ->
Ptr Gst.Caps.Caps ->
Word32 ->
Word32 ->
Word32 ->
IO ()
bufferPoolConfigSetParams ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> Gst.Caps.Caps
-> Word32
-> Word32
-> Word32
-> m ()
bufferPoolConfigSetParams :: Structure -> Caps -> Word32 -> Word32 -> Word32 -> m ()
bufferPoolConfigSetParams config :: Structure
config caps :: Caps
caps size :: Word32
size minBuffers :: Word32
minBuffers maxBuffers :: Word32
maxBuffers = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
Ptr Structure -> Ptr Caps -> Word32 -> Word32 -> Word32 -> IO ()
gst_buffer_pool_config_set_params Ptr Structure
config' Ptr Caps
caps' Word32
size Word32
minBuffers Word32
maxBuffers
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_buffer_pool_config_validate_params" gst_buffer_pool_config_validate_params ::
Ptr Gst.Structure.Structure ->
Ptr Gst.Caps.Caps ->
Word32 ->
Word32 ->
Word32 ->
IO CInt
bufferPoolConfigValidateParams ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gst.Structure.Structure
-> Gst.Caps.Caps
-> Word32
-> Word32
-> Word32
-> m Bool
bufferPoolConfigValidateParams :: Structure -> Caps -> Word32 -> Word32 -> Word32 -> m Bool
bufferPoolConfigValidateParams config :: Structure
config caps :: Caps
caps size :: Word32
size minBuffers :: Word32
minBuffers maxBuffers :: Word32
maxBuffers = 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 Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
CInt
result <- Ptr Structure -> Ptr Caps -> Word32 -> Word32 -> Word32 -> IO CInt
gst_buffer_pool_config_validate_params Ptr Structure
config' Ptr Caps
caps' Word32
size Word32
minBuffers Word32
maxBuffers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif