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

/No description available in the introspection data./
-}

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

module GI.Gst.Objects.ProxyPad
    (

-- * Exported types
    ProxyPad(..)                            ,
    IsProxyPad                              ,
    toProxyPad                              ,
    noProxyPad                              ,


 -- * Methods
-- ** chainDefault #method:chainDefault#

    proxyPadChainDefault                    ,


-- ** chainListDefault #method:chainListDefault#

    proxyPadChainListDefault                ,


-- ** getInternal #method:getInternal#

#if ENABLE_OVERLOADING
    ProxyPadGetInternalMethodInfo           ,
#endif
    proxyPadGetInternal                     ,


-- ** getrangeDefault #method:getrangeDefault#

    proxyPadGetrangeDefault                 ,


-- ** iterateInternalLinksDefault #method:iterateInternalLinksDefault#

    proxyPadIterateInternalLinksDefault     ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
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.Structs.Buffer as Gst.Buffer
import {-# SOURCE #-} qualified GI.Gst.Structs.BufferList as Gst.BufferList
import {-# SOURCE #-} qualified GI.Gst.Structs.Iterator as Gst.Iterator

-- | Memory-managed wrapper type.
newtype ProxyPad = ProxyPad (ManagedPtr ProxyPad)
foreign import ccall "gst_proxy_pad_get_type"
    c_gst_proxy_pad_get_type :: IO GType

instance GObject ProxyPad where
    gobjectType = c_gst_proxy_pad_get_type


-- | Type class for types which can be safely cast to `ProxyPad`, for instance with `toProxyPad`.
class (GObject o, O.IsDescendantOf ProxyPad o) => IsProxyPad o
instance (GObject o, O.IsDescendantOf ProxyPad o) => IsProxyPad o

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

-- | Cast to `ProxyPad`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toProxyPad :: (MonadIO m, IsProxyPad o) => o -> m ProxyPad
toProxyPad = liftIO . unsafeCastTo ProxyPad

-- | A convenience alias for `Nothing` :: `Maybe` `ProxyPad`.
noProxyPad :: Maybe ProxyPad
noProxyPad = Nothing

#if ENABLE_OVERLOADING
type family ResolveProxyPadMethod (t :: Symbol) (o :: *) :: * where
    ResolveProxyPadMethod "activateMode" o = Gst.Pad.PadActivateModeMethodInfo
    ResolveProxyPadMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveProxyPadMethod "addProbe" o = Gst.Pad.PadAddProbeMethodInfo
    ResolveProxyPadMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveProxyPadMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveProxyPadMethod "canLink" o = Gst.Pad.PadCanLinkMethodInfo
    ResolveProxyPadMethod "chain" o = Gst.Pad.PadChainMethodInfo
    ResolveProxyPadMethod "chainList" o = Gst.Pad.PadChainListMethodInfo
    ResolveProxyPadMethod "checkReconfigure" o = Gst.Pad.PadCheckReconfigureMethodInfo
    ResolveProxyPadMethod "createStreamId" o = Gst.Pad.PadCreateStreamIdMethodInfo
    ResolveProxyPadMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveProxyPadMethod "eventDefault" o = Gst.Pad.PadEventDefaultMethodInfo
    ResolveProxyPadMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveProxyPadMethod "forward" o = Gst.Pad.PadForwardMethodInfo
    ResolveProxyPadMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveProxyPadMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveProxyPadMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveProxyPadMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveProxyPadMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveProxyPadMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveProxyPadMethod "hasCurrentCaps" o = Gst.Pad.PadHasCurrentCapsMethodInfo
    ResolveProxyPadMethod "isActive" o = Gst.Pad.PadIsActiveMethodInfo
    ResolveProxyPadMethod "isBlocked" o = Gst.Pad.PadIsBlockedMethodInfo
    ResolveProxyPadMethod "isBlocking" o = Gst.Pad.PadIsBlockingMethodInfo
    ResolveProxyPadMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveProxyPadMethod "isLinked" o = Gst.Pad.PadIsLinkedMethodInfo
    ResolveProxyPadMethod "iterateInternalLinks" o = Gst.Pad.PadIterateInternalLinksMethodInfo
    ResolveProxyPadMethod "link" o = Gst.Pad.PadLinkMethodInfo
    ResolveProxyPadMethod "linkFull" o = Gst.Pad.PadLinkFullMethodInfo
    ResolveProxyPadMethod "linkMaybeGhosting" o = Gst.Pad.PadLinkMaybeGhostingMethodInfo
    ResolveProxyPadMethod "linkMaybeGhostingFull" o = Gst.Pad.PadLinkMaybeGhostingFullMethodInfo
    ResolveProxyPadMethod "markReconfigure" o = Gst.Pad.PadMarkReconfigureMethodInfo
    ResolveProxyPadMethod "needsReconfigure" o = Gst.Pad.PadNeedsReconfigureMethodInfo
    ResolveProxyPadMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveProxyPadMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveProxyPadMethod "pauseTask" o = Gst.Pad.PadPauseTaskMethodInfo
    ResolveProxyPadMethod "peerQuery" o = Gst.Pad.PadPeerQueryMethodInfo
    ResolveProxyPadMethod "peerQueryAcceptCaps" o = Gst.Pad.PadPeerQueryAcceptCapsMethodInfo
    ResolveProxyPadMethod "peerQueryCaps" o = Gst.Pad.PadPeerQueryCapsMethodInfo
    ResolveProxyPadMethod "peerQueryConvert" o = Gst.Pad.PadPeerQueryConvertMethodInfo
    ResolveProxyPadMethod "peerQueryDuration" o = Gst.Pad.PadPeerQueryDurationMethodInfo
    ResolveProxyPadMethod "peerQueryPosition" o = Gst.Pad.PadPeerQueryPositionMethodInfo
    ResolveProxyPadMethod "proxyQueryAcceptCaps" o = Gst.Pad.PadProxyQueryAcceptCapsMethodInfo
    ResolveProxyPadMethod "proxyQueryCaps" o = Gst.Pad.PadProxyQueryCapsMethodInfo
    ResolveProxyPadMethod "pullRange" o = Gst.Pad.PadPullRangeMethodInfo
    ResolveProxyPadMethod "push" o = Gst.Pad.PadPushMethodInfo
    ResolveProxyPadMethod "pushEvent" o = Gst.Pad.PadPushEventMethodInfo
    ResolveProxyPadMethod "pushList" o = Gst.Pad.PadPushListMethodInfo
    ResolveProxyPadMethod "query" o = Gst.Pad.PadQueryMethodInfo
    ResolveProxyPadMethod "queryAcceptCaps" o = Gst.Pad.PadQueryAcceptCapsMethodInfo
    ResolveProxyPadMethod "queryCaps" o = Gst.Pad.PadQueryCapsMethodInfo
    ResolveProxyPadMethod "queryConvert" o = Gst.Pad.PadQueryConvertMethodInfo
    ResolveProxyPadMethod "queryDefault" o = Gst.Pad.PadQueryDefaultMethodInfo
    ResolveProxyPadMethod "queryDuration" o = Gst.Pad.PadQueryDurationMethodInfo
    ResolveProxyPadMethod "queryPosition" o = Gst.Pad.PadQueryPositionMethodInfo
    ResolveProxyPadMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveProxyPadMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveProxyPadMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveProxyPadMethod "removeProbe" o = Gst.Pad.PadRemoveProbeMethodInfo
    ResolveProxyPadMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveProxyPadMethod "sendEvent" o = Gst.Pad.PadSendEventMethodInfo
    ResolveProxyPadMethod "startTask" o = Gst.Pad.PadStartTaskMethodInfo
    ResolveProxyPadMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveProxyPadMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveProxyPadMethod "stickyEventsForeach" o = Gst.Pad.PadStickyEventsForeachMethodInfo
    ResolveProxyPadMethod "stopTask" o = Gst.Pad.PadStopTaskMethodInfo
    ResolveProxyPadMethod "storeStickyEvent" o = Gst.Pad.PadStoreStickyEventMethodInfo
    ResolveProxyPadMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveProxyPadMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveProxyPadMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveProxyPadMethod "unlink" o = Gst.Pad.PadUnlinkMethodInfo
    ResolveProxyPadMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveProxyPadMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveProxyPadMethod "useFixedCaps" o = Gst.Pad.PadUseFixedCapsMethodInfo
    ResolveProxyPadMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveProxyPadMethod "getAllowedCaps" o = Gst.Pad.PadGetAllowedCapsMethodInfo
    ResolveProxyPadMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveProxyPadMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveProxyPadMethod "getCurrentCaps" o = Gst.Pad.PadGetCurrentCapsMethodInfo
    ResolveProxyPadMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveProxyPadMethod "getDirection" o = Gst.Pad.PadGetDirectionMethodInfo
    ResolveProxyPadMethod "getElementPrivate" o = Gst.Pad.PadGetElementPrivateMethodInfo
    ResolveProxyPadMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveProxyPadMethod "getInternal" o = ProxyPadGetInternalMethodInfo
    ResolveProxyPadMethod "getLastFlowReturn" o = Gst.Pad.PadGetLastFlowReturnMethodInfo
    ResolveProxyPadMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveProxyPadMethod "getOffset" o = Gst.Pad.PadGetOffsetMethodInfo
    ResolveProxyPadMethod "getPadTemplate" o = Gst.Pad.PadGetPadTemplateMethodInfo
    ResolveProxyPadMethod "getPadTemplateCaps" o = Gst.Pad.PadGetPadTemplateCapsMethodInfo
    ResolveProxyPadMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveProxyPadMethod "getParentElement" o = Gst.Pad.PadGetParentElementMethodInfo
    ResolveProxyPadMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveProxyPadMethod "getPeer" o = Gst.Pad.PadGetPeerMethodInfo
    ResolveProxyPadMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveProxyPadMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveProxyPadMethod "getRange" o = Gst.Pad.PadGetRangeMethodInfo
    ResolveProxyPadMethod "getStickyEvent" o = Gst.Pad.PadGetStickyEventMethodInfo
    ResolveProxyPadMethod "getStream" o = Gst.Pad.PadGetStreamMethodInfo
    ResolveProxyPadMethod "getStreamId" o = Gst.Pad.PadGetStreamIdMethodInfo
    ResolveProxyPadMethod "getTaskState" o = Gst.Pad.PadGetTaskStateMethodInfo
    ResolveProxyPadMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveProxyPadMethod "setActivateFunctionFull" o = Gst.Pad.PadSetActivateFunctionFullMethodInfo
    ResolveProxyPadMethod "setActivatemodeFunctionFull" o = Gst.Pad.PadSetActivatemodeFunctionFullMethodInfo
    ResolveProxyPadMethod "setActive" o = Gst.Pad.PadSetActiveMethodInfo
    ResolveProxyPadMethod "setChainFunctionFull" o = Gst.Pad.PadSetChainFunctionFullMethodInfo
    ResolveProxyPadMethod "setChainListFunctionFull" o = Gst.Pad.PadSetChainListFunctionFullMethodInfo
    ResolveProxyPadMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveProxyPadMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveProxyPadMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveProxyPadMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveProxyPadMethod "setElementPrivate" o = Gst.Pad.PadSetElementPrivateMethodInfo
    ResolveProxyPadMethod "setEventFullFunctionFull" o = Gst.Pad.PadSetEventFullFunctionFullMethodInfo
    ResolveProxyPadMethod "setEventFunctionFull" o = Gst.Pad.PadSetEventFunctionFullMethodInfo
    ResolveProxyPadMethod "setGetrangeFunctionFull" o = Gst.Pad.PadSetGetrangeFunctionFullMethodInfo
    ResolveProxyPadMethod "setIterateInternalLinksFunctionFull" o = Gst.Pad.PadSetIterateInternalLinksFunctionFullMethodInfo
    ResolveProxyPadMethod "setLinkFunctionFull" o = Gst.Pad.PadSetLinkFunctionFullMethodInfo
    ResolveProxyPadMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveProxyPadMethod "setOffset" o = Gst.Pad.PadSetOffsetMethodInfo
    ResolveProxyPadMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveProxyPadMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveProxyPadMethod "setQueryFunctionFull" o = Gst.Pad.PadSetQueryFunctionFullMethodInfo
    ResolveProxyPadMethod "setUnlinkFunctionFull" o = Gst.Pad.PadSetUnlinkFunctionFullMethodInfo
    ResolveProxyPadMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveProxyPadMethod t ProxyPad, O.MethodInfo info ProxyPad p) => OL.IsLabel t (ProxyPad -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList ProxyPad
type instance O.AttributeList ProxyPad = ProxyPadAttributeList
type ProxyPadAttributeList = ('[ '("caps", Gst.Pad.PadCapsPropertyInfo), '("direction", Gst.Pad.PadDirectionPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("offset", Gst.Pad.PadOffsetPropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("template", Gst.Pad.PadTemplatePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type instance O.SignalList ProxyPad = ProxyPadSignalList
type ProxyPadSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("linked", Gst.Pad.PadLinkedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("unlinked", Gst.Pad.PadUnlinkedSignalInfo)] :: [(Symbol, *)])

#endif

-- method ProxyPad::get_internal
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "ProxyPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstProxyPad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "ProxyPad"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_proxy_pad_get_internal" gst_proxy_pad_get_internal ::
    Ptr ProxyPad ->                         -- pad : TInterface (Name {namespace = "Gst", name = "ProxyPad"})
    IO (Ptr ProxyPad)

{- |
Get the internal pad of /@pad@/. Unref target pad after usage.

The internal pad of a 'GI.Gst.Objects.GhostPad.GhostPad' is the internally used
pad of opposite direction, which is used to link to the target.
-}
proxyPadGetInternal ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyPad a) =>
    a
    {- ^ /@pad@/: the 'GI.Gst.Objects.ProxyPad.ProxyPad' -}
    -> m (Maybe ProxyPad)
    {- ^ __Returns:__ the target 'GI.Gst.Objects.ProxyPad.ProxyPad', can
be 'Nothing'.  Unref target pad after usage. -}
proxyPadGetInternal pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_proxy_pad_get_internal pad'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject ProxyPad) result'
        return result''
    touchManagedPtr pad
    return maybeResult

#if ENABLE_OVERLOADING
data ProxyPadGetInternalMethodInfo
instance (signature ~ (m (Maybe ProxyPad)), MonadIO m, IsProxyPad a) => O.MethodInfo ProxyPadGetInternalMethodInfo a signature where
    overloadedMethod _ = proxyPadGetInternal

#endif

-- method ProxyPad::chain_default
-- method type : MemberFunction
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a sink #GstPad, returns GST_FLOW_ERROR if not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBuffer to send, return GST_FLOW_ERROR\n    if not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_proxy_pad_chain_default" gst_proxy_pad_chain_default ::
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    Ptr Gst.Object.Object ->                -- parent : TInterface (Name {namespace = "Gst", name = "Object"})
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    IO CInt

{- |
Invoke the default chain function of the proxy pad.
-}
proxyPadChainDefault ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    a
    {- ^ /@pad@/: a sink 'GI.Gst.Objects.Pad.Pad', returns GST_FLOW_ERROR if not. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/ or 'Nothing' -}
    -> Gst.Buffer.Buffer
    {- ^ /@buffer@/: the 'GI.Gst.Structs.Buffer.Buffer' to send, return GST_FLOW_ERROR
    if not. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.FlowReturn' from the pad. -}
proxyPadChainDefault pad parent buffer = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    buffer' <- B.ManagedPtr.disownBoxed buffer
    result <- gst_proxy_pad_chain_default pad' maybeParent buffer'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr buffer
    return result'

#if ENABLE_OVERLOADING
#endif

-- method ProxyPad::chain_list_default
-- method type : MemberFunction
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a sink #GstPad, returns GST_FLOW_ERROR if not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "list", argType = TInterface (Name {namespace = "Gst", name = "BufferList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBufferList to send, return GST_FLOW_ERROR\n    if not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_proxy_pad_chain_list_default" gst_proxy_pad_chain_list_default ::
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    Ptr Gst.Object.Object ->                -- parent : TInterface (Name {namespace = "Gst", name = "Object"})
    Ptr Gst.BufferList.BufferList ->        -- list : TInterface (Name {namespace = "Gst", name = "BufferList"})
    IO CInt

{- |
Invoke the default chain list function of the proxy pad.
-}
proxyPadChainListDefault ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    a
    {- ^ /@pad@/: a sink 'GI.Gst.Objects.Pad.Pad', returns GST_FLOW_ERROR if not. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/ or 'Nothing' -}
    -> Gst.BufferList.BufferList
    {- ^ /@list@/: the 'GI.Gst.Structs.BufferList.BufferList' to send, return GST_FLOW_ERROR
    if not. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.FlowReturn' from the pad. -}
proxyPadChainListDefault pad parent list = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    list' <- B.ManagedPtr.disownBoxed list
    result <- gst_proxy_pad_chain_list_default pad' maybeParent list'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr list
    return result'

#if ENABLE_OVERLOADING
#endif

-- method ProxyPad::getrange_default
-- method type : MemberFunction
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a src #GstPad, returns #GST_FLOW_ERROR if not.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the parent of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The start offset of the buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The length of the buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to hold the #GstBuffer,\n    returns #GST_FLOW_ERROR if %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_proxy_pad_getrange_default" gst_proxy_pad_getrange_default ::
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    Ptr Gst.Object.Object ->                -- parent : TInterface (Name {namespace = "Gst", name = "Object"})
    Word64 ->                               -- offset : TBasicType TUInt64
    Word32 ->                               -- size : TBasicType TUInt
    Ptr (Ptr Gst.Buffer.Buffer) ->          -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    IO CInt

{- |
Invoke the default getrange function of the proxy pad.
-}
proxyPadGetrangeDefault ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    a
    {- ^ /@pad@/: a src 'GI.Gst.Objects.Pad.Pad', returns @/GST_FLOW_ERROR/@ if not. -}
    -> b
    {- ^ /@parent@/: the parent of /@pad@/ -}
    -> Word64
    {- ^ /@offset@/: The start offset of the buffer -}
    -> Word32
    {- ^ /@size@/: The length of the buffer -}
    -> m ((Gst.Enums.FlowReturn, Gst.Buffer.Buffer))
    {- ^ __Returns:__ a 'GI.Gst.Enums.FlowReturn' from the pad. -}
proxyPadGetrangeDefault pad parent offset size = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    parent' <- unsafeManagedPtrCastPtr parent
    buffer <- allocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
    result <- gst_proxy_pad_getrange_default pad' parent' offset size buffer
    let result' = (toEnum . fromIntegral) result
    buffer' <- peek buffer
    buffer'' <- (wrapBoxed Gst.Buffer.Buffer) buffer'
    touchManagedPtr pad
    touchManagedPtr parent
    freeMem buffer
    return (result', buffer'')

#if ENABLE_OVERLOADING
#endif

-- method ProxyPad::iterate_internal_links_default
-- method type : MemberFunction
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to get the internal links of.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad or %NULL", 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_proxy_pad_iterate_internal_links_default" gst_proxy_pad_iterate_internal_links_default ::
    Ptr Gst.Pad.Pad ->                      -- pad : TInterface (Name {namespace = "Gst", name = "Pad"})
    Ptr Gst.Object.Object ->                -- parent : TInterface (Name {namespace = "Gst", name = "Object"})
    IO (Ptr Gst.Iterator.Iterator)

{- |
Invoke the default iterate internal links function of the proxy pad.
-}
proxyPadIterateInternalLinksDefault ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to get the internal links of. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/ or 'Nothing' -}
    -> m (Maybe Gst.Iterator.Iterator)
    {- ^ __Returns:__ a 'GI.Gst.Structs.Iterator.Iterator' of 'GI.Gst.Objects.Pad.Pad', or 'Nothing' if /@pad@/
has no parent. Unref each returned pad with 'GI.Gst.Objects.Object.objectUnref'. -}
proxyPadIterateInternalLinksDefault pad parent = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    result <- gst_proxy_pad_iterate_internal_links_default pad' maybeParent
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Gst.Iterator.Iterator) result'
        return result''
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    return maybeResult

#if ENABLE_OVERLOADING
#endif