#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gst.Structs.PadProbeInfo
(
PadProbeInfo(..) ,
newZeroPadProbeInfo ,
noPadProbeInfo ,
#if ENABLE_OVERLOADING
PadProbeInfoGetBufferMethodInfo ,
#endif
padProbeInfoGetBuffer ,
#if ENABLE_OVERLOADING
PadProbeInfoGetBufferListMethodInfo ,
#endif
padProbeInfoGetBufferList ,
#if ENABLE_OVERLOADING
PadProbeInfoGetEventMethodInfo ,
#endif
padProbeInfoGetEvent ,
#if ENABLE_OVERLOADING
PadProbeInfoGetQueryMethodInfo ,
#endif
padProbeInfoGetQuery ,
clearPadProbeInfoData ,
getPadProbeInfoData ,
#if ENABLE_OVERLOADING
padProbeInfo_data ,
#endif
setPadProbeInfoData ,
getPadProbeInfoId ,
#if ENABLE_OVERLOADING
padProbeInfo_id ,
#endif
setPadProbeInfoId ,
getPadProbeInfoOffset ,
#if ENABLE_OVERLOADING
padProbeInfo_offset ,
#endif
setPadProbeInfoOffset ,
getPadProbeInfoSize ,
#if ENABLE_OVERLOADING
padProbeInfo_size ,
#endif
setPadProbeInfoSize ,
getPadProbeInfoType ,
#if ENABLE_OVERLOADING
padProbeInfo_type ,
#endif
setPadProbeInfoType ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.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 {-# SOURCE #-} qualified GI.Gst.Flags as Gst.Flags
import {-# SOURCE #-} qualified GI.Gst.Structs.Buffer as Gst.Buffer
import {-# SOURCE #-} qualified GI.Gst.Structs.BufferList as Gst.BufferList
import {-# SOURCE #-} qualified GI.Gst.Structs.Event as Gst.Event
import {-# SOURCE #-} qualified GI.Gst.Structs.Query as Gst.Query
newtype PadProbeInfo = PadProbeInfo (ManagedPtr PadProbeInfo)
instance WrappedPtr PadProbeInfo where
wrappedPtrCalloc = callocBytes 40
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 40 >=> wrapPtr PadProbeInfo)
wrappedPtrFree = Just ptr_to_g_free
newZeroPadProbeInfo :: MonadIO m => m PadProbeInfo
newZeroPadProbeInfo = liftIO $ wrappedPtrCalloc >>= wrapPtr PadProbeInfo
instance tag ~ 'AttrSet => Constructible PadProbeInfo tag where
new _ attrs = do
o <- newZeroPadProbeInfo
GI.Attributes.set o attrs
return o
noPadProbeInfo :: Maybe PadProbeInfo
noPadProbeInfo = Nothing
getPadProbeInfoType :: MonadIO m => PadProbeInfo -> m [Gst.Flags.PadProbeType]
getPadProbeInfoType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = wordToGFlags val
return val'
setPadProbeInfoType :: MonadIO m => PadProbeInfo -> [Gst.Flags.PadProbeType] -> m ()
setPadProbeInfoType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gflagsToWord val
poke (ptr `plusPtr` 0) (val' :: CUInt)
#if ENABLE_OVERLOADING
data PadProbeInfoTypeFieldInfo
instance AttrInfo PadProbeInfoTypeFieldInfo where
type AttrAllowedOps PadProbeInfoTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadProbeInfoTypeFieldInfo = (~) [Gst.Flags.PadProbeType]
type AttrBaseTypeConstraint PadProbeInfoTypeFieldInfo = (~) PadProbeInfo
type AttrGetType PadProbeInfoTypeFieldInfo = [Gst.Flags.PadProbeType]
type AttrLabel PadProbeInfoTypeFieldInfo = "type"
type AttrOrigin PadProbeInfoTypeFieldInfo = PadProbeInfo
attrGet _ = getPadProbeInfoType
attrSet _ = setPadProbeInfoType
attrConstruct = undefined
attrClear _ = undefined
padProbeInfo_type :: AttrLabelProxy "type"
padProbeInfo_type = AttrLabelProxy
#endif
getPadProbeInfoId :: MonadIO m => PadProbeInfo -> m CULong
getPadProbeInfoId s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CULong
return val
setPadProbeInfoId :: MonadIO m => PadProbeInfo -> CULong -> m ()
setPadProbeInfoId s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CULong)
#if ENABLE_OVERLOADING
data PadProbeInfoIdFieldInfo
instance AttrInfo PadProbeInfoIdFieldInfo where
type AttrAllowedOps PadProbeInfoIdFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadProbeInfoIdFieldInfo = (~) CULong
type AttrBaseTypeConstraint PadProbeInfoIdFieldInfo = (~) PadProbeInfo
type AttrGetType PadProbeInfoIdFieldInfo = CULong
type AttrLabel PadProbeInfoIdFieldInfo = "id"
type AttrOrigin PadProbeInfoIdFieldInfo = PadProbeInfo
attrGet _ = getPadProbeInfoId
attrSet _ = setPadProbeInfoId
attrConstruct = undefined
attrClear _ = undefined
padProbeInfo_id :: AttrLabelProxy "id"
padProbeInfo_id = AttrLabelProxy
#endif
getPadProbeInfoData :: MonadIO m => PadProbeInfo -> m (Ptr ())
getPadProbeInfoData s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (Ptr ())
return val
setPadProbeInfoData :: MonadIO m => PadProbeInfo -> Ptr () -> m ()
setPadProbeInfoData s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Ptr ())
clearPadProbeInfoData :: MonadIO m => PadProbeInfo -> m ()
clearPadProbeInfoData s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr ())
#if ENABLE_OVERLOADING
data PadProbeInfoDataFieldInfo
instance AttrInfo PadProbeInfoDataFieldInfo where
type AttrAllowedOps PadProbeInfoDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PadProbeInfoDataFieldInfo = (~) (Ptr ())
type AttrBaseTypeConstraint PadProbeInfoDataFieldInfo = (~) PadProbeInfo
type AttrGetType PadProbeInfoDataFieldInfo = Ptr ()
type AttrLabel PadProbeInfoDataFieldInfo = "data"
type AttrOrigin PadProbeInfoDataFieldInfo = PadProbeInfo
attrGet _ = getPadProbeInfoData
attrSet _ = setPadProbeInfoData
attrConstruct = undefined
attrClear _ = clearPadProbeInfoData
padProbeInfo_data :: AttrLabelProxy "data"
padProbeInfo_data = AttrLabelProxy
#endif
getPadProbeInfoOffset :: MonadIO m => PadProbeInfo -> m Word64
getPadProbeInfoOffset s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Word64
return val
setPadProbeInfoOffset :: MonadIO m => PadProbeInfo -> Word64 -> m ()
setPadProbeInfoOffset s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Word64)
#if ENABLE_OVERLOADING
data PadProbeInfoOffsetFieldInfo
instance AttrInfo PadProbeInfoOffsetFieldInfo where
type AttrAllowedOps PadProbeInfoOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadProbeInfoOffsetFieldInfo = (~) Word64
type AttrBaseTypeConstraint PadProbeInfoOffsetFieldInfo = (~) PadProbeInfo
type AttrGetType PadProbeInfoOffsetFieldInfo = Word64
type AttrLabel PadProbeInfoOffsetFieldInfo = "offset"
type AttrOrigin PadProbeInfoOffsetFieldInfo = PadProbeInfo
attrGet _ = getPadProbeInfoOffset
attrSet _ = setPadProbeInfoOffset
attrConstruct = undefined
attrClear _ = undefined
padProbeInfo_offset :: AttrLabelProxy "offset"
padProbeInfo_offset = AttrLabelProxy
#endif
getPadProbeInfoSize :: MonadIO m => PadProbeInfo -> m Word32
getPadProbeInfoSize s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Word32
return val
setPadProbeInfoSize :: MonadIO m => PadProbeInfo -> Word32 -> m ()
setPadProbeInfoSize s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Word32)
#if ENABLE_OVERLOADING
data PadProbeInfoSizeFieldInfo
instance AttrInfo PadProbeInfoSizeFieldInfo where
type AttrAllowedOps PadProbeInfoSizeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadProbeInfoSizeFieldInfo = (~) Word32
type AttrBaseTypeConstraint PadProbeInfoSizeFieldInfo = (~) PadProbeInfo
type AttrGetType PadProbeInfoSizeFieldInfo = Word32
type AttrLabel PadProbeInfoSizeFieldInfo = "size"
type AttrOrigin PadProbeInfoSizeFieldInfo = PadProbeInfo
attrGet _ = getPadProbeInfoSize
attrSet _ = setPadProbeInfoSize
attrConstruct = undefined
attrClear _ = undefined
padProbeInfo_size :: AttrLabelProxy "size"
padProbeInfo_size = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList PadProbeInfo
type instance O.AttributeList PadProbeInfo = PadProbeInfoAttributeList
type PadProbeInfoAttributeList = ('[ '("type", PadProbeInfoTypeFieldInfo), '("id", PadProbeInfoIdFieldInfo), '("data", PadProbeInfoDataFieldInfo), '("offset", PadProbeInfoOffsetFieldInfo), '("size", PadProbeInfoSizeFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_pad_probe_info_get_buffer" gst_pad_probe_info_get_buffer ::
Ptr PadProbeInfo ->
IO (Ptr Gst.Buffer.Buffer)
padProbeInfoGetBuffer ::
(B.CallStack.HasCallStack, MonadIO m) =>
PadProbeInfo
-> m (Maybe Gst.Buffer.Buffer)
padProbeInfoGetBuffer info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- gst_pad_probe_info_get_buffer info'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Gst.Buffer.Buffer) result'
return result''
touchManagedPtr info
return maybeResult
#if ENABLE_OVERLOADING
data PadProbeInfoGetBufferMethodInfo
instance (signature ~ (m (Maybe Gst.Buffer.Buffer)), MonadIO m) => O.MethodInfo PadProbeInfoGetBufferMethodInfo PadProbeInfo signature where
overloadedMethod _ = padProbeInfoGetBuffer
#endif
foreign import ccall "gst_pad_probe_info_get_buffer_list" gst_pad_probe_info_get_buffer_list ::
Ptr PadProbeInfo ->
IO (Ptr Gst.BufferList.BufferList)
padProbeInfoGetBufferList ::
(B.CallStack.HasCallStack, MonadIO m) =>
PadProbeInfo
-> m (Maybe Gst.BufferList.BufferList)
padProbeInfoGetBufferList info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- gst_pad_probe_info_get_buffer_list info'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Gst.BufferList.BufferList) result'
return result''
touchManagedPtr info
return maybeResult
#if ENABLE_OVERLOADING
data PadProbeInfoGetBufferListMethodInfo
instance (signature ~ (m (Maybe Gst.BufferList.BufferList)), MonadIO m) => O.MethodInfo PadProbeInfoGetBufferListMethodInfo PadProbeInfo signature where
overloadedMethod _ = padProbeInfoGetBufferList
#endif
foreign import ccall "gst_pad_probe_info_get_event" gst_pad_probe_info_get_event ::
Ptr PadProbeInfo ->
IO (Ptr Gst.Event.Event)
padProbeInfoGetEvent ::
(B.CallStack.HasCallStack, MonadIO m) =>
PadProbeInfo
-> m (Maybe Gst.Event.Event)
padProbeInfoGetEvent info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- gst_pad_probe_info_get_event info'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Gst.Event.Event) result'
return result''
touchManagedPtr info
return maybeResult
#if ENABLE_OVERLOADING
data PadProbeInfoGetEventMethodInfo
instance (signature ~ (m (Maybe Gst.Event.Event)), MonadIO m) => O.MethodInfo PadProbeInfoGetEventMethodInfo PadProbeInfo signature where
overloadedMethod _ = padProbeInfoGetEvent
#endif
foreign import ccall "gst_pad_probe_info_get_query" gst_pad_probe_info_get_query ::
Ptr PadProbeInfo ->
IO (Ptr Gst.Query.Query)
padProbeInfoGetQuery ::
(B.CallStack.HasCallStack, MonadIO m) =>
PadProbeInfo
-> m (Maybe Gst.Query.Query)
padProbeInfoGetQuery info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- gst_pad_probe_info_get_query info'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed Gst.Query.Query) result'
return result''
touchManagedPtr info
return maybeResult
#if ENABLE_OVERLOADING
data PadProbeInfoGetQueryMethodInfo
instance (signature ~ (m (Maybe Gst.Query.Query)), MonadIO m) => O.MethodInfo PadProbeInfoGetQueryMethodInfo PadProbeInfo signature where
overloadedMethod _ = padProbeInfoGetQuery
#endif
#if ENABLE_OVERLOADING
type family ResolvePadProbeInfoMethod (t :: Symbol) (o :: *) :: * where
ResolvePadProbeInfoMethod "getBuffer" o = PadProbeInfoGetBufferMethodInfo
ResolvePadProbeInfoMethod "getBufferList" o = PadProbeInfoGetBufferListMethodInfo
ResolvePadProbeInfoMethod "getEvent" o = PadProbeInfoGetEventMethodInfo
ResolvePadProbeInfoMethod "getQuery" o = PadProbeInfoGetQueryMethodInfo
ResolvePadProbeInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePadProbeInfoMethod t PadProbeInfo, O.MethodInfo info PadProbeInfo p) => OL.IsLabel t (PadProbeInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif