{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstBase.Objects.Adapter
(
Adapter(..) ,
IsAdapter ,
toAdapter ,
#if defined(ENABLE_OVERLOADING)
ResolveAdapterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AdapterAvailableMethodInfo ,
#endif
adapterAvailable ,
#if defined(ENABLE_OVERLOADING)
AdapterAvailableFastMethodInfo ,
#endif
adapterAvailableFast ,
#if defined(ENABLE_OVERLOADING)
AdapterClearMethodInfo ,
#endif
adapterClear ,
#if defined(ENABLE_OVERLOADING)
AdapterCopyMethodInfo ,
#endif
adapterCopy ,
#if defined(ENABLE_OVERLOADING)
AdapterDistanceFromDiscontMethodInfo ,
#endif
adapterDistanceFromDiscont ,
#if defined(ENABLE_OVERLOADING)
AdapterDtsAtDiscontMethodInfo ,
#endif
adapterDtsAtDiscont ,
#if defined(ENABLE_OVERLOADING)
AdapterFlushMethodInfo ,
#endif
adapterFlush ,
#if defined(ENABLE_OVERLOADING)
AdapterGetBufferMethodInfo ,
#endif
adapterGetBuffer ,
#if defined(ENABLE_OVERLOADING)
AdapterGetBufferFastMethodInfo ,
#endif
adapterGetBufferFast ,
#if defined(ENABLE_OVERLOADING)
AdapterGetBufferListMethodInfo ,
#endif
adapterGetBufferList ,
#if defined(ENABLE_OVERLOADING)
AdapterGetListMethodInfo ,
#endif
adapterGetList ,
#if defined(ENABLE_OVERLOADING)
AdapterMapMethodInfo ,
#endif
adapterMap ,
#if defined(ENABLE_OVERLOADING)
AdapterMaskedScanUint32MethodInfo ,
#endif
adapterMaskedScanUint32 ,
#if defined(ENABLE_OVERLOADING)
AdapterMaskedScanUint32PeekMethodInfo ,
#endif
adapterMaskedScanUint32Peek ,
adapterNew ,
#if defined(ENABLE_OVERLOADING)
AdapterOffsetAtDiscontMethodInfo ,
#endif
adapterOffsetAtDiscont ,
#if defined(ENABLE_OVERLOADING)
AdapterPrevDtsMethodInfo ,
#endif
adapterPrevDts ,
#if defined(ENABLE_OVERLOADING)
AdapterPrevDtsAtOffsetMethodInfo ,
#endif
adapterPrevDtsAtOffset ,
#if defined(ENABLE_OVERLOADING)
AdapterPrevOffsetMethodInfo ,
#endif
adapterPrevOffset ,
#if defined(ENABLE_OVERLOADING)
AdapterPrevPtsMethodInfo ,
#endif
adapterPrevPts ,
#if defined(ENABLE_OVERLOADING)
AdapterPrevPtsAtOffsetMethodInfo ,
#endif
adapterPrevPtsAtOffset ,
#if defined(ENABLE_OVERLOADING)
AdapterPtsAtDiscontMethodInfo ,
#endif
adapterPtsAtDiscont ,
#if defined(ENABLE_OVERLOADING)
AdapterPushMethodInfo ,
#endif
adapterPush ,
#if defined(ENABLE_OVERLOADING)
AdapterTakeMethodInfo ,
#endif
adapterTake ,
#if defined(ENABLE_OVERLOADING)
AdapterTakeBufferMethodInfo ,
#endif
adapterTakeBuffer ,
#if defined(ENABLE_OVERLOADING)
AdapterTakeBufferFastMethodInfo ,
#endif
adapterTakeBufferFast ,
#if defined(ENABLE_OVERLOADING)
AdapterTakeBufferListMethodInfo ,
#endif
adapterTakeBufferList ,
#if defined(ENABLE_OVERLOADING)
AdapterTakeListMethodInfo ,
#endif
adapterTakeList ,
#if defined(ENABLE_OVERLOADING)
AdapterUnmapMethodInfo ,
#endif
adapterUnmap ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Structs.Buffer as Gst.Buffer
import qualified GI.Gst.Structs.BufferList as Gst.BufferList
newtype Adapter = Adapter (SP.ManagedPtr Adapter)
deriving (Adapter -> Adapter -> Bool
(Adapter -> Adapter -> Bool)
-> (Adapter -> Adapter -> Bool) -> Eq Adapter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Adapter -> Adapter -> Bool
$c/= :: Adapter -> Adapter -> Bool
== :: Adapter -> Adapter -> Bool
$c== :: Adapter -> Adapter -> Bool
Eq)
instance SP.ManagedPtrNewtype Adapter where
toManagedPtr :: Adapter -> ManagedPtr Adapter
toManagedPtr (Adapter ManagedPtr Adapter
p) = ManagedPtr Adapter
p
foreign import ccall "gst_adapter_get_type"
c_gst_adapter_get_type :: IO B.Types.GType
instance B.Types.TypedObject Adapter where
glibType :: IO GType
glibType = IO GType
c_gst_adapter_get_type
instance B.Types.GObject Adapter
class (SP.GObject o, O.IsDescendantOf Adapter o) => IsAdapter o
instance (SP.GObject o, O.IsDescendantOf Adapter o) => IsAdapter o
instance O.HasParentTypes Adapter
type instance O.ParentTypes Adapter = '[GObject.Object.Object]
toAdapter :: (MIO.MonadIO m, IsAdapter o) => o -> m Adapter
toAdapter :: forall (m :: * -> *) o. (MonadIO m, IsAdapter o) => o -> m Adapter
toAdapter = IO Adapter -> m Adapter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Adapter -> m Adapter) -> (o -> IO Adapter) -> o -> m Adapter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Adapter -> Adapter) -> o -> IO Adapter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Adapter -> Adapter
Adapter
instance B.GValue.IsGValue (Maybe Adapter) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_adapter_get_type
gvalueSet_ :: Ptr GValue -> Maybe Adapter -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Adapter
P.Nothing = Ptr GValue -> Ptr Adapter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Adapter
forall a. Ptr a
FP.nullPtr :: FP.Ptr Adapter)
gvalueSet_ Ptr GValue
gv (P.Just Adapter
obj) = Adapter -> (Ptr Adapter -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Adapter
obj (Ptr GValue -> Ptr Adapter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Adapter)
gvalueGet_ Ptr GValue
gv = do
Ptr Adapter
ptr <- Ptr GValue -> IO (Ptr Adapter)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Adapter)
if Ptr Adapter
ptr Ptr Adapter -> Ptr Adapter -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Adapter
forall a. Ptr a
FP.nullPtr
then Adapter -> Maybe Adapter
forall a. a -> Maybe a
P.Just (Adapter -> Maybe Adapter) -> IO Adapter -> IO (Maybe Adapter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Adapter -> Adapter) -> Ptr Adapter -> IO Adapter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Adapter -> Adapter
Adapter Ptr Adapter
ptr
else Maybe Adapter -> IO (Maybe Adapter)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Adapter
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAdapterMethod (t :: Symbol) (o :: *) :: * where
ResolveAdapterMethod "available" o = AdapterAvailableMethodInfo
ResolveAdapterMethod "availableFast" o = AdapterAvailableFastMethodInfo
ResolveAdapterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAdapterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAdapterMethod "clear" o = AdapterClearMethodInfo
ResolveAdapterMethod "copy" o = AdapterCopyMethodInfo
ResolveAdapterMethod "distanceFromDiscont" o = AdapterDistanceFromDiscontMethodInfo
ResolveAdapterMethod "dtsAtDiscont" o = AdapterDtsAtDiscontMethodInfo
ResolveAdapterMethod "flush" o = AdapterFlushMethodInfo
ResolveAdapterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAdapterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAdapterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAdapterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAdapterMethod "map" o = AdapterMapMethodInfo
ResolveAdapterMethod "maskedScanUint32" o = AdapterMaskedScanUint32MethodInfo
ResolveAdapterMethod "maskedScanUint32Peek" o = AdapterMaskedScanUint32PeekMethodInfo
ResolveAdapterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAdapterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAdapterMethod "offsetAtDiscont" o = AdapterOffsetAtDiscontMethodInfo
ResolveAdapterMethod "prevDts" o = AdapterPrevDtsMethodInfo
ResolveAdapterMethod "prevDtsAtOffset" o = AdapterPrevDtsAtOffsetMethodInfo
ResolveAdapterMethod "prevOffset" o = AdapterPrevOffsetMethodInfo
ResolveAdapterMethod "prevPts" o = AdapterPrevPtsMethodInfo
ResolveAdapterMethod "prevPtsAtOffset" o = AdapterPrevPtsAtOffsetMethodInfo
ResolveAdapterMethod "ptsAtDiscont" o = AdapterPtsAtDiscontMethodInfo
ResolveAdapterMethod "push" o = AdapterPushMethodInfo
ResolveAdapterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAdapterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAdapterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAdapterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAdapterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAdapterMethod "take" o = AdapterTakeMethodInfo
ResolveAdapterMethod "takeBuffer" o = AdapterTakeBufferMethodInfo
ResolveAdapterMethod "takeBufferFast" o = AdapterTakeBufferFastMethodInfo
ResolveAdapterMethod "takeBufferList" o = AdapterTakeBufferListMethodInfo
ResolveAdapterMethod "takeList" o = AdapterTakeListMethodInfo
ResolveAdapterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAdapterMethod "unmap" o = AdapterUnmapMethodInfo
ResolveAdapterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAdapterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAdapterMethod "getBuffer" o = AdapterGetBufferMethodInfo
ResolveAdapterMethod "getBufferFast" o = AdapterGetBufferFastMethodInfo
ResolveAdapterMethod "getBufferList" o = AdapterGetBufferListMethodInfo
ResolveAdapterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAdapterMethod "getList" o = AdapterGetListMethodInfo
ResolveAdapterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAdapterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAdapterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAdapterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAdapterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAdapterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAdapterMethod t Adapter, O.OverloadedMethod info Adapter p) => OL.IsLabel t (Adapter -> 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 ~ ResolveAdapterMethod t Adapter, O.OverloadedMethod info Adapter p, R.HasField t Adapter p) => R.HasField t Adapter p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAdapterMethod t Adapter, O.OverloadedMethodInfo info Adapter) => OL.IsLabel t (O.MethodProxy info Adapter) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Adapter
type instance O.AttributeList Adapter = AdapterAttributeList
type AdapterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Adapter = AdapterSignalList
type AdapterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_adapter_new" gst_adapter_new ::
IO (Ptr Adapter)
adapterNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Adapter
adapterNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Adapter
adapterNew = IO Adapter -> m Adapter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Adapter -> m Adapter) -> IO Adapter -> m Adapter
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
result <- IO (Ptr Adapter)
gst_adapter_new
Text -> Ptr Adapter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"adapterNew" Ptr Adapter
result
Adapter
result' <- ((ManagedPtr Adapter -> Adapter) -> Ptr Adapter -> IO Adapter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Adapter -> Adapter
Adapter) Ptr Adapter
result
Adapter -> IO Adapter
forall (m :: * -> *) a. Monad m => a -> m a
return Adapter
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_adapter_available" gst_adapter_available ::
Ptr Adapter ->
IO Word64
adapterAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterAvailable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterAvailable a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_available Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterAvailableMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterAvailableMethodInfo a signature where
overloadedMethod = adapterAvailable
instance O.OverloadedMethodInfo AdapterAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterAvailable"
})
#endif
foreign import ccall "gst_adapter_available_fast" gst_adapter_available_fast ::
Ptr Adapter ->
IO Word64
adapterAvailableFast ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterAvailableFast :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterAvailableFast a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_available_fast Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterAvailableFastMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterAvailableFastMethodInfo a signature where
overloadedMethod = adapterAvailableFast
instance O.OverloadedMethodInfo AdapterAvailableFastMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterAvailableFast",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterAvailableFast"
})
#endif
foreign import ccall "gst_adapter_clear" gst_adapter_clear ::
Ptr Adapter ->
IO ()
adapterClear ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m ()
adapterClear :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m ()
adapterClear a
adapter = 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 Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Adapter -> IO ()
gst_adapter_clear Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AdapterClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterClearMethodInfo a signature where
overloadedMethod = adapterClear
instance O.OverloadedMethodInfo AdapterClearMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterClear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterClear"
})
#endif
foreign import ccall "gst_adapter_copy_bytes" gst_adapter_copy_bytes ::
Ptr Adapter ->
Word64 ->
Word64 ->
IO (Ptr GLib.Bytes.Bytes)
adapterCopy ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> Word64
-> m GLib.Bytes.Bytes
adapterCopy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> Word64 -> m Bytes
adapterCopy a
adapter Word64
offset Word64
size = IO Bytes -> m Bytes
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Bytes
result <- Ptr Adapter -> Word64 -> Word64 -> IO (Ptr Bytes)
gst_adapter_copy_bytes Ptr Adapter
adapter' Word64
offset Word64
size
Text -> Ptr Bytes -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"adapterCopy" Ptr Bytes
result
Bytes
result' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Bytes -> IO Bytes
forall (m :: * -> *) a. Monad m => a -> m a
return Bytes
result'
#if defined(ENABLE_OVERLOADING)
data AdapterCopyMethodInfo
instance (signature ~ (Word64 -> Word64 -> m GLib.Bytes.Bytes), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterCopyMethodInfo a signature where
overloadedMethod = adapterCopy
instance O.OverloadedMethodInfo AdapterCopyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterCopy"
})
#endif
foreign import ccall "gst_adapter_distance_from_discont" gst_adapter_distance_from_discont ::
Ptr Adapter ->
IO Word64
adapterDistanceFromDiscont ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterDistanceFromDiscont :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterDistanceFromDiscont a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_distance_from_discont Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterDistanceFromDiscontMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterDistanceFromDiscontMethodInfo a signature where
overloadedMethod = adapterDistanceFromDiscont
instance O.OverloadedMethodInfo AdapterDistanceFromDiscontMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterDistanceFromDiscont",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterDistanceFromDiscont"
})
#endif
foreign import ccall "gst_adapter_dts_at_discont" gst_adapter_dts_at_discont ::
Ptr Adapter ->
IO Word64
adapterDtsAtDiscont ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterDtsAtDiscont :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterDtsAtDiscont a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_dts_at_discont Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterDtsAtDiscontMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterDtsAtDiscontMethodInfo a signature where
overloadedMethod = adapterDtsAtDiscont
instance O.OverloadedMethodInfo AdapterDtsAtDiscontMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterDtsAtDiscont",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterDtsAtDiscont"
})
#endif
foreign import ccall "gst_adapter_flush" gst_adapter_flush ::
Ptr Adapter ->
Word64 ->
IO ()
adapterFlush ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m ()
adapterFlush :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m ()
adapterFlush a
adapter Word64
flush = 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 Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Adapter -> Word64 -> IO ()
gst_adapter_flush Ptr Adapter
adapter' Word64
flush
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AdapterFlushMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterFlushMethodInfo a signature where
overloadedMethod = adapterFlush
instance O.OverloadedMethodInfo AdapterFlushMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterFlush",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterFlush"
})
#endif
foreign import ccall "gst_adapter_get_buffer" gst_adapter_get_buffer ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.Buffer.Buffer)
adapterGetBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.Buffer.Buffer)
adapterGetBuffer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe Buffer)
adapterGetBuffer a
adapter Word64
nbytes = IO (Maybe Buffer) -> m (Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Buffer) -> m (Maybe Buffer))
-> IO (Maybe Buffer) -> m (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Buffer
result <- Ptr Adapter -> Word64 -> IO (Ptr Buffer)
gst_adapter_get_buffer Ptr Adapter
adapter' Word64
nbytes
Maybe Buffer
maybeResult <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
result ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
result' -> do
Buffer
result'' <- ((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
result'
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe Buffer -> IO (Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Buffer
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterGetBufferMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.Buffer.Buffer)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterGetBufferMethodInfo a signature where
overloadedMethod = adapterGetBuffer
instance O.OverloadedMethodInfo AdapterGetBufferMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterGetBuffer",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterGetBuffer"
})
#endif
foreign import ccall "gst_adapter_get_buffer_fast" gst_adapter_get_buffer_fast ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.Buffer.Buffer)
adapterGetBufferFast ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.Buffer.Buffer)
adapterGetBufferFast :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe Buffer)
adapterGetBufferFast a
adapter Word64
nbytes = IO (Maybe Buffer) -> m (Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Buffer) -> m (Maybe Buffer))
-> IO (Maybe Buffer) -> m (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Buffer
result <- Ptr Adapter -> Word64 -> IO (Ptr Buffer)
gst_adapter_get_buffer_fast Ptr Adapter
adapter' Word64
nbytes
Maybe Buffer
maybeResult <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
result ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
result' -> do
Buffer
result'' <- ((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
result'
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe Buffer -> IO (Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Buffer
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterGetBufferFastMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.Buffer.Buffer)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterGetBufferFastMethodInfo a signature where
overloadedMethod = adapterGetBufferFast
instance O.OverloadedMethodInfo AdapterGetBufferFastMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterGetBufferFast",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterGetBufferFast"
})
#endif
foreign import ccall "gst_adapter_get_buffer_list" gst_adapter_get_buffer_list ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.BufferList.BufferList)
adapterGetBufferList ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.BufferList.BufferList)
adapterGetBufferList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe BufferList)
adapterGetBufferList a
adapter Word64
nbytes = IO (Maybe BufferList) -> m (Maybe BufferList)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe BufferList) -> m (Maybe BufferList))
-> IO (Maybe BufferList) -> m (Maybe BufferList)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr BufferList
result <- Ptr Adapter -> Word64 -> IO (Ptr BufferList)
gst_adapter_get_buffer_list Ptr Adapter
adapter' Word64
nbytes
Maybe BufferList
maybeResult <- Ptr BufferList
-> (Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr BufferList
result ((Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList))
-> (Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList)
forall a b. (a -> b) -> a -> b
$ \Ptr BufferList
result' -> do
BufferList
result'' <- ((ManagedPtr BufferList -> BufferList)
-> Ptr BufferList -> IO BufferList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferList -> BufferList
Gst.BufferList.BufferList) Ptr BufferList
result'
BufferList -> IO BufferList
forall (m :: * -> *) a. Monad m => a -> m a
return BufferList
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe BufferList -> IO (Maybe BufferList)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe BufferList
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterGetBufferListMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.BufferList.BufferList)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterGetBufferListMethodInfo a signature where
overloadedMethod = adapterGetBufferList
instance O.OverloadedMethodInfo AdapterGetBufferListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterGetBufferList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterGetBufferList"
})
#endif
foreign import ccall "gst_adapter_get_list" gst_adapter_get_list ::
Ptr Adapter ->
Word64 ->
IO (Ptr (GList (Ptr Gst.Buffer.Buffer)))
adapterGetList ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m [Gst.Buffer.Buffer]
adapterGetList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m [Buffer]
adapterGetList a
adapter Word64
nbytes = IO [Buffer] -> m [Buffer]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Buffer] -> m [Buffer]) -> IO [Buffer] -> m [Buffer]
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr (GList (Ptr Buffer))
result <- Ptr Adapter -> Word64 -> IO (Ptr (GList (Ptr Buffer)))
gst_adapter_get_list Ptr Adapter
adapter' Word64
nbytes
[Ptr Buffer]
result' <- Ptr (GList (Ptr Buffer)) -> IO [Ptr Buffer]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Buffer))
result
[Buffer]
result'' <- (Ptr Buffer -> IO Buffer) -> [Ptr Buffer] -> IO [Buffer]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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]
result'
Ptr (GList (Ptr Buffer)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Buffer))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
[Buffer] -> IO [Buffer]
forall (m :: * -> *) a. Monad m => a -> m a
return [Buffer]
result''
#if defined(ENABLE_OVERLOADING)
data AdapterGetListMethodInfo
instance (signature ~ (Word64 -> m [Gst.Buffer.Buffer]), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterGetListMethodInfo a signature where
overloadedMethod = adapterGetList
instance O.OverloadedMethodInfo AdapterGetListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterGetList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterGetList"
})
#endif
foreign import ccall "gst_adapter_map" gst_adapter_map ::
Ptr Adapter ->
Ptr Word64 ->
IO (Ptr Word8)
adapterMap ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m (Maybe ByteString)
adapterMap :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m (Maybe ByteString)
adapterMap a
adapter = IO (Maybe ByteString) -> m (Maybe ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString) -> m (Maybe ByteString))
-> IO (Maybe ByteString) -> m (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
size <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word8
result <- Ptr Adapter -> Ptr Word64 -> IO (Ptr Word8)
gst_adapter_map Ptr Adapter
adapter' Ptr Word64
size
Word64
size' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
size
Maybe ByteString
maybeResult <- Ptr Word8 -> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Word8
result ((Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString))
-> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ \Ptr Word8
result' -> do
ByteString
result'' <- (Word64 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word64
size') Ptr Word8
result'
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
size
Maybe ByteString -> IO (Maybe ByteString)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ByteString
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterMapMethodInfo
instance (signature ~ (m (Maybe ByteString)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterMapMethodInfo a signature where
overloadedMethod = adapterMap
instance O.OverloadedMethodInfo AdapterMapMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterMap",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterMap"
})
#endif
foreign import ccall "gst_adapter_masked_scan_uint32" gst_adapter_masked_scan_uint32 ::
Ptr Adapter ->
Word32 ->
Word32 ->
Word64 ->
Word64 ->
IO Int64
adapterMaskedScanUint32 ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word32
-> Word32
-> Word64
-> Word64
-> m Int64
adapterMaskedScanUint32 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word32 -> Word32 -> Word64 -> Word64 -> m Int64
adapterMaskedScanUint32 a
adapter Word32
mask Word32
pattern Word64
offset Word64
size = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Int64
result <- Ptr Adapter -> Word32 -> Word32 -> Word64 -> Word64 -> IO Int64
gst_adapter_masked_scan_uint32 Ptr Adapter
adapter' Word32
mask Word32
pattern Word64
offset Word64
size
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result
#if defined(ENABLE_OVERLOADING)
data AdapterMaskedScanUint32MethodInfo
instance (signature ~ (Word32 -> Word32 -> Word64 -> Word64 -> m Int64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterMaskedScanUint32MethodInfo a signature where
overloadedMethod = adapterMaskedScanUint32
instance O.OverloadedMethodInfo AdapterMaskedScanUint32MethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterMaskedScanUint32",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterMaskedScanUint32"
})
#endif
foreign import ccall "gst_adapter_masked_scan_uint32_peek" gst_adapter_masked_scan_uint32_peek ::
Ptr Adapter ->
Word32 ->
Word32 ->
Word64 ->
Word64 ->
Ptr Word32 ->
IO Int64
adapterMaskedScanUint32Peek ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word32
-> Word32
-> Word64
-> Word64
-> m ((Int64, Word32))
adapterMaskedScanUint32Peek :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word32 -> Word32 -> Word64 -> Word64 -> m (Int64, Word32)
adapterMaskedScanUint32Peek a
adapter Word32
mask Word32
pattern Word64
offset Word64
size = IO (Int64, Word32) -> m (Int64, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int64, Word32) -> m (Int64, Word32))
-> IO (Int64, Word32) -> m (Int64, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word32
value <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Int64
result <- Ptr Adapter
-> Word32 -> Word32 -> Word64 -> Word64 -> Ptr Word32 -> IO Int64
gst_adapter_masked_scan_uint32_peek Ptr Adapter
adapter' Word32
mask Word32
pattern Word64
offset Word64
size Ptr Word32
value
Word32
value' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
value
(Int64, Word32) -> IO (Int64, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int64
result, Word32
value')
#if defined(ENABLE_OVERLOADING)
data AdapterMaskedScanUint32PeekMethodInfo
instance (signature ~ (Word32 -> Word32 -> Word64 -> Word64 -> m ((Int64, Word32))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterMaskedScanUint32PeekMethodInfo a signature where
overloadedMethod = adapterMaskedScanUint32Peek
instance O.OverloadedMethodInfo AdapterMaskedScanUint32PeekMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterMaskedScanUint32Peek",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterMaskedScanUint32Peek"
})
#endif
foreign import ccall "gst_adapter_offset_at_discont" gst_adapter_offset_at_discont ::
Ptr Adapter ->
IO Word64
adapterOffsetAtDiscont ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterOffsetAtDiscont :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterOffsetAtDiscont a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_offset_at_discont Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterOffsetAtDiscontMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterOffsetAtDiscontMethodInfo a signature where
overloadedMethod = adapterOffsetAtDiscont
instance O.OverloadedMethodInfo AdapterOffsetAtDiscontMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterOffsetAtDiscont",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterOffsetAtDiscont"
})
#endif
foreign import ccall "gst_adapter_prev_dts" gst_adapter_prev_dts ::
Ptr Adapter ->
Ptr Word64 ->
IO Word64
adapterPrevDts ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m ((Word64, Word64))
adapterPrevDts :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m (Word64, Word64)
adapterPrevDts a
adapter = IO (Word64, Word64) -> m (Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64) -> m (Word64, Word64))
-> IO (Word64, Word64) -> m (Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
distance <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Word64
result <- Ptr Adapter -> Ptr Word64 -> IO Word64
gst_adapter_prev_dts Ptr Adapter
adapter' Ptr Word64
distance
Word64
distance' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
distance
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
distance
(Word64, Word64) -> IO (Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
result, Word64
distance')
#if defined(ENABLE_OVERLOADING)
data AdapterPrevDtsMethodInfo
instance (signature ~ (m ((Word64, Word64))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPrevDtsMethodInfo a signature where
overloadedMethod = adapterPrevDts
instance O.OverloadedMethodInfo AdapterPrevDtsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPrevDts",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPrevDts"
})
#endif
foreign import ccall "gst_adapter_prev_dts_at_offset" gst_adapter_prev_dts_at_offset ::
Ptr Adapter ->
Word64 ->
Ptr Word64 ->
IO Word64
adapterPrevDtsAtOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m ((Word64, Word64))
adapterPrevDtsAtOffset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Word64, Word64)
adapterPrevDtsAtOffset a
adapter Word64
offset = IO (Word64, Word64) -> m (Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64) -> m (Word64, Word64))
-> IO (Word64, Word64) -> m (Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
distance <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Word64
result <- Ptr Adapter -> Word64 -> Ptr Word64 -> IO Word64
gst_adapter_prev_dts_at_offset Ptr Adapter
adapter' Word64
offset Ptr Word64
distance
Word64
distance' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
distance
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
distance
(Word64, Word64) -> IO (Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
result, Word64
distance')
#if defined(ENABLE_OVERLOADING)
data AdapterPrevDtsAtOffsetMethodInfo
instance (signature ~ (Word64 -> m ((Word64, Word64))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPrevDtsAtOffsetMethodInfo a signature where
overloadedMethod = adapterPrevDtsAtOffset
instance O.OverloadedMethodInfo AdapterPrevDtsAtOffsetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPrevDtsAtOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPrevDtsAtOffset"
})
#endif
foreign import ccall "gst_adapter_prev_offset" gst_adapter_prev_offset ::
Ptr Adapter ->
Ptr Word64 ->
IO Word64
adapterPrevOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m ((Word64, Word64))
adapterPrevOffset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m (Word64, Word64)
adapterPrevOffset a
adapter = IO (Word64, Word64) -> m (Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64) -> m (Word64, Word64))
-> IO (Word64, Word64) -> m (Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
distance <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Word64
result <- Ptr Adapter -> Ptr Word64 -> IO Word64
gst_adapter_prev_offset Ptr Adapter
adapter' Ptr Word64
distance
Word64
distance' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
distance
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
distance
(Word64, Word64) -> IO (Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
result, Word64
distance')
#if defined(ENABLE_OVERLOADING)
data AdapterPrevOffsetMethodInfo
instance (signature ~ (m ((Word64, Word64))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPrevOffsetMethodInfo a signature where
overloadedMethod = adapterPrevOffset
instance O.OverloadedMethodInfo AdapterPrevOffsetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPrevOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPrevOffset"
})
#endif
foreign import ccall "gst_adapter_prev_pts" gst_adapter_prev_pts ::
Ptr Adapter ->
Ptr Word64 ->
IO Word64
adapterPrevPts ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m ((Word64, Word64))
adapterPrevPts :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m (Word64, Word64)
adapterPrevPts a
adapter = IO (Word64, Word64) -> m (Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64) -> m (Word64, Word64))
-> IO (Word64, Word64) -> m (Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
distance <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Word64
result <- Ptr Adapter -> Ptr Word64 -> IO Word64
gst_adapter_prev_pts Ptr Adapter
adapter' Ptr Word64
distance
Word64
distance' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
distance
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
distance
(Word64, Word64) -> IO (Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
result, Word64
distance')
#if defined(ENABLE_OVERLOADING)
data AdapterPrevPtsMethodInfo
instance (signature ~ (m ((Word64, Word64))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPrevPtsMethodInfo a signature where
overloadedMethod = adapterPrevPts
instance O.OverloadedMethodInfo AdapterPrevPtsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPrevPts",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPrevPts"
})
#endif
foreign import ccall "gst_adapter_prev_pts_at_offset" gst_adapter_prev_pts_at_offset ::
Ptr Adapter ->
Word64 ->
Ptr Word64 ->
IO Word64
adapterPrevPtsAtOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m ((Word64, Word64))
adapterPrevPtsAtOffset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Word64, Word64)
adapterPrevPtsAtOffset a
adapter Word64
offset = IO (Word64, Word64) -> m (Word64, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word64, Word64) -> m (Word64, Word64))
-> IO (Word64, Word64) -> m (Word64, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
distance <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Word64
result <- Ptr Adapter -> Word64 -> Ptr Word64 -> IO Word64
gst_adapter_prev_pts_at_offset Ptr Adapter
adapter' Word64
offset Ptr Word64
distance
Word64
distance' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
distance
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
distance
(Word64, Word64) -> IO (Word64, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word64
result, Word64
distance')
#if defined(ENABLE_OVERLOADING)
data AdapterPrevPtsAtOffsetMethodInfo
instance (signature ~ (Word64 -> m ((Word64, Word64))), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPrevPtsAtOffsetMethodInfo a signature where
overloadedMethod = adapterPrevPtsAtOffset
instance O.OverloadedMethodInfo AdapterPrevPtsAtOffsetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPrevPtsAtOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPrevPtsAtOffset"
})
#endif
foreign import ccall "gst_adapter_pts_at_discont" gst_adapter_pts_at_discont ::
Ptr Adapter ->
IO Word64
adapterPtsAtDiscont ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m Word64
adapterPtsAtDiscont :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m Word64
adapterPtsAtDiscont a
adapter = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Word64
result <- Ptr Adapter -> IO Word64
gst_adapter_pts_at_discont Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AdapterPtsAtDiscontMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPtsAtDiscontMethodInfo a signature where
overloadedMethod = adapterPtsAtDiscont
instance O.OverloadedMethodInfo AdapterPtsAtDiscontMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPtsAtDiscont",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPtsAtDiscont"
})
#endif
foreign import ccall "gst_adapter_push" gst_adapter_push ::
Ptr Adapter ->
Ptr Gst.Buffer.Buffer ->
IO ()
adapterPush ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Gst.Buffer.Buffer
-> m ()
adapterPush :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Buffer -> m ()
adapterPush a
adapter Buffer
buf = 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 Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Buffer
buf' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Buffer
buf
Ptr Adapter -> Ptr Buffer -> IO ()
gst_adapter_push Ptr Adapter
adapter' Ptr Buffer
buf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buf
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AdapterPushMethodInfo
instance (signature ~ (Gst.Buffer.Buffer -> m ()), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterPushMethodInfo a signature where
overloadedMethod = adapterPush
instance O.OverloadedMethodInfo AdapterPushMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterPush",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterPush"
})
#endif
foreign import ccall "gst_adapter_take" gst_adapter_take ::
Ptr Adapter ->
Ptr Word64 ->
IO (Ptr Word8)
adapterTake ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m (Maybe ByteString)
adapterTake :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m (Maybe ByteString)
adapterTake a
adapter = IO (Maybe ByteString) -> m (Maybe ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString) -> m (Maybe ByteString))
-> IO (Maybe ByteString) -> m (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Word64
nbytes <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr Word8
result <- Ptr Adapter -> Ptr Word64 -> IO (Ptr Word8)
gst_adapter_take Ptr Adapter
adapter' Ptr Word64
nbytes
Word64
nbytes' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
nbytes
Maybe ByteString
maybeResult <- Ptr Word8 -> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Word8
result ((Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString))
-> (Ptr Word8 -> IO ByteString) -> IO (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ \Ptr Word8
result' -> do
ByteString
result'' <- (Word64 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word64
nbytes') Ptr Word8
result'
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
result'
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
nbytes
Maybe ByteString -> IO (Maybe ByteString)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ByteString
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterTakeMethodInfo
instance (signature ~ (m (Maybe ByteString)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterTakeMethodInfo a signature where
overloadedMethod = adapterTake
instance O.OverloadedMethodInfo AdapterTakeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterTake",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterTake"
})
#endif
foreign import ccall "gst_adapter_take_buffer" gst_adapter_take_buffer ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.Buffer.Buffer)
adapterTakeBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.Buffer.Buffer)
adapterTakeBuffer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe Buffer)
adapterTakeBuffer a
adapter Word64
nbytes = IO (Maybe Buffer) -> m (Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Buffer) -> m (Maybe Buffer))
-> IO (Maybe Buffer) -> m (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Buffer
result <- Ptr Adapter -> Word64 -> IO (Ptr Buffer)
gst_adapter_take_buffer Ptr Adapter
adapter' Word64
nbytes
Maybe Buffer
maybeResult <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
result ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
result' -> do
Buffer
result'' <- ((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
result'
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe Buffer -> IO (Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Buffer
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterTakeBufferMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.Buffer.Buffer)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterTakeBufferMethodInfo a signature where
overloadedMethod = adapterTakeBuffer
instance O.OverloadedMethodInfo AdapterTakeBufferMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterTakeBuffer",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterTakeBuffer"
})
#endif
foreign import ccall "gst_adapter_take_buffer_fast" gst_adapter_take_buffer_fast ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.Buffer.Buffer)
adapterTakeBufferFast ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.Buffer.Buffer)
adapterTakeBufferFast :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe Buffer)
adapterTakeBufferFast a
adapter Word64
nbytes = IO (Maybe Buffer) -> m (Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Buffer) -> m (Maybe Buffer))
-> IO (Maybe Buffer) -> m (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Buffer
result <- Ptr Adapter -> Word64 -> IO (Ptr Buffer)
gst_adapter_take_buffer_fast Ptr Adapter
adapter' Word64
nbytes
Maybe Buffer
maybeResult <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
result ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
result' -> do
Buffer
result'' <- ((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
result'
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe Buffer -> IO (Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Buffer
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterTakeBufferFastMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.Buffer.Buffer)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterTakeBufferFastMethodInfo a signature where
overloadedMethod = adapterTakeBufferFast
instance O.OverloadedMethodInfo AdapterTakeBufferFastMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterTakeBufferFast",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterTakeBufferFast"
})
#endif
foreign import ccall "gst_adapter_take_buffer_list" gst_adapter_take_buffer_list ::
Ptr Adapter ->
Word64 ->
IO (Ptr Gst.BufferList.BufferList)
adapterTakeBufferList ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m (Maybe Gst.BufferList.BufferList)
adapterTakeBufferList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m (Maybe BufferList)
adapterTakeBufferList a
adapter Word64
nbytes = IO (Maybe BufferList) -> m (Maybe BufferList)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe BufferList) -> m (Maybe BufferList))
-> IO (Maybe BufferList) -> m (Maybe BufferList)
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr BufferList
result <- Ptr Adapter -> Word64 -> IO (Ptr BufferList)
gst_adapter_take_buffer_list Ptr Adapter
adapter' Word64
nbytes
Maybe BufferList
maybeResult <- Ptr BufferList
-> (Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr BufferList
result ((Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList))
-> (Ptr BufferList -> IO BufferList) -> IO (Maybe BufferList)
forall a b. (a -> b) -> a -> b
$ \Ptr BufferList
result' -> do
BufferList
result'' <- ((ManagedPtr BufferList -> BufferList)
-> Ptr BufferList -> IO BufferList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferList -> BufferList
Gst.BufferList.BufferList) Ptr BufferList
result'
BufferList -> IO BufferList
forall (m :: * -> *) a. Monad m => a -> m a
return BufferList
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
Maybe BufferList -> IO (Maybe BufferList)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe BufferList
maybeResult
#if defined(ENABLE_OVERLOADING)
data AdapterTakeBufferListMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.BufferList.BufferList)), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterTakeBufferListMethodInfo a signature where
overloadedMethod = adapterTakeBufferList
instance O.OverloadedMethodInfo AdapterTakeBufferListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterTakeBufferList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterTakeBufferList"
})
#endif
foreign import ccall "gst_adapter_take_list" gst_adapter_take_list ::
Ptr Adapter ->
Word64 ->
IO (Ptr (GList (Ptr Gst.Buffer.Buffer)))
adapterTakeList ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> Word64
-> m [Gst.Buffer.Buffer]
adapterTakeList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> Word64 -> m [Buffer]
adapterTakeList a
adapter Word64
nbytes = IO [Buffer] -> m [Buffer]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Buffer] -> m [Buffer]) -> IO [Buffer] -> m [Buffer]
forall a b. (a -> b) -> a -> b
$ do
Ptr Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr (GList (Ptr Buffer))
result <- Ptr Adapter -> Word64 -> IO (Ptr (GList (Ptr Buffer)))
gst_adapter_take_list Ptr Adapter
adapter' Word64
nbytes
[Ptr Buffer]
result' <- Ptr (GList (Ptr Buffer)) -> IO [Ptr Buffer]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Buffer))
result
[Buffer]
result'' <- (Ptr Buffer -> IO Buffer) -> [Ptr Buffer] -> IO [Buffer]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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]
result'
Ptr (GList (Ptr Buffer)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Buffer))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
[Buffer] -> IO [Buffer]
forall (m :: * -> *) a. Monad m => a -> m a
return [Buffer]
result''
#if defined(ENABLE_OVERLOADING)
data AdapterTakeListMethodInfo
instance (signature ~ (Word64 -> m [Gst.Buffer.Buffer]), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterTakeListMethodInfo a signature where
overloadedMethod = adapterTakeList
instance O.OverloadedMethodInfo AdapterTakeListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterTakeList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterTakeList"
})
#endif
foreign import ccall "gst_adapter_unmap" gst_adapter_unmap ::
Ptr Adapter ->
IO ()
adapterUnmap ::
(B.CallStack.HasCallStack, MonadIO m, IsAdapter a) =>
a
-> m ()
adapterUnmap :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAdapter a) =>
a -> m ()
adapterUnmap a
adapter = 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 Adapter
adapter' <- a -> IO (Ptr Adapter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
adapter
Ptr Adapter -> IO ()
gst_adapter_unmap Ptr Adapter
adapter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
adapter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AdapterUnmapMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAdapter a) => O.OverloadedMethod AdapterUnmapMethodInfo a signature where
overloadedMethod = adapterUnmap
instance O.OverloadedMethodInfo AdapterUnmapMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstBase.Objects.Adapter.adapterUnmap",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstbase-1.0.25/docs/GI-GstBase-Objects-Adapter.html#v:adapterUnmap"
})
#endif