packages feed

gi-gst-0.1.6.13: GI/Gst/Structs/PadProbeInfo.hs


{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Info passed in the #GstPadProbeCallback.
-}

module GI.Gst.Structs.PadProbeInfo
    ( 

-- * Exported types
    PadProbeInfo(..)                        ,
    newZeroPadProbeInfo                     ,
    noPadProbeInfo                          ,


 -- * Methods
-- ** padProbeInfoGetBuffer
    PadProbeInfoGetBufferMethodInfo         ,
    padProbeInfoGetBuffer                   ,


-- ** padProbeInfoGetBufferList
    PadProbeInfoGetBufferListMethodInfo     ,
    padProbeInfoGetBufferList               ,


-- ** padProbeInfoGetEvent
    PadProbeInfoGetEventMethodInfo          ,
    padProbeInfoGetEvent                    ,


-- ** padProbeInfoGetQuery
    PadProbeInfoGetQueryMethodInfo          ,
    padProbeInfoGetQuery                    ,




 -- * Properties
-- ** Data
    padProbeInfoReadData                    ,


-- ** Id
    padProbeInfoReadId                      ,


-- ** Offset
    padProbeInfoReadOffset                  ,


-- ** Size
    padProbeInfoReadSize                    ,


-- ** Type
    padProbeInfoReadType                    ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gst.Types
import GI.Gst.Callbacks

newtype PadProbeInfo = PadProbeInfo (ForeignPtr PadProbeInfo)
-- | Construct a `PadProbeInfo` struct initialized to zero.
newZeroPadProbeInfo :: MonadIO m => m PadProbeInfo
newZeroPadProbeInfo = liftIO $ callocBytes 40 >>= wrapPtr PadProbeInfo

noPadProbeInfo :: Maybe PadProbeInfo
noPadProbeInfo = Nothing

padProbeInfoReadType :: PadProbeInfo -> IO [PadProbeType]
padProbeInfoReadType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = wordToGFlags val
    return val'

padProbeInfoReadId :: PadProbeInfo -> IO Word64
padProbeInfoReadId s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO Word64
    return val

padProbeInfoReadData :: PadProbeInfo -> IO (Ptr ())
padProbeInfoReadData s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (Ptr ())
    return val

padProbeInfoReadOffset :: PadProbeInfo -> IO Word64
padProbeInfoReadOffset s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO Word64
    return val

padProbeInfoReadSize :: PadProbeInfo -> IO Word32
padProbeInfoReadSize s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO Word32
    return val

-- method PadProbeInfo::get_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "_obj", argType = TInterface "Gst" "PadProbeInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : TInterface "Gst" "Buffer"
-- throws : False
-- Skip return : False

foreign import ccall "gst_pad_probe_info_get_buffer" gst_pad_probe_info_get_buffer :: 
    Ptr PadProbeInfo ->                     -- _obj : TInterface "Gst" "PadProbeInfo"
    IO (Ptr Buffer)


padProbeInfoGetBuffer ::
    (MonadIO m) =>
    PadProbeInfo                            -- _obj
    -> m Buffer                             -- result
padProbeInfoGetBuffer _obj = liftIO $ do
    let _obj' = unsafeManagedPtrGetPtr _obj
    result <- gst_pad_probe_info_get_buffer _obj'
    checkUnexpectedReturnNULL "gst_pad_probe_info_get_buffer" result
    result' <- (newBoxed Buffer) result
    touchManagedPtr _obj
    return result'

data PadProbeInfoGetBufferMethodInfo
instance (signature ~ (m Buffer), MonadIO m) => MethodInfo PadProbeInfoGetBufferMethodInfo PadProbeInfo signature where
    overloadedMethod _ = padProbeInfoGetBuffer

-- method PadProbeInfo::get_buffer_list
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "_obj", argType = TInterface "Gst" "PadProbeInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : TInterface "Gst" "BufferList"
-- throws : False
-- Skip return : False

foreign import ccall "gst_pad_probe_info_get_buffer_list" gst_pad_probe_info_get_buffer_list :: 
    Ptr PadProbeInfo ->                     -- _obj : TInterface "Gst" "PadProbeInfo"
    IO (Ptr BufferList)


padProbeInfoGetBufferList ::
    (MonadIO m) =>
    PadProbeInfo                            -- _obj
    -> m BufferList                         -- result
padProbeInfoGetBufferList _obj = liftIO $ do
    let _obj' = unsafeManagedPtrGetPtr _obj
    result <- gst_pad_probe_info_get_buffer_list _obj'
    checkUnexpectedReturnNULL "gst_pad_probe_info_get_buffer_list" result
    result' <- (newBoxed BufferList) result
    touchManagedPtr _obj
    return result'

data PadProbeInfoGetBufferListMethodInfo
instance (signature ~ (m BufferList), MonadIO m) => MethodInfo PadProbeInfoGetBufferListMethodInfo PadProbeInfo signature where
    overloadedMethod _ = padProbeInfoGetBufferList

-- method PadProbeInfo::get_event
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "_obj", argType = TInterface "Gst" "PadProbeInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : TInterface "Gst" "Event"
-- throws : False
-- Skip return : False

foreign import ccall "gst_pad_probe_info_get_event" gst_pad_probe_info_get_event :: 
    Ptr PadProbeInfo ->                     -- _obj : TInterface "Gst" "PadProbeInfo"
    IO (Ptr Event)


padProbeInfoGetEvent ::
    (MonadIO m) =>
    PadProbeInfo                            -- _obj
    -> m Event                              -- result
padProbeInfoGetEvent _obj = liftIO $ do
    let _obj' = unsafeManagedPtrGetPtr _obj
    result <- gst_pad_probe_info_get_event _obj'
    checkUnexpectedReturnNULL "gst_pad_probe_info_get_event" result
    result' <- (newBoxed Event) result
    touchManagedPtr _obj
    return result'

data PadProbeInfoGetEventMethodInfo
instance (signature ~ (m Event), MonadIO m) => MethodInfo PadProbeInfoGetEventMethodInfo PadProbeInfo signature where
    overloadedMethod _ = padProbeInfoGetEvent

-- method PadProbeInfo::get_query
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "_obj", argType = TInterface "Gst" "PadProbeInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : TInterface "Gst" "Query"
-- throws : False
-- Skip return : False

foreign import ccall "gst_pad_probe_info_get_query" gst_pad_probe_info_get_query :: 
    Ptr PadProbeInfo ->                     -- _obj : TInterface "Gst" "PadProbeInfo"
    IO (Ptr Query)


padProbeInfoGetQuery ::
    (MonadIO m) =>
    PadProbeInfo                            -- _obj
    -> m Query                              -- result
padProbeInfoGetQuery _obj = liftIO $ do
    let _obj' = unsafeManagedPtrGetPtr _obj
    result <- gst_pad_probe_info_get_query _obj'
    checkUnexpectedReturnNULL "gst_pad_probe_info_get_query" result
    result' <- (newBoxed Query) result
    touchManagedPtr _obj
    return result'

data PadProbeInfoGetQueryMethodInfo
instance (signature ~ (m Query), MonadIO m) => MethodInfo PadProbeInfoGetQueryMethodInfo PadProbeInfo signature where
    overloadedMethod _ = padProbeInfoGetQuery

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 = MethodResolutionFailed l o

instance (info ~ ResolvePadProbeInfoMethod t PadProbeInfo, MethodInfo info PadProbeInfo p) => IsLabelProxy t (PadProbeInfo -> p) where
    fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePadProbeInfoMethod t PadProbeInfo, MethodInfo info PadProbeInfo p) => IsLabel t (PadProbeInfo -> p) where
    fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif