{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gst.Objects.ElementFactory
(
ElementFactory(..) ,
IsElementFactory ,
toElementFactory ,
noElementFactory ,
#if defined(ENABLE_OVERLOADING)
ResolveElementFactoryMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ElementFactoryCanSinkAllCapsMethodInfo ,
#endif
elementFactoryCanSinkAllCaps ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryCanSinkAnyCapsMethodInfo ,
#endif
elementFactoryCanSinkAnyCaps ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryCanSrcAllCapsMethodInfo ,
#endif
elementFactoryCanSrcAllCaps ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryCanSrcAnyCapsMethodInfo ,
#endif
elementFactoryCanSrcAnyCaps ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryCreateMethodInfo ,
#endif
elementFactoryCreate ,
elementFactoryFind ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetElementTypeMethodInfo ,
#endif
elementFactoryGetElementType ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetMetadataMethodInfo ,
#endif
elementFactoryGetMetadata ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetMetadataKeysMethodInfo ,
#endif
elementFactoryGetMetadataKeys ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetNumPadTemplatesMethodInfo,
#endif
elementFactoryGetNumPadTemplates ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetStaticPadTemplatesMethodInfo,
#endif
elementFactoryGetStaticPadTemplates ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetUriProtocolsMethodInfo ,
#endif
elementFactoryGetUriProtocols ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryGetUriTypeMethodInfo ,
#endif
elementFactoryGetUriType ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryHasInterfaceMethodInfo ,
#endif
elementFactoryHasInterface ,
elementFactoryListFilter ,
elementFactoryListGetElements ,
#if defined(ENABLE_OVERLOADING)
ElementFactoryListIsTypeMethodInfo ,
#endif
elementFactoryListIsType ,
elementFactoryMake ,
) 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.GI.Base.Signals as B.Signals
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Objects.Element as Gst.Element
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.PluginFeature as Gst.PluginFeature
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.StaticPadTemplate as Gst.StaticPadTemplate
newtype ElementFactory = ElementFactory (ManagedPtr ElementFactory)
deriving (ElementFactory -> ElementFactory -> Bool
(ElementFactory -> ElementFactory -> Bool)
-> (ElementFactory -> ElementFactory -> Bool) -> Eq ElementFactory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElementFactory -> ElementFactory -> Bool
$c/= :: ElementFactory -> ElementFactory -> Bool
== :: ElementFactory -> ElementFactory -> Bool
$c== :: ElementFactory -> ElementFactory -> Bool
Eq)
foreign import ccall "gst_element_factory_get_type"
c_gst_element_factory_get_type :: IO GType
instance GObject ElementFactory where
gobjectType :: IO GType
gobjectType = IO GType
c_gst_element_factory_get_type
instance B.GValue.IsGValue ElementFactory where
toGValue :: ElementFactory -> IO GValue
toGValue o :: ElementFactory
o = do
GType
gtype <- IO GType
c_gst_element_factory_get_type
ElementFactory -> (Ptr ElementFactory -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ElementFactory
o (GType
-> (GValue -> Ptr ElementFactory -> IO ())
-> Ptr ElementFactory
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr ElementFactory -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO ElementFactory
fromGValue gv :: GValue
gv = do
Ptr ElementFactory
ptr <- GValue -> IO (Ptr ElementFactory)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr ElementFactory)
(ManagedPtr ElementFactory -> ElementFactory)
-> Ptr ElementFactory -> IO ElementFactory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ElementFactory -> ElementFactory
ElementFactory Ptr ElementFactory
ptr
class (GObject o, O.IsDescendantOf ElementFactory o) => IsElementFactory o
instance (GObject o, O.IsDescendantOf ElementFactory o) => IsElementFactory o
instance O.HasParentTypes ElementFactory
type instance O.ParentTypes ElementFactory = '[Gst.PluginFeature.PluginFeature, Gst.Object.Object, GObject.Object.Object]
toElementFactory :: (MonadIO m, IsElementFactory o) => o -> m ElementFactory
toElementFactory :: o -> m ElementFactory
toElementFactory = IO ElementFactory -> m ElementFactory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ElementFactory -> m ElementFactory)
-> (o -> IO ElementFactory) -> o -> m ElementFactory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ElementFactory -> ElementFactory)
-> o -> IO ElementFactory
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr ElementFactory -> ElementFactory
ElementFactory
noElementFactory :: Maybe ElementFactory
noElementFactory :: Maybe ElementFactory
noElementFactory = Maybe ElementFactory
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveElementFactoryMethod (t :: Symbol) (o :: *) :: * where
ResolveElementFactoryMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveElementFactoryMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveElementFactoryMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveElementFactoryMethod "canSinkAllCaps" o = ElementFactoryCanSinkAllCapsMethodInfo
ResolveElementFactoryMethod "canSinkAnyCaps" o = ElementFactoryCanSinkAnyCapsMethodInfo
ResolveElementFactoryMethod "canSrcAllCaps" o = ElementFactoryCanSrcAllCapsMethodInfo
ResolveElementFactoryMethod "canSrcAnyCaps" o = ElementFactoryCanSrcAnyCapsMethodInfo
ResolveElementFactoryMethod "checkVersion" o = Gst.PluginFeature.PluginFeatureCheckVersionMethodInfo
ResolveElementFactoryMethod "create" o = ElementFactoryCreateMethodInfo
ResolveElementFactoryMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveElementFactoryMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveElementFactoryMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveElementFactoryMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveElementFactoryMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveElementFactoryMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveElementFactoryMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveElementFactoryMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveElementFactoryMethod "hasInterface" o = ElementFactoryHasInterfaceMethodInfo
ResolveElementFactoryMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveElementFactoryMethod "listIsType" o = ElementFactoryListIsTypeMethodInfo
ResolveElementFactoryMethod "load" o = Gst.PluginFeature.PluginFeatureLoadMethodInfo
ResolveElementFactoryMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveElementFactoryMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveElementFactoryMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveElementFactoryMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveElementFactoryMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveElementFactoryMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveElementFactoryMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveElementFactoryMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveElementFactoryMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveElementFactoryMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveElementFactoryMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveElementFactoryMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveElementFactoryMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveElementFactoryMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveElementFactoryMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveElementFactoryMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveElementFactoryMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveElementFactoryMethod "getElementType" o = ElementFactoryGetElementTypeMethodInfo
ResolveElementFactoryMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveElementFactoryMethod "getMetadata" o = ElementFactoryGetMetadataMethodInfo
ResolveElementFactoryMethod "getMetadataKeys" o = ElementFactoryGetMetadataKeysMethodInfo
ResolveElementFactoryMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveElementFactoryMethod "getNumPadTemplates" o = ElementFactoryGetNumPadTemplatesMethodInfo
ResolveElementFactoryMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveElementFactoryMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveElementFactoryMethod "getPlugin" o = Gst.PluginFeature.PluginFeatureGetPluginMethodInfo
ResolveElementFactoryMethod "getPluginName" o = Gst.PluginFeature.PluginFeatureGetPluginNameMethodInfo
ResolveElementFactoryMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveElementFactoryMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveElementFactoryMethod "getRank" o = Gst.PluginFeature.PluginFeatureGetRankMethodInfo
ResolveElementFactoryMethod "getStaticPadTemplates" o = ElementFactoryGetStaticPadTemplatesMethodInfo
ResolveElementFactoryMethod "getUriProtocols" o = ElementFactoryGetUriProtocolsMethodInfo
ResolveElementFactoryMethod "getUriType" o = ElementFactoryGetUriTypeMethodInfo
ResolveElementFactoryMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveElementFactoryMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveElementFactoryMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveElementFactoryMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveElementFactoryMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveElementFactoryMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveElementFactoryMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveElementFactoryMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveElementFactoryMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveElementFactoryMethod "setRank" o = Gst.PluginFeature.PluginFeatureSetRankMethodInfo
ResolveElementFactoryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveElementFactoryMethod t ElementFactory, O.MethodInfo info ElementFactory p) => OL.IsLabel t (ElementFactory -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ElementFactory
type instance O.AttributeList ElementFactory = ElementFactoryAttributeList
type ElementFactoryAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ElementFactory = ElementFactorySignalList
type ElementFactorySignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_element_factory_can_sink_all_caps" gst_element_factory_can_sink_all_caps ::
Ptr ElementFactory ->
Ptr Gst.Caps.Caps ->
IO CInt
elementFactoryCanSinkAllCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Gst.Caps.Caps
-> m Bool
elementFactoryCanSinkAllCaps :: a -> Caps -> m Bool
elementFactoryCanSinkAllCaps factory :: a
factory caps :: Caps
caps = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
CInt
result <- Ptr ElementFactory -> Ptr Caps -> IO CInt
gst_element_factory_can_sink_all_caps Ptr ElementFactory
factory' Ptr Caps
caps'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryCanSinkAllCapsMethodInfo
instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSinkAllCapsMethodInfo a signature where
overloadedMethod = elementFactoryCanSinkAllCaps
#endif
foreign import ccall "gst_element_factory_can_sink_any_caps" gst_element_factory_can_sink_any_caps ::
Ptr ElementFactory ->
Ptr Gst.Caps.Caps ->
IO CInt
elementFactoryCanSinkAnyCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Gst.Caps.Caps
-> m Bool
elementFactoryCanSinkAnyCaps :: a -> Caps -> m Bool
elementFactoryCanSinkAnyCaps factory :: a
factory caps :: Caps
caps = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
CInt
result <- Ptr ElementFactory -> Ptr Caps -> IO CInt
gst_element_factory_can_sink_any_caps Ptr ElementFactory
factory' Ptr Caps
caps'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryCanSinkAnyCapsMethodInfo
instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSinkAnyCapsMethodInfo a signature where
overloadedMethod = elementFactoryCanSinkAnyCaps
#endif
foreign import ccall "gst_element_factory_can_src_all_caps" gst_element_factory_can_src_all_caps ::
Ptr ElementFactory ->
Ptr Gst.Caps.Caps ->
IO CInt
elementFactoryCanSrcAllCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Gst.Caps.Caps
-> m Bool
elementFactoryCanSrcAllCaps :: a -> Caps -> m Bool
elementFactoryCanSrcAllCaps factory :: a
factory caps :: Caps
caps = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
CInt
result <- Ptr ElementFactory -> Ptr Caps -> IO CInt
gst_element_factory_can_src_all_caps Ptr ElementFactory
factory' Ptr Caps
caps'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryCanSrcAllCapsMethodInfo
instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSrcAllCapsMethodInfo a signature where
overloadedMethod = elementFactoryCanSrcAllCaps
#endif
foreign import ccall "gst_element_factory_can_src_any_caps" gst_element_factory_can_src_any_caps ::
Ptr ElementFactory ->
Ptr Gst.Caps.Caps ->
IO CInt
elementFactoryCanSrcAnyCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Gst.Caps.Caps
-> m Bool
elementFactoryCanSrcAnyCaps :: a -> Caps -> m Bool
elementFactoryCanSrcAnyCaps factory :: a
factory caps :: Caps
caps = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
CInt
result <- Ptr ElementFactory -> Ptr Caps -> IO CInt
gst_element_factory_can_src_any_caps Ptr ElementFactory
factory' Ptr Caps
caps'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryCanSrcAnyCapsMethodInfo
instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSrcAnyCapsMethodInfo a signature where
overloadedMethod = elementFactoryCanSrcAnyCaps
#endif
foreign import ccall "gst_element_factory_create" gst_element_factory_create ::
Ptr ElementFactory ->
CString ->
IO (Ptr Gst.Element.Element)
elementFactoryCreate ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Maybe (T.Text)
-> m (Maybe Gst.Element.Element)
elementFactoryCreate :: a -> Maybe Text -> m (Maybe Element)
elementFactoryCreate factory :: a
factory name :: Maybe Text
name = IO (Maybe Element) -> m (Maybe Element)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Element) -> m (Maybe Element))
-> IO (Maybe Element) -> m (Maybe Element)
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr CChar
maybeName <- case Maybe Text
name of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jName :: Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr Element
result <- Ptr ElementFactory -> Ptr CChar -> IO (Ptr Element)
gst_element_factory_create Ptr ElementFactory
factory' Ptr CChar
maybeName
Maybe Element
maybeResult <- Ptr Element -> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Element
result ((Ptr Element -> IO Element) -> IO (Maybe Element))
-> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Element
result' -> do
Element
result'' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
result'
Element -> IO Element
forall (m :: * -> *) a. Monad m => a -> m a
return Element
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
Maybe Element -> IO (Maybe Element)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Element
maybeResult
#if defined(ENABLE_OVERLOADING)
data ElementFactoryCreateMethodInfo
instance (signature ~ (Maybe (T.Text) -> m (Maybe Gst.Element.Element)), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCreateMethodInfo a signature where
overloadedMethod = elementFactoryCreate
#endif
foreign import ccall "gst_element_factory_get_element_type" gst_element_factory_get_element_type ::
Ptr ElementFactory ->
IO CGType
elementFactoryGetElementType ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m GType
elementFactoryGetElementType :: a -> m GType
elementFactoryGetElementType factory :: a
factory = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CGType
result <- Ptr ElementFactory -> IO CGType
gst_element_factory_get_element_type Ptr ElementFactory
factory'
let result' :: GType
result' = CGType -> GType
GType CGType
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetElementTypeMethodInfo
instance (signature ~ (m GType), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetElementTypeMethodInfo a signature where
overloadedMethod = elementFactoryGetElementType
#endif
foreign import ccall "gst_element_factory_get_metadata" gst_element_factory_get_metadata ::
Ptr ElementFactory ->
CString ->
IO CString
elementFactoryGetMetadata ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> T.Text
-> m (Maybe T.Text)
elementFactoryGetMetadata :: a -> Text -> m (Maybe Text)
elementFactoryGetMetadata factory :: a
factory key :: Text
key = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr CChar
key' <- Text -> IO (Ptr CChar)
textToCString Text
key
Ptr CChar
result <- Ptr ElementFactory -> Ptr CChar -> IO (Ptr CChar)
gst_element_factory_get_metadata Ptr ElementFactory
factory' Ptr CChar
key'
Maybe Text
maybeResult <- Ptr CChar -> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CChar
result ((Ptr CChar -> IO Text) -> IO (Maybe Text))
-> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr CChar
result' -> do
Text
result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
key'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetMetadataMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetMetadataMethodInfo a signature where
overloadedMethod = elementFactoryGetMetadata
#endif
foreign import ccall "gst_element_factory_get_metadata_keys" gst_element_factory_get_metadata_keys ::
Ptr ElementFactory ->
IO (Ptr CString)
elementFactoryGetMetadataKeys ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m (Maybe [T.Text])
elementFactoryGetMetadataKeys :: a -> m (Maybe [Text])
elementFactoryGetMetadataKeys factory :: a
factory = IO (Maybe [Text]) -> m (Maybe [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr (Ptr CChar)
result <- Ptr ElementFactory -> IO (Ptr (Ptr CChar))
gst_element_factory_get_metadata_keys Ptr ElementFactory
factory'
Maybe [Text]
maybeResult <- Ptr (Ptr CChar)
-> (Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr (Ptr CChar)
result ((Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr (Ptr CChar)
result' -> do
[Text]
result'' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result'
(Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result'
Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Maybe [Text] -> IO (Maybe [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetMetadataKeysMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetMetadataKeysMethodInfo a signature where
overloadedMethod = elementFactoryGetMetadataKeys
#endif
foreign import ccall "gst_element_factory_get_num_pad_templates" gst_element_factory_get_num_pad_templates ::
Ptr ElementFactory ->
IO Word32
elementFactoryGetNumPadTemplates ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m Word32
elementFactoryGetNumPadTemplates :: a -> m Word32
elementFactoryGetNumPadTemplates factory :: a
factory = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Word32
result <- Ptr ElementFactory -> IO Word32
gst_element_factory_get_num_pad_templates Ptr ElementFactory
factory'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetNumPadTemplatesMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetNumPadTemplatesMethodInfo a signature where
overloadedMethod = elementFactoryGetNumPadTemplates
#endif
foreign import ccall "gst_element_factory_get_static_pad_templates" gst_element_factory_get_static_pad_templates ::
Ptr ElementFactory ->
IO (Ptr (GList (Ptr Gst.StaticPadTemplate.StaticPadTemplate)))
elementFactoryGetStaticPadTemplates ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m [Gst.StaticPadTemplate.StaticPadTemplate]
elementFactoryGetStaticPadTemplates :: a -> m [StaticPadTemplate]
elementFactoryGetStaticPadTemplates factory :: a
factory = IO [StaticPadTemplate] -> m [StaticPadTemplate]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [StaticPadTemplate] -> m [StaticPadTemplate])
-> IO [StaticPadTemplate] -> m [StaticPadTemplate]
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr (GList (Ptr StaticPadTemplate))
result <- Ptr ElementFactory -> IO (Ptr (GList (Ptr StaticPadTemplate)))
gst_element_factory_get_static_pad_templates Ptr ElementFactory
factory'
[Ptr StaticPadTemplate]
result' <- Ptr (GList (Ptr StaticPadTemplate)) -> IO [Ptr StaticPadTemplate]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr StaticPadTemplate))
result
[StaticPadTemplate]
result'' <- (Ptr StaticPadTemplate -> IO StaticPadTemplate)
-> [Ptr StaticPadTemplate] -> IO [StaticPadTemplate]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr StaticPadTemplate -> StaticPadTemplate)
-> Ptr StaticPadTemplate -> IO StaticPadTemplate
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr StaticPadTemplate -> StaticPadTemplate
Gst.StaticPadTemplate.StaticPadTemplate) [Ptr StaticPadTemplate]
result'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
[StaticPadTemplate] -> IO [StaticPadTemplate]
forall (m :: * -> *) a. Monad m => a -> m a
return [StaticPadTemplate]
result''
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetStaticPadTemplatesMethodInfo
instance (signature ~ (m [Gst.StaticPadTemplate.StaticPadTemplate]), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetStaticPadTemplatesMethodInfo a signature where
overloadedMethod = elementFactoryGetStaticPadTemplates
#endif
foreign import ccall "gst_element_factory_get_uri_protocols" gst_element_factory_get_uri_protocols ::
Ptr ElementFactory ->
IO (Ptr CString)
elementFactoryGetUriProtocols ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m [T.Text]
elementFactoryGetUriProtocols :: a -> m [Text]
elementFactoryGetUriProtocols factory :: a
factory = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr (Ptr CChar)
result <- Ptr ElementFactory -> IO (Ptr (Ptr CChar))
gst_element_factory_get_uri_protocols Ptr ElementFactory
factory'
Text -> Ptr (Ptr CChar) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "elementFactoryGetUriProtocols" Ptr (Ptr CChar)
result
[Text]
result' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetUriProtocolsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetUriProtocolsMethodInfo a signature where
overloadedMethod = elementFactoryGetUriProtocols
#endif
foreign import ccall "gst_element_factory_get_uri_type" gst_element_factory_get_uri_type ::
Ptr ElementFactory ->
IO CUInt
elementFactoryGetUriType ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> m Gst.Enums.URIType
elementFactoryGetUriType :: a -> m URIType
elementFactoryGetUriType factory :: a
factory = IO URIType -> m URIType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO URIType -> m URIType) -> IO URIType -> m URIType
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CUInt
result <- Ptr ElementFactory -> IO CUInt
gst_element_factory_get_uri_type Ptr ElementFactory
factory'
let result' :: URIType
result' = (Int -> URIType
forall a. Enum a => Int -> a
toEnum (Int -> URIType) -> (CUInt -> Int) -> CUInt -> URIType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
URIType -> IO URIType
forall (m :: * -> *) a. Monad m => a -> m a
return URIType
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryGetUriTypeMethodInfo
instance (signature ~ (m Gst.Enums.URIType), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetUriTypeMethodInfo a signature where
overloadedMethod = elementFactoryGetUriType
#endif
foreign import ccall "gst_element_factory_has_interface" gst_element_factory_has_interface ::
Ptr ElementFactory ->
CString ->
IO CInt
elementFactoryHasInterface ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> T.Text
-> m Bool
elementFactoryHasInterface :: a -> Text -> m Bool
elementFactoryHasInterface factory :: a
factory interfacename :: Text
interfacename = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr CChar
interfacename' <- Text -> IO (Ptr CChar)
textToCString Text
interfacename
CInt
result <- Ptr ElementFactory -> Ptr CChar -> IO CInt
gst_element_factory_has_interface Ptr ElementFactory
factory' Ptr CChar
interfacename'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
interfacename'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryHasInterfaceMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryHasInterfaceMethodInfo a signature where
overloadedMethod = elementFactoryHasInterface
#endif
foreign import ccall "gst_element_factory_list_is_type" gst_element_factory_list_is_type ::
Ptr ElementFactory ->
Word64 ->
IO CInt
elementFactoryListIsType ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
a
-> Word64
-> m Bool
elementFactoryListIsType :: a -> CGType -> m Bool
elementFactoryListIsType factory :: a
factory type_ :: CGType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ElementFactory
factory' <- a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CInt
result <- Ptr ElementFactory -> CGType -> IO CInt
gst_element_factory_list_is_type Ptr ElementFactory
factory' CGType
type_
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ElementFactoryListIsTypeMethodInfo
instance (signature ~ (Word64 -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryListIsTypeMethodInfo a signature where
overloadedMethod = elementFactoryListIsType
#endif
foreign import ccall "gst_element_factory_find" gst_element_factory_find ::
CString ->
IO (Ptr ElementFactory)
elementFactoryFind ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe ElementFactory)
elementFactoryFind :: Text -> m (Maybe ElementFactory)
elementFactoryFind name :: Text
name = IO (Maybe ElementFactory) -> m (Maybe ElementFactory)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ElementFactory) -> m (Maybe ElementFactory))
-> IO (Maybe ElementFactory) -> m (Maybe ElementFactory)
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
Ptr ElementFactory
result <- Ptr CChar -> IO (Ptr ElementFactory)
gst_element_factory_find Ptr CChar
name'
Maybe ElementFactory
maybeResult <- Ptr ElementFactory
-> (Ptr ElementFactory -> IO ElementFactory)
-> IO (Maybe ElementFactory)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr ElementFactory
result ((Ptr ElementFactory -> IO ElementFactory)
-> IO (Maybe ElementFactory))
-> (Ptr ElementFactory -> IO ElementFactory)
-> IO (Maybe ElementFactory)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr ElementFactory
result' -> do
ElementFactory
result'' <- ((ManagedPtr ElementFactory -> ElementFactory)
-> Ptr ElementFactory -> IO ElementFactory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ElementFactory -> ElementFactory
ElementFactory) Ptr ElementFactory
result'
ElementFactory -> IO ElementFactory
forall (m :: * -> *) a. Monad m => a -> m a
return ElementFactory
result''
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
Maybe ElementFactory -> IO (Maybe ElementFactory)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ElementFactory
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_element_factory_list_filter" gst_element_factory_list_filter ::
Ptr (GList (Ptr ElementFactory)) ->
Ptr Gst.Caps.Caps ->
CUInt ->
CInt ->
IO (Ptr (GList (Ptr ElementFactory)))
elementFactoryListFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) =>
[a]
-> Gst.Caps.Caps
-> Gst.Enums.PadDirection
-> Bool
-> m [ElementFactory]
elementFactoryListFilter :: [a] -> Caps -> PadDirection -> Bool -> m [ElementFactory]
elementFactoryListFilter list :: [a]
list caps :: Caps
caps direction :: PadDirection
direction subsetonly :: Bool
subsetonly = IO [ElementFactory] -> m [ElementFactory]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ElementFactory] -> m [ElementFactory])
-> IO [ElementFactory] -> m [ElementFactory]
forall a b. (a -> b) -> a -> b
$ do
[Ptr ElementFactory]
list' <- (a -> IO (Ptr ElementFactory)) -> [a] -> IO [Ptr ElementFactory]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> IO (Ptr ElementFactory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [a]
list
Ptr (GList (Ptr ElementFactory))
list'' <- [Ptr ElementFactory] -> IO (Ptr (GList (Ptr ElementFactory)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr ElementFactory]
list'
Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (PadDirection -> Int) -> PadDirection -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PadDirection -> Int
forall a. Enum a => a -> Int
fromEnum) PadDirection
direction
let subsetonly' :: CInt
subsetonly' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
subsetonly
Ptr (GList (Ptr ElementFactory))
result <- Ptr (GList (Ptr ElementFactory))
-> Ptr Caps
-> CUInt
-> CInt
-> IO (Ptr (GList (Ptr ElementFactory)))
gst_element_factory_list_filter Ptr (GList (Ptr ElementFactory))
list'' Ptr Caps
caps' CUInt
direction' CInt
subsetonly'
[Ptr ElementFactory]
result' <- Ptr (GList (Ptr ElementFactory)) -> IO [Ptr ElementFactory]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr ElementFactory))
result
[ElementFactory]
result'' <- (Ptr ElementFactory -> IO ElementFactory)
-> [Ptr ElementFactory] -> IO [ElementFactory]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr ElementFactory -> ElementFactory)
-> Ptr ElementFactory -> IO ElementFactory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ElementFactory -> ElementFactory
ElementFactory) [Ptr ElementFactory]
result'
Ptr (GList (Ptr ElementFactory)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr ElementFactory))
result
(a -> IO ()) -> [a] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [a]
list
Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
Ptr (GList (Ptr ElementFactory)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr ElementFactory))
list''
[ElementFactory] -> IO [ElementFactory]
forall (m :: * -> *) a. Monad m => a -> m a
return [ElementFactory]
result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_element_factory_list_get_elements" gst_element_factory_list_get_elements ::
Word64 ->
CUInt ->
IO (Ptr (GList (Ptr ElementFactory)))
elementFactoryListGetElements ::
(B.CallStack.HasCallStack, MonadIO m) =>
Word64
-> Gst.Enums.Rank
-> m [ElementFactory]
elementFactoryListGetElements :: CGType -> Rank -> m [ElementFactory]
elementFactoryListGetElements type_ :: CGType
type_ minrank :: Rank
minrank = IO [ElementFactory] -> m [ElementFactory]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ElementFactory] -> m [ElementFactory])
-> IO [ElementFactory] -> m [ElementFactory]
forall a b. (a -> b) -> a -> b
$ do
let minrank' :: CUInt
minrank' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Rank -> Int) -> Rank -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rank -> Int
forall a. Enum a => a -> Int
fromEnum) Rank
minrank
Ptr (GList (Ptr ElementFactory))
result <- CGType -> CUInt -> IO (Ptr (GList (Ptr ElementFactory)))
gst_element_factory_list_get_elements CGType
type_ CUInt
minrank'
[Ptr ElementFactory]
result' <- Ptr (GList (Ptr ElementFactory)) -> IO [Ptr ElementFactory]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr ElementFactory))
result
[ElementFactory]
result'' <- (Ptr ElementFactory -> IO ElementFactory)
-> [Ptr ElementFactory] -> IO [ElementFactory]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr ElementFactory -> ElementFactory)
-> Ptr ElementFactory -> IO ElementFactory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ElementFactory -> ElementFactory
ElementFactory) [Ptr ElementFactory]
result'
Ptr (GList (Ptr ElementFactory)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr ElementFactory))
result
[ElementFactory] -> IO [ElementFactory]
forall (m :: * -> *) a. Monad m => a -> m a
return [ElementFactory]
result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_element_factory_make" gst_element_factory_make ::
CString ->
CString ->
IO (Ptr Gst.Element.Element)
elementFactoryMake ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (T.Text)
-> m (Maybe Gst.Element.Element)
elementFactoryMake :: Text -> Maybe Text -> m (Maybe Element)
elementFactoryMake factoryname :: Text
factoryname name :: Maybe Text
name = IO (Maybe Element) -> m (Maybe Element)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Element) -> m (Maybe Element))
-> IO (Maybe Element) -> m (Maybe Element)
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
factoryname' <- Text -> IO (Ptr CChar)
textToCString Text
factoryname
Ptr CChar
maybeName <- case Maybe Text
name of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jName :: Text
jName -> do
Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
Ptr Element
result <- Ptr CChar -> Ptr CChar -> IO (Ptr Element)
gst_element_factory_make Ptr CChar
factoryname' Ptr CChar
maybeName
Maybe Element
maybeResult <- Ptr Element -> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Element
result ((Ptr Element -> IO Element) -> IO (Maybe Element))
-> (Ptr Element -> IO Element) -> IO (Maybe Element)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Element
result' -> do
Element
result'' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
result'
Element -> IO Element
forall (m :: * -> *) a. Monad m => a -> m a
return Element
result''
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
factoryname'
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
Maybe Element -> IO (Maybe Element)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Element
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif