{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) 'GI.Gst.Objects.ElementFactory.ElementFactory' is used to create instances of elements. A GstElementFactory can be added to a 'GI.Gst.Objects.Plugin.Plugin' as it is also a 'GI.Gst.Objects.PluginFeature.PluginFeature'. Use the 'GI.Gst.Objects.ElementFactory.elementFactoryFind' and 'GI.Gst.Objects.ElementFactory.elementFactoryCreate' functions to create element instances or use 'GI.Gst.Objects.ElementFactory.elementFactoryMake' as a convenient shortcut. The following code example shows you how to create a GstFileSrc element. \<example> \<title>Using an element factory\<\/title> \<programlisting language=\"c\"> @/include/@ <gst\/gst.h> GstElement *src; GstElementFactory *srcfactory; gst_init (&argc, &argv); srcfactory = gst_element_factory_find (\"filesrc\"); g_return_if_fail (srcfactory != NULL); src = gst_element_factory_create (srcfactory, \"src\"); g_return_if_fail (src != NULL); ... \<\/programlisting> \<\/example> -} module GI.Gst.Objects.ElementFactory ( -- * Exported types ElementFactory(..) , IsElementFactory , toElementFactory , noElementFactory , -- * Methods -- ** canSinkAllCaps #method:canSinkAllCaps# ElementFactoryCanSinkAllCapsMethodInfo , elementFactoryCanSinkAllCaps , -- ** canSinkAnyCaps #method:canSinkAnyCaps# ElementFactoryCanSinkAnyCapsMethodInfo , elementFactoryCanSinkAnyCaps , -- ** canSrcAllCaps #method:canSrcAllCaps# ElementFactoryCanSrcAllCapsMethodInfo , elementFactoryCanSrcAllCaps , -- ** canSrcAnyCaps #method:canSrcAnyCaps# ElementFactoryCanSrcAnyCapsMethodInfo , elementFactoryCanSrcAnyCaps , -- ** create #method:create# ElementFactoryCreateMethodInfo , elementFactoryCreate , -- ** find #method:find# elementFactoryFind , -- ** getElementType #method:getElementType# ElementFactoryGetElementTypeMethodInfo , elementFactoryGetElementType , -- ** getMetadata #method:getMetadata# ElementFactoryGetMetadataMethodInfo , elementFactoryGetMetadata , -- ** getMetadataKeys #method:getMetadataKeys# ElementFactoryGetMetadataKeysMethodInfo , elementFactoryGetMetadataKeys , -- ** getNumPadTemplates #method:getNumPadTemplates# ElementFactoryGetNumPadTemplatesMethodInfo, elementFactoryGetNumPadTemplates , -- ** getStaticPadTemplates #method:getStaticPadTemplates# ElementFactoryGetStaticPadTemplatesMethodInfo, elementFactoryGetStaticPadTemplates , -- ** getUriProtocols #method:getUriProtocols# ElementFactoryGetUriProtocolsMethodInfo , elementFactoryGetUriProtocols , -- ** getUriType #method:getUriType# ElementFactoryGetUriTypeMethodInfo , elementFactoryGetUriType , -- ** hasInterface #method:hasInterface# ElementFactoryHasInterfaceMethodInfo , elementFactoryHasInterface , -- ** listFilter #method:listFilter# elementFactoryListFilter , -- ** listGetElements #method:listGetElements# elementFactoryListGetElements , -- ** listIsType #method:listIsType# ElementFactoryListIsTypeMethodInfo , elementFactoryListIsType , -- ** make #method:make# 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.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack 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 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) foreign import ccall "gst_element_factory_get_type" c_gst_element_factory_get_type :: IO GType instance GObject ElementFactory where gobjectType _ = c_gst_element_factory_get_type class GObject o => IsElementFactory o #if MIN_VERSION_base(4,9,0) instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ElementFactory a) => IsElementFactory a #endif instance IsElementFactory ElementFactory instance Gst.PluginFeature.IsPluginFeature ElementFactory instance Gst.Object.IsObject ElementFactory instance GObject.Object.IsObject ElementFactory toElementFactory :: IsElementFactory o => o -> IO ElementFactory toElementFactory = unsafeCastTo ElementFactory noElementFactory :: Maybe ElementFactory noElementFactory = Nothing 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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo ResolveElementFactoryMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo 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 "getValueArray" o = Gst.Object.ObjectGetValueArrayMethodInfo 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 "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) => O.IsLabelProxy t (ElementFactory -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveElementFactoryMethod t ElementFactory, O.MethodInfo info ElementFactory p) => O.IsLabel t (ElementFactory -> p) where fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif instance O.HasAttributeList ElementFactory type instance O.AttributeList ElementFactory = ElementFactoryAttributeList type ElementFactoryAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)]) type instance O.SignalList ElementFactory = ElementFactorySignalList type ElementFactorySignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) -- method ElementFactory::can_sink_all_caps -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to query", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the caps to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_can_sink_all_caps" gst_element_factory_can_sink_all_caps :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"}) IO CInt {- | Checks if the factory can sink all possible capabilities. -} elementFactoryCanSinkAllCaps :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to query -} -> Gst.Caps.Caps {- ^ /@caps@/: the caps to check -} -> m Bool {- ^ __Returns:__ 'True' if the caps are fully compatible. -} elementFactoryCanSinkAllCaps factory caps = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory caps' <- unsafeManagedPtrGetPtr caps result <- gst_element_factory_can_sink_all_caps factory' caps' let result' = (/= 0) result touchManagedPtr factory touchManagedPtr caps return result' data ElementFactoryCanSinkAllCapsMethodInfo instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSinkAllCapsMethodInfo a signature where overloadedMethod _ = elementFactoryCanSinkAllCaps -- method ElementFactory::can_sink_any_caps -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to query", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the caps to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_can_sink_any_caps" gst_element_factory_can_sink_any_caps :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"}) IO CInt {- | Checks if the factory can sink any possible capability. -} elementFactoryCanSinkAnyCaps :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to query -} -> Gst.Caps.Caps {- ^ /@caps@/: the caps to check -} -> m Bool {- ^ __Returns:__ 'True' if the caps have a common subset. -} elementFactoryCanSinkAnyCaps factory caps = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory caps' <- unsafeManagedPtrGetPtr caps result <- gst_element_factory_can_sink_any_caps factory' caps' let result' = (/= 0) result touchManagedPtr factory touchManagedPtr caps return result' data ElementFactoryCanSinkAnyCapsMethodInfo instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSinkAnyCapsMethodInfo a signature where overloadedMethod _ = elementFactoryCanSinkAnyCaps -- method ElementFactory::can_src_all_caps -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to query", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the caps to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_can_src_all_caps" gst_element_factory_can_src_all_caps :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"}) IO CInt {- | Checks if the factory can src all possible capabilities. -} elementFactoryCanSrcAllCaps :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to query -} -> Gst.Caps.Caps {- ^ /@caps@/: the caps to check -} -> m Bool {- ^ __Returns:__ 'True' if the caps are fully compatible. -} elementFactoryCanSrcAllCaps factory caps = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory caps' <- unsafeManagedPtrGetPtr caps result <- gst_element_factory_can_src_all_caps factory' caps' let result' = (/= 0) result touchManagedPtr factory touchManagedPtr caps return result' data ElementFactoryCanSrcAllCapsMethodInfo instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSrcAllCapsMethodInfo a signature where overloadedMethod _ = elementFactoryCanSrcAllCaps -- method ElementFactory::can_src_any_caps -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to query", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the caps to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_can_src_any_caps" gst_element_factory_can_src_any_caps :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"}) IO CInt {- | Checks if the factory can src any possible capability. -} elementFactoryCanSrcAnyCaps :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to query -} -> Gst.Caps.Caps {- ^ /@caps@/: the caps to check -} -> m Bool {- ^ __Returns:__ 'True' if the caps have a common subset. -} elementFactoryCanSrcAnyCaps factory caps = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory caps' <- unsafeManagedPtrGetPtr caps result <- gst_element_factory_can_src_any_caps factory' caps' let result' = (/= 0) result touchManagedPtr factory touchManagedPtr caps return result' data ElementFactoryCanSrcAnyCapsMethodInfo instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCanSrcAnyCapsMethodInfo a signature where overloadedMethod _ = elementFactoryCanSrcAnyCaps -- method ElementFactory::create -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to instantiate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "name of new element, or %NULL to automatically create\n a unique name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gst", name = "Element"})) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_create" gst_element_factory_create :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) CString -> -- name : TBasicType TUTF8 IO (Ptr Gst.Element.Element) {- | Create a new element of the type defined by the given elementfactory. It will be given the name supplied, since all elements require a name as their first argument. -} elementFactoryCreate :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to instantiate -} -> Maybe (T.Text) {- ^ /@name@/: name of new element, or 'Nothing' to automatically create a unique name -} -> m (Maybe Gst.Element.Element) {- ^ __Returns:__ new 'GI.Gst.Objects.Element.Element' or 'Nothing' if the element couldn\'t be created -} elementFactoryCreate factory name = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory maybeName <- case name of Nothing -> return nullPtr Just jName -> do jName' <- textToCString jName return jName' result <- gst_element_factory_create factory' maybeName maybeResult <- convertIfNonNull result $ \result' -> do result'' <- (newObject Gst.Element.Element) result' return result'' touchManagedPtr factory freeMem maybeName return maybeResult data ElementFactoryCreateMethodInfo instance (signature ~ (Maybe (T.Text) -> m (Maybe Gst.Element.Element)), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryCreateMethodInfo a signature where overloadedMethod _ = elementFactoryCreate -- method ElementFactory::get_element_type -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "factory to get managed #GType from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TGType) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_element_type" gst_element_factory_get_element_type :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO CGType {- | Get the 'GType' for elements managed by this factory. The type can only be retrieved if the element factory is loaded, which can be assured with 'GI.Gst.Objects.PluginFeature.pluginFeatureLoad'. -} elementFactoryGetElementType :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: factory to get managed 'GType' from -} -> m GType {- ^ __Returns:__ the 'GType' for elements managed by this factory or 0 if the factory is not loaded. -} elementFactoryGetElementType factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_element_type factory' let result' = GType result touchManagedPtr factory return result' data ElementFactoryGetElementTypeMethodInfo instance (signature ~ (m GType), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetElementTypeMethodInfo a signature where overloadedMethod _ = elementFactoryGetElementType -- method ElementFactory::get_metadata -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a key", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_metadata" gst_element_factory_get_metadata :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) CString -> -- key : TBasicType TUTF8 IO CString {- | Get the metadata on /@factory@/ with /@key@/. -} elementFactoryGetMetadata :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> T.Text {- ^ /@key@/: a key -} -> m (Maybe T.Text) {- ^ __Returns:__ the metadata with /@key@/ on /@factory@/ or 'Nothing' when there was no metadata with the given /@key@/. -} elementFactoryGetMetadata factory key = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory key' <- textToCString key result <- gst_element_factory_get_metadata factory' key' maybeResult <- convertIfNonNull result $ \result' -> do result'' <- cstringToText result' return result'' touchManagedPtr factory freeMem key' return maybeResult data ElementFactoryGetMetadataMethodInfo instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetMetadataMethodInfo a signature where overloadedMethod _ = elementFactoryGetMetadata -- method ElementFactory::get_metadata_keys -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_metadata_keys" gst_element_factory_get_metadata_keys :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO (Ptr CString) {- | Get the available keys for the metadata on /@factory@/. -} elementFactoryGetMetadataKeys :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> m (Maybe [T.Text]) {- ^ __Returns:__ a 'Nothing'-terminated array of key strings, or 'Nothing' when there is no metadata. Free with 'GI.GLib.Functions.strfreev' when no longer needed. -} elementFactoryGetMetadataKeys factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_metadata_keys factory' maybeResult <- convertIfNonNull result $ \result' -> do result'' <- unpackZeroTerminatedUTF8CArray result' mapZeroTerminatedCArray freeMem result' freeMem result' return result'' touchManagedPtr factory return maybeResult data ElementFactoryGetMetadataKeysMethodInfo instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetMetadataKeysMethodInfo a signature where overloadedMethod _ = elementFactoryGetMetadataKeys -- method ElementFactory::get_num_pad_templates -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_num_pad_templates" gst_element_factory_get_num_pad_templates :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO Word32 {- | Gets the number of pad_templates in this factory. -} elementFactoryGetNumPadTemplates :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> m Word32 {- ^ __Returns:__ the number of pad_templates -} elementFactoryGetNumPadTemplates factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_num_pad_templates factory' touchManagedPtr factory return result data ElementFactoryGetNumPadTemplatesMethodInfo instance (signature ~ (m Word32), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetNumPadTemplatesMethodInfo a signature where overloadedMethod _ = elementFactoryGetNumPadTemplates -- method ElementFactory::get_static_pad_templates -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Gst", name = "StaticPadTemplate"}))) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_static_pad_templates" gst_element_factory_get_static_pad_templates :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO (Ptr (GList (Ptr Gst.StaticPadTemplate.StaticPadTemplate))) {- | Gets the 'GI.GLib.Structs.List.List' of 'GI.Gst.Structs.StaticPadTemplate.StaticPadTemplate' for this factory. -} elementFactoryGetStaticPadTemplates :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> m [Gst.StaticPadTemplate.StaticPadTemplate] {- ^ __Returns:__ the static pad templates -} elementFactoryGetStaticPadTemplates factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_static_pad_templates factory' result' <- unpackGList result result'' <- mapM (newPtr Gst.StaticPadTemplate.StaticPadTemplate) result' touchManagedPtr factory return result'' data ElementFactoryGetStaticPadTemplatesMethodInfo instance (signature ~ (m [Gst.StaticPadTemplate.StaticPadTemplate]), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetStaticPadTemplatesMethodInfo a signature where overloadedMethod _ = elementFactoryGetStaticPadTemplates -- method ElementFactory::get_uri_protocols -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_uri_protocols" gst_element_factory_get_uri_protocols :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO (Ptr CString) {- | Gets a 'Nothing'-terminated array of protocols this element supports or 'Nothing' if no protocols are supported. You may not change the contents of the returned array, as it is still owned by the element factory. Use @/g_strdupv()/@ to make a copy of the protocol string array if you need to. -} elementFactoryGetUriProtocols :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> m [T.Text] {- ^ __Returns:__ the supported protocols or 'Nothing' -} elementFactoryGetUriProtocols factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_uri_protocols factory' checkUnexpectedReturnNULL "elementFactoryGetUriProtocols" result result' <- unpackZeroTerminatedUTF8CArray result touchManagedPtr factory return result' data ElementFactoryGetUriProtocolsMethodInfo instance (signature ~ (m [T.Text]), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetUriProtocolsMethodInfo a signature where overloadedMethod _ = elementFactoryGetUriProtocols -- method ElementFactory::get_uri_type -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gst", name = "URIType"})) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_get_uri_type" gst_element_factory_get_uri_type :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) IO CUInt {- | Gets the type of URIs the element supports or @/GST_URI_UNKNOWN/@ if none. -} elementFactoryGetUriType :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> m Gst.Enums.URIType {- ^ __Returns:__ type of URIs this element supports -} elementFactoryGetUriType factory = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_get_uri_type factory' let result' = (toEnum . fromIntegral) result touchManagedPtr factory return result' data ElementFactoryGetUriTypeMethodInfo instance (signature ~ (m Gst.Enums.URIType), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryGetUriTypeMethodInfo a signature where overloadedMethod _ = elementFactoryGetUriType -- method ElementFactory::has_interface -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interfacename", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an interface name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_has_interface" gst_element_factory_has_interface :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) CString -> -- interfacename : TBasicType TUTF8 IO CInt {- | Check if /@factory@/ implements the interface with name /@interfacename@/. -} elementFactoryHasInterface :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> T.Text {- ^ /@interfacename@/: an interface name -} -> m Bool {- ^ __Returns:__ 'True' when /@factory@/ implement the interface. -} elementFactoryHasInterface factory interfacename = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory interfacename' <- textToCString interfacename result <- gst_element_factory_has_interface factory' interfacename' let result' = (/= 0) result touchManagedPtr factory freeMem interfacename' return result' data ElementFactoryHasInterfaceMethodInfo instance (signature ~ (T.Text -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryHasInterfaceMethodInfo a signature where overloadedMethod _ = elementFactoryHasInterface -- method ElementFactory::list_is_type -- method type : OrdinaryMethod -- Args : [Arg {argCName = "factory", argType = TInterface (Name {namespace = "Gst", name = "ElementFactory"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactoryListType", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_list_is_type" gst_element_factory_list_is_type :: Ptr ElementFactory -> -- factory : TInterface (Name {namespace = "Gst", name = "ElementFactory"}) Word64 -> -- type : TBasicType TUInt64 IO CInt {- | Check if /@factory@/ is of the given types. -} elementFactoryListIsType :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => a {- ^ /@factory@/: a 'GI.Gst.Objects.ElementFactory.ElementFactory' -} -> Word64 {- ^ /@type@/: a @/GstElementFactoryListType/@ -} -> m Bool {- ^ __Returns:__ 'True' if /@factory@/ is of /@type@/. -} elementFactoryListIsType factory type_ = liftIO $ do factory' <- unsafeManagedPtrCastPtr factory result <- gst_element_factory_list_is_type factory' type_ let result' = (/= 0) result touchManagedPtr factory return result' data ElementFactoryListIsTypeMethodInfo instance (signature ~ (Word64 -> m Bool), MonadIO m, IsElementFactory a) => O.MethodInfo ElementFactoryListIsTypeMethodInfo a signature where overloadedMethod _ = elementFactoryListIsType -- method ElementFactory::find -- method type : MemberFunction -- Args : [Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of factory to find", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gst", name = "ElementFactory"})) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_find" gst_element_factory_find :: CString -> -- name : TBasicType TUTF8 IO (Ptr ElementFactory) {- | Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing. -} elementFactoryFind :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@name@/: name of factory to find -} -> m (Maybe ElementFactory) {- ^ __Returns:__ 'GI.Gst.Objects.ElementFactory.ElementFactory' if found, 'Nothing' otherwise -} elementFactoryFind name = liftIO $ do name' <- textToCString name result <- gst_element_factory_find name' maybeResult <- convertIfNonNull result $ \result' -> do result'' <- (wrapObject ElementFactory) result' return result'' freeMem name' return maybeResult -- method ElementFactory::list_filter -- method type : MemberFunction -- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Gst", name = "ElementFactory"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GList of\n #GstElementFactory to filter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstCaps", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "direction", argType = TInterface (Name {namespace = "Gst", name = "PadDirection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPadDirection to filter on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "subsetonly", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to filter on caps subsets or not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Gst", name = "ElementFactory"}))) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_list_filter" gst_element_factory_list_filter :: Ptr (GList (Ptr ElementFactory)) -> -- list : TGList (TInterface (Name {namespace = "Gst", name = "ElementFactory"})) Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"}) CUInt -> -- direction : TInterface (Name {namespace = "Gst", name = "PadDirection"}) CInt -> -- subsetonly : TBasicType TBoolean IO (Ptr (GList (Ptr ElementFactory))) {- | Filter out all the elementfactories in /@list@/ that can handle /@caps@/ in the given direction. If /@subsetonly@/ is 'True', then only the elements whose pads templates are a complete superset of /@caps@/ will be returned. Else any element whose pad templates caps can intersect with /@caps@/ will be returned. -} elementFactoryListFilter :: (B.CallStack.HasCallStack, MonadIO m, IsElementFactory a) => [a] {- ^ /@list@/: a 'GI.GLib.Structs.List.List' of 'GI.Gst.Objects.ElementFactory.ElementFactory' to filter -} -> Gst.Caps.Caps {- ^ /@caps@/: a 'GI.Gst.Structs.Caps.Caps' -} -> Gst.Enums.PadDirection {- ^ /@direction@/: a 'GI.Gst.Enums.PadDirection' to filter on -} -> Bool {- ^ /@subsetonly@/: whether to filter on caps subsets or not. -} -> m [ElementFactory] {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.Gst.Objects.ElementFactory.ElementFactory' elements that match the given requisites. Use @/gst_plugin_feature_list_free/@ after usage. -} elementFactoryListFilter list caps direction subsetonly = liftIO $ do list' <- mapM unsafeManagedPtrCastPtr list list'' <- packGList list' caps' <- unsafeManagedPtrGetPtr caps let direction' = (fromIntegral . fromEnum) direction let subsetonly' = (fromIntegral . fromEnum) subsetonly result <- gst_element_factory_list_filter list'' caps' direction' subsetonly' result' <- unpackGList result result'' <- mapM (wrapObject ElementFactory) result' g_list_free result mapM_ touchManagedPtr list touchManagedPtr caps g_list_free list'' return result'' -- method ElementFactory::list_get_elements -- method type : MemberFunction -- Args : [Arg {argCName = "type", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstElementFactoryListType", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "minrank", argType = TInterface (Name {namespace = "Gst", name = "Rank"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Minimum rank", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Gst", name = "ElementFactory"}))) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_list_get_elements" gst_element_factory_list_get_elements :: Word64 -> -- type : TBasicType TUInt64 CUInt -> -- minrank : TInterface (Name {namespace = "Gst", name = "Rank"}) IO (Ptr (GList (Ptr ElementFactory))) {- | Get a list of factories that match the given /@type@/. Only elements with a rank greater or equal to /@minrank@/ will be returned. The list of factories is returned by decreasing rank. -} elementFactoryListGetElements :: (B.CallStack.HasCallStack, MonadIO m) => Word64 {- ^ /@type@/: a @/GstElementFactoryListType/@ -} -> Gst.Enums.Rank {- ^ /@minrank@/: Minimum rank -} -> m [ElementFactory] {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.Gst.Objects.ElementFactory.ElementFactory' elements. Use 'GI.Gst.Objects.PluginFeature.pluginFeatureListFree' after usage. -} elementFactoryListGetElements type_ minrank = liftIO $ do let minrank' = (fromIntegral . fromEnum) minrank result <- gst_element_factory_list_get_elements type_ minrank' result' <- unpackGList result result'' <- mapM (wrapObject ElementFactory) result' g_list_free result return result'' -- method ElementFactory::make -- method type : MemberFunction -- Args : [Arg {argCName = "factoryname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a named factory to instantiate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "name of new element, or %NULL to automatically create\n a unique name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gst", name = "Element"})) -- throws : False -- Skip return : False foreign import ccall "gst_element_factory_make" gst_element_factory_make :: CString -> -- factoryname : TBasicType TUTF8 CString -> -- name : TBasicType TUTF8 IO (Ptr Gst.Element.Element) {- | Create a new element of the type defined by the given element factory. If name is 'Nothing', then the element will receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will be given the name supplied. -} elementFactoryMake :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@factoryname@/: a named factory to instantiate -} -> Maybe (T.Text) {- ^ /@name@/: name of new element, or 'Nothing' to automatically create a unique name -} -> m (Maybe Gst.Element.Element) {- ^ __Returns:__ new 'GI.Gst.Objects.Element.Element' or 'Nothing' if unable to create element -} elementFactoryMake factoryname name = liftIO $ do factoryname' <- textToCString factoryname maybeName <- case name of Nothing -> return nullPtr Just jName -> do jName' <- textToCString jName return jName' result <- gst_element_factory_make factoryname' maybeName maybeResult <- convertIfNonNull result $ \result' -> do result'' <- (newObject Gst.Element.Element) result' return result'' freeMem factoryname' freeMem maybeName return maybeResult