{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- GstElement is the abstract base class needed to construct an element that
-- can be used in a GStreamer pipeline. Please refer to the plugin writers
-- guide for more information on creating t'GI.Gst.Objects.Element.Element' subclasses.
-- 
-- The name of a t'GI.Gst.Objects.Element.Element' can be get with @/gst_element_get_name()/@ and set with
-- @/gst_element_set_name()/@.  For speed, @/GST_ELEMENT_NAME()/@ can be used in the
-- core when using the appropriate locking. Do not use this in plug-ins or
-- applications in order to retain ABI compatibility.
-- 
-- Elements can have pads (of the type t'GI.Gst.Objects.Pad.Pad').  These pads link to pads on
-- other elements.  t'GI.Gst.Structs.Buffer.Buffer' flow between these linked pads.
-- A t'GI.Gst.Objects.Element.Element' has a t'GI.GLib.Structs.List.List' of t'GI.Gst.Objects.Pad.Pad' structures for all their input (or sink)
-- and output (or source) pads.
-- Core and plug-in writers can add and remove pads with 'GI.Gst.Objects.Element.elementAddPad'
-- and 'GI.Gst.Objects.Element.elementRemovePad'.
-- 
-- An existing pad of an element can be retrieved by name with
-- 'GI.Gst.Objects.Element.elementGetStaticPad'. A new dynamic pad can be created using
-- 'GI.Gst.Objects.Element.elementRequestPad' with a t'GI.Gst.Objects.PadTemplate.PadTemplate'.
-- An iterator of all pads can be retrieved with 'GI.Gst.Objects.Element.elementIteratePads'.
-- 
-- Elements can be linked through their pads.
-- If the link is straightforward, use the 'GI.Gst.Objects.Element.elementLink'
-- convenience function to link two elements, or @/gst_element_link_many()/@
-- for more elements in a row.
-- Use 'GI.Gst.Objects.Element.elementLinkFiltered' to link two elements constrained by
-- a specified set of t'GI.Gst.Structs.Caps.Caps'.
-- For finer control, use 'GI.Gst.Objects.Element.elementLinkPads' and
-- 'GI.Gst.Objects.Element.elementLinkPadsFiltered' to specify the pads to link on
-- each element by name.
-- 
-- Each element has a state (see t'GI.Gst.Enums.State').  You can get and set the state
-- of an element with 'GI.Gst.Objects.Element.elementGetState' and 'GI.Gst.Objects.Element.elementSetState'.
-- Setting a state triggers a t'GI.Gst.Enums.StateChange'. To get a string representation
-- of a t'GI.Gst.Enums.State', use 'GI.Gst.Objects.Element.elementStateGetName'.
-- 
-- You can get and set a t'GI.Gst.Objects.Clock.Clock' on an element using 'GI.Gst.Objects.Element.elementGetClock'
-- and 'GI.Gst.Objects.Element.elementSetClock'.
-- Some elements can provide a clock for the pipeline if
-- the @/GST_ELEMENT_FLAG_PROVIDE_CLOCK/@ flag is set. With the
-- 'GI.Gst.Objects.Element.elementProvideClock' method one can retrieve the clock provided by
-- such an element.
-- Not all elements require a clock to operate correctly. If the
-- @/GST_ELEMENT_FLAG_REQUIRE_CLOCK/@() flag is set, a clock should be set on the
-- element with 'GI.Gst.Objects.Element.elementSetClock'.
-- 
-- Note that clock selection and distribution is normally handled by the
-- toplevel t'GI.Gst.Objects.Pipeline.Pipeline' so the clock functions are only to be used in very
-- specific situations.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gst.Objects.Element
    ( 

-- * Exported types
    Element(..)                             ,
    IsElement                               ,
    toElement                               ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortState]("GI.Gst.Objects.Element#g:method:abortState"), [addControlBinding]("GI.Gst.Objects.Object#g:method:addControlBinding"), [addPad]("GI.Gst.Objects.Element#g:method:addPad"), [addPropertyDeepNotifyWatch]("GI.Gst.Objects.Element#g:method:addPropertyDeepNotifyWatch"), [addPropertyNotifyWatch]("GI.Gst.Objects.Element#g:method:addPropertyNotifyWatch"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [callAsync]("GI.Gst.Objects.Element#g:method:callAsync"), [changeState]("GI.Gst.Objects.Element#g:method:changeState"), [continueState]("GI.Gst.Objects.Element#g:method:continueState"), [createAllPads]("GI.Gst.Objects.Element#g:method:createAllPads"), [defaultError]("GI.Gst.Objects.Object#g:method:defaultError"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [foreachPad]("GI.Gst.Objects.Element#g:method:foreachPad"), [foreachSinkPad]("GI.Gst.Objects.Element#g:method:foreachSinkPad"), [foreachSrcPad]("GI.Gst.Objects.Element#g:method:foreachSrcPad"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hasActiveControlBindings]("GI.Gst.Objects.Object#g:method:hasActiveControlBindings"), [hasAncestor]("GI.Gst.Objects.Object#g:method:hasAncestor"), [hasAsAncestor]("GI.Gst.Objects.Object#g:method:hasAsAncestor"), [hasAsParent]("GI.Gst.Objects.Object#g:method:hasAsParent"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isLockedState]("GI.Gst.Objects.Element#g:method:isLockedState"), [iteratePads]("GI.Gst.Objects.Element#g:method:iteratePads"), [iterateSinkPads]("GI.Gst.Objects.Element#g:method:iterateSinkPads"), [iterateSrcPads]("GI.Gst.Objects.Element#g:method:iterateSrcPads"), [link]("GI.Gst.Objects.Element#g:method:link"), [linkFiltered]("GI.Gst.Objects.Element#g:method:linkFiltered"), [linkPads]("GI.Gst.Objects.Element#g:method:linkPads"), [linkPadsFiltered]("GI.Gst.Objects.Element#g:method:linkPadsFiltered"), [linkPadsFull]("GI.Gst.Objects.Element#g:method:linkPadsFull"), [lostState]("GI.Gst.Objects.Element#g:method:lostState"), [messageFull]("GI.Gst.Objects.Element#g:method:messageFull"), [messageFullWithDetails]("GI.Gst.Objects.Element#g:method:messageFullWithDetails"), [noMorePads]("GI.Gst.Objects.Element#g:method:noMorePads"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [postMessage]("GI.Gst.Objects.Element#g:method:postMessage"), [provideClock]("GI.Gst.Objects.Element#g:method:provideClock"), [query]("GI.Gst.Objects.Element#g:method:query"), [queryConvert]("GI.Gst.Objects.Element#g:method:queryConvert"), [queryDuration]("GI.Gst.Objects.Element#g:method:queryDuration"), [queryPosition]("GI.Gst.Objects.Element#g:method:queryPosition"), [ref]("GI.Gst.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [releaseRequestPad]("GI.Gst.Objects.Element#g:method:releaseRequestPad"), [removeControlBinding]("GI.Gst.Objects.Object#g:method:removeControlBinding"), [removePad]("GI.Gst.Objects.Element#g:method:removePad"), [removePropertyNotifyWatch]("GI.Gst.Objects.Element#g:method:removePropertyNotifyWatch"), [requestPad]("GI.Gst.Objects.Element#g:method:requestPad"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [seek]("GI.Gst.Objects.Element#g:method:seek"), [seekSimple]("GI.Gst.Objects.Element#g:method:seekSimple"), [sendEvent]("GI.Gst.Objects.Element#g:method:sendEvent"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [suggestNextSync]("GI.Gst.Objects.Object#g:method:suggestNextSync"), [syncStateWithParent]("GI.Gst.Objects.Element#g:method:syncStateWithParent"), [syncValues]("GI.Gst.Objects.Object#g:method:syncValues"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unlink]("GI.Gst.Objects.Element#g:method:unlink"), [unlinkPads]("GI.Gst.Objects.Element#g:method:unlinkPads"), [unparent]("GI.Gst.Objects.Object#g:method:unparent"), [unref]("GI.Gst.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getBaseTime]("GI.Gst.Objects.Element#g:method:getBaseTime"), [getBus]("GI.Gst.Objects.Element#g:method:getBus"), [getClock]("GI.Gst.Objects.Element#g:method:getClock"), [getCompatiblePad]("GI.Gst.Objects.Element#g:method:getCompatiblePad"), [getCompatiblePadTemplate]("GI.Gst.Objects.Element#g:method:getCompatiblePadTemplate"), [getContext]("GI.Gst.Objects.Element#g:method:getContext"), [getContextUnlocked]("GI.Gst.Objects.Element#g:method:getContextUnlocked"), [getContexts]("GI.Gst.Objects.Element#g:method:getContexts"), [getControlBinding]("GI.Gst.Objects.Object#g:method:getControlBinding"), [getControlRate]("GI.Gst.Objects.Object#g:method:getControlRate"), [getCurrentClockTime]("GI.Gst.Objects.Element#g:method:getCurrentClockTime"), [getCurrentRunningTime]("GI.Gst.Objects.Element#g:method:getCurrentRunningTime"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getFactory]("GI.Gst.Objects.Element#g:method:getFactory"), [getGValueArray]("GI.Gst.Objects.Object#g:method:getGValueArray"), [getMetadata]("GI.Gst.Objects.Element#g:method:getMetadata"), [getName]("GI.Gst.Objects.Object#g:method:getName"), [getPadTemplate]("GI.Gst.Objects.Element#g:method:getPadTemplate"), [getPadTemplateList]("GI.Gst.Objects.Element#g:method:getPadTemplateList"), [getParent]("GI.Gst.Objects.Object#g:method:getParent"), [getPathString]("GI.Gst.Objects.Object#g:method:getPathString"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRequestPad]("GI.Gst.Objects.Element#g:method:getRequestPad"), [getStartTime]("GI.Gst.Objects.Element#g:method:getStartTime"), [getState]("GI.Gst.Objects.Element#g:method:getState"), [getStaticPad]("GI.Gst.Objects.Element#g:method:getStaticPad"), [getValue]("GI.Gst.Objects.Object#g:method:getValue").
-- 
-- ==== Setters
-- [setBaseTime]("GI.Gst.Objects.Element#g:method:setBaseTime"), [setBus]("GI.Gst.Objects.Element#g:method:setBus"), [setClock]("GI.Gst.Objects.Element#g:method:setClock"), [setContext]("GI.Gst.Objects.Element#g:method:setContext"), [setControlBindingDisabled]("GI.Gst.Objects.Object#g:method:setControlBindingDisabled"), [setControlBindingsDisabled]("GI.Gst.Objects.Object#g:method:setControlBindingsDisabled"), [setControlRate]("GI.Gst.Objects.Object#g:method:setControlRate"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setLockedState]("GI.Gst.Objects.Element#g:method:setLockedState"), [setName]("GI.Gst.Objects.Object#g:method:setName"), [setParent]("GI.Gst.Objects.Object#g:method:setParent"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setStartTime]("GI.Gst.Objects.Element#g:method:setStartTime"), [setState]("GI.Gst.Objects.Element#g:method:setState").

#if defined(ENABLE_OVERLOADING)
    ResolveElementMethod                    ,
#endif

-- ** abortState #method:abortState#

#if defined(ENABLE_OVERLOADING)
    ElementAbortStateMethodInfo             ,
#endif
    elementAbortState                       ,


-- ** addPad #method:addPad#

#if defined(ENABLE_OVERLOADING)
    ElementAddPadMethodInfo                 ,
#endif
    elementAddPad                           ,


-- ** addPropertyDeepNotifyWatch #method:addPropertyDeepNotifyWatch#

#if defined(ENABLE_OVERLOADING)
    ElementAddPropertyDeepNotifyWatchMethodInfo,
#endif
    elementAddPropertyDeepNotifyWatch       ,


-- ** addPropertyNotifyWatch #method:addPropertyNotifyWatch#

#if defined(ENABLE_OVERLOADING)
    ElementAddPropertyNotifyWatchMethodInfo ,
#endif
    elementAddPropertyNotifyWatch           ,


-- ** callAsync #method:callAsync#

#if defined(ENABLE_OVERLOADING)
    ElementCallAsyncMethodInfo              ,
#endif
    elementCallAsync                        ,


-- ** changeState #method:changeState#

#if defined(ENABLE_OVERLOADING)
    ElementChangeStateMethodInfo            ,
#endif
    elementChangeState                      ,


-- ** continueState #method:continueState#

#if defined(ENABLE_OVERLOADING)
    ElementContinueStateMethodInfo          ,
#endif
    elementContinueState                    ,


-- ** createAllPads #method:createAllPads#

#if defined(ENABLE_OVERLOADING)
    ElementCreateAllPadsMethodInfo          ,
#endif
    elementCreateAllPads                    ,


-- ** foreachPad #method:foreachPad#

#if defined(ENABLE_OVERLOADING)
    ElementForeachPadMethodInfo             ,
#endif
    elementForeachPad                       ,


-- ** foreachSinkPad #method:foreachSinkPad#

#if defined(ENABLE_OVERLOADING)
    ElementForeachSinkPadMethodInfo         ,
#endif
    elementForeachSinkPad                   ,


-- ** foreachSrcPad #method:foreachSrcPad#

#if defined(ENABLE_OVERLOADING)
    ElementForeachSrcPadMethodInfo          ,
#endif
    elementForeachSrcPad                    ,


-- ** getBaseTime #method:getBaseTime#

#if defined(ENABLE_OVERLOADING)
    ElementGetBaseTimeMethodInfo            ,
#endif
    elementGetBaseTime                      ,


-- ** getBus #method:getBus#

#if defined(ENABLE_OVERLOADING)
    ElementGetBusMethodInfo                 ,
#endif
    elementGetBus                           ,


-- ** getClock #method:getClock#

#if defined(ENABLE_OVERLOADING)
    ElementGetClockMethodInfo               ,
#endif
    elementGetClock                         ,


-- ** getCompatiblePad #method:getCompatiblePad#

#if defined(ENABLE_OVERLOADING)
    ElementGetCompatiblePadMethodInfo       ,
#endif
    elementGetCompatiblePad                 ,


-- ** getCompatiblePadTemplate #method:getCompatiblePadTemplate#

#if defined(ENABLE_OVERLOADING)
    ElementGetCompatiblePadTemplateMethodInfo,
#endif
    elementGetCompatiblePadTemplate         ,


-- ** getContext #method:getContext#

#if defined(ENABLE_OVERLOADING)
    ElementGetContextMethodInfo             ,
#endif
    elementGetContext                       ,


-- ** getContextUnlocked #method:getContextUnlocked#

#if defined(ENABLE_OVERLOADING)
    ElementGetContextUnlockedMethodInfo     ,
#endif
    elementGetContextUnlocked               ,


-- ** getContexts #method:getContexts#

#if defined(ENABLE_OVERLOADING)
    ElementGetContextsMethodInfo            ,
#endif
    elementGetContexts                      ,


-- ** getCurrentClockTime #method:getCurrentClockTime#

#if defined(ENABLE_OVERLOADING)
    ElementGetCurrentClockTimeMethodInfo    ,
#endif
    elementGetCurrentClockTime              ,


-- ** getCurrentRunningTime #method:getCurrentRunningTime#

#if defined(ENABLE_OVERLOADING)
    ElementGetCurrentRunningTimeMethodInfo  ,
#endif
    elementGetCurrentRunningTime            ,


-- ** getFactory #method:getFactory#

#if defined(ENABLE_OVERLOADING)
    ElementGetFactoryMethodInfo             ,
#endif
    elementGetFactory                       ,


-- ** getMetadata #method:getMetadata#

#if defined(ENABLE_OVERLOADING)
    ElementGetMetadataMethodInfo            ,
#endif
    elementGetMetadata                      ,


-- ** getPadTemplate #method:getPadTemplate#

#if defined(ENABLE_OVERLOADING)
    ElementGetPadTemplateMethodInfo         ,
#endif
    elementGetPadTemplate                   ,


-- ** getPadTemplateList #method:getPadTemplateList#

#if defined(ENABLE_OVERLOADING)
    ElementGetPadTemplateListMethodInfo     ,
#endif
    elementGetPadTemplateList               ,


-- ** getRequestPad #method:getRequestPad#

#if defined(ENABLE_OVERLOADING)
    ElementGetRequestPadMethodInfo          ,
#endif
    elementGetRequestPad                    ,


-- ** getStartTime #method:getStartTime#

#if defined(ENABLE_OVERLOADING)
    ElementGetStartTimeMethodInfo           ,
#endif
    elementGetStartTime                     ,


-- ** getState #method:getState#

#if defined(ENABLE_OVERLOADING)
    ElementGetStateMethodInfo               ,
#endif
    elementGetState                         ,


-- ** getStaticPad #method:getStaticPad#

#if defined(ENABLE_OVERLOADING)
    ElementGetStaticPadMethodInfo           ,
#endif
    elementGetStaticPad                     ,


-- ** isLockedState #method:isLockedState#

#if defined(ENABLE_OVERLOADING)
    ElementIsLockedStateMethodInfo          ,
#endif
    elementIsLockedState                    ,


-- ** iteratePads #method:iteratePads#

#if defined(ENABLE_OVERLOADING)
    ElementIteratePadsMethodInfo            ,
#endif
    elementIteratePads                      ,


-- ** iterateSinkPads #method:iterateSinkPads#

#if defined(ENABLE_OVERLOADING)
    ElementIterateSinkPadsMethodInfo        ,
#endif
    elementIterateSinkPads                  ,


-- ** iterateSrcPads #method:iterateSrcPads#

#if defined(ENABLE_OVERLOADING)
    ElementIterateSrcPadsMethodInfo         ,
#endif
    elementIterateSrcPads                   ,


-- ** link #method:link#

#if defined(ENABLE_OVERLOADING)
    ElementLinkMethodInfo                   ,
#endif
    elementLink                             ,


-- ** linkFiltered #method:linkFiltered#

#if defined(ENABLE_OVERLOADING)
    ElementLinkFilteredMethodInfo           ,
#endif
    elementLinkFiltered                     ,


-- ** linkPads #method:linkPads#

#if defined(ENABLE_OVERLOADING)
    ElementLinkPadsMethodInfo               ,
#endif
    elementLinkPads                         ,


-- ** linkPadsFiltered #method:linkPadsFiltered#

#if defined(ENABLE_OVERLOADING)
    ElementLinkPadsFilteredMethodInfo       ,
#endif
    elementLinkPadsFiltered                 ,


-- ** linkPadsFull #method:linkPadsFull#

#if defined(ENABLE_OVERLOADING)
    ElementLinkPadsFullMethodInfo           ,
#endif
    elementLinkPadsFull                     ,


-- ** lostState #method:lostState#

#if defined(ENABLE_OVERLOADING)
    ElementLostStateMethodInfo              ,
#endif
    elementLostState                        ,


-- ** makeFromUri #method:makeFromUri#

    elementMakeFromUri                      ,


-- ** messageFull #method:messageFull#

#if defined(ENABLE_OVERLOADING)
    ElementMessageFullMethodInfo            ,
#endif
    elementMessageFull                      ,


-- ** messageFullWithDetails #method:messageFullWithDetails#

#if defined(ENABLE_OVERLOADING)
    ElementMessageFullWithDetailsMethodInfo ,
#endif
    elementMessageFullWithDetails           ,


-- ** noMorePads #method:noMorePads#

#if defined(ENABLE_OVERLOADING)
    ElementNoMorePadsMethodInfo             ,
#endif
    elementNoMorePads                       ,


-- ** postMessage #method:postMessage#

#if defined(ENABLE_OVERLOADING)
    ElementPostMessageMethodInfo            ,
#endif
    elementPostMessage                      ,


-- ** provideClock #method:provideClock#

#if defined(ENABLE_OVERLOADING)
    ElementProvideClockMethodInfo           ,
#endif
    elementProvideClock                     ,


-- ** query #method:query#

#if defined(ENABLE_OVERLOADING)
    ElementQueryMethodInfo                  ,
#endif
    elementQuery                            ,


-- ** queryConvert #method:queryConvert#

#if defined(ENABLE_OVERLOADING)
    ElementQueryConvertMethodInfo           ,
#endif
    elementQueryConvert                     ,


-- ** queryDuration #method:queryDuration#

#if defined(ENABLE_OVERLOADING)
    ElementQueryDurationMethodInfo          ,
#endif
    elementQueryDuration                    ,


-- ** queryPosition #method:queryPosition#

#if defined(ENABLE_OVERLOADING)
    ElementQueryPositionMethodInfo          ,
#endif
    elementQueryPosition                    ,


-- ** register #method:register#

    elementRegister                         ,


-- ** releaseRequestPad #method:releaseRequestPad#

#if defined(ENABLE_OVERLOADING)
    ElementReleaseRequestPadMethodInfo      ,
#endif
    elementReleaseRequestPad                ,


-- ** removePad #method:removePad#

#if defined(ENABLE_OVERLOADING)
    ElementRemovePadMethodInfo              ,
#endif
    elementRemovePad                        ,


-- ** removePropertyNotifyWatch #method:removePropertyNotifyWatch#

#if defined(ENABLE_OVERLOADING)
    ElementRemovePropertyNotifyWatchMethodInfo,
#endif
    elementRemovePropertyNotifyWatch        ,


-- ** requestPad #method:requestPad#

#if defined(ENABLE_OVERLOADING)
    ElementRequestPadMethodInfo             ,
#endif
    elementRequestPad                       ,


-- ** seek #method:seek#

#if defined(ENABLE_OVERLOADING)
    ElementSeekMethodInfo                   ,
#endif
    elementSeek                             ,


-- ** seekSimple #method:seekSimple#

#if defined(ENABLE_OVERLOADING)
    ElementSeekSimpleMethodInfo             ,
#endif
    elementSeekSimple                       ,


-- ** sendEvent #method:sendEvent#

#if defined(ENABLE_OVERLOADING)
    ElementSendEventMethodInfo              ,
#endif
    elementSendEvent                        ,


-- ** setBaseTime #method:setBaseTime#

#if defined(ENABLE_OVERLOADING)
    ElementSetBaseTimeMethodInfo            ,
#endif
    elementSetBaseTime                      ,


-- ** setBus #method:setBus#

#if defined(ENABLE_OVERLOADING)
    ElementSetBusMethodInfo                 ,
#endif
    elementSetBus                           ,


-- ** setClock #method:setClock#

#if defined(ENABLE_OVERLOADING)
    ElementSetClockMethodInfo               ,
#endif
    elementSetClock                         ,


-- ** setContext #method:setContext#

#if defined(ENABLE_OVERLOADING)
    ElementSetContextMethodInfo             ,
#endif
    elementSetContext                       ,


-- ** setLockedState #method:setLockedState#

#if defined(ENABLE_OVERLOADING)
    ElementSetLockedStateMethodInfo         ,
#endif
    elementSetLockedState                   ,


-- ** setStartTime #method:setStartTime#

#if defined(ENABLE_OVERLOADING)
    ElementSetStartTimeMethodInfo           ,
#endif
    elementSetStartTime                     ,


-- ** setState #method:setState#

#if defined(ENABLE_OVERLOADING)
    ElementSetStateMethodInfo               ,
#endif
    elementSetState                         ,


-- ** stateChangeReturnGetName #method:stateChangeReturnGetName#

    elementStateChangeReturnGetName         ,


-- ** stateGetName #method:stateGetName#

    elementStateGetName                     ,


-- ** syncStateWithParent #method:syncStateWithParent#

#if defined(ENABLE_OVERLOADING)
    ElementSyncStateWithParentMethodInfo    ,
#endif
    elementSyncStateWithParent              ,


-- ** unlink #method:unlink#

#if defined(ENABLE_OVERLOADING)
    ElementUnlinkMethodInfo                 ,
#endif
    elementUnlink                           ,


-- ** unlinkPads #method:unlinkPads#

#if defined(ENABLE_OVERLOADING)
    ElementUnlinkPadsMethodInfo             ,
#endif
    elementUnlinkPads                       ,




 -- * Signals


-- ** noMorePads #signal:noMorePads#

    C_ElementNoMorePadsCallback             ,
    ElementNoMorePadsCallback               ,
#if defined(ENABLE_OVERLOADING)
    ElementNoMorePadsSignalInfo             ,
#endif
    afterElementNoMorePads                  ,
    genClosure_ElementNoMorePads            ,
    mk_ElementNoMorePadsCallback            ,
    noElementNoMorePadsCallback             ,
    onElementNoMorePads                     ,
    wrap_ElementNoMorePadsCallback          ,


-- ** padAdded #signal:padAdded#

    C_ElementPadAddedCallback               ,
    ElementPadAddedCallback                 ,
#if defined(ENABLE_OVERLOADING)
    ElementPadAddedSignalInfo               ,
#endif
    afterElementPadAdded                    ,
    genClosure_ElementPadAdded              ,
    mk_ElementPadAddedCallback              ,
    noElementPadAddedCallback               ,
    onElementPadAdded                       ,
    wrap_ElementPadAddedCallback            ,


-- ** padRemoved #signal:padRemoved#

    C_ElementPadRemovedCallback             ,
    ElementPadRemovedCallback               ,
#if defined(ENABLE_OVERLOADING)
    ElementPadRemovedSignalInfo             ,
#endif
    afterElementPadRemoved                  ,
    genClosure_ElementPadRemoved            ,
    mk_ElementPadRemovedCallback            ,
    noElementPadRemovedCallback             ,
    onElementPadRemoved                     ,
    wrap_ElementPadRemovedCallback          ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Callbacks as Gst.Callbacks
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Flags as Gst.Flags
import {-# SOURCE #-} qualified GI.Gst.Objects.Bus as Gst.Bus
import {-# SOURCE #-} qualified GI.Gst.Objects.Clock as Gst.Clock
import {-# SOURCE #-} qualified GI.Gst.Objects.ElementFactory as Gst.ElementFactory
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Pad as Gst.Pad
import {-# SOURCE #-} qualified GI.Gst.Objects.PadTemplate as Gst.PadTemplate
import {-# SOURCE #-} qualified GI.Gst.Objects.Plugin as Gst.Plugin
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.Context as Gst.Context
import {-# SOURCE #-} qualified GI.Gst.Structs.Event as Gst.Event
import {-# SOURCE #-} qualified GI.Gst.Structs.Iterator as Gst.Iterator
import {-# SOURCE #-} qualified GI.Gst.Structs.Message as Gst.Message
import {-# SOURCE #-} qualified GI.Gst.Structs.Query as Gst.Query
import {-# SOURCE #-} qualified GI.Gst.Structs.Structure as Gst.Structure

-- | Memory-managed wrapper type.
newtype Element = Element (SP.ManagedPtr Element)
    deriving (Element -> Element -> Bool
(Element -> Element -> Bool)
-> (Element -> Element -> Bool) -> Eq Element
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Element -> Element -> Bool
$c/= :: Element -> Element -> Bool
== :: Element -> Element -> Bool
$c== :: Element -> Element -> Bool
Eq)

instance SP.ManagedPtrNewtype Element where
    toManagedPtr :: Element -> ManagedPtr Element
toManagedPtr (Element ManagedPtr Element
p) = ManagedPtr Element
p

foreign import ccall "gst_element_get_type"
    c_gst_element_get_type :: IO B.Types.GType

instance B.Types.TypedObject Element where
    glibType :: IO GType
glibType = IO GType
c_gst_element_get_type

instance B.Types.GObject Element

-- | Type class for types which can be safely cast to `Element`, for instance with `toElement`.
class (SP.GObject o, O.IsDescendantOf Element o) => IsElement o
instance (SP.GObject o, O.IsDescendantOf Element o) => IsElement o

instance O.HasParentTypes Element
type instance O.ParentTypes Element = '[Gst.Object.Object, GObject.Object.Object]

-- | Cast to `Element`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toElement :: (MIO.MonadIO m, IsElement o) => o -> m Element
toElement :: forall (m :: * -> *) o. (MonadIO m, IsElement o) => o -> m Element
toElement = IO Element -> m Element
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Element -> m Element) -> (o -> IO Element) -> o -> m Element
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Element -> Element) -> o -> IO Element
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Element -> Element
Element

-- | Convert 'Element' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Element) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_element_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Element -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Element
P.Nothing = Ptr GValue -> Ptr Element -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Element
forall a. Ptr a
FP.nullPtr :: FP.Ptr Element)
    gvalueSet_ Ptr GValue
gv (P.Just Element
obj) = Element -> (Ptr Element -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Element
obj (Ptr GValue -> Ptr Element -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Element)
gvalueGet_ Ptr GValue
gv = do
        Ptr Element
ptr <- Ptr GValue -> IO (Ptr Element)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Element)
        if Ptr Element
ptr Ptr Element -> Ptr Element -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Element
forall a. Ptr a
FP.nullPtr
        then Element -> Maybe Element
forall a. a -> Maybe a
P.Just (Element -> Maybe Element) -> IO Element -> IO (Maybe Element)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Element -> Element
Element Ptr Element
ptr
        else Maybe Element -> IO (Maybe Element)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Element
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveElementMethod (t :: Symbol) (o :: *) :: * where
    ResolveElementMethod "abortState" o = ElementAbortStateMethodInfo
    ResolveElementMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveElementMethod "addPad" o = ElementAddPadMethodInfo
    ResolveElementMethod "addPropertyDeepNotifyWatch" o = ElementAddPropertyDeepNotifyWatchMethodInfo
    ResolveElementMethod "addPropertyNotifyWatch" o = ElementAddPropertyNotifyWatchMethodInfo
    ResolveElementMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveElementMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveElementMethod "callAsync" o = ElementCallAsyncMethodInfo
    ResolveElementMethod "changeState" o = ElementChangeStateMethodInfo
    ResolveElementMethod "continueState" o = ElementContinueStateMethodInfo
    ResolveElementMethod "createAllPads" o = ElementCreateAllPadsMethodInfo
    ResolveElementMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveElementMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveElementMethod "foreachPad" o = ElementForeachPadMethodInfo
    ResolveElementMethod "foreachSinkPad" o = ElementForeachSinkPadMethodInfo
    ResolveElementMethod "foreachSrcPad" o = ElementForeachSrcPadMethodInfo
    ResolveElementMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveElementMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveElementMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveElementMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveElementMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveElementMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveElementMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveElementMethod "isLockedState" o = ElementIsLockedStateMethodInfo
    ResolveElementMethod "iteratePads" o = ElementIteratePadsMethodInfo
    ResolveElementMethod "iterateSinkPads" o = ElementIterateSinkPadsMethodInfo
    ResolveElementMethod "iterateSrcPads" o = ElementIterateSrcPadsMethodInfo
    ResolveElementMethod "link" o = ElementLinkMethodInfo
    ResolveElementMethod "linkFiltered" o = ElementLinkFilteredMethodInfo
    ResolveElementMethod "linkPads" o = ElementLinkPadsMethodInfo
    ResolveElementMethod "linkPadsFiltered" o = ElementLinkPadsFilteredMethodInfo
    ResolveElementMethod "linkPadsFull" o = ElementLinkPadsFullMethodInfo
    ResolveElementMethod "lostState" o = ElementLostStateMethodInfo
    ResolveElementMethod "messageFull" o = ElementMessageFullMethodInfo
    ResolveElementMethod "messageFullWithDetails" o = ElementMessageFullWithDetailsMethodInfo
    ResolveElementMethod "noMorePads" o = ElementNoMorePadsMethodInfo
    ResolveElementMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveElementMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveElementMethod "postMessage" o = ElementPostMessageMethodInfo
    ResolveElementMethod "provideClock" o = ElementProvideClockMethodInfo
    ResolveElementMethod "query" o = ElementQueryMethodInfo
    ResolveElementMethod "queryConvert" o = ElementQueryConvertMethodInfo
    ResolveElementMethod "queryDuration" o = ElementQueryDurationMethodInfo
    ResolveElementMethod "queryPosition" o = ElementQueryPositionMethodInfo
    ResolveElementMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveElementMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveElementMethod "releaseRequestPad" o = ElementReleaseRequestPadMethodInfo
    ResolveElementMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveElementMethod "removePad" o = ElementRemovePadMethodInfo
    ResolveElementMethod "removePropertyNotifyWatch" o = ElementRemovePropertyNotifyWatchMethodInfo
    ResolveElementMethod "requestPad" o = ElementRequestPadMethodInfo
    ResolveElementMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveElementMethod "seek" o = ElementSeekMethodInfo
    ResolveElementMethod "seekSimple" o = ElementSeekSimpleMethodInfo
    ResolveElementMethod "sendEvent" o = ElementSendEventMethodInfo
    ResolveElementMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveElementMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveElementMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveElementMethod "syncStateWithParent" o = ElementSyncStateWithParentMethodInfo
    ResolveElementMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveElementMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveElementMethod "unlink" o = ElementUnlinkMethodInfo
    ResolveElementMethod "unlinkPads" o = ElementUnlinkPadsMethodInfo
    ResolveElementMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveElementMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveElementMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveElementMethod "getBaseTime" o = ElementGetBaseTimeMethodInfo
    ResolveElementMethod "getBus" o = ElementGetBusMethodInfo
    ResolveElementMethod "getClock" o = ElementGetClockMethodInfo
    ResolveElementMethod "getCompatiblePad" o = ElementGetCompatiblePadMethodInfo
    ResolveElementMethod "getCompatiblePadTemplate" o = ElementGetCompatiblePadTemplateMethodInfo
    ResolveElementMethod "getContext" o = ElementGetContextMethodInfo
    ResolveElementMethod "getContextUnlocked" o = ElementGetContextUnlockedMethodInfo
    ResolveElementMethod "getContexts" o = ElementGetContextsMethodInfo
    ResolveElementMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveElementMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveElementMethod "getCurrentClockTime" o = ElementGetCurrentClockTimeMethodInfo
    ResolveElementMethod "getCurrentRunningTime" o = ElementGetCurrentRunningTimeMethodInfo
    ResolveElementMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveElementMethod "getFactory" o = ElementGetFactoryMethodInfo
    ResolveElementMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveElementMethod "getMetadata" o = ElementGetMetadataMethodInfo
    ResolveElementMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveElementMethod "getPadTemplate" o = ElementGetPadTemplateMethodInfo
    ResolveElementMethod "getPadTemplateList" o = ElementGetPadTemplateListMethodInfo
    ResolveElementMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveElementMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveElementMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveElementMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveElementMethod "getRequestPad" o = ElementGetRequestPadMethodInfo
    ResolveElementMethod "getStartTime" o = ElementGetStartTimeMethodInfo
    ResolveElementMethod "getState" o = ElementGetStateMethodInfo
    ResolveElementMethod "getStaticPad" o = ElementGetStaticPadMethodInfo
    ResolveElementMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveElementMethod "setBaseTime" o = ElementSetBaseTimeMethodInfo
    ResolveElementMethod "setBus" o = ElementSetBusMethodInfo
    ResolveElementMethod "setClock" o = ElementSetClockMethodInfo
    ResolveElementMethod "setContext" o = ElementSetContextMethodInfo
    ResolveElementMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveElementMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveElementMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveElementMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveElementMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveElementMethod "setLockedState" o = ElementSetLockedStateMethodInfo
    ResolveElementMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveElementMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveElementMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveElementMethod "setStartTime" o = ElementSetStartTimeMethodInfo
    ResolveElementMethod "setState" o = ElementSetStateMethodInfo
    ResolveElementMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveElementMethod t Element, O.OverloadedMethod info Element p) => OL.IsLabel t (Element -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveElementMethod t Element, O.OverloadedMethod info Element p, R.HasField t Element p) => R.HasField t Element p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveElementMethod t Element, O.OverloadedMethodInfo info Element) => OL.IsLabel t (O.MethodProxy info Element) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- signal Element::no-more-pads
-- | This signals that the element will not generate more dynamic pads.
-- Note that this signal will usually be emitted from the context of
-- the streaming thread.
type ElementNoMorePadsCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementNoMorePadsCallback`@.
noElementNoMorePadsCallback :: Maybe ElementNoMorePadsCallback
noElementNoMorePadsCallback :: Maybe (IO ())
noElementNoMorePadsCallback = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ElementNoMorePadsCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ElementNoMorePadsCallback`.
foreign import ccall "wrapper"
    mk_ElementNoMorePadsCallback :: C_ElementNoMorePadsCallback -> IO (FunPtr C_ElementNoMorePadsCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ElementNoMorePads :: MonadIO m => ElementNoMorePadsCallback -> m (GClosure C_ElementNoMorePadsCallback)
genClosure_ElementNoMorePads :: forall (m :: * -> *).
MonadIO m =>
IO () -> m (GClosure C_ElementNoMorePadsCallback)
genClosure_ElementNoMorePads IO ()
cb = IO (GClosure C_ElementNoMorePadsCallback)
-> m (GClosure C_ElementNoMorePadsCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ElementNoMorePadsCallback)
 -> m (GClosure C_ElementNoMorePadsCallback))
-> IO (GClosure C_ElementNoMorePadsCallback)
-> m (GClosure C_ElementNoMorePadsCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementNoMorePadsCallback
cb' = IO () -> C_ElementNoMorePadsCallback
wrap_ElementNoMorePadsCallback IO ()
cb
    C_ElementNoMorePadsCallback
-> IO (FunPtr C_ElementNoMorePadsCallback)
mk_ElementNoMorePadsCallback C_ElementNoMorePadsCallback
cb' IO (FunPtr C_ElementNoMorePadsCallback)
-> (FunPtr C_ElementNoMorePadsCallback
    -> IO (GClosure C_ElementNoMorePadsCallback))
-> IO (GClosure C_ElementNoMorePadsCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ElementNoMorePadsCallback
-> IO (GClosure C_ElementNoMorePadsCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ElementNoMorePadsCallback` into a `C_ElementNoMorePadsCallback`.
wrap_ElementNoMorePadsCallback ::
    ElementNoMorePadsCallback ->
    C_ElementNoMorePadsCallback
wrap_ElementNoMorePadsCallback :: IO () -> C_ElementNoMorePadsCallback
wrap_ElementNoMorePadsCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
    IO ()
_cb 


-- | Connect a signal handler for the [noMorePads](#signal:noMorePads) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' element #noMorePads callback
-- @
-- 
-- 
onElementNoMorePads :: (IsElement a, MonadIO m) => a -> ElementNoMorePadsCallback -> m SignalHandlerId
onElementNoMorePads :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
onElementNoMorePads a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementNoMorePadsCallback
cb' = IO () -> C_ElementNoMorePadsCallback
wrap_ElementNoMorePadsCallback IO ()
cb
    FunPtr C_ElementNoMorePadsCallback
cb'' <- C_ElementNoMorePadsCallback
-> IO (FunPtr C_ElementNoMorePadsCallback)
mk_ElementNoMorePadsCallback C_ElementNoMorePadsCallback
cb'
    a
-> Text
-> FunPtr C_ElementNoMorePadsCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"no-more-pads" FunPtr C_ElementNoMorePadsCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [noMorePads](#signal:noMorePads) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' element #noMorePads callback
-- @
-- 
-- 
afterElementNoMorePads :: (IsElement a, MonadIO m) => a -> ElementNoMorePadsCallback -> m SignalHandlerId
afterElementNoMorePads :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
afterElementNoMorePads a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementNoMorePadsCallback
cb' = IO () -> C_ElementNoMorePadsCallback
wrap_ElementNoMorePadsCallback IO ()
cb
    FunPtr C_ElementNoMorePadsCallback
cb'' <- C_ElementNoMorePadsCallback
-> IO (FunPtr C_ElementNoMorePadsCallback)
mk_ElementNoMorePadsCallback C_ElementNoMorePadsCallback
cb'
    a
-> Text
-> FunPtr C_ElementNoMorePadsCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"no-more-pads" FunPtr C_ElementNoMorePadsCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ElementNoMorePadsSignalInfo
instance SignalInfo ElementNoMorePadsSignalInfo where
    type HaskellCallbackType ElementNoMorePadsSignalInfo = ElementNoMorePadsCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ElementNoMorePadsCallback cb
        cb'' <- mk_ElementNoMorePadsCallback cb'
        connectSignalFunPtr obj "no-more-pads" cb'' connectMode detail

#endif

-- signal Element::pad-added
-- | a new t'GI.Gst.Objects.Pad.Pad' has been added to the element. Note that this signal will
-- usually be emitted from the context of the streaming thread. Also keep in
-- mind that if you add new elements to the pipeline in the signal handler
-- you will need to set them to the desired target state with
-- 'GI.Gst.Objects.Element.elementSetState' or 'GI.Gst.Objects.Element.elementSyncStateWithParent'.
type ElementPadAddedCallback =
    Gst.Pad.Pad
    -- ^ /@newPad@/: the pad that has been added
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementPadAddedCallback`@.
noElementPadAddedCallback :: Maybe ElementPadAddedCallback
noElementPadAddedCallback :: Maybe ElementPadAddedCallback
noElementPadAddedCallback = Maybe ElementPadAddedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ElementPadAddedCallback =
    Ptr () ->                               -- object
    Ptr Gst.Pad.Pad ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ElementPadAddedCallback`.
foreign import ccall "wrapper"
    mk_ElementPadAddedCallback :: C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ElementPadAdded :: MonadIO m => ElementPadAddedCallback -> m (GClosure C_ElementPadAddedCallback)
genClosure_ElementPadAdded :: forall (m :: * -> *).
MonadIO m =>
ElementPadAddedCallback -> m (GClosure C_ElementPadAddedCallback)
genClosure_ElementPadAdded ElementPadAddedCallback
cb = IO (GClosure C_ElementPadAddedCallback)
-> m (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ElementPadAddedCallback)
 -> m (GClosure C_ElementPadAddedCallback))
-> IO (GClosure C_ElementPadAddedCallback)
-> m (GClosure C_ElementPadAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadAddedCallback ElementPadAddedCallback
cb
    C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadAddedCallback C_ElementPadAddedCallback
cb' IO (FunPtr C_ElementPadAddedCallback)
-> (FunPtr C_ElementPadAddedCallback
    -> IO (GClosure C_ElementPadAddedCallback))
-> IO (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ElementPadAddedCallback
-> IO (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ElementPadAddedCallback` into a `C_ElementPadAddedCallback`.
wrap_ElementPadAddedCallback ::
    ElementPadAddedCallback ->
    C_ElementPadAddedCallback
wrap_ElementPadAddedCallback :: ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadAddedCallback ElementPadAddedCallback
_cb Ptr ()
_ Ptr Pad
newPad Ptr ()
_ = do
    Pad
newPad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
newPad
    ElementPadAddedCallback
_cb  Pad
newPad'


-- | Connect a signal handler for the [padAdded](#signal:padAdded) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' element #padAdded callback
-- @
-- 
-- 
onElementPadAdded :: (IsElement a, MonadIO m) => a -> ElementPadAddedCallback -> m SignalHandlerId
onElementPadAdded :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> ElementPadAddedCallback -> m SignalHandlerId
onElementPadAdded a
obj ElementPadAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadAddedCallback ElementPadAddedCallback
cb
    FunPtr C_ElementPadAddedCallback
cb'' <- C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadAddedCallback C_ElementPadAddedCallback
cb'
    a
-> Text
-> FunPtr C_ElementPadAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pad-added" FunPtr C_ElementPadAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [padAdded](#signal:padAdded) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' element #padAdded callback
-- @
-- 
-- 
afterElementPadAdded :: (IsElement a, MonadIO m) => a -> ElementPadAddedCallback -> m SignalHandlerId
afterElementPadAdded :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> ElementPadAddedCallback -> m SignalHandlerId
afterElementPadAdded a
obj ElementPadAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadAddedCallback ElementPadAddedCallback
cb
    FunPtr C_ElementPadAddedCallback
cb'' <- C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadAddedCallback C_ElementPadAddedCallback
cb'
    a
-> Text
-> FunPtr C_ElementPadAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pad-added" FunPtr C_ElementPadAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ElementPadAddedSignalInfo
instance SignalInfo ElementPadAddedSignalInfo where
    type HaskellCallbackType ElementPadAddedSignalInfo = ElementPadAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ElementPadAddedCallback cb
        cb'' <- mk_ElementPadAddedCallback cb'
        connectSignalFunPtr obj "pad-added" cb'' connectMode detail

#endif

-- signal Element::pad-removed
-- | a t'GI.Gst.Objects.Pad.Pad' has been removed from the element
type ElementPadRemovedCallback =
    Gst.Pad.Pad
    -- ^ /@oldPad@/: the pad that has been removed
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementPadRemovedCallback`@.
noElementPadRemovedCallback :: Maybe ElementPadRemovedCallback
noElementPadRemovedCallback :: Maybe ElementPadAddedCallback
noElementPadRemovedCallback = Maybe ElementPadAddedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ElementPadRemovedCallback =
    Ptr () ->                               -- object
    Ptr Gst.Pad.Pad ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ElementPadRemovedCallback`.
foreign import ccall "wrapper"
    mk_ElementPadRemovedCallback :: C_ElementPadRemovedCallback -> IO (FunPtr C_ElementPadRemovedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ElementPadRemoved :: MonadIO m => ElementPadRemovedCallback -> m (GClosure C_ElementPadRemovedCallback)
genClosure_ElementPadRemoved :: forall (m :: * -> *).
MonadIO m =>
ElementPadAddedCallback -> m (GClosure C_ElementPadAddedCallback)
genClosure_ElementPadRemoved ElementPadAddedCallback
cb = IO (GClosure C_ElementPadAddedCallback)
-> m (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ElementPadAddedCallback)
 -> m (GClosure C_ElementPadAddedCallback))
-> IO (GClosure C_ElementPadAddedCallback)
-> m (GClosure C_ElementPadAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadRemovedCallback ElementPadAddedCallback
cb
    C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadRemovedCallback C_ElementPadAddedCallback
cb' IO (FunPtr C_ElementPadAddedCallback)
-> (FunPtr C_ElementPadAddedCallback
    -> IO (GClosure C_ElementPadAddedCallback))
-> IO (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ElementPadAddedCallback
-> IO (GClosure C_ElementPadAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ElementPadRemovedCallback` into a `C_ElementPadRemovedCallback`.
wrap_ElementPadRemovedCallback ::
    ElementPadRemovedCallback ->
    C_ElementPadRemovedCallback
wrap_ElementPadRemovedCallback :: ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadRemovedCallback ElementPadAddedCallback
_cb Ptr ()
_ Ptr Pad
oldPad Ptr ()
_ = do
    Pad
oldPad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
oldPad
    ElementPadAddedCallback
_cb  Pad
oldPad'


-- | Connect a signal handler for the [padRemoved](#signal:padRemoved) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' element #padRemoved callback
-- @
-- 
-- 
onElementPadRemoved :: (IsElement a, MonadIO m) => a -> ElementPadRemovedCallback -> m SignalHandlerId
onElementPadRemoved :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> ElementPadAddedCallback -> m SignalHandlerId
onElementPadRemoved a
obj ElementPadAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadRemovedCallback ElementPadAddedCallback
cb
    FunPtr C_ElementPadAddedCallback
cb'' <- C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadRemovedCallback C_ElementPadAddedCallback
cb'
    a
-> Text
-> FunPtr C_ElementPadAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pad-removed" FunPtr C_ElementPadAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [padRemoved](#signal:padRemoved) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' element #padRemoved callback
-- @
-- 
-- 
afterElementPadRemoved :: (IsElement a, MonadIO m) => a -> ElementPadRemovedCallback -> m SignalHandlerId
afterElementPadRemoved :: forall a (m :: * -> *).
(IsElement a, MonadIO m) =>
a -> ElementPadAddedCallback -> m SignalHandlerId
afterElementPadRemoved a
obj ElementPadAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ElementPadAddedCallback
cb' = ElementPadAddedCallback -> C_ElementPadAddedCallback
wrap_ElementPadRemovedCallback ElementPadAddedCallback
cb
    FunPtr C_ElementPadAddedCallback
cb'' <- C_ElementPadAddedCallback -> IO (FunPtr C_ElementPadAddedCallback)
mk_ElementPadRemovedCallback C_ElementPadAddedCallback
cb'
    a
-> Text
-> FunPtr C_ElementPadAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pad-removed" FunPtr C_ElementPadAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ElementPadRemovedSignalInfo
instance SignalInfo ElementPadRemovedSignalInfo where
    type HaskellCallbackType ElementPadRemovedSignalInfo = ElementPadRemovedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ElementPadRemovedCallback cb
        cb'' <- mk_ElementPadRemovedCallback cb'
        connectSignalFunPtr obj "pad-removed" cb'' connectMode detail

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Element
type instance O.AttributeList Element = ElementAttributeList
type ElementAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Element = ElementSignalList
type ElementSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("noMorePads", ElementNoMorePadsSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("padAdded", ElementPadAddedSignalInfo), '("padRemoved", ElementPadRemovedSignalInfo)] :: [(Symbol, *)])

#endif

-- method Element::abort_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to abort the state of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_abort_state" gst_element_abort_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO ()

-- | Abort the state change of the element. This function is used
-- by elements that do asynchronous state changes and find out
-- something is wrong.
-- 
-- This function should be called with the STATE_LOCK held.
-- 
-- MT safe.
elementAbortState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to abort the state of.
    -> m ()
elementAbortState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m ()
elementAbortState a
element = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Element -> IO ()
gst_element_abort_state Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ElementAbortStateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsElement a) => O.OverloadedMethod ElementAbortStateMethodInfo a signature where
    overloadedMethod = elementAbortState

instance O.OverloadedMethodInfo ElementAbortStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementAbortState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementAbortState"
        }


#endif

-- method Element::add_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to add the pad to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pad"
--           , argType = TInterface Name { namespace = "Gst" , name = "Pad" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstPad to add to the element."
--                 , 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_add_pad" gst_element_add_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    IO CInt

-- | Adds a pad (link point) to /@element@/. /@pad@/\'s parent will be set to /@element@/;
-- see 'GI.Gst.Objects.Object.objectSetParent' for refcounting information.
-- 
-- Pads are automatically activated when added in the PAUSED or PLAYING
-- state.
-- 
-- The pad and the element should be unlocked when calling this function.
-- 
-- This function will emit the [padAdded]("GI.Gst.Objects.Element#g:signal:padAdded") signal on the element.
elementAddPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, Gst.Pad.IsPad b) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to add the pad to.
    -> b
    -- ^ /@pad@/: the t'GI.Gst.Objects.Pad.Pad' to add to the element.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pad could be added. This function can fail when
    -- a pad with the same name already existed or the pad already had another
    -- parent.
    -- 
    -- MT safe.
elementAddPad :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsPad b) =>
a -> b -> m Bool
elementAddPad a
element b
pad = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Pad
pad' <- b -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
pad
    CInt
result <- Ptr Element -> Ptr Pad -> IO CInt
gst_element_add_pad Ptr Element
element' Ptr Pad
pad'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
pad
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementAddPadMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsElement a, Gst.Pad.IsPad b) => O.OverloadedMethod ElementAddPadMethodInfo a signature where
    overloadedMethod = elementAddPad

instance O.OverloadedMethodInfo ElementAddPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementAddPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementAddPad"
        }


#endif

-- method Element::add_property_deep_notify_watch
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GstElement to watch (recursively) for property changes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "property_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "name of property to watch for changes, or\n    NULL to watch all properties"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "include_value"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "whether to include the new property value in the message"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TULong)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_add_property_deep_notify_watch" gst_element_add_property_deep_notify_watch :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- property_name : TBasicType TUTF8
    CInt ->                                 -- include_value : TBasicType TBoolean
    IO CULong

-- | /No description available in the introspection data./
-- 
-- /Since: 1.10/
elementAddPropertyDeepNotifyWatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to watch (recursively) for property changes
    -> Maybe (T.Text)
    -- ^ /@propertyName@/: name of property to watch for changes, or
    --     NULL to watch all properties
    -> Bool
    -- ^ /@includeValue@/: whether to include the new property value in the message
    -> m CULong
    -- ^ __Returns:__ a watch id, which can be used in connection with
    --     'GI.Gst.Objects.Element.elementRemovePropertyNotifyWatch' to remove the watch again.
elementAddPropertyDeepNotifyWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Maybe Text -> Bool -> m SignalHandlerId
elementAddPropertyDeepNotifyWatch a
element Maybe Text
propertyName Bool
includeValue = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
maybePropertyName <- case Maybe Text
propertyName of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jPropertyName -> do
            Ptr CChar
jPropertyName' <- Text -> IO (Ptr CChar)
textToCString Text
jPropertyName
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jPropertyName'
    let includeValue' :: CInt
includeValue' = (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
includeValue
    SignalHandlerId
result <- Ptr Element -> Ptr CChar -> CInt -> IO SignalHandlerId
gst_element_add_property_deep_notify_watch Ptr Element
element' Ptr CChar
maybePropertyName CInt
includeValue'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybePropertyName
    SignalHandlerId -> IO SignalHandlerId
forall (m :: * -> *) a. Monad m => a -> m a
return SignalHandlerId
result

#if defined(ENABLE_OVERLOADING)
data ElementAddPropertyDeepNotifyWatchMethodInfo
instance (signature ~ (Maybe (T.Text) -> Bool -> m CULong), MonadIO m, IsElement a) => O.OverloadedMethod ElementAddPropertyDeepNotifyWatchMethodInfo a signature where
    overloadedMethod = elementAddPropertyDeepNotifyWatch

instance O.OverloadedMethodInfo ElementAddPropertyDeepNotifyWatchMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementAddPropertyDeepNotifyWatch",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementAddPropertyDeepNotifyWatch"
        }


#endif

-- method Element::add_property_notify_watch
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to watch for property changes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "property_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "name of property to watch for changes, or\n    NULL to watch all properties"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "include_value"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "whether to include the new property value in the message"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TULong)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_add_property_notify_watch" gst_element_add_property_notify_watch :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- property_name : TBasicType TUTF8
    CInt ->                                 -- include_value : TBasicType TBoolean
    IO CULong

-- | /No description available in the introspection data./
-- 
-- /Since: 1.10/
elementAddPropertyNotifyWatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to watch for property changes
    -> Maybe (T.Text)
    -- ^ /@propertyName@/: name of property to watch for changes, or
    --     NULL to watch all properties
    -> Bool
    -- ^ /@includeValue@/: whether to include the new property value in the message
    -> m CULong
    -- ^ __Returns:__ a watch id, which can be used in connection with
    --     'GI.Gst.Objects.Element.elementRemovePropertyNotifyWatch' to remove the watch again.
elementAddPropertyNotifyWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Maybe Text -> Bool -> m SignalHandlerId
elementAddPropertyNotifyWatch a
element Maybe Text
propertyName Bool
includeValue = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
maybePropertyName <- case Maybe Text
propertyName of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jPropertyName -> do
            Ptr CChar
jPropertyName' <- Text -> IO (Ptr CChar)
textToCString Text
jPropertyName
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jPropertyName'
    let includeValue' :: CInt
includeValue' = (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
includeValue
    SignalHandlerId
result <- Ptr Element -> Ptr CChar -> CInt -> IO SignalHandlerId
gst_element_add_property_notify_watch Ptr Element
element' Ptr CChar
maybePropertyName CInt
includeValue'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybePropertyName
    SignalHandlerId -> IO SignalHandlerId
forall (m :: * -> *) a. Monad m => a -> m a
return SignalHandlerId
result

#if defined(ENABLE_OVERLOADING)
data ElementAddPropertyNotifyWatchMethodInfo
instance (signature ~ (Maybe (T.Text) -> Bool -> m CULong), MonadIO m, IsElement a) => O.OverloadedMethod ElementAddPropertyNotifyWatchMethodInfo a signature where
    overloadedMethod = elementAddPropertyNotifyWatch

instance O.OverloadedMethodInfo ElementAddPropertyNotifyWatchMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementAddPropertyNotifyWatch",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementAddPropertyNotifyWatch"
        }


#endif

-- method Element::call_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface
--                 Name { namespace = "Gst" , name = "ElementCallAsyncFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Function to call asynchronously from another thread"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = 2
--           , argDestroy = 3
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Data to pass to @func"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destroy_notify"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GDestroyNotify for @user_data"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_call_async" gst_element_call_async :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    FunPtr Gst.Callbacks.C_ElementCallAsyncFunc -> -- func : TInterface (Name {namespace = "Gst", name = "ElementCallAsyncFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

-- | Calls /@func@/ from another thread and passes /@userData@/ to it. This is to be
-- used for cases when a state change has to be performed from a streaming
-- thread, directly via 'GI.Gst.Objects.Element.elementSetState' or indirectly e.g. via SEEK
-- events.
-- 
-- Calling those functions directly from the streaming thread will cause
-- deadlocks in many situations, as they might involve waiting for the
-- streaming thread to shut down from this very streaming thread.
-- 
-- MT safe.
-- 
-- /Since: 1.10/
elementCallAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'
    -> Gst.Callbacks.ElementCallAsyncFunc
    -- ^ /@func@/: Function to call asynchronously from another thread
    -> m ()
elementCallAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> ElementCallAsyncFunc -> m ()
elementCallAsync a
element ElementCallAsyncFunc
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    FunPtr C_ElementCallAsyncFunc
func' <- C_ElementCallAsyncFunc -> IO (FunPtr C_ElementCallAsyncFunc)
Gst.Callbacks.mk_ElementCallAsyncFunc (Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
-> ElementCallAsyncFunc_WithClosures -> C_ElementCallAsyncFunc
Gst.Callbacks.wrap_ElementCallAsyncFunc Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
forall a. Maybe a
Nothing (ElementCallAsyncFunc -> ElementCallAsyncFunc_WithClosures
Gst.Callbacks.drop_closures_ElementCallAsyncFunc ElementCallAsyncFunc
func))
    let userData :: Ptr ()
userData = FunPtr C_ElementCallAsyncFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ElementCallAsyncFunc
func'
    let destroyNotify :: FunPtr (Ptr a -> IO ())
destroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
    Ptr Element
-> FunPtr C_ElementCallAsyncFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gst_element_call_async Ptr Element
element' FunPtr C_ElementCallAsyncFunc
func' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
destroyNotify
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ElementCallAsyncMethodInfo
instance (signature ~ (Gst.Callbacks.ElementCallAsyncFunc -> m ()), MonadIO m, IsElement a) => O.OverloadedMethod ElementCallAsyncMethodInfo a signature where
    overloadedMethod = elementCallAsync

instance O.OverloadedMethodInfo ElementCallAsyncMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementCallAsync",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementCallAsync"
        }


#endif

-- method Element::change_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "transition"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "StateChange" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the requested transition"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Gst" , name = "StateChangeReturn" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_change_state" gst_element_change_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CUInt ->                                -- transition : TInterface (Name {namespace = "Gst", name = "StateChange"})
    IO CUInt

-- | Perform /@transition@/ on /@element@/.
-- 
-- This function must be called with STATE_LOCK held and is mainly used
-- internally.
elementChangeState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'
    -> Gst.Enums.StateChange
    -- ^ /@transition@/: the requested transition
    -> m Gst.Enums.StateChangeReturn
    -- ^ __Returns:__ the t'GI.Gst.Enums.StateChangeReturn' of the state transition.
elementChangeState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> StateChange -> m StateChangeReturn
elementChangeState a
element StateChange
transition = IO StateChangeReturn -> m StateChangeReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StateChangeReturn -> m StateChangeReturn)
-> IO StateChangeReturn -> m StateChangeReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    let transition' :: CUInt
transition' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (StateChange -> Int) -> StateChange -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateChange -> Int
forall a. Enum a => a -> Int
fromEnum) StateChange
transition
    CUInt
result <- Ptr Element -> CUInt -> IO CUInt
gst_element_change_state Ptr Element
element' CUInt
transition'
    let result' :: StateChangeReturn
result' = (Int -> StateChangeReturn
forall a. Enum a => Int -> a
toEnum (Int -> StateChangeReturn)
-> (CUInt -> Int) -> CUInt -> StateChangeReturn
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
element
    StateChangeReturn -> IO StateChangeReturn
forall (m :: * -> *) a. Monad m => a -> m a
return StateChangeReturn
result'

#if defined(ENABLE_OVERLOADING)
data ElementChangeStateMethodInfo
instance (signature ~ (Gst.Enums.StateChange -> m Gst.Enums.StateChangeReturn), MonadIO m, IsElement a) => O.OverloadedMethod ElementChangeStateMethodInfo a signature where
    overloadedMethod = elementChangeState

instance O.OverloadedMethodInfo ElementChangeStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementChangeState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementChangeState"
        }


#endif

-- method Element::continue_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GstElement to continue the state change of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ret"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "StateChangeReturn" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The previous state return value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Gst" , name = "StateChangeReturn" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_continue_state" gst_element_continue_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CUInt ->                                -- ret : TInterface (Name {namespace = "Gst", name = "StateChangeReturn"})
    IO CUInt

-- | Commit the state change of the element and proceed to the next
-- pending state if any. This function is used
-- by elements that do asynchronous state changes.
-- The core will normally call this method automatically when an
-- element returned 'GI.Gst.Enums.StateChangeReturnSuccess' from the state change function.
-- 
-- If after calling this method the element still has not reached
-- the pending state, the next state change is performed.
-- 
-- This method is used internally and should normally not be called by plugins
-- or applications.
-- 
-- This function must be called with STATE_LOCK held.
elementContinueState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to continue the state change of.
    -> Gst.Enums.StateChangeReturn
    -- ^ /@ret@/: The previous state return value
    -> m Gst.Enums.StateChangeReturn
    -- ^ __Returns:__ The result of the commit state change.
    -- 
    -- MT safe.
elementContinueState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> StateChangeReturn -> m StateChangeReturn
elementContinueState a
element StateChangeReturn
ret = IO StateChangeReturn -> m StateChangeReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StateChangeReturn -> m StateChangeReturn)
-> IO StateChangeReturn -> m StateChangeReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    let ret' :: CUInt
ret' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (StateChangeReturn -> Int) -> StateChangeReturn -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateChangeReturn -> Int
forall a. Enum a => a -> Int
fromEnum) StateChangeReturn
ret
    CUInt
result <- Ptr Element -> CUInt -> IO CUInt
gst_element_continue_state Ptr Element
element' CUInt
ret'
    let result' :: StateChangeReturn
result' = (Int -> StateChangeReturn
forall a. Enum a => Int -> a
toEnum (Int -> StateChangeReturn)
-> (CUInt -> Int) -> CUInt -> StateChangeReturn
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
element
    StateChangeReturn -> IO StateChangeReturn
forall (m :: * -> *) a. Monad m => a -> m a
return StateChangeReturn
result'

#if defined(ENABLE_OVERLOADING)
data ElementContinueStateMethodInfo
instance (signature ~ (Gst.Enums.StateChangeReturn -> m Gst.Enums.StateChangeReturn), MonadIO m, IsElement a) => O.OverloadedMethod ElementContinueStateMethodInfo a signature where
    overloadedMethod = elementContinueState

instance O.OverloadedMethodInfo ElementContinueStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementContinueState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementContinueState"
        }


#endif

-- method Element::create_all_pads
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to create pads for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_create_all_pads" gst_element_create_all_pads :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO ()

-- | Creates a pad for each pad template that is always available.
-- This function is only useful during object initialization of
-- subclasses of t'GI.Gst.Objects.Element.Element'.
elementCreateAllPads ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to create pads for
    -> m ()
elementCreateAllPads :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m ()
elementCreateAllPads a
element = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Element -> IO ()
gst_element_create_all_pads Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ElementCreateAllPadsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsElement a) => O.OverloadedMethod ElementCreateAllPadsMethodInfo a signature where
    overloadedMethod = elementCreateAllPads

instance O.OverloadedMethodInfo ElementCreateAllPadsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementCreateAllPads",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementCreateAllPads"
        }


#endif

-- method Element::foreach_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to iterate pads of"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface
--                 Name { namespace = "Gst" , name = "ElementForeachPadFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "function to call for each pad"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to @func"
--                 , 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_foreach_pad" gst_element_foreach_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    FunPtr Gst.Callbacks.C_ElementForeachPadFunc -> -- func : TInterface (Name {namespace = "Gst", name = "ElementForeachPadFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO CInt

-- | Call /@func@/ with /@userData@/ for each of /@element@/\'s pads. /@func@/ will be called
-- exactly once for each pad that exists at the time of this call, unless
-- one of the calls to /@func@/ returns 'P.False' in which case we will stop
-- iterating pads and return early. If new pads are added or pads are removed
-- while pads are being iterated, this will not be taken into account until
-- next time this function is used.
-- 
-- /Since: 1.14/
elementForeachPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to iterate pads of
    -> Gst.Callbacks.ElementForeachPadFunc
    -- ^ /@func@/: function to call for each pad
    -> m Bool
    -- ^ __Returns:__ 'P.False' if /@element@/ had no pads or if one of the calls to /@func@/
    --   returned 'P.False'.
elementForeachPad :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> ElementForeachPadFunc -> m Bool
elementForeachPad a
element ElementForeachPadFunc
func = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    FunPtr C_ElementForeachPadFunc
func' <- C_ElementForeachPadFunc -> IO (FunPtr C_ElementForeachPadFunc)
Gst.Callbacks.mk_ElementForeachPadFunc (Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
-> ElementForeachPadFunc_WithClosures -> C_ElementForeachPadFunc
Gst.Callbacks.wrap_ElementForeachPadFunc Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
forall a. Maybe a
Nothing (ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
Gst.Callbacks.drop_closures_ElementForeachPadFunc ElementForeachPadFunc
func))
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    CInt
result <- Ptr Element -> FunPtr C_ElementForeachPadFunc -> Ptr () -> IO CInt
gst_element_foreach_pad Ptr Element
element' FunPtr C_ElementForeachPadFunc
func' Ptr ()
forall a. Ptr a
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_ElementForeachPadFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ElementForeachPadFunc
func'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementForeachPadMethodInfo
instance (signature ~ (Gst.Callbacks.ElementForeachPadFunc -> m Bool), MonadIO m, IsElement a) => O.OverloadedMethod ElementForeachPadMethodInfo a signature where
    overloadedMethod = elementForeachPad

instance O.OverloadedMethodInfo ElementForeachPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementForeachPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementForeachPad"
        }


#endif

-- method Element::foreach_sink_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to iterate sink pads of"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface
--                 Name { namespace = "Gst" , name = "ElementForeachPadFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "function to call for each sink pad"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to @func"
--                 , 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_foreach_sink_pad" gst_element_foreach_sink_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    FunPtr Gst.Callbacks.C_ElementForeachPadFunc -> -- func : TInterface (Name {namespace = "Gst", name = "ElementForeachPadFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO CInt

-- | Call /@func@/ with /@userData@/ for each of /@element@/\'s sink pads. /@func@/ will be
-- called exactly once for each sink pad that exists at the time of this call,
-- unless one of the calls to /@func@/ returns 'P.False' in which case we will stop
-- iterating pads and return early. If new sink pads are added or sink pads
-- are removed while the sink pads are being iterated, this will not be taken
-- into account until next time this function is used.
-- 
-- /Since: 1.14/
elementForeachSinkPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to iterate sink pads of
    -> Gst.Callbacks.ElementForeachPadFunc
    -- ^ /@func@/: function to call for each sink pad
    -> m Bool
    -- ^ __Returns:__ 'P.False' if /@element@/ had no sink pads or if one of the calls to /@func@/
    --   returned 'P.False'.
elementForeachSinkPad :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> ElementForeachPadFunc -> m Bool
elementForeachSinkPad a
element ElementForeachPadFunc
func = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    FunPtr C_ElementForeachPadFunc
func' <- C_ElementForeachPadFunc -> IO (FunPtr C_ElementForeachPadFunc)
Gst.Callbacks.mk_ElementForeachPadFunc (Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
-> ElementForeachPadFunc_WithClosures -> C_ElementForeachPadFunc
Gst.Callbacks.wrap_ElementForeachPadFunc Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
forall a. Maybe a
Nothing (ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
Gst.Callbacks.drop_closures_ElementForeachPadFunc ElementForeachPadFunc
func))
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    CInt
result <- Ptr Element -> FunPtr C_ElementForeachPadFunc -> Ptr () -> IO CInt
gst_element_foreach_sink_pad Ptr Element
element' FunPtr C_ElementForeachPadFunc
func' Ptr ()
forall a. Ptr a
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_ElementForeachPadFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ElementForeachPadFunc
func'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementForeachSinkPadMethodInfo
instance (signature ~ (Gst.Callbacks.ElementForeachPadFunc -> m Bool), MonadIO m, IsElement a) => O.OverloadedMethod ElementForeachSinkPadMethodInfo a signature where
    overloadedMethod = elementForeachSinkPad

instance O.OverloadedMethodInfo ElementForeachSinkPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementForeachSinkPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementForeachSinkPad"
        }


#endif

-- method Element::foreach_src_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to iterate source pads of"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface
--                 Name { namespace = "Gst" , name = "ElementForeachPadFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "function to call for each source pad"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to @func"
--                 , 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_foreach_src_pad" gst_element_foreach_src_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    FunPtr Gst.Callbacks.C_ElementForeachPadFunc -> -- func : TInterface (Name {namespace = "Gst", name = "ElementForeachPadFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO CInt

-- | Call /@func@/ with /@userData@/ for each of /@element@/\'s source pads. /@func@/ will be
-- called exactly once for each source pad that exists at the time of this call,
-- unless one of the calls to /@func@/ returns 'P.False' in which case we will stop
-- iterating pads and return early. If new source pads are added or source pads
-- are removed while the source pads are being iterated, this will not be taken
-- into account until next time this function is used.
-- 
-- /Since: 1.14/
elementForeachSrcPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to iterate source pads of
    -> Gst.Callbacks.ElementForeachPadFunc
    -- ^ /@func@/: function to call for each source pad
    -> m Bool
    -- ^ __Returns:__ 'P.False' if /@element@/ had no source pads or if one of the calls
    --   to /@func@/ returned 'P.False'.
elementForeachSrcPad :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> ElementForeachPadFunc -> m Bool
elementForeachSrcPad a
element ElementForeachPadFunc
func = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    FunPtr C_ElementForeachPadFunc
func' <- C_ElementForeachPadFunc -> IO (FunPtr C_ElementForeachPadFunc)
Gst.Callbacks.mk_ElementForeachPadFunc (Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
-> ElementForeachPadFunc_WithClosures -> C_ElementForeachPadFunc
Gst.Callbacks.wrap_ElementForeachPadFunc Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
forall a. Maybe a
Nothing (ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
Gst.Callbacks.drop_closures_ElementForeachPadFunc ElementForeachPadFunc
func))
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    CInt
result <- Ptr Element -> FunPtr C_ElementForeachPadFunc -> Ptr () -> IO CInt
gst_element_foreach_src_pad Ptr Element
element' FunPtr C_ElementForeachPadFunc
func' Ptr ()
forall a. Ptr a
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_ElementForeachPadFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ElementForeachPadFunc
func'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementForeachSrcPadMethodInfo
instance (signature ~ (Gst.Callbacks.ElementForeachPadFunc -> m Bool), MonadIO m, IsElement a) => O.OverloadedMethod ElementForeachSrcPadMethodInfo a signature where
    overloadedMethod = elementForeachSrcPad

instance O.OverloadedMethodInfo ElementForeachSrcPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementForeachSrcPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementForeachSrcPad"
        }


#endif

-- method Element::get_base_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_base_time" gst_element_get_base_time :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO Word64

-- | Returns the base time of the element. The base time is the
-- absolute time of the clock when this element was last put to
-- PLAYING. Subtracting the base time from the clock time gives
-- the running time of the element.
elementGetBaseTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Word64
    -- ^ __Returns:__ the base time of the element.
    -- 
    -- MT safe.
elementGetBaseTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Word64
elementGetBaseTime a
element = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Word64
result <- Ptr Element -> IO Word64
gst_element_get_base_time Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result

#if defined(ENABLE_OVERLOADING)
data ElementGetBaseTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetBaseTimeMethodInfo a signature where
    overloadedMethod = elementGetBaseTime

instance O.OverloadedMethodInfo ElementGetBaseTimeMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetBaseTime",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetBaseTime"
        }


#endif

-- method Element::get_bus
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the bus of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Bus" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_bus" gst_element_get_bus :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.Bus.Bus)

-- | Returns the bus of the element. Note that only a t'GI.Gst.Objects.Pipeline.Pipeline' will provide a
-- bus for the application.
elementGetBus ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the bus of.
    -> m (Maybe Gst.Bus.Bus)
    -- ^ __Returns:__ the element\'s t'GI.Gst.Objects.Bus.Bus'. unref after
    -- usage.
    -- 
    -- MT safe.
elementGetBus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m (Maybe Bus)
elementGetBus a
element = IO (Maybe Bus) -> m (Maybe Bus)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Bus) -> m (Maybe Bus))
-> IO (Maybe Bus) -> m (Maybe Bus)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Bus
result <- Ptr Element -> IO (Ptr Bus)
gst_element_get_bus Ptr Element
element'
    Maybe Bus
maybeResult <- Ptr Bus -> (Ptr Bus -> IO Bus) -> IO (Maybe Bus)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Bus
result ((Ptr Bus -> IO Bus) -> IO (Maybe Bus))
-> (Ptr Bus -> IO Bus) -> IO (Maybe Bus)
forall a b. (a -> b) -> a -> b
$ \Ptr Bus
result' -> do
        Bus
result'' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Bus -> Bus
Gst.Bus.Bus) Ptr Bus
result'
        Bus -> IO Bus
forall (m :: * -> *) a. Monad m => a -> m a
return Bus
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Maybe Bus -> IO (Maybe Bus)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Bus
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetBusMethodInfo
instance (signature ~ (m (Maybe Gst.Bus.Bus)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetBusMethodInfo a signature where
    overloadedMethod = elementGetBus

instance O.OverloadedMethodInfo ElementGetBusMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetBus",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetBus"
        }


#endif

-- method Element::get_clock
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the clock of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Clock" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_clock" gst_element_get_clock :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.Clock.Clock)

-- | Gets the currently configured clock of the element. This is the clock as was
-- last set with 'GI.Gst.Objects.Element.elementSetClock'.
-- 
-- Elements in a pipeline will only have their clock set when the
-- pipeline is in the PLAYING state.
elementGetClock ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the clock of.
    -> m (Maybe Gst.Clock.Clock)
    -- ^ __Returns:__ the t'GI.Gst.Objects.Clock.Clock' of the element. unref after usage.
    -- 
    -- MT safe.
elementGetClock :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m (Maybe Clock)
elementGetClock a
element = IO (Maybe Clock) -> m (Maybe Clock)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Clock) -> m (Maybe Clock))
-> IO (Maybe Clock) -> m (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Clock
result <- Ptr Element -> IO (Ptr Clock)
gst_element_get_clock Ptr Element
element'
    Maybe Clock
maybeResult <- Ptr Clock -> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Clock
result ((Ptr Clock -> IO Clock) -> IO (Maybe Clock))
-> (Ptr Clock -> IO Clock) -> IO (Maybe Clock)
forall a b. (a -> b) -> a -> b
$ \Ptr Clock
result' -> do
        Clock
result'' <- ((ManagedPtr Clock -> Clock) -> Ptr Clock -> IO Clock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Clock -> Clock
Gst.Clock.Clock) Ptr Clock
result'
        Clock -> IO Clock
forall (m :: * -> *) a. Monad m => a -> m a
return Clock
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Maybe Clock -> IO (Maybe Clock)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Clock
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetClockMethodInfo
instance (signature ~ (m (Maybe Gst.Clock.Clock)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetClockMethodInfo a signature where
    overloadedMethod = elementGetClock

instance O.OverloadedMethodInfo ElementGetClockMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetClock",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetClock"
        }


#endif

-- method Element::get_compatible_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GstElement in which the pad should be found."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pad"
--           , argType = TInterface Name { namespace = "Gst" , name = "Pad" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstPad to find a compatible one for."
--                 , 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 = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstCaps to use as a filter."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Pad" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_compatible_pad" gst_element_get_compatible_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    Ptr Gst.Caps.Caps ->                    -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO (Ptr Gst.Pad.Pad)

-- | Looks for an unlinked pad to which the given pad can link. It is not
-- guaranteed that linking the pads will work, though it should work in most
-- cases.
-- 
-- This function will first attempt to find a compatible unlinked ALWAYS pad,
-- and if none can be found, it will request a compatible REQUEST pad by looking
-- at the templates of /@element@/.
elementGetCompatiblePad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, Gst.Pad.IsPad b) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' in which the pad should be found.
    -> b
    -- ^ /@pad@/: the t'GI.Gst.Objects.Pad.Pad' to find a compatible one for.
    -> Maybe (Gst.Caps.Caps)
    -- ^ /@caps@/: the t'GI.Gst.Structs.Caps.Caps' to use as a filter.
    -> m (Maybe Gst.Pad.Pad)
    -- ^ __Returns:__ the t'GI.Gst.Objects.Pad.Pad' to which a link
    --   can be made, or 'P.Nothing' if one cannot be found. 'GI.Gst.Objects.Object.objectUnref'
    --   after usage.
elementGetCompatiblePad :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsPad b) =>
a -> b -> Maybe Caps -> m (Maybe Pad)
elementGetCompatiblePad a
element b
pad Maybe Caps
caps = IO (Maybe Pad) -> m (Maybe Pad)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pad) -> m (Maybe Pad))
-> IO (Maybe Pad) -> m (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Pad
pad' <- b -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
pad
    Ptr Caps
maybeCaps <- case Maybe Caps
caps of
        Maybe Caps
Nothing -> Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
forall a. Ptr a
nullPtr
        Just Caps
jCaps -> do
            Ptr Caps
jCaps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
jCaps
            Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
jCaps'
    Ptr Pad
result <- Ptr Element -> Ptr Pad -> Ptr Caps -> IO (Ptr Pad)
gst_element_get_compatible_pad Ptr Element
element' Ptr Pad
pad' Ptr Caps
maybeCaps
    Maybe Pad
maybeResult <- Ptr Pad -> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pad
result ((Ptr Pad -> IO Pad) -> IO (Maybe Pad))
-> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ \Ptr Pad
result' -> do
        Pad
result'' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
result'
        Pad -> IO Pad
forall (m :: * -> *) a. Monad m => a -> m a
return Pad
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
pad
    Maybe Caps -> (Caps -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Caps
caps Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Maybe Pad -> IO (Maybe Pad)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pad
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetCompatiblePadMethodInfo
instance (signature ~ (b -> Maybe (Gst.Caps.Caps) -> m (Maybe Gst.Pad.Pad)), MonadIO m, IsElement a, Gst.Pad.IsPad b) => O.OverloadedMethod ElementGetCompatiblePadMethodInfo a signature where
    overloadedMethod = elementGetCompatiblePad

instance O.OverloadedMethodInfo ElementGetCompatiblePadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetCompatiblePad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetCompatiblePad"
        }


#endif

-- method Element::get_compatible_pad_template
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GstElement to get a compatible pad template for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "compattempl"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "PadTemplate" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstPadTemplate to find a compatible\n    template for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "PadTemplate" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_compatible_pad_template" gst_element_get_compatible_pad_template :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Gst.PadTemplate.PadTemplate ->      -- compattempl : TInterface (Name {namespace = "Gst", name = "PadTemplate"})
    IO (Ptr Gst.PadTemplate.PadTemplate)

-- | Retrieves a pad template from /@element@/ that is compatible with /@compattempl@/.
-- Pads from compatible templates can be linked together.
elementGetCompatiblePadTemplate ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, Gst.PadTemplate.IsPadTemplate b) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get a compatible pad template for
    -> b
    -- ^ /@compattempl@/: the t'GI.Gst.Objects.PadTemplate.PadTemplate' to find a compatible
    --     template for
    -> m (Maybe Gst.PadTemplate.PadTemplate)
    -- ^ __Returns:__ a compatible t'GI.Gst.Objects.PadTemplate.PadTemplate',
    --   or 'P.Nothing' if none was found. No unreferencing is necessary.
elementGetCompatiblePadTemplate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsPadTemplate b) =>
a -> b -> m (Maybe PadTemplate)
elementGetCompatiblePadTemplate a
element b
compattempl = IO (Maybe PadTemplate) -> m (Maybe PadTemplate)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PadTemplate) -> m (Maybe PadTemplate))
-> IO (Maybe PadTemplate) -> m (Maybe PadTemplate)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr PadTemplate
compattempl' <- b -> IO (Ptr PadTemplate)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
compattempl
    Ptr PadTemplate
result <- Ptr Element -> Ptr PadTemplate -> IO (Ptr PadTemplate)
gst_element_get_compatible_pad_template Ptr Element
element' Ptr PadTemplate
compattempl'
    Maybe PadTemplate
maybeResult <- Ptr PadTemplate
-> (Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PadTemplate
result ((Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate))
-> (Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate)
forall a b. (a -> b) -> a -> b
$ \Ptr PadTemplate
result' -> do
        PadTemplate
result'' <- ((ManagedPtr PadTemplate -> PadTemplate)
-> Ptr PadTemplate -> IO PadTemplate
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PadTemplate -> PadTemplate
Gst.PadTemplate.PadTemplate) Ptr PadTemplate
result'
        PadTemplate -> IO PadTemplate
forall (m :: * -> *) a. Monad m => a -> m a
return PadTemplate
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
compattempl
    Maybe PadTemplate -> IO (Maybe PadTemplate)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PadTemplate
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetCompatiblePadTemplateMethodInfo
instance (signature ~ (b -> m (Maybe Gst.PadTemplate.PadTemplate)), MonadIO m, IsElement a, Gst.PadTemplate.IsPadTemplate b) => O.OverloadedMethod ElementGetCompatiblePadTemplateMethodInfo a signature where
    overloadedMethod = elementGetCompatiblePadTemplate

instance O.OverloadedMethodInfo ElementGetCompatiblePadTemplateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetCompatiblePadTemplate",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetCompatiblePadTemplate"
        }


#endif

-- method Element::get_context
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the context of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context_type"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a name of a context to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Context" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_context" gst_element_get_context :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- context_type : TBasicType TUTF8
    IO (Ptr Gst.Context.Context)

-- | Gets the context with /@contextType@/ set on the element or NULL.
-- 
-- MT safe.
-- 
-- /Since: 1.8/
elementGetContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the context of.
    -> T.Text
    -- ^ /@contextType@/: a name of a context to retrieve
    -> m (Maybe Gst.Context.Context)
    -- ^ __Returns:__ A t'GI.Gst.Structs.Context.Context' or NULL
elementGetContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m (Maybe Context)
elementGetContext a
element Text
contextType = IO (Maybe Context) -> m (Maybe Context)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Context) -> m (Maybe Context))
-> IO (Maybe Context) -> m (Maybe Context)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
contextType' <- Text -> IO (Ptr CChar)
textToCString Text
contextType
    Ptr Context
result <- Ptr Element -> Ptr CChar -> IO (Ptr Context)
gst_element_get_context Ptr Element
element' Ptr CChar
contextType'
    Maybe Context
maybeResult <- Ptr Context -> (Ptr Context -> IO Context) -> IO (Maybe Context)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Context
result ((Ptr Context -> IO Context) -> IO (Maybe Context))
-> (Ptr Context -> IO Context) -> IO (Maybe Context)
forall a b. (a -> b) -> a -> b
$ \Ptr Context
result' -> do
        Context
result'' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Context -> Context
Gst.Context.Context) Ptr Context
result'
        Context -> IO Context
forall (m :: * -> *) a. Monad m => a -> m a
return Context
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
contextType'
    Maybe Context -> IO (Maybe Context)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Context
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetContextMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Context.Context)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetContextMethodInfo a signature where
    overloadedMethod = elementGetContext

instance O.OverloadedMethodInfo ElementGetContextMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetContext",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetContext"
        }


#endif

-- method Element::get_context_unlocked
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the context of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context_type"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a name of a context to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Context" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_context_unlocked" gst_element_get_context_unlocked :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- context_type : TBasicType TUTF8
    IO (Ptr Gst.Context.Context)

-- | Gets the context with /@contextType@/ set on the element or NULL.
-- 
-- /Since: 1.8/
elementGetContextUnlocked ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the context of.
    -> T.Text
    -- ^ /@contextType@/: a name of a context to retrieve
    -> m (Maybe Gst.Context.Context)
    -- ^ __Returns:__ A t'GI.Gst.Structs.Context.Context' or NULL
elementGetContextUnlocked :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m (Maybe Context)
elementGetContextUnlocked a
element Text
contextType = IO (Maybe Context) -> m (Maybe Context)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Context) -> m (Maybe Context))
-> IO (Maybe Context) -> m (Maybe Context)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
contextType' <- Text -> IO (Ptr CChar)
textToCString Text
contextType
    Ptr Context
result <- Ptr Element -> Ptr CChar -> IO (Ptr Context)
gst_element_get_context_unlocked Ptr Element
element' Ptr CChar
contextType'
    Maybe Context
maybeResult <- Ptr Context -> (Ptr Context -> IO Context) -> IO (Maybe Context)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Context
result ((Ptr Context -> IO Context) -> IO (Maybe Context))
-> (Ptr Context -> IO Context) -> IO (Maybe Context)
forall a b. (a -> b) -> a -> b
$ \Ptr Context
result' -> do
        Context
result'' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Context -> Context
Gst.Context.Context) Ptr Context
result'
        Context -> IO Context
forall (m :: * -> *) a. Monad m => a -> m a
return Context
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
contextType'
    Maybe Context -> IO (Maybe Context)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Context
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetContextUnlockedMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Context.Context)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetContextUnlockedMethodInfo a signature where
    overloadedMethod = elementGetContextUnlocked

instance O.OverloadedMethodInfo ElementGetContextUnlockedMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetContextUnlocked",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetContextUnlocked"
        }


#endif

-- method Element::get_contexts
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to set the context of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList (TInterface Name { namespace = "Gst" , name = "Context" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_contexts" gst_element_get_contexts :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr (GList (Ptr Gst.Context.Context)))

-- | Gets the contexts set on the element.
-- 
-- MT safe.
-- 
-- /Since: 1.8/
elementGetContexts ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to set the context of.
    -> m [Gst.Context.Context]
    -- ^ __Returns:__ List of t'GI.Gst.Structs.Context.Context'
elementGetContexts :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m [Context]
elementGetContexts a
element = IO [Context] -> m [Context]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Context] -> m [Context]) -> IO [Context] -> m [Context]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr (GList (Ptr Context))
result <- Ptr Element -> IO (Ptr (GList (Ptr Context)))
gst_element_get_contexts Ptr Element
element'
    [Ptr Context]
result' <- Ptr (GList (Ptr Context)) -> IO [Ptr Context]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Context))
result
    [Context]
result'' <- (Ptr Context -> IO Context) -> [Ptr Context] -> IO [Context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Context -> Context
Gst.Context.Context) [Ptr Context]
result'
    Ptr (GList (Ptr Context)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Context))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    [Context] -> IO [Context]
forall (m :: * -> *) a. Monad m => a -> m a
return [Context]
result''

#if defined(ENABLE_OVERLOADING)
data ElementGetContextsMethodInfo
instance (signature ~ (m [Gst.Context.Context]), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetContextsMethodInfo a signature where
    overloadedMethod = elementGetContexts

instance O.OverloadedMethodInfo ElementGetContextsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetContexts",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetContexts"
        }


#endif

-- method Element::get_current_clock_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_current_clock_time" gst_element_get_current_clock_time :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO Word64

-- | Returns the current clock time of the element, as in, the time of the
-- element\'s clock, or GST_CLOCK_TIME_NONE if there is no clock.
-- 
-- /Since: 1.18/
elementGetCurrentClockTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Word64
    -- ^ __Returns:__ the clock time of the element, or GST_CLOCK_TIME_NONE if there is
    -- no clock.
elementGetCurrentClockTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Word64
elementGetCurrentClockTime a
element = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Word64
result <- Ptr Element -> IO Word64
gst_element_get_current_clock_time Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result

#if defined(ENABLE_OVERLOADING)
data ElementGetCurrentClockTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetCurrentClockTimeMethodInfo a signature where
    overloadedMethod = elementGetCurrentClockTime

instance O.OverloadedMethodInfo ElementGetCurrentClockTimeMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetCurrentClockTime",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetCurrentClockTime"
        }


#endif

-- method Element::get_current_running_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_current_running_time" gst_element_get_current_running_time :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO Word64

-- | Returns the running time of the element. The running time is the
-- element\'s clock time minus its base time. Will return GST_CLOCK_TIME_NONE
-- if the element has no clock, or if its base time has not been set.
-- 
-- /Since: 1.18/
elementGetCurrentRunningTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Word64
    -- ^ __Returns:__ the running time of the element, or GST_CLOCK_TIME_NONE if the
    -- element has no clock or its base time has not been set.
elementGetCurrentRunningTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Word64
elementGetCurrentRunningTime a
element = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Word64
result <- Ptr Element -> IO Word64
gst_element_get_current_running_time Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result

#if defined(ENABLE_OVERLOADING)
data ElementGetCurrentRunningTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetCurrentRunningTimeMethodInfo a signature where
    overloadedMethod = elementGetCurrentRunningTime

instance O.OverloadedMethodInfo ElementGetCurrentRunningTimeMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetCurrentRunningTime",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetCurrentRunningTime"
        }


#endif

-- method Element::get_factory
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GstElement to request the element factory of."
--                 , 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_get_factory" gst_element_get_factory :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.ElementFactory.ElementFactory)

-- | Retrieves the factory that was used to create this element.
elementGetFactory ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to request the element factory of.
    -> m (Maybe Gst.ElementFactory.ElementFactory)
    -- ^ __Returns:__ the t'GI.Gst.Objects.ElementFactory.ElementFactory' used for creating this
    --     element or 'P.Nothing' if element has not been registered (static element). no refcounting is needed.
elementGetFactory :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m (Maybe ElementFactory)
elementGetFactory a
element = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr ElementFactory
result <- Ptr Element -> IO (Ptr ElementFactory)
gst_element_get_factory Ptr Element
element'
    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
$ \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
newObject ManagedPtr ElementFactory -> ElementFactory
Gst.ElementFactory.ElementFactory) Ptr ElementFactory
result'
        ElementFactory -> IO ElementFactory
forall (m :: * -> *) a. Monad m => a -> m a
return ElementFactory
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Maybe ElementFactory -> IO (Maybe ElementFactory)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ElementFactory
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetFactoryMethodInfo
instance (signature ~ (m (Maybe Gst.ElementFactory.ElementFactory)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetFactoryMethodInfo a signature where
    overloadedMethod = elementGetFactory

instance O.OverloadedMethodInfo ElementGetFactoryMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetFactory",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetFactory"
        }


#endif

-- method Element::get_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "class to get metadata for"
--                 , 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 "the key to get" , 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_get_metadata" gst_element_get_metadata :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- key : TBasicType TUTF8
    IO CString

-- | Get metadata with /@key@/ in /@klass@/.
-- 
-- /Since: 1.14/
elementGetMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: class to get metadata for
    -> T.Text
    -- ^ /@key@/: the key to get
    -> m T.Text
    -- ^ __Returns:__ the metadata for /@key@/.
elementGetMetadata :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m Text
elementGetMetadata a
element Text
key = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
key' <- Text -> IO (Ptr CChar)
textToCString Text
key
    Ptr CChar
result <- Ptr Element -> Ptr CChar -> IO (Ptr CChar)
gst_element_get_metadata Ptr Element
element' Ptr CChar
key'
    Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"elementGetMetadata" Ptr CChar
result
    Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
key'
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data ElementGetMetadataMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetMetadataMethodInfo a signature where
    overloadedMethod = elementGetMetadata

instance O.OverloadedMethodInfo ElementGetMetadataMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetMetadata",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetMetadata"
        }


#endif

-- method Element::get_pad_template
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the pad template of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the #GstPadTemplate to get."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "PadTemplate" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_pad_template" gst_element_get_pad_template :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr Gst.PadTemplate.PadTemplate)

-- | Retrieves a padtemplate from /@element@/ with the given name.
-- 
-- /Since: 1.14/
elementGetPadTemplate ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the pad template of.
    -> T.Text
    -- ^ /@name@/: the name of the t'GI.Gst.Objects.PadTemplate.PadTemplate' to get.
    -> m (Maybe Gst.PadTemplate.PadTemplate)
    -- ^ __Returns:__ the t'GI.Gst.Objects.PadTemplate.PadTemplate' with the
    --     given name, or 'P.Nothing' if none was found. No unreferencing is
    --     necessary.
elementGetPadTemplate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m (Maybe PadTemplate)
elementGetPadTemplate a
element Text
name = IO (Maybe PadTemplate) -> m (Maybe PadTemplate)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PadTemplate) -> m (Maybe PadTemplate))
-> IO (Maybe PadTemplate) -> m (Maybe PadTemplate)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
    Ptr PadTemplate
result <- Ptr Element -> Ptr CChar -> IO (Ptr PadTemplate)
gst_element_get_pad_template Ptr Element
element' Ptr CChar
name'
    Maybe PadTemplate
maybeResult <- Ptr PadTemplate
-> (Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PadTemplate
result ((Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate))
-> (Ptr PadTemplate -> IO PadTemplate) -> IO (Maybe PadTemplate)
forall a b. (a -> b) -> a -> b
$ \Ptr PadTemplate
result' -> do
        PadTemplate
result'' <- ((ManagedPtr PadTemplate -> PadTemplate)
-> Ptr PadTemplate -> IO PadTemplate
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PadTemplate -> PadTemplate
Gst.PadTemplate.PadTemplate) Ptr PadTemplate
result'
        PadTemplate -> IO PadTemplate
forall (m :: * -> *) a. Monad m => a -> m a
return PadTemplate
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
    Maybe PadTemplate -> IO (Maybe PadTemplate)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PadTemplate
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetPadTemplateMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.PadTemplate.PadTemplate)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetPadTemplateMethodInfo a signature where
    overloadedMethod = elementGetPadTemplate

instance O.OverloadedMethodInfo ElementGetPadTemplateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetPadTemplate",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetPadTemplate"
        }


#endif

-- method Element::get_pad_template_list
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get pad templates of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList
--                  (TInterface Name { namespace = "Gst" , name = "PadTemplate" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_pad_template_list" gst_element_get_pad_template_list :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr (GList (Ptr Gst.PadTemplate.PadTemplate)))

-- | Retrieves a list of the pad templates associated with /@element@/. The
-- list must not be modified by the calling code.
-- 
-- /Since: 1.14/
elementGetPadTemplateList ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get pad templates of.
    -> m [Gst.PadTemplate.PadTemplate]
    -- ^ __Returns:__ the t'GI.GLib.Structs.List.List' of
    --     pad templates.
elementGetPadTemplateList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m [PadTemplate]
elementGetPadTemplateList a
element = IO [PadTemplate] -> m [PadTemplate]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PadTemplate] -> m [PadTemplate])
-> IO [PadTemplate] -> m [PadTemplate]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr (GList (Ptr PadTemplate))
result <- Ptr Element -> IO (Ptr (GList (Ptr PadTemplate)))
gst_element_get_pad_template_list Ptr Element
element'
    [Ptr PadTemplate]
result' <- Ptr (GList (Ptr PadTemplate)) -> IO [Ptr PadTemplate]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr PadTemplate))
result
    [PadTemplate]
result'' <- (Ptr PadTemplate -> IO PadTemplate)
-> [Ptr PadTemplate] -> IO [PadTemplate]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr PadTemplate -> PadTemplate)
-> Ptr PadTemplate -> IO PadTemplate
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PadTemplate -> PadTemplate
Gst.PadTemplate.PadTemplate) [Ptr PadTemplate]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    [PadTemplate] -> IO [PadTemplate]
forall (m :: * -> *) a. Monad m => a -> m a
return [PadTemplate]
result''

#if defined(ENABLE_OVERLOADING)
data ElementGetPadTemplateListMethodInfo
instance (signature ~ (m [Gst.PadTemplate.PadTemplate]), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetPadTemplateListMethodInfo a signature where
    overloadedMethod = elementGetPadTemplateList

instance O.OverloadedMethodInfo ElementGetPadTemplateListMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetPadTemplateList",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetPadTemplateList"
        }


#endif

-- method Element::get_request_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to find a request pad of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the request #GstPad to retrieve."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Pad" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_request_pad" gst_element_get_request_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr Gst.Pad.Pad)

-- | Retrieves a pad from the element by name (e.g. \"src_%d\"). This version only
-- retrieves request pads. The pad should be released with
-- 'GI.Gst.Objects.Element.elementReleaseRequestPad'.
-- 
-- This method is slower than manually getting the pad template and calling
-- 'GI.Gst.Objects.Element.elementRequestPad' if the pads should have a specific name (e.g.
-- /@name@/ is \"src_1\" instead of \"src_%u\").
elementGetRequestPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to find a request pad of.
    -> T.Text
    -- ^ /@name@/: the name of the request t'GI.Gst.Objects.Pad.Pad' to retrieve.
    -> m (Maybe Gst.Pad.Pad)
    -- ^ __Returns:__ requested t'GI.Gst.Objects.Pad.Pad' if found,
    --     otherwise 'P.Nothing'.  Release after usage.
elementGetRequestPad :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m (Maybe Pad)
elementGetRequestPad a
element Text
name = IO (Maybe Pad) -> m (Maybe Pad)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pad) -> m (Maybe Pad))
-> IO (Maybe Pad) -> m (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
    Ptr Pad
result <- Ptr Element -> Ptr CChar -> IO (Ptr Pad)
gst_element_get_request_pad Ptr Element
element' Ptr CChar
name'
    Maybe Pad
maybeResult <- Ptr Pad -> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pad
result ((Ptr Pad -> IO Pad) -> IO (Maybe Pad))
-> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ \Ptr Pad
result' -> do
        Pad
result'' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
result'
        Pad -> IO Pad
forall (m :: * -> *) a. Monad m => a -> m a
return Pad
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
    Maybe Pad -> IO (Maybe Pad)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pad
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetRequestPadMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Pad.Pad)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetRequestPadMethodInfo a signature where
    overloadedMethod = elementGetRequestPad

instance O.OverloadedMethodInfo ElementGetRequestPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetRequestPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetRequestPad"
        }


#endif

-- method Element::get_start_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_start_time" gst_element_get_start_time :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO Word64

-- | Returns the start time of the element. The start time is the
-- running time of the clock when this element was last put to PAUSED.
-- 
-- Usually the start_time is managed by a toplevel element such as
-- t'GI.Gst.Objects.Pipeline.Pipeline'.
-- 
-- MT safe.
elementGetStartTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Word64
    -- ^ __Returns:__ the start time of the element.
elementGetStartTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Word64
elementGetStartTime a
element = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Word64
result <- Ptr Element -> IO Word64
gst_element_get_start_time Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result

#if defined(ENABLE_OVERLOADING)
data ElementGetStartTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetStartTimeMethodInfo a signature where
    overloadedMethod = elementGetStartTime

instance O.OverloadedMethodInfo ElementGetStartTimeMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetStartTime",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetStartTime"
        }


#endif

-- method Element::get_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to get the state of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "state"
--           , argType = TInterface Name { namespace = "Gst" , name = "State" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a pointer to #GstState to hold the state.\n    Can be %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "pending"
--           , argType = TInterface Name { namespace = "Gst" , name = "State" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a pointer to #GstState to hold the pending\n    state. Can be %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "timeout"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GstClockTime to specify the timeout for an async\n          state change or %GST_CLOCK_TIME_NONE for infinite timeout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Gst" , name = "StateChangeReturn" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_state" gst_element_get_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr CUInt ->                            -- state : TInterface (Name {namespace = "Gst", name = "State"})
    Ptr CUInt ->                            -- pending : TInterface (Name {namespace = "Gst", name = "State"})
    Word64 ->                               -- timeout : TBasicType TUInt64
    IO CUInt

-- | Gets the state of the element.
-- 
-- For elements that performed an ASYNC state change, as reported by
-- 'GI.Gst.Objects.Element.elementSetState', this function will block up to the
-- specified timeout value for the state change to complete.
-- If the element completes the state change or goes into
-- an error, this function returns immediately with a return value of
-- 'GI.Gst.Enums.StateChangeReturnSuccess' or 'GI.Gst.Enums.StateChangeReturnFailure' respectively.
-- 
-- For elements that did not return 'GI.Gst.Enums.StateChangeReturnAsync', this function
-- returns the current and pending state immediately.
-- 
-- This function returns 'GI.Gst.Enums.StateChangeReturnNoPreroll' if the element
-- successfully changed its state but is not able to provide data yet.
-- This mostly happens for live sources that only produce data in
-- 'GI.Gst.Enums.StatePlaying'. While the state change return is equivalent to
-- 'GI.Gst.Enums.StateChangeReturnSuccess', it is returned to the application to signal that
-- some sink elements might not be able to complete their state change because
-- an element is not producing data to complete the preroll. When setting the
-- element to playing, the preroll will complete and playback will start.
elementGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to get the state of.
    -> Word64
    -- ^ /@timeout@/: a @/GstClockTime/@ to specify the timeout for an async
    --           state change or 'GI.Gst.Constants.CLOCK_TIME_NONE' for infinite timeout.
    -> m ((Gst.Enums.StateChangeReturn, Gst.Enums.State, Gst.Enums.State))
    -- ^ __Returns:__ 'GI.Gst.Enums.StateChangeReturnSuccess' if the element has no more pending state
    --          and the last state change succeeded, 'GI.Gst.Enums.StateChangeReturnAsync' if the
    --          element is still performing a state change or
    --          'GI.Gst.Enums.StateChangeReturnFailure' if the last state change failed.
    -- 
    -- MT safe.
elementGetState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Word64 -> m (StateChangeReturn, State, State)
elementGetState a
element Word64
timeout = IO (StateChangeReturn, State, State)
-> m (StateChangeReturn, State, State)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (StateChangeReturn, State, State)
 -> m (StateChangeReturn, State, State))
-> IO (StateChangeReturn, State, State)
-> m (StateChangeReturn, State, State)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CUInt
state <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    Ptr CUInt
pending <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    CUInt
result <- Ptr Element -> Ptr CUInt -> Ptr CUInt -> Word64 -> IO CUInt
gst_element_get_state Ptr Element
element' Ptr CUInt
state Ptr CUInt
pending Word64
timeout
    let result' :: StateChangeReturn
result' = (Int -> StateChangeReturn
forall a. Enum a => Int -> a
toEnum (Int -> StateChangeReturn)
-> (CUInt -> Int) -> CUInt -> StateChangeReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    CUInt
state' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
state
    let state'' :: State
state'' = (Int -> State
forall a. Enum a => Int -> a
toEnum (Int -> State) -> (CUInt -> Int) -> CUInt -> State
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
state'
    CUInt
pending' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
pending
    let pending'' :: State
pending'' = (Int -> State
forall a. Enum a => Int -> a
toEnum (Int -> State) -> (CUInt -> Int) -> CUInt -> State
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
pending'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
state
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
pending
    (StateChangeReturn, State, State)
-> IO (StateChangeReturn, State, State)
forall (m :: * -> *) a. Monad m => a -> m a
return (StateChangeReturn
result', State
state'', State
pending'')

#if defined(ENABLE_OVERLOADING)
data ElementGetStateMethodInfo
instance (signature ~ (Word64 -> m ((Gst.Enums.StateChangeReturn, Gst.Enums.State, Gst.Enums.State))), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetStateMethodInfo a signature where
    overloadedMethod = elementGetState

instance O.OverloadedMethodInfo ElementGetStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetState"
        }


#endif

-- method Element::get_static_pad
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to find a static pad of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the static #GstPad to retrieve."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Pad" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_get_static_pad" gst_element_get_static_pad :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr Gst.Pad.Pad)

-- | Retrieves a pad from /@element@/ by name. This version only retrieves
-- already-existing (i.e. \'static\') pads.
elementGetStaticPad ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to find a static pad of.
    -> T.Text
    -- ^ /@name@/: the name of the static t'GI.Gst.Objects.Pad.Pad' to retrieve.
    -> m (Maybe Gst.Pad.Pad)
    -- ^ __Returns:__ the requested t'GI.Gst.Objects.Pad.Pad' if
    --     found, otherwise 'P.Nothing'.  unref after usage.
    -- 
    -- MT safe.
elementGetStaticPad :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> Text -> m (Maybe Pad)
elementGetStaticPad a
element Text
name = IO (Maybe Pad) -> m (Maybe Pad)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pad) -> m (Maybe Pad))
-> IO (Maybe Pad) -> m (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr CChar
name' <- Text -> IO (Ptr CChar)
textToCString Text
name
    Ptr Pad
result <- Ptr Element -> Ptr CChar -> IO (Ptr Pad)
gst_element_get_static_pad Ptr Element
element' Ptr CChar
name'
    Maybe Pad
maybeResult <- Ptr Pad -> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pad
result ((Ptr Pad -> IO Pad) -> IO (Maybe Pad))
-> (Ptr Pad -> IO Pad) -> IO (Maybe Pad)
forall a b. (a -> b) -> a -> b
$ \Ptr Pad
result' -> do
        Pad
result'' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
result'
        Pad -> IO Pad
forall (m :: * -> *) a. Monad m => a -> m a
return Pad
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
name'
    Maybe Pad -> IO (Maybe Pad)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pad
maybeResult

#if defined(ENABLE_OVERLOADING)
data ElementGetStaticPadMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Pad.Pad)), MonadIO m, IsElement a) => O.OverloadedMethod ElementGetStaticPadMethodInfo a signature where
    overloadedMethod = elementGetStaticPad

instance O.OverloadedMethodInfo ElementGetStaticPadMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementGetStaticPad",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementGetStaticPad"
        }


#endif

-- method Element::is_locked_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , 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_is_locked_state" gst_element_is_locked_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO CInt

-- | Checks if the state of an element is locked.
-- If the state of an element is locked, state changes of the parent don\'t
-- affect the element.
-- This way you can leave currently unused elements inside bins. Just lock their
-- state before changing the state from @/GST_STATE_NULL/@.
-- 
-- MT safe.
elementIsLockedState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Bool
    -- ^ __Returns:__ 'P.True', if the element\'s state is locked.
elementIsLockedState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Bool
elementIsLockedState a
element = 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 Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    CInt
result <- Ptr Element -> IO CInt
gst_element_is_locked_state Ptr Element
element'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementIsLockedStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsElement a) => O.OverloadedMethod ElementIsLockedStateMethodInfo a signature where
    overloadedMethod = elementIsLockedState

instance O.OverloadedMethodInfo ElementIsLockedStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementIsLockedState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementIsLockedState"
        }


#endif

-- method Element::iterate_pads
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to iterate pads of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_iterate_pads" gst_element_iterate_pads :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.Iterator.Iterator)

-- | Retrieves an iterator of /@element@/\'s pads. The iterator should
-- be freed after usage. Also more specialized iterators exists such as
-- 'GI.Gst.Objects.Element.elementIterateSrcPads' or 'GI.Gst.Objects.Element.elementIterateSinkPads'.
-- 
-- The order of pads returned by the iterator will be the order in which
-- the pads were added to the element.
elementIteratePads ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' to iterate pads of.
    -> m Gst.Iterator.Iterator
    -- ^ __Returns:__ the t'GI.Gst.Structs.Iterator.Iterator' of t'GI.Gst.Objects.Pad.Pad'.
    -- 
    -- MT safe.
elementIteratePads :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Iterator
elementIteratePads a
element = IO Iterator -> m Iterator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Iterator -> m Iterator) -> IO Iterator -> m Iterator
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Iterator
result <- Ptr Element -> IO (Ptr Iterator)
gst_element_iterate_pads Ptr Element
element'
    Text -> Ptr Iterator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"elementIteratePads" Ptr Iterator
result
    Iterator
result' <- ((ManagedPtr Iterator -> Iterator) -> Ptr Iterator -> IO Iterator
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator) Ptr Iterator
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Iterator -> IO Iterator
forall (m :: * -> *) a. Monad m => a -> m a
return Iterator
result'

#if defined(ENABLE_OVERLOADING)
data ElementIteratePadsMethodInfo
instance (signature ~ (m Gst.Iterator.Iterator), MonadIO m, IsElement a) => O.OverloadedMethod ElementIteratePadsMethodInfo a signature where
    overloadedMethod = elementIteratePads

instance O.OverloadedMethodInfo ElementIteratePadsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementIteratePads",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementIteratePads"
        }


#endif

-- method Element::iterate_sink_pads
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_iterate_sink_pads" gst_element_iterate_sink_pads :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.Iterator.Iterator)

-- | Retrieves an iterator of /@element@/\'s sink pads.
-- 
-- The order of pads returned by the iterator will be the order in which
-- the pads were added to the element.
elementIterateSinkPads ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Gst.Iterator.Iterator
    -- ^ __Returns:__ the t'GI.Gst.Structs.Iterator.Iterator' of t'GI.Gst.Objects.Pad.Pad'.
    -- 
    -- MT safe.
elementIterateSinkPads :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Iterator
elementIterateSinkPads a
element = IO Iterator -> m Iterator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Iterator -> m Iterator) -> IO Iterator -> m Iterator
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Iterator
result <- Ptr Element -> IO (Ptr Iterator)
gst_element_iterate_sink_pads Ptr Element
element'
    Text -> Ptr Iterator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"elementIterateSinkPads" Ptr Iterator
result
    Iterator
result' <- ((ManagedPtr Iterator -> Iterator) -> Ptr Iterator -> IO Iterator
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator) Ptr Iterator
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Iterator -> IO Iterator
forall (m :: * -> *) a. Monad m => a -> m a
return Iterator
result'

#if defined(ENABLE_OVERLOADING)
data ElementIterateSinkPadsMethodInfo
instance (signature ~ (m Gst.Iterator.Iterator), MonadIO m, IsElement a) => O.OverloadedMethod ElementIterateSinkPadsMethodInfo a signature where
    overloadedMethod = elementIterateSinkPads

instance O.OverloadedMethodInfo ElementIterateSinkPadsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementIterateSinkPads",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementIterateSinkPads"
        }


#endif

-- method Element::iterate_src_pads
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_iterate_src_pads" gst_element_iterate_src_pads :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO (Ptr Gst.Iterator.Iterator)

-- | Retrieves an iterator of /@element@/\'s source pads.
-- 
-- The order of pads returned by the iterator will be the order in which
-- the pads were added to the element.
elementIterateSrcPads ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element'.
    -> m Gst.Iterator.Iterator
    -- ^ __Returns:__ the t'GI.Gst.Structs.Iterator.Iterator' of t'GI.Gst.Objects.Pad.Pad'.
    -- 
    -- MT safe.
elementIterateSrcPads :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m Iterator
elementIterateSrcPads a
element = IO Iterator -> m Iterator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Iterator -> m Iterator) -> IO Iterator -> m Iterator
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Iterator
result <- Ptr Element -> IO (Ptr Iterator)
gst_element_iterate_src_pads Ptr Element
element'
    Text -> Ptr Iterator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"elementIterateSrcPads" Ptr Iterator
result
    Iterator
result' <- ((ManagedPtr Iterator -> Iterator) -> Ptr Iterator -> IO Iterator
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator) Ptr Iterator
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    Iterator -> IO Iterator
forall (m :: * -> *) a. Monad m => a -> m a
return Iterator
result'

#if defined(ENABLE_OVERLOADING)
data ElementIterateSrcPadsMethodInfo
instance (signature ~ (m Gst.Iterator.Iterator), MonadIO m, IsElement a) => O.OverloadedMethod ElementIterateSrcPadsMethodInfo a signature where
    overloadedMethod = elementIterateSrcPads

instance O.OverloadedMethodInfo ElementIterateSrcPadsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementIterateSrcPads",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementIterateSrcPads"
        }


#endif

-- method Element::link
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement containing the source pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstElement containing the destination pad."
--                 , 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_link" gst_element_link :: 
    Ptr Element ->                          -- src : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Element ->                          -- dest : TInterface (Name {namespace = "Gst", name = "Element"})
    IO CInt

-- | Links /@src@/ to /@dest@/. The link must be from source to
-- destination; the other direction will not be tried. The function looks for
-- existing pads that aren\'t linked yet. It will request new pads if necessary.
-- Such pads need to be released manually when unlinking.
-- If multiple links are possible, only one is established.
-- 
-- Make sure you have added your elements to a bin or pipeline with
-- 'GI.Gst.Objects.Bin.binAdd' before trying to link them.
elementLink ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, IsElement b) =>
    a
    -- ^ /@src@/: a t'GI.Gst.Objects.Element.Element' containing the source pad.
    -> b
    -- ^ /@dest@/: the t'GI.Gst.Objects.Element.Element' containing the destination pad.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the elements could be linked, 'P.False' otherwise.
elementLink :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsElement b) =>
a -> b -> m Bool
elementLink a
src b
dest = 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 Element
src' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr Element
dest' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
    CInt
result <- Ptr Element -> Ptr Element -> IO CInt
gst_element_link Ptr Element
src' Ptr Element
dest'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementLinkMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsElement a, IsElement b) => O.OverloadedMethod ElementLinkMethodInfo a signature where
    overloadedMethod = elementLink

instance O.OverloadedMethodInfo ElementLinkMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLink",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLink"
        }


#endif

-- method Element::link_filtered
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement containing the source pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstElement containing the destination pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filter"
--           , argType = TInterface Name { namespace = "Gst" , name = "Caps" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #GstCaps to filter the link,\n    or %NULL for no filter."
--                 , 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_link_filtered" gst_element_link_filtered :: 
    Ptr Element ->                          -- src : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Element ->                          -- dest : TInterface (Name {namespace = "Gst", name = "Element"})
    Ptr Gst.Caps.Caps ->                    -- filter : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO CInt

-- | Links /@src@/ to /@dest@/ using the given caps as filtercaps.
-- The link must be from source to
-- destination; the other direction will not be tried. The function looks for
-- existing pads that aren\'t linked yet. It will request new pads if necessary.
-- If multiple links are possible, only one is established.
-- 
-- Make sure you have added your elements to a bin or pipeline with
-- 'GI.Gst.Objects.Bin.binAdd' before trying to link them.
elementLinkFiltered ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, IsElement b) =>
    a
    -- ^ /@src@/: a t'GI.Gst.Objects.Element.Element' containing the source pad.
    -> b
    -- ^ /@dest@/: the t'GI.Gst.Objects.Element.Element' containing the destination pad.
    -> Maybe (Gst.Caps.Caps)
    -- ^ /@filter@/: the t'GI.Gst.Structs.Caps.Caps' to filter the link,
    --     or 'P.Nothing' for no filter.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pads could be linked, 'P.False' otherwise.
elementLinkFiltered :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsElement b) =>
a -> b -> Maybe Caps -> m Bool
elementLinkFiltered a
src b
dest Maybe Caps
filter = 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 Element
src' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr Element
dest' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
    Ptr Caps
maybeFilter <- case Maybe Caps
filter of
        Maybe Caps
Nothing -> Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
forall a. Ptr a
nullPtr
        Just Caps
jFilter -> do
            Ptr Caps
jFilter' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
jFilter
            Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
jFilter'
    CInt
result <- Ptr Element -> Ptr Element -> Ptr Caps -> IO CInt
gst_element_link_filtered Ptr Element
src' Ptr Element
dest' Ptr Caps
maybeFilter
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
    Maybe Caps -> (Caps -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Caps
filter Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementLinkFilteredMethodInfo
instance (signature ~ (b -> Maybe (Gst.Caps.Caps) -> m Bool), MonadIO m, IsElement a, IsElement b) => O.OverloadedMethod ElementLinkFilteredMethodInfo a signature where
    overloadedMethod = elementLinkFiltered

instance O.OverloadedMethodInfo ElementLinkFilteredMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLinkFiltered",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLinkFiltered"
        }


#endif

-- method Element::link_pads
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement containing the source pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "srcpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in source element\n    or %NULL for any pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstElement containing the destination pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in destination element,\nor %NULL for any pad."
--                 , 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_link_pads" gst_element_link_pads :: 
    Ptr Element ->                          -- src : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- srcpadname : TBasicType TUTF8
    Ptr Element ->                          -- dest : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- destpadname : TBasicType TUTF8
    IO CInt

-- | Links the two named pads of the source and destination elements.
-- Side effect is that if one of the pads has no parent, it becomes a
-- child of the parent of the other element.  If they have different
-- parents, the link fails.
elementLinkPads ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, IsElement b) =>
    a
    -- ^ /@src@/: a t'GI.Gst.Objects.Element.Element' containing the source pad.
    -> Maybe (T.Text)
    -- ^ /@srcpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in source element
    --     or 'P.Nothing' for any pad.
    -> b
    -- ^ /@dest@/: the t'GI.Gst.Objects.Element.Element' containing the destination pad.
    -> Maybe (T.Text)
    -- ^ /@destpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in destination element,
    -- or 'P.Nothing' for any pad.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pads could be linked, 'P.False' otherwise.
elementLinkPads :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsElement b) =>
a -> Maybe Text -> b -> Maybe Text -> m Bool
elementLinkPads a
src Maybe Text
srcpadname b
dest Maybe Text
destpadname = 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 Element
src' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr CChar
maybeSrcpadname <- case Maybe Text
srcpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jSrcpadname -> do
            Ptr CChar
jSrcpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jSrcpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jSrcpadname'
    Ptr Element
dest' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
    Ptr CChar
maybeDestpadname <- case Maybe Text
destpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jDestpadname -> do
            Ptr CChar
jDestpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jDestpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDestpadname'
    CInt
result <- Ptr Element -> Ptr CChar -> Ptr Element -> Ptr CChar -> IO CInt
gst_element_link_pads Ptr Element
src' Ptr CChar
maybeSrcpadname Ptr Element
dest' Ptr CChar
maybeDestpadname
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeSrcpadname
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDestpadname
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementLinkPadsMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Maybe (T.Text) -> m Bool), MonadIO m, IsElement a, IsElement b) => O.OverloadedMethod ElementLinkPadsMethodInfo a signature where
    overloadedMethod = elementLinkPads

instance O.OverloadedMethodInfo ElementLinkPadsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLinkPads",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLinkPads"
        }


#endif

-- method Element::link_pads_filtered
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement containing the source pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "srcpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in source element\n    or %NULL for any pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstElement containing the destination pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in destination element\n    or %NULL for any pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filter"
--           , argType = TInterface Name { namespace = "Gst" , name = "Caps" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #GstCaps to filter the link,\n    or %NULL for no filter."
--                 , 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_link_pads_filtered" gst_element_link_pads_filtered :: 
    Ptr Element ->                          -- src : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- srcpadname : TBasicType TUTF8
    Ptr Element ->                          -- dest : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- destpadname : TBasicType TUTF8
    Ptr Gst.Caps.Caps ->                    -- filter : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO CInt

-- | Links the two named pads of the source and destination elements. Side effect
-- is that if one of the pads has no parent, it becomes a child of the parent of
-- the other element. If they have different parents, the link fails. If /@caps@/
-- is not 'P.Nothing', makes sure that the caps of the link is a subset of /@caps@/.
elementLinkPadsFiltered ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, IsElement b) =>
    a
    -- ^ /@src@/: a t'GI.Gst.Objects.Element.Element' containing the source pad.
    -> Maybe (T.Text)
    -- ^ /@srcpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in source element
    --     or 'P.Nothing' for any pad.
    -> b
    -- ^ /@dest@/: the t'GI.Gst.Objects.Element.Element' containing the destination pad.
    -> Maybe (T.Text)
    -- ^ /@destpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in destination element
    --     or 'P.Nothing' for any pad.
    -> Maybe (Gst.Caps.Caps)
    -- ^ /@filter@/: the t'GI.Gst.Structs.Caps.Caps' to filter the link,
    --     or 'P.Nothing' for no filter.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pads could be linked, 'P.False' otherwise.
elementLinkPadsFiltered :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsElement b) =>
a -> Maybe Text -> b -> Maybe Text -> Maybe Caps -> m Bool
elementLinkPadsFiltered a
src Maybe Text
srcpadname b
dest Maybe Text
destpadname Maybe Caps
filter = 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 Element
src' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr CChar
maybeSrcpadname <- case Maybe Text
srcpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jSrcpadname -> do
            Ptr CChar
jSrcpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jSrcpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jSrcpadname'
    Ptr Element
dest' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
    Ptr CChar
maybeDestpadname <- case Maybe Text
destpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jDestpadname -> do
            Ptr CChar
jDestpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jDestpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDestpadname'
    Ptr Caps
maybeFilter <- case Maybe Caps
filter of
        Maybe Caps
Nothing -> Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
forall a. Ptr a
nullPtr
        Just Caps
jFilter -> do
            Ptr Caps
jFilter' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
jFilter
            Ptr Caps -> IO (Ptr Caps)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Caps
jFilter'
    CInt
result <- Ptr Element
-> Ptr CChar -> Ptr Element -> Ptr CChar -> Ptr Caps -> IO CInt
gst_element_link_pads_filtered Ptr Element
src' Ptr CChar
maybeSrcpadname Ptr Element
dest' Ptr CChar
maybeDestpadname Ptr Caps
maybeFilter
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
    Maybe Caps -> (Caps -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Caps
filter Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeSrcpadname
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDestpadname
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementLinkPadsFilteredMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Maybe (T.Text) -> Maybe (Gst.Caps.Caps) -> m Bool), MonadIO m, IsElement a, IsElement b) => O.OverloadedMethod ElementLinkPadsFilteredMethodInfo a signature where
    overloadedMethod = elementLinkPadsFiltered

instance O.OverloadedMethodInfo ElementLinkPadsFilteredMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLinkPadsFiltered",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLinkPadsFiltered"
        }


#endif

-- method Element::link_pads_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement containing the source pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "srcpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in source element\n    or %NULL for any pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstElement containing the destination pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destpadname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the #GstPad in destination element,\nor %NULL for any pad."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "PadLinkCheck" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GstPadLinkCheck to be performed when linking pads."
--                 , 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_link_pads_full" gst_element_link_pads_full :: 
    Ptr Element ->                          -- src : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- srcpadname : TBasicType TUTF8
    Ptr Element ->                          -- dest : TInterface (Name {namespace = "Gst", name = "Element"})
    CString ->                              -- destpadname : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gst", name = "PadLinkCheck"})
    IO CInt

-- | Links the two named pads of the source and destination elements.
-- Side effect is that if one of the pads has no parent, it becomes a
-- child of the parent of the other element.  If they have different
-- parents, the link fails.
-- 
-- Calling 'GI.Gst.Objects.Element.elementLinkPadsFull' with /@flags@/ == 'GI.Gst.Flags.PadLinkCheckDefault'
-- is the same as calling 'GI.Gst.Objects.Element.elementLinkPads' and the recommended way of
-- linking pads with safety checks applied.
-- 
-- This is a convenience function for 'GI.Gst.Objects.Pad.padLinkFull'.
elementLinkPadsFull ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a, IsElement b) =>
    a
    -- ^ /@src@/: a t'GI.Gst.Objects.Element.Element' containing the source pad.
    -> Maybe (T.Text)
    -- ^ /@srcpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in source element
    --     or 'P.Nothing' for any pad.
    -> b
    -- ^ /@dest@/: the t'GI.Gst.Objects.Element.Element' containing the destination pad.
    -> Maybe (T.Text)
    -- ^ /@destpadname@/: the name of the t'GI.Gst.Objects.Pad.Pad' in destination element,
    -- or 'P.Nothing' for any pad.
    -> [Gst.Flags.PadLinkCheck]
    -- ^ /@flags@/: the t'GI.Gst.Flags.PadLinkCheck' to be performed when linking pads.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pads could be linked, 'P.False' otherwise.
elementLinkPadsFull :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsElement a, IsElement b) =>
a -> Maybe Text -> b -> Maybe Text -> [PadLinkCheck] -> m Bool
elementLinkPadsFull a
src Maybe Text
srcpadname b
dest Maybe Text
destpadname [PadLinkCheck]
flags = 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 Element
src' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr CChar
maybeSrcpadname <- case Maybe Text
srcpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jSrcpadname -> do
            Ptr CChar
jSrcpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jSrcpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jSrcpadname'
    Ptr Element
dest' <- b -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
    Ptr CChar
maybeDestpadname <- case Maybe Text
destpadname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jDestpadname -> do
            Ptr CChar
jDestpadname' <- Text -> IO (Ptr CChar)
textToCString Text
jDestpadname
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDestpadname'
    let flags' :: CUInt
flags' = [PadLinkCheck] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [PadLinkCheck]
flags
    CInt
result <- Ptr Element
-> Ptr CChar -> Ptr Element -> Ptr CChar -> CUInt -> IO CInt
gst_element_link_pads_full Ptr Element
src' Ptr CChar
maybeSrcpadname Ptr Element
dest' Ptr CChar
maybeDestpadname CUInt
flags'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeSrcpadname
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDestpadname
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ElementLinkPadsFullMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Maybe (T.Text) -> [Gst.Flags.PadLinkCheck] -> m Bool), MonadIO m, IsElement a, IsElement b) => O.OverloadedMethod ElementLinkPadsFullMethodInfo a signature where
    overloadedMethod = elementLinkPadsFull

instance O.OverloadedMethodInfo ElementLinkPadsFullMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLinkPadsFull",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLinkPadsFull"
        }


#endif

-- method Element::lost_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement the state is lost of"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_element_lost_state" gst_element_lost_state :: 
    Ptr Element ->                          -- element : TInterface (Name {namespace = "Gst", name = "Element"})
    IO ()

-- | Brings the element to the lost state. The current state of the
-- element is copied to the pending state so that any call to
-- 'GI.Gst.Objects.Element.elementGetState' will return 'GI.Gst.Enums.StateChangeReturnAsync'.
-- 
-- An ASYNC_START message is posted. If the element was PLAYING, it will
-- go to PAUSED. The element will be restored to its PLAYING state by
-- the parent pipeline when it prerolls again.
-- 
-- This is mostly used for elements that lost their preroll buffer
-- in the 'GI.Gst.Enums.StatePaused' or 'GI.Gst.Enums.StatePlaying' state after a flush,
-- they will go to their pending state again when a new preroll buffer is
-- queued. This function can only be called when the element is currently
-- not in error or an async state change.
-- 
-- This function is used internally and should normally not be called from
-- plugins or applications.
elementLostState ::
    (B.CallStack.HasCallStack, MonadIO m, IsElement a) =>
    a
    -- ^ /@element@/: a t'GI.Gst.Objects.Element.Element' the state is lost of
    -> m ()
elementLostState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsElement a) =>
a -> m ()
elementLostState a
element = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Element -> IO ()
gst_element_lost_state Ptr Element
element'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ElementLostStateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsElement a) => O.OverloadedMethod ElementLostStateMethodInfo a signature where
    overloadedMethod = elementLostState

instance O.OverloadedMethodInfo ElementLostStateMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gst.Objects.Element.elementLostState",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gst-1.0.24/docs/GI-Gst-Objects-Element.html#v:elementLostState"
        }


#endif

-- method Element::message_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstElement to send message from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "MessageType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstMessageType"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "domain"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the GStreamer GError domain this message belongs to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "code"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the GError code belonging to the domain"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "an allocated text string to be used\n           as a replacement for the default message connected to code,\n           or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "debug"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "an allocated debug message to be\n           used as a replacement for the default debugging information,\n           or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "file"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the source code file where the error was generated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "function"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the source code function where the error was generated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the source code line where the error was generated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--