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

This base class is for filter elements that process data. Elements
that are suitable for implementation using 'GI.GstBase.Objects.BaseTransform.BaseTransform' are ones
where the size and caps of the output is known entirely from the input
caps and buffer sizes. These include elements that directly transform
one buffer into another, modify the contents of a buffer in-place, as
well as elements that collate multiple input buffers into one output buffer,
or that expand one input buffer into multiple output buffers. See below
for more concrete use cases.

It provides for:

* one sinkpad and one srcpad
* Possible formats on sink and source pad implemented
  with custom transform_caps function. By default uses
  same format on sink and source.

* Handles state changes
* Does flushing
* Push mode
* Pull mode if the sub-class transform can operate on arbitrary data

= Use Cases

== Passthrough mode

  * Element has no interest in modifying the buffer. It may want to inspect it,
    in which case the element should have a transform_ip function. If there
    is no transform_ip function in passthrough mode, the buffer is pushed
    intact.

  * The 'GI.GstBase.Structs.BaseTransformClass.BaseTransformClass'.@/passthrough_on_same_caps/@ variable
    will automatically set\/unset passthrough based on whether the
    element negotiates the same caps on both pads.

  * 'GI.GstBase.Structs.BaseTransformClass.BaseTransformClass'.@/passthrough_on_same_caps/@ on an element that
    doesn\'t implement a transform_caps function is useful for elements that
    only inspect data (such as level)

  * Example elements

    * Level
    * Videoscale, audioconvert, videoconvert, audioresample in certain modes.

== Modifications in-place - input buffer and output buffer are the same thing.

* The element must implement a transform_ip function.
* Output buffer size must \<= input buffer size
* If the always_in_place flag is set, non-writable buffers will be copied
  and passed to the transform_ip function, otherwise a new buffer will be
  created and the transform function called.

* Incoming writable buffers will be passed to the transform_ip function
  immediately.
* only implementing transform_ip and not transform implies always_in_place = 'True'

  * Example elements:
    * Volume
    * Audioconvert in certain modes (signed\/unsigned conversion)
    * videoconvert in certain modes (endianness swapping)

== Modifications only to the caps\/metadata of a buffer

* The element does not require writable data, but non-writable buffers
  should be subbuffered so that the meta-information can be replaced.

* Elements wishing to operate in this mode should replace the
  prepare_output_buffer method to create subbuffers of the input buffer
  and set always_in_place to 'True'

* Example elements
  * Capsfilter when setting caps on outgoing buffers that have
    none.
  * identity when it is going to re-timestamp buffers by
    datarate.

== Normal mode
  * always_in_place flag is not set, or there is no transform_ip function
  * Element will receive an input buffer and output buffer to operate on.
  * Output buffer is allocated by calling the prepare_output_buffer function.
  * Example elements:
    * Videoscale, videoconvert, audioconvert when doing
    scaling\/conversions

== Special output buffer allocations
  * Elements which need to do special allocation of their output buffers
    beyond allocating output buffers via the negotiated allocator or
    buffer pool should implement the prepare_output_buffer method.

  * Example elements:
    * efence

= Sub-class settable flags on GstBaseTransform

* passthrough

  * Implies that in the current configuration, the sub-class is not interested in modifying the buffers.
  * Elements which are always in passthrough mode whenever the same caps has been negotiated on both pads can set the class variable passthrough_on_same_caps to have this behaviour automatically.

* always_in_place
  * Determines whether a non-writable buffer will be copied before passing
    to the transform_ip function.

  * Implied 'True' if no transform function is implemented.
  * Implied 'False' if ONLY transform function is implemented.
-}

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

module GI.GstBase.Objects.BaseTransform
    (

-- * Exported types
    BaseTransform(..)                       ,
    IsBaseTransform                         ,
    toBaseTransform                         ,
    noBaseTransform                         ,


 -- * Methods
-- ** getAllocator #method:getAllocator#

#if ENABLE_OVERLOADING
    BaseTransformGetAllocatorMethodInfo     ,
#endif
    baseTransformGetAllocator               ,


-- ** getBufferPool #method:getBufferPool#

#if ENABLE_OVERLOADING
    BaseTransformGetBufferPoolMethodInfo    ,
#endif
    baseTransformGetBufferPool              ,


-- ** isInPlace #method:isInPlace#

#if ENABLE_OVERLOADING
    BaseTransformIsInPlaceMethodInfo        ,
#endif
    baseTransformIsInPlace                  ,


-- ** isPassthrough #method:isPassthrough#

#if ENABLE_OVERLOADING
    BaseTransformIsPassthroughMethodInfo    ,
#endif
    baseTransformIsPassthrough              ,


-- ** isQosEnabled #method:isQosEnabled#

#if ENABLE_OVERLOADING
    BaseTransformIsQosEnabledMethodInfo     ,
#endif
    baseTransformIsQosEnabled               ,


-- ** reconfigureSink #method:reconfigureSink#

#if ENABLE_OVERLOADING
    BaseTransformReconfigureSinkMethodInfo  ,
#endif
    baseTransformReconfigureSink            ,


-- ** reconfigureSrc #method:reconfigureSrc#

#if ENABLE_OVERLOADING
    BaseTransformReconfigureSrcMethodInfo   ,
#endif
    baseTransformReconfigureSrc             ,


-- ** setGapAware #method:setGapAware#

#if ENABLE_OVERLOADING
    BaseTransformSetGapAwareMethodInfo      ,
#endif
    baseTransformSetGapAware                ,


-- ** setInPlace #method:setInPlace#

#if ENABLE_OVERLOADING
    BaseTransformSetInPlaceMethodInfo       ,
#endif
    baseTransformSetInPlace                 ,


-- ** setPassthrough #method:setPassthrough#

#if ENABLE_OVERLOADING
    BaseTransformSetPassthroughMethodInfo   ,
#endif
    baseTransformSetPassthrough             ,


-- ** setPreferPassthrough #method:setPreferPassthrough#

#if ENABLE_OVERLOADING
    BaseTransformSetPreferPassthroughMethodInfo,
#endif
    baseTransformSetPreferPassthrough       ,


-- ** setQosEnabled #method:setQosEnabled#

#if ENABLE_OVERLOADING
    BaseTransformSetQosEnabledMethodInfo    ,
#endif
    baseTransformSetQosEnabled              ,


-- ** updateQos #method:updateQos#

#if ENABLE_OVERLOADING
    BaseTransformUpdateQosMethodInfo        ,
#endif
    baseTransformUpdateQos                  ,


-- ** updateSrcCaps #method:updateSrcCaps#

#if ENABLE_OVERLOADING
    BaseTransformUpdateSrcCapsMethodInfo    ,
#endif
    baseTransformUpdateSrcCaps              ,




 -- * Properties
-- ** qos #attr:qos#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    BaseTransformQosPropertyInfo            ,
#endif
#if ENABLE_OVERLOADING
    baseTransformQos                        ,
#endif
    constructBaseTransformQos               ,
    getBaseTransformQos                     ,
    setBaseTransformQos                     ,




    ) 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 qualified GI.Gst.Objects.Allocator as Gst.Allocator
import qualified GI.Gst.Objects.BufferPool as Gst.BufferPool
import qualified GI.Gst.Objects.Element as Gst.Element
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Structs.AllocationParams as Gst.AllocationParams
import qualified GI.Gst.Structs.Caps as Gst.Caps

-- | Memory-managed wrapper type.
newtype BaseTransform = BaseTransform (ManagedPtr BaseTransform)
foreign import ccall "gst_base_transform_get_type"
    c_gst_base_transform_get_type :: IO GType

instance GObject BaseTransform where
    gobjectType = c_gst_base_transform_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `BaseTransform`.
noBaseTransform :: Maybe BaseTransform
noBaseTransform = Nothing

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

instance (info ~ ResolveBaseTransformMethod t BaseTransform, O.MethodInfo info BaseTransform p) => OL.IsLabel t (BaseTransform -> 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

-- VVV Prop "qos"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@qos@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' baseTransform #qos
@
-}
getBaseTransformQos :: (MonadIO m, IsBaseTransform o) => o -> m Bool
getBaseTransformQos obj = liftIO $ B.Properties.getObjectPropertyBool obj "qos"

{- |
Set the value of the “@qos@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' baseTransform [ #qos 'Data.GI.Base.Attributes.:=' value ]
@
-}
setBaseTransformQos :: (MonadIO m, IsBaseTransform o) => o -> Bool -> m ()
setBaseTransformQos obj val = liftIO $ B.Properties.setObjectPropertyBool obj "qos" val

{- |
Construct a `GValueConstruct` with valid value for the “@qos@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructBaseTransformQos :: (IsBaseTransform o) => Bool -> IO (GValueConstruct o)
constructBaseTransformQos val = B.Properties.constructObjectPropertyBool "qos" val

#if ENABLE_OVERLOADING
data BaseTransformQosPropertyInfo
instance AttrInfo BaseTransformQosPropertyInfo where
    type AttrAllowedOps BaseTransformQosPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseTransformQosPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint BaseTransformQosPropertyInfo = IsBaseTransform
    type AttrGetType BaseTransformQosPropertyInfo = Bool
    type AttrLabel BaseTransformQosPropertyInfo = "qos"
    type AttrOrigin BaseTransformQosPropertyInfo = BaseTransform
    attrGet _ = getBaseTransformQos
    attrSet _ = setBaseTransformQos
    attrConstruct _ = constructBaseTransformQos
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList BaseTransform
type instance O.AttributeList BaseTransform = BaseTransformAttributeList
type BaseTransformAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("qos", BaseTransformQosPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
baseTransformQos :: AttrLabelProxy "qos"
baseTransformQos = AttrLabelProxy

#endif

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

#endif

-- method BaseTransform::get_allocator
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "allocator", argType = TInterface (Name {namespace = "Gst", name = "Allocator"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstAllocator\nused", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "params", argType = TInterface (Name {namespace = "Gst", name = "AllocationParams"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the\n#GstAllocationParams of @allocator", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_get_allocator" gst_base_transform_get_allocator ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    Ptr (Ptr Gst.Allocator.Allocator) ->    -- allocator : TInterface (Name {namespace = "Gst", name = "Allocator"})
    Ptr Gst.AllocationParams.AllocationParams -> -- params : TInterface (Name {namespace = "Gst", name = "AllocationParams"})
    IO ()

{- |
Lets 'GI.GstBase.Objects.BaseTransform.BaseTransform' sub-classes to know the memory /@allocator@/
used by the base class and its /@params@/.

Unref the /@allocator@/ after use it.
-}
baseTransformGetAllocator ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> m ((Gst.Allocator.Allocator, Gst.AllocationParams.AllocationParams))
baseTransformGetAllocator trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    allocator <- allocMem :: IO (Ptr (Ptr Gst.Allocator.Allocator))
    params <- callocBoxedBytes 64 :: IO (Ptr Gst.AllocationParams.AllocationParams)
    gst_base_transform_get_allocator trans' allocator params
    allocator' <- peek allocator
    allocator'' <- (wrapObject Gst.Allocator.Allocator) allocator'
    params' <- (wrapBoxed Gst.AllocationParams.AllocationParams) params
    touchManagedPtr trans
    freeMem allocator
    return (allocator'', params')

#if ENABLE_OVERLOADING
data BaseTransformGetAllocatorMethodInfo
instance (signature ~ (m ((Gst.Allocator.Allocator, Gst.AllocationParams.AllocationParams))), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformGetAllocatorMethodInfo a signature where
    overloadedMethod _ = baseTransformGetAllocator

#endif

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

foreign import ccall "gst_base_transform_get_buffer_pool" gst_base_transform_get_buffer_pool ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO (Ptr Gst.BufferPool.BufferPool)

{- |
/No description available in the introspection data./
-}
baseTransformGetBufferPool ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> m Gst.BufferPool.BufferPool
    {- ^ __Returns:__ the instance of the 'GI.Gst.Objects.BufferPool.BufferPool' used
by /@trans@/; free it after use it -}
baseTransformGetBufferPool trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    result <- gst_base_transform_get_buffer_pool trans'
    checkUnexpectedReturnNULL "baseTransformGetBufferPool" result
    result' <- (wrapObject Gst.BufferPool.BufferPool) result
    touchManagedPtr trans
    return result'

#if ENABLE_OVERLOADING
data BaseTransformGetBufferPoolMethodInfo
instance (signature ~ (m Gst.BufferPool.BufferPool), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformGetBufferPoolMethodInfo a signature where
    overloadedMethod _ = baseTransformGetBufferPool

#endif

-- method BaseTransform::is_in_place
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBaseTransform to query", 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_base_transform_is_in_place" gst_base_transform_is_in_place ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO CInt

{- |
See if /@trans@/ is configured as a in_place transform.
-}
baseTransformIsInPlace ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: the 'GI.GstBase.Objects.BaseTransform.BaseTransform' to query -}
    -> m Bool
    {- ^ __Returns:__ 'True' is the transform is configured in in_place mode.

MT safe. -}
baseTransformIsInPlace trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    result <- gst_base_transform_is_in_place trans'
    let result' = (/= 0) result
    touchManagedPtr trans
    return result'

#if ENABLE_OVERLOADING
data BaseTransformIsInPlaceMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformIsInPlaceMethodInfo a signature where
    overloadedMethod _ = baseTransformIsInPlace

#endif

-- method BaseTransform::is_passthrough
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBaseTransform to query", 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_base_transform_is_passthrough" gst_base_transform_is_passthrough ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO CInt

{- |
See if /@trans@/ is configured as a passthrough transform.
-}
baseTransformIsPassthrough ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: the 'GI.GstBase.Objects.BaseTransform.BaseTransform' to query -}
    -> m Bool
    {- ^ __Returns:__ 'True' is the transform is configured in passthrough mode.

MT safe. -}
baseTransformIsPassthrough trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    result <- gst_base_transform_is_passthrough trans'
    let result' = (/= 0) result
    touchManagedPtr trans
    return result'

#if ENABLE_OVERLOADING
data BaseTransformIsPassthroughMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformIsPassthroughMethodInfo a signature where
    overloadedMethod _ = baseTransformIsPassthrough

#endif

-- method BaseTransform::is_qos_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", 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_base_transform_is_qos_enabled" gst_base_transform_is_qos_enabled ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO CInt

{- |
Queries if the transform will handle QoS.
-}
baseTransformIsQosEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if QoS is enabled.

MT safe. -}
baseTransformIsQosEnabled trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    result <- gst_base_transform_is_qos_enabled trans'
    let result' = (/= 0) result
    touchManagedPtr trans
    return result'

#if ENABLE_OVERLOADING
data BaseTransformIsQosEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformIsQosEnabledMethodInfo a signature where
    overloadedMethod _ = baseTransformIsQosEnabled

#endif

-- method BaseTransform::reconfigure_sink
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_reconfigure_sink" gst_base_transform_reconfigure_sink ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO ()

{- |
Instructs /@trans@/ to request renegotiation upstream. This function is
typically called after properties on the transform were set that
influence the input format.
-}
baseTransformReconfigureSink ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> m ()
baseTransformReconfigureSink trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    gst_base_transform_reconfigure_sink trans'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformReconfigureSinkMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformReconfigureSinkMethodInfo a signature where
    overloadedMethod _ = baseTransformReconfigureSink

#endif

-- method BaseTransform::reconfigure_src
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_reconfigure_src" gst_base_transform_reconfigure_src ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    IO ()

{- |
Instructs /@trans@/ to renegotiate a new downstream transform on the next
buffer. This function is typically called after properties on the transform
were set that influence the output format.
-}
baseTransformReconfigureSrc ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> m ()
baseTransformReconfigureSrc trans = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    gst_base_transform_reconfigure_src trans'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformReconfigureSrcMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformReconfigureSrcMethodInfo a signature where
    overloadedMethod _ = baseTransformReconfigureSrc

#endif

-- method BaseTransform::set_gap_aware
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "gap_aware", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "New state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_set_gap_aware" gst_base_transform_set_gap_aware ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CInt ->                                 -- gap_aware : TBasicType TBoolean
    IO ()

{- |
If /@gapAware@/ is 'False' (the default), output buffers will have the
'GI.Gst.Flags.BufferFlagsGap' flag unset.

If set to 'True', the element must handle output buffers with this flag set
correctly, i.e. it can assume that the buffer contains neutral data but must
unset the flag if the output is no neutral data.

MT safe.
-}
baseTransformSetGapAware ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> Bool
    {- ^ /@gapAware@/: New state -}
    -> m ()
baseTransformSetGapAware trans gapAware = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let gapAware' = (fromIntegral . fromEnum) gapAware
    gst_base_transform_set_gap_aware trans' gapAware'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformSetGapAwareMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformSetGapAwareMethodInfo a signature where
    overloadedMethod _ = baseTransformSetGapAware

#endif

-- method BaseTransform::set_in_place
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBaseTransform to modify", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "in_place", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Boolean value indicating that we would like to operate\non in_place buffers.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_set_in_place" gst_base_transform_set_in_place ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CInt ->                                 -- in_place : TBasicType TBoolean
    IO ()

{- |
Determines whether a non-writable buffer will be copied before passing
to the transform_ip function.

  * Always 'True' if no transform function is implemented.
  * Always 'False' if ONLY transform function is implemented.

MT safe.
-}
baseTransformSetInPlace ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: the 'GI.GstBase.Objects.BaseTransform.BaseTransform' to modify -}
    -> Bool
    {- ^ /@inPlace@/: Boolean value indicating that we would like to operate
on in_place buffers. -}
    -> m ()
baseTransformSetInPlace trans inPlace = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let inPlace' = (fromIntegral . fromEnum) inPlace
    gst_base_transform_set_in_place trans' inPlace'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformSetInPlaceMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformSetInPlaceMethodInfo a signature where
    overloadedMethod _ = baseTransformSetInPlace

#endif

-- method BaseTransform::set_passthrough
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBaseTransform to set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "passthrough", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "boolean indicating passthrough mode.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_set_passthrough" gst_base_transform_set_passthrough ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CInt ->                                 -- passthrough : TBasicType TBoolean
    IO ()

{- |
Set passthrough mode for this filter by default. This is mostly
useful for filters that do not care about negotiation.

Always 'True' for filters which don\'t implement either a transform
or transform_ip method.

MT safe.
-}
baseTransformSetPassthrough ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: the 'GI.GstBase.Objects.BaseTransform.BaseTransform' to set -}
    -> Bool
    {- ^ /@passthrough@/: boolean indicating passthrough mode. -}
    -> m ()
baseTransformSetPassthrough trans passthrough = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let passthrough' = (fromIntegral . fromEnum) passthrough
    gst_base_transform_set_passthrough trans' passthrough'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformSetPassthroughMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformSetPassthroughMethodInfo a signature where
    overloadedMethod _ = baseTransformSetPassthrough

#endif

-- method BaseTransform::set_prefer_passthrough
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "prefer_passthrough", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "New state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_set_prefer_passthrough" gst_base_transform_set_prefer_passthrough ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CInt ->                                 -- prefer_passthrough : TBasicType TBoolean
    IO ()

{- |
If /@preferPassthrough@/ is 'True' (the default), /@trans@/ will check and
prefer passthrough caps from the list of caps returned by the
transform_caps vmethod.

If set to 'False', the element must order the caps returned from the
transform_caps function in such a way that the preferred format is
first in the list. This can be interesting for transforms that can do
passthrough transforms but prefer to do something else, like a
capsfilter.

MT safe.

/Since: 1.0.1/
-}
baseTransformSetPreferPassthrough ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> Bool
    {- ^ /@preferPassthrough@/: New state -}
    -> m ()
baseTransformSetPreferPassthrough trans preferPassthrough = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let preferPassthrough' = (fromIntegral . fromEnum) preferPassthrough
    gst_base_transform_set_prefer_passthrough trans' preferPassthrough'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformSetPreferPassthroughMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformSetPreferPassthroughMethodInfo a signature where
    overloadedMethod _ = baseTransformSetPreferPassthrough

#endif

-- method BaseTransform::set_qos_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "enabled", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "new state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_set_qos_enabled" gst_base_transform_set_qos_enabled ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Enable or disable QoS handling in the transform.

MT safe.
-}
baseTransformSetQosEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> Bool
    {- ^ /@enabled@/: new state -}
    -> m ()
baseTransformSetQosEnabled trans enabled = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_base_transform_set_qos_enabled trans' enabled'
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformSetQosEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformSetQosEnabledMethodInfo a signature where
    overloadedMethod _ = baseTransformSetQosEnabled

#endif

-- method BaseTransform::update_qos
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "proportion", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the proportion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "diff", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the diff against the clock", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timestamp", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the timestamp of the buffer generating the QoS expressed in\nrunning_time.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_transform_update_qos" gst_base_transform_update_qos ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    CDouble ->                              -- proportion : TBasicType TDouble
    Int64 ->                                -- diff : TBasicType TInt64
    Word64 ->                               -- timestamp : TBasicType TUInt64
    IO ()

{- |
Set the QoS parameters in the transform. This function is called internally
when a QOS event is received but subclasses can provide custom information
when needed.

MT safe.
-}
baseTransformUpdateQos ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> Double
    {- ^ /@proportion@/: the proportion -}
    -> Int64
    {- ^ /@diff@/: the diff against the clock -}
    -> Word64
    {- ^ /@timestamp@/: the timestamp of the buffer generating the QoS expressed in
running_time. -}
    -> m ()
baseTransformUpdateQos trans proportion diff timestamp = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    let proportion' = realToFrac proportion
    gst_base_transform_update_qos trans' proportion' diff timestamp
    touchManagedPtr trans
    return ()

#if ENABLE_OVERLOADING
data BaseTransformUpdateQosMethodInfo
instance (signature ~ (Double -> Int64 -> Word64 -> m ()), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformUpdateQosMethodInfo a signature where
    overloadedMethod _ = baseTransformUpdateQos

#endif

-- method BaseTransform::update_src_caps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "trans", argType = TInterface (Name {namespace = "GstBase", name = "BaseTransform"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseTransform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "updated_caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An updated version of the srcpad caps to be pushed\ndownstream", 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_base_transform_update_src_caps" gst_base_transform_update_src_caps ::
    Ptr BaseTransform ->                    -- trans : TInterface (Name {namespace = "GstBase", name = "BaseTransform"})
    Ptr Gst.Caps.Caps ->                    -- updated_caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO CInt

{- |
Updates the srcpad caps and send the caps downstream. This function
can be used by subclasses when they have already negotiated their caps
but found a change in them (or computed new information). This way,
they can notify downstream about that change without losing any
buffer.

/Since: 1.6/
-}
baseTransformUpdateSrcCaps ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseTransform a) =>
    a
    {- ^ /@trans@/: a 'GI.GstBase.Objects.BaseTransform.BaseTransform' -}
    -> Gst.Caps.Caps
    {- ^ /@updatedCaps@/: An updated version of the srcpad caps to be pushed
downstream -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the caps could be send downstream 'False' otherwise -}
baseTransformUpdateSrcCaps trans updatedCaps = liftIO $ do
    trans' <- unsafeManagedPtrCastPtr trans
    updatedCaps' <- unsafeManagedPtrGetPtr updatedCaps
    result <- gst_base_transform_update_src_caps trans' updatedCaps'
    let result' = (/= 0) result
    touchManagedPtr trans
    touchManagedPtr updatedCaps
    return result'

#if ENABLE_OVERLOADING
data BaseTransformUpdateSrcCapsMethodInfo
instance (signature ~ (Gst.Caps.Caps -> m Bool), MonadIO m, IsBaseTransform a) => O.MethodInfo BaseTransformUpdateSrcCapsMethodInfo a signature where
    overloadedMethod _ = baseTransformUpdateSrcCaps

#endif