{-# 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 ,
#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.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.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
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 (SP.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)
instance SP.ManagedPtrNewtype BufferPool where
toManagedPtr :: BufferPool -> ManagedPtr BufferPool
toManagedPtr (BufferPool ManagedPtr BufferPool
p) = ManagedPtr BufferPool
p
foreign import ccall "gst_buffer_pool_get_type"
c_gst_buffer_pool_get_type :: IO B.Types.GType
instance B.Types.TypedObject BufferPool where
glibType :: IO GType
glibType = IO GType
c_gst_buffer_pool_get_type
instance B.Types.GObject BufferPool
class (SP.GObject o, O.IsDescendantOf BufferPool o) => IsBufferPool o
instance (SP.GObject o, O.IsDescendantOf BufferPool o) => IsBufferPool o
instance O.HasParentTypes BufferPool
type instance O.ParentTypes BufferPool = '[Gst.Object.Object, GObject.Object.Object]
toBufferPool :: (MIO.MonadIO m, IsBufferPool o) => o -> m BufferPool
toBufferPool :: forall (m :: * -> *) o.
(MonadIO m, IsBufferPool o) =>
o -> m BufferPool
toBufferPool = IO BufferPool -> m BufferPool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr BufferPool -> BufferPool
BufferPool
instance B.GValue.IsGValue (Maybe BufferPool) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_buffer_pool_get_type
gvalueSet_ :: Ptr GValue -> Maybe BufferPool -> IO ()
gvalueSet_ Ptr GValue
gv Maybe BufferPool
P.Nothing = Ptr GValue -> Ptr BufferPool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr BufferPool
forall a. Ptr a
FP.nullPtr :: FP.Ptr BufferPool)
gvalueSet_ Ptr GValue
gv (P.Just BufferPool
obj) = BufferPool -> (Ptr BufferPool -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BufferPool
obj (Ptr GValue -> Ptr BufferPool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe BufferPool)
gvalueGet_ Ptr GValue
gv = do
Ptr BufferPool
ptr <- Ptr GValue -> IO (Ptr BufferPool)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr BufferPool)
if Ptr BufferPool
ptr Ptr BufferPool -> Ptr BufferPool -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr BufferPool
forall a. Ptr a
FP.nullPtr
then BufferPool -> Maybe BufferPool
forall a. a -> Maybe a
P.Just (BufferPool -> Maybe BufferPool)
-> IO BufferPool -> IO (Maybe BufferPool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
else Maybe BufferPool -> IO (Maybe BufferPool)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe BufferPool
forall a. Maybe a
P.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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveBufferPoolMethod t BufferPool, O.OverloadedMethod info BufferPool p, R.HasField t BufferPool p) => R.HasField t BufferPool p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBufferPoolMethod t BufferPool, O.OverloadedMethodInfo info BufferPool) => OL.IsLabel t (O.MethodProxy info BufferPool) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => 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 Text
"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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Maybe BufferPoolAcquireParams -> m (FlowReturn, Buffer)
bufferPoolAcquireBuffer a
pool 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)
callocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
Ptr BufferPoolAcquireParams
maybeParams <- case Maybe BufferPoolAcquireParams
params of
Maybe BufferPoolAcquireParams
Nothing -> Ptr BufferPoolAcquireParams -> IO (Ptr BufferPoolAcquireParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BufferPoolAcquireParams
forall a. Ptr a
nullPtr
Just 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, GBoxed 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.OverloadedMethod BufferPoolAcquireBufferMethodInfo a signature where
overloadedMethod = bufferPoolAcquireBuffer
instance O.OverloadedMethodInfo BufferPoolAcquireBufferMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolAcquireBuffer",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> m Structure
bufferPoolGetConfig 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 Text
"bufferPoolGetConfig" Ptr Structure
result
Structure
result' <- ((ManagedPtr Structure -> Structure)
-> Ptr Structure -> IO Structure
forall a.
(HasCallStack, GBoxed 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.OverloadedMethod BufferPoolGetConfigMethodInfo a signature where
overloadedMethod = bufferPoolGetConfig
instance O.OverloadedMethodInfo BufferPoolGetConfigMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolGetConfig",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> m [Text]
bufferPoolGetOptions 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 Text
"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.OverloadedMethod BufferPoolGetOptionsMethodInfo a signature where
overloadedMethod = bufferPoolGetOptions
instance O.OverloadedMethodInfo BufferPoolGetOptionsMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolGetOptions",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Text -> m Bool
bufferPoolHasOption a
pool 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
/= CInt
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.OverloadedMethod BufferPoolHasOptionMethodInfo a signature where
overloadedMethod = bufferPoolHasOption
instance O.OverloadedMethodInfo BufferPoolHasOptionMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolHasOption",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> m Bool
bufferPoolIsActive 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
/= CInt
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.OverloadedMethod BufferPoolIsActiveMethodInfo a signature where
overloadedMethod = bufferPoolIsActive
instance O.OverloadedMethodInfo BufferPoolIsActiveMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolIsActive",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Buffer -> m ()
bufferPoolReleaseBuffer a
pool 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, GBoxed 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.OverloadedMethod BufferPoolReleaseBufferMethodInfo a signature where
overloadedMethod = bufferPoolReleaseBuffer
instance O.OverloadedMethodInfo BufferPoolReleaseBufferMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolReleaseBuffer",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Bool -> m Bool
bufferPoolSetActive a
pool 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
/= CInt
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.OverloadedMethod BufferPoolSetActiveMethodInfo a signature where
overloadedMethod = bufferPoolSetActive
instance O.OverloadedMethodInfo BufferPoolSetActiveMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolSetActive",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Structure -> m Bool
bufferPoolSetConfig a
pool 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, GBoxed 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
/= CInt
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.OverloadedMethod BufferPoolSetConfigMethodInfo a signature where
overloadedMethod = bufferPoolSetConfig
instance O.OverloadedMethodInfo BufferPoolSetConfigMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolSetConfig",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBufferPool a) =>
a -> Bool -> m ()
bufferPoolSetFlushing a
pool 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.OverloadedMethod BufferPoolSetFlushingMethodInfo a signature where
overloadedMethod = bufferPoolSetFlushing
instance O.OverloadedMethodInfo BufferPoolSetFlushingMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gst.Objects.BufferPool.bufferPoolSetFlushing",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-BufferPool.html#v: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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> Text -> m ()
bufferPoolConfigAddOption Structure
config 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, Maybe Gst.Allocator.Allocator, Gst.AllocationParams.AllocationParams))
bufferPoolConfigGetAllocator :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> m (Bool, Maybe Allocator, AllocationParams)
bufferPoolConfigGetAllocator Structure
config = IO (Bool, Maybe Allocator, AllocationParams)
-> m (Bool, Maybe Allocator, AllocationParams)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Maybe Allocator, AllocationParams)
-> m (Bool, Maybe Allocator, AllocationParams))
-> IO (Bool, Maybe Allocator, AllocationParams)
-> m (Bool, Maybe 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)
callocMem :: IO (Ptr (Ptr Gst.Allocator.Allocator))
Ptr AllocationParams
params <- Int -> IO (Ptr AllocationParams)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
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
/= CInt
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
Maybe Allocator
maybeAllocator' <- Ptr Allocator
-> (Ptr Allocator -> IO Allocator) -> IO (Maybe Allocator)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Allocator
allocator' ((Ptr Allocator -> IO Allocator) -> IO (Maybe Allocator))
-> (Ptr Allocator -> IO Allocator) -> IO (Maybe Allocator)
forall a b. (a -> b) -> a -> b
$ \Ptr Allocator
allocator'' -> do
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''
Allocator -> IO Allocator
forall (m :: * -> *) a. Monad m => a -> m a
return Allocator
allocator'''
AllocationParams
params' <- ((ManagedPtr AllocationParams -> AllocationParams)
-> Ptr AllocationParams -> IO AllocationParams
forall a.
(HasCallStack, GBoxed 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, Maybe Allocator, AllocationParams)
-> IO (Bool, Maybe Allocator, AllocationParams)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Maybe Allocator
maybeAllocator', 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 (Maybe T.Text)
bufferPoolConfigGetOption :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> Word32 -> m (Maybe Text)
bufferPoolConfigGetOption Structure
config Word32
index = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe 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
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#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, Maybe Gst.Caps.Caps, Word32, Word32, Word32))
bufferPoolConfigGetParams :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> m (Bool, Maybe Caps, Word32, Word32, Word32)
bufferPoolConfigGetParams Structure
config = IO (Bool, Maybe Caps, Word32, Word32, Word32)
-> m (Bool, Maybe Caps, Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Maybe Caps, Word32, Word32, Word32)
-> m (Bool, Maybe Caps, Word32, Word32, Word32))
-> IO (Bool, Maybe Caps, Word32, Word32, Word32)
-> m (Bool, Maybe 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)
callocMem :: 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
/= CInt
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
Maybe Caps
maybeCaps' <- Ptr Caps -> (Ptr Caps -> IO Caps) -> IO (Maybe Caps)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Caps
caps' ((Ptr Caps -> IO Caps) -> IO (Maybe Caps))
-> (Ptr Caps -> IO Caps) -> IO (Maybe Caps)
forall a b. (a -> b) -> a -> b
$ \Ptr Caps
caps'' -> do
Caps
caps''' <- ((ManagedPtr Caps -> Caps) -> Ptr Caps -> IO Caps
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Caps -> Caps
Gst.Caps.Caps) Ptr Caps
caps''
Caps -> IO Caps
forall (m :: * -> *) a. Monad m => a -> m a
return 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, Maybe Caps, Word32, Word32, Word32)
-> IO (Bool, Maybe Caps, Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Maybe Caps
maybeCaps', 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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> Text -> m Bool
bufferPoolConfigHasOption Structure
config 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
/= CInt
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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> m Word32
bufferPoolConfigNOptions 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAllocator a) =>
Structure -> Maybe a -> Maybe AllocationParams -> m ()
bufferPoolConfigSetAllocator Structure
config Maybe a
allocator 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
Maybe a
Nothing -> Ptr Allocator -> IO (Ptr Allocator)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Allocator
forall a. Ptr a
nullPtr
Just 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
Maybe AllocationParams
Nothing -> Ptr AllocationParams -> IO (Ptr AllocationParams)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AllocationParams
forall a. Ptr a
nullPtr
Just 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
-> Maybe (Gst.Caps.Caps)
-> Word32
-> Word32
-> Word32
-> m ()
bufferPoolConfigSetParams :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> Maybe Caps -> Word32 -> Word32 -> Word32 -> m ()
bufferPoolConfigSetParams Structure
config Maybe Caps
caps Word32
size Word32
minBuffers 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
maybeCaps <- case Maybe Caps
caps of
Maybe Caps
Nothing -> Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
forall a. Ptr a
nullPtr
Just Caps
jCaps -> do
Ptr Caps
jCaps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
jCaps
Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
jCaps'
Ptr Structure -> Ptr Caps -> Word32 -> Word32 -> Word32 -> IO ()
gst_buffer_pool_config_set_params Ptr Structure
config' Ptr Caps
maybeCaps Word32
size Word32
minBuffers Word32
maxBuffers
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Maybe Caps -> (Caps -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Caps
caps Caps -> 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_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
-> Maybe (Gst.Caps.Caps)
-> Word32
-> Word32
-> Word32
-> m Bool
bufferPoolConfigValidateParams :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> Maybe Caps -> Word32 -> Word32 -> Word32 -> m Bool
bufferPoolConfigValidateParams Structure
config Maybe Caps
caps Word32
size Word32
minBuffers 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
maybeCaps <- case Maybe Caps
caps of
Maybe Caps
Nothing -> Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
forall a. Ptr a
nullPtr
Just Caps
jCaps -> do
Ptr Caps
jCaps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
jCaps
Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
jCaps'
CInt
result <- Ptr Structure -> Ptr Caps -> Word32 -> Word32 -> Word32 -> IO CInt
gst_buffer_pool_config_validate_params Ptr Structure
config' Ptr Caps
maybeCaps Word32
size Word32
minBuffers Word32
maxBuffers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
Maybe Caps -> (Caps -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Caps
caps Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif