{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstVideo.Objects.VideoBufferPool
(
VideoBufferPool(..) ,
IsVideoBufferPool ,
toVideoBufferPool ,
#if defined(ENABLE_OVERLOADING)
ResolveVideoBufferPoolMethod ,
#endif
videoBufferPoolNew ,
) 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.GHashTable as B.GHT
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.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Objects.BufferPool as Gst.BufferPool
import qualified GI.Gst.Objects.Object as Gst.Object
newtype VideoBufferPool = VideoBufferPool (SP.ManagedPtr VideoBufferPool)
deriving (VideoBufferPool -> VideoBufferPool -> Bool
(VideoBufferPool -> VideoBufferPool -> Bool)
-> (VideoBufferPool -> VideoBufferPool -> Bool)
-> Eq VideoBufferPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VideoBufferPool -> VideoBufferPool -> Bool
== :: VideoBufferPool -> VideoBufferPool -> Bool
$c/= :: VideoBufferPool -> VideoBufferPool -> Bool
/= :: VideoBufferPool -> VideoBufferPool -> Bool
Eq)
instance SP.ManagedPtrNewtype VideoBufferPool where
toManagedPtr :: VideoBufferPool -> ManagedPtr VideoBufferPool
toManagedPtr (VideoBufferPool ManagedPtr VideoBufferPool
p) = ManagedPtr VideoBufferPool
p
foreign import ccall "gst_video_buffer_pool_get_type"
c_gst_video_buffer_pool_get_type :: IO B.Types.GType
instance B.Types.TypedObject VideoBufferPool where
glibType :: IO GType
glibType = IO GType
c_gst_video_buffer_pool_get_type
instance B.Types.GObject VideoBufferPool
class (SP.GObject o, O.IsDescendantOf VideoBufferPool o) => IsVideoBufferPool o
instance (SP.GObject o, O.IsDescendantOf VideoBufferPool o) => IsVideoBufferPool o
instance O.HasParentTypes VideoBufferPool
type instance O.ParentTypes VideoBufferPool = '[Gst.BufferPool.BufferPool, Gst.Object.Object, GObject.Object.Object]
toVideoBufferPool :: (MIO.MonadIO m, IsVideoBufferPool o) => o -> m VideoBufferPool
toVideoBufferPool :: forall (m :: * -> *) o.
(MonadIO m, IsVideoBufferPool o) =>
o -> m VideoBufferPool
toVideoBufferPool = IO VideoBufferPool -> m VideoBufferPool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO VideoBufferPool -> m VideoBufferPool)
-> (o -> IO VideoBufferPool) -> o -> m VideoBufferPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr VideoBufferPool -> VideoBufferPool)
-> o -> IO VideoBufferPool
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr VideoBufferPool -> VideoBufferPool
VideoBufferPool
instance B.GValue.IsGValue (Maybe VideoBufferPool) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_video_buffer_pool_get_type
gvalueSet_ :: Ptr GValue -> Maybe VideoBufferPool -> IO ()
gvalueSet_ Ptr GValue
gv Maybe VideoBufferPool
P.Nothing = Ptr GValue -> Ptr VideoBufferPool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr VideoBufferPool
forall a. Ptr a
FP.nullPtr :: FP.Ptr VideoBufferPool)
gvalueSet_ Ptr GValue
gv (P.Just VideoBufferPool
obj) = VideoBufferPool -> (Ptr VideoBufferPool -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr VideoBufferPool
obj (Ptr GValue -> Ptr VideoBufferPool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe VideoBufferPool)
gvalueGet_ Ptr GValue
gv = do
Ptr VideoBufferPool
ptr <- Ptr GValue -> IO (Ptr VideoBufferPool)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr VideoBufferPool)
if Ptr VideoBufferPool
ptr Ptr VideoBufferPool -> Ptr VideoBufferPool -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr VideoBufferPool
forall a. Ptr a
FP.nullPtr
then VideoBufferPool -> Maybe VideoBufferPool
forall a. a -> Maybe a
P.Just (VideoBufferPool -> Maybe VideoBufferPool)
-> IO VideoBufferPool -> IO (Maybe VideoBufferPool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr VideoBufferPool -> VideoBufferPool)
-> Ptr VideoBufferPool -> IO VideoBufferPool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr VideoBufferPool -> VideoBufferPool
VideoBufferPool Ptr VideoBufferPool
ptr
else Maybe VideoBufferPool -> IO (Maybe VideoBufferPool)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe VideoBufferPool
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveVideoBufferPoolMethod (t :: Symbol) (o :: *) :: * where
ResolveVideoBufferPoolMethod "acquireBuffer" o = Gst.BufferPool.BufferPoolAcquireBufferMethodInfo
ResolveVideoBufferPoolMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveVideoBufferPoolMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveVideoBufferPoolMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveVideoBufferPoolMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveVideoBufferPoolMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveVideoBufferPoolMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveVideoBufferPoolMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveVideoBufferPoolMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveVideoBufferPoolMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveVideoBufferPoolMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveVideoBufferPoolMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveVideoBufferPoolMethod "hasOption" o = Gst.BufferPool.BufferPoolHasOptionMethodInfo
ResolveVideoBufferPoolMethod "isActive" o = Gst.BufferPool.BufferPoolIsActiveMethodInfo
ResolveVideoBufferPoolMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveVideoBufferPoolMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveVideoBufferPoolMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveVideoBufferPoolMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveVideoBufferPoolMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveVideoBufferPoolMethod "releaseBuffer" o = Gst.BufferPool.BufferPoolReleaseBufferMethodInfo
ResolveVideoBufferPoolMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveVideoBufferPoolMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveVideoBufferPoolMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveVideoBufferPoolMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveVideoBufferPoolMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveVideoBufferPoolMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveVideoBufferPoolMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveVideoBufferPoolMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveVideoBufferPoolMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveVideoBufferPoolMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveVideoBufferPoolMethod "getConfig" o = Gst.BufferPool.BufferPoolGetConfigMethodInfo
ResolveVideoBufferPoolMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveVideoBufferPoolMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveVideoBufferPoolMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveVideoBufferPoolMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveVideoBufferPoolMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveVideoBufferPoolMethod "getOptions" o = Gst.BufferPool.BufferPoolGetOptionsMethodInfo
ResolveVideoBufferPoolMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveVideoBufferPoolMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveVideoBufferPoolMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveVideoBufferPoolMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveVideoBufferPoolMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveVideoBufferPoolMethod "setActive" o = Gst.BufferPool.BufferPoolSetActiveMethodInfo
ResolveVideoBufferPoolMethod "setConfig" o = Gst.BufferPool.BufferPoolSetConfigMethodInfo
ResolveVideoBufferPoolMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveVideoBufferPoolMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveVideoBufferPoolMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveVideoBufferPoolMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveVideoBufferPoolMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveVideoBufferPoolMethod "setFlushing" o = Gst.BufferPool.BufferPoolSetFlushingMethodInfo
ResolveVideoBufferPoolMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveVideoBufferPoolMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveVideoBufferPoolMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveVideoBufferPoolMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVideoBufferPoolMethod t VideoBufferPool, O.OverloadedMethod info VideoBufferPool p) => OL.IsLabel t (VideoBufferPool -> 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 ~ ResolveVideoBufferPoolMethod t VideoBufferPool, O.OverloadedMethod info VideoBufferPool p, R.HasField t VideoBufferPool p) => R.HasField t VideoBufferPool p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveVideoBufferPoolMethod t VideoBufferPool, O.OverloadedMethodInfo info VideoBufferPool) => OL.IsLabel t (O.MethodProxy info VideoBufferPool) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList VideoBufferPool
type instance O.AttributeList VideoBufferPool = VideoBufferPoolAttributeList
type VideoBufferPoolAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList VideoBufferPool = VideoBufferPoolSignalList
type VideoBufferPoolSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_video_buffer_pool_new" gst_video_buffer_pool_new ::
IO (Ptr VideoBufferPool)
videoBufferPoolNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m VideoBufferPool
videoBufferPoolNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m VideoBufferPool
videoBufferPoolNew = IO VideoBufferPool -> m VideoBufferPool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoBufferPool -> m VideoBufferPool)
-> IO VideoBufferPool -> m VideoBufferPool
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoBufferPool
result <- IO (Ptr VideoBufferPool)
gst_video_buffer_pool_new
Text -> Ptr VideoBufferPool -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoBufferPoolNew" Ptr VideoBufferPool
result
VideoBufferPool
result' <- ((ManagedPtr VideoBufferPool -> VideoBufferPool)
-> Ptr VideoBufferPool -> IO VideoBufferPool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr VideoBufferPool -> VideoBufferPool
VideoBufferPool) Ptr VideoBufferPool
result
VideoBufferPool -> IO VideoBufferPool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return VideoBufferPool
result'
#if defined(ENABLE_OVERLOADING)
#endif