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

This base class is for audio decoders turning encoded data into
raw audio samples.

GstAudioDecoder and subclass should cooperate as follows.
\<orderedlist>
\<listitem>
  \<itemizedlist>\<title>Configuration\<\/title>
  \<listitem>\<para>
    Initially, GstAudioDecoder calls /@start@/ when the decoder element
    is activated, which allows subclass to perform any global setup.
    Base class (context) parameters can already be set according to subclass
    capabilities (or possibly upon receive more information in subsequent
    /@setFormat@/).
  \<\/para>\<\/listitem>
  \<listitem>\<para>
    GstAudioDecoder calls /@setFormat@/ to inform subclass of the format
    of input audio data that it is about to receive.
    While unlikely, it might be called more than once, if changing input
    parameters require reconfiguration.
  \<\/para>\<\/listitem>
  \<listitem>\<para>
    GstAudioDecoder calls /@stop@/ at end of all processing.
  \<\/para>\<\/listitem>
  \<\/itemizedlist>
\<\/listitem>
As of configuration stage, and throughout processing, GstAudioDecoder
provides various (context) parameters, e.g. describing the format of
output audio data (valid when output caps have been set) or current parsing state.
Conversely, subclass can and should configure context to inform
base class of its expectation w.r.t. buffer handling.
\<listitem>
  \<itemizedlist>
  \<title>Data processing\<\/title>
    \<listitem>\<para>
      Base class gathers input data, and optionally allows subclass
      to parse this into subsequently manageable (as defined by subclass)
      chunks.  Such chunks are subsequently referred to as \'frames\',
      though they may or may not correspond to 1 (or more) audio format frame.
    \<\/para>\<\/listitem>
    \<listitem>\<para>
      Input frame is provided to subclass\' /@handleFrame@/.
    \<\/para>\<\/listitem>
    \<listitem>\<para>
      If codec processing results in decoded data, subclass should call
      /@gstAudioDecoderFinishFrame@/ to have decoded data pushed
      downstream.
    \<\/para>\<\/listitem>
    \<listitem>\<para>
      Just prior to actually pushing a buffer downstream,
      it is passed to /@prePush@/.  Subclass should either use this callback
      to arrange for additional downstream pushing or otherwise ensure such
      custom pushing occurs after at least a method call has finished since
      setting src pad caps.
    \<\/para>\<\/listitem>
    \<listitem>\<para>
      During the parsing process GstAudioDecoderClass will handle both
      srcpad and sinkpad events. Sink events will be passed to subclass
      if /@event@/ callback has been provided.
    \<\/para>\<\/listitem>
  \<\/itemizedlist>
\<\/listitem>
\<listitem>
  \<itemizedlist>\<title>Shutdown phase\<\/title>
  \<listitem>\<para>
    GstAudioDecoder class calls /@stop@/ to inform the subclass that data
    parsing will be stopped.
  \<\/para>\<\/listitem>
  \<\/itemizedlist>
\<\/listitem>
\<\/orderedlist>

Subclass is responsible for providing pad template caps for
source and sink pads. The pads need to be named \"sink\" and \"src\". It also
needs to set the fixed caps on srcpad, when the format is ensured.  This
is typically when base class calls subclass\' /@setFormat@/ function, though
it might be delayed until calling /@gstAudioDecoderFinishFrame@/.

In summary, above process should have subclass concentrating on
codec data processing while leaving other matters to base class,
such as most notably timestamp handling.  While it may exert more control
in this area (see e.g. /@prePush@/), it is very much not recommended.

In particular, base class will try to arrange for perfect output timestamps
as much as possible while tracking upstream timestamps.
To this end, if deviation between the next ideal expected perfect timestamp
and upstream exceeds 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder':@/tolerance/@, then resync to upstream
occurs (which would happen always if the tolerance mechanism is disabled).

In non-live pipelines, baseclass can also (configurably) arrange for
output buffer aggregation which may help to redue large(r) numbers of
small(er) buffers being pushed and processed downstream.

On the other hand, it should be noted that baseclass only provides limited
seeking support (upon explicit subclass request), as full-fledged support
should rather be left to upstream demuxer, parser or alike.  This simple
approach caters for seeking and duration reporting using estimated input
bitrates.

Things that subclass need to take care of:
\<itemizedlist>
  \<listitem>\<para>Provide pad templates\<\/para>\<\/listitem>
  \<listitem>\<para>
     Set source pad caps when appropriate
  \<\/para>\<\/listitem>
  \<listitem>\<para>
     Set user-configurable properties to sane defaults for format and
     implementing codec at hand, and convey some subclass capabilities and
     expectations in context.
  \<\/para>\<\/listitem>
  \<listitem>\<para>
     Accept data in /@handleFrame@/ and provide encoded results to
     /@gstAudioDecoderFinishFrame@/.  If it is prepared to perform
     PLC, it should also accept NULL data in /@handleFrame@/ and provide for
     data for indicated duration.
  \<\/para>\<\/listitem>
\<\/itemizedlist>
-}

module GI.GstAudio.Objects.AudioDecoder
    ( 

-- * Exported types
    AudioDecoder(..)                        ,
    IsAudioDecoder                          ,
    toAudioDecoder                          ,
    noAudioDecoder                          ,


 -- * Methods
-- ** allocateOutputBuffer #method:allocateOutputBuffer#
    AudioDecoderAllocateOutputBufferMethodInfo,
    audioDecoderAllocateOutputBuffer        ,


-- ** finishFrame #method:finishFrame#
    AudioDecoderFinishFrameMethodInfo       ,
    audioDecoderFinishFrame                 ,


-- ** getAllocator #method:getAllocator#
    AudioDecoderGetAllocatorMethodInfo      ,
    audioDecoderGetAllocator                ,


-- ** getAudioInfo #method:getAudioInfo#
    AudioDecoderGetAudioInfoMethodInfo      ,
    audioDecoderGetAudioInfo                ,


-- ** getDelay #method:getDelay#
    AudioDecoderGetDelayMethodInfo          ,
    audioDecoderGetDelay                    ,


-- ** getDrainable #method:getDrainable#
    AudioDecoderGetDrainableMethodInfo      ,
    audioDecoderGetDrainable                ,


-- ** getEstimateRate #method:getEstimateRate#
    AudioDecoderGetEstimateRateMethodInfo   ,
    audioDecoderGetEstimateRate             ,


-- ** getLatency #method:getLatency#
    AudioDecoderGetLatencyMethodInfo        ,
    audioDecoderGetLatency                  ,


-- ** getMaxErrors #method:getMaxErrors#
    AudioDecoderGetMaxErrorsMethodInfo      ,
    audioDecoderGetMaxErrors                ,


-- ** getMinLatency #method:getMinLatency#
    AudioDecoderGetMinLatencyMethodInfo     ,
    audioDecoderGetMinLatency               ,


-- ** getNeedsFormat #method:getNeedsFormat#
    AudioDecoderGetNeedsFormatMethodInfo    ,
    audioDecoderGetNeedsFormat              ,


-- ** getParseState #method:getParseState#
    AudioDecoderGetParseStateMethodInfo     ,
    audioDecoderGetParseState               ,


-- ** getPlc #method:getPlc#
    AudioDecoderGetPlcMethodInfo            ,
    audioDecoderGetPlc                      ,


-- ** getPlcAware #method:getPlcAware#
    AudioDecoderGetPlcAwareMethodInfo       ,
    audioDecoderGetPlcAware                 ,


-- ** getTolerance #method:getTolerance#
    AudioDecoderGetToleranceMethodInfo      ,
    audioDecoderGetTolerance                ,


-- ** mergeTags #method:mergeTags#
    AudioDecoderMergeTagsMethodInfo         ,
    audioDecoderMergeTags                   ,


-- ** negotiate #method:negotiate#
    AudioDecoderNegotiateMethodInfo         ,
    audioDecoderNegotiate                   ,


-- ** proxyGetcaps #method:proxyGetcaps#
    AudioDecoderProxyGetcapsMethodInfo      ,
    audioDecoderProxyGetcaps                ,


-- ** setAllocationCaps #method:setAllocationCaps#
    AudioDecoderSetAllocationCapsMethodInfo ,
    audioDecoderSetAllocationCaps           ,


-- ** setDrainable #method:setDrainable#
    AudioDecoderSetDrainableMethodInfo      ,
    audioDecoderSetDrainable                ,


-- ** setEstimateRate #method:setEstimateRate#
    AudioDecoderSetEstimateRateMethodInfo   ,
    audioDecoderSetEstimateRate             ,


-- ** setLatency #method:setLatency#
    AudioDecoderSetLatencyMethodInfo        ,
    audioDecoderSetLatency                  ,


-- ** setMaxErrors #method:setMaxErrors#
    AudioDecoderSetMaxErrorsMethodInfo      ,
    audioDecoderSetMaxErrors                ,


-- ** setMinLatency #method:setMinLatency#
    AudioDecoderSetMinLatencyMethodInfo     ,
    audioDecoderSetMinLatency               ,


-- ** setNeedsFormat #method:setNeedsFormat#
    AudioDecoderSetNeedsFormatMethodInfo    ,
    audioDecoderSetNeedsFormat              ,


-- ** setOutputFormat #method:setOutputFormat#
    AudioDecoderSetOutputFormatMethodInfo   ,
    audioDecoderSetOutputFormat             ,


-- ** setPlc #method:setPlc#
    AudioDecoderSetPlcMethodInfo            ,
    audioDecoderSetPlc                      ,


-- ** setPlcAware #method:setPlcAware#
    AudioDecoderSetPlcAwareMethodInfo       ,
    audioDecoderSetPlcAware                 ,


-- ** setTolerance #method:setTolerance#
    AudioDecoderSetToleranceMethodInfo      ,
    audioDecoderSetTolerance                ,


-- ** setUseDefaultPadAcceptcaps #method:setUseDefaultPadAcceptcaps#
    AudioDecoderSetUseDefaultPadAcceptcapsMethodInfo,
    audioDecoderSetUseDefaultPadAcceptcaps  ,




 -- * Properties
-- ** minLatency #attr:minLatency#
    AudioDecoderMinLatencyPropertyInfo      ,
    audioDecoderMinLatency                  ,
    constructAudioDecoderMinLatency         ,
    getAudioDecoderMinLatency               ,
    setAudioDecoderMinLatency               ,


-- ** plc #attr:plc#
    AudioDecoderPlcPropertyInfo             ,
    audioDecoderPlc                         ,
    constructAudioDecoderPlc                ,
    getAudioDecoderPlc                      ,
    setAudioDecoderPlc                      ,


-- ** tolerance #attr:tolerance#
    AudioDecoderTolerancePropertyInfo       ,
    audioDecoderTolerance                   ,
    constructAudioDecoderTolerance          ,
    getAudioDecoderTolerance                ,
    setAudioDecoderTolerance                ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Enums as Gst.Enums
import qualified GI.Gst.Objects.Allocator as Gst.Allocator
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.Buffer as Gst.Buffer
import qualified GI.Gst.Structs.Caps as Gst.Caps
import qualified GI.Gst.Structs.TagList as Gst.TagList
import {-# SOURCE #-} qualified GI.GstAudio.Structs.AudioInfo as GstAudio.AudioInfo

newtype AudioDecoder = AudioDecoder (ManagedPtr AudioDecoder)
foreign import ccall "gst_audio_decoder_get_type"
    c_gst_audio_decoder_get_type :: IO GType

instance GObject AudioDecoder where
    gobjectType _ = c_gst_audio_decoder_get_type
    

class GObject o => IsAudioDecoder o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AudioDecoder a) =>
    IsAudioDecoder a
#endif
instance IsAudioDecoder AudioDecoder
instance Gst.Element.IsElement AudioDecoder
instance Gst.Object.IsObject AudioDecoder
instance GObject.Object.IsObject AudioDecoder

toAudioDecoder :: IsAudioDecoder o => o -> IO AudioDecoder
toAudioDecoder = unsafeCastTo AudioDecoder

noAudioDecoder :: Maybe AudioDecoder
noAudioDecoder = Nothing

type family ResolveAudioDecoderMethod (t :: Symbol) (o :: *) :: * where
    ResolveAudioDecoderMethod "abortState" o = Gst.Element.ElementAbortStateMethodInfo
    ResolveAudioDecoderMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveAudioDecoderMethod "addPad" o = Gst.Element.ElementAddPadMethodInfo
    ResolveAudioDecoderMethod "addPropertyDeepNotifyWatch" o = Gst.Element.ElementAddPropertyDeepNotifyWatchMethodInfo
    ResolveAudioDecoderMethod "addPropertyNotifyWatch" o = Gst.Element.ElementAddPropertyNotifyWatchMethodInfo
    ResolveAudioDecoderMethod "allocateOutputBuffer" o = AudioDecoderAllocateOutputBufferMethodInfo
    ResolveAudioDecoderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAudioDecoderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAudioDecoderMethod "callAsync" o = Gst.Element.ElementCallAsyncMethodInfo
    ResolveAudioDecoderMethod "changeState" o = Gst.Element.ElementChangeStateMethodInfo
    ResolveAudioDecoderMethod "continueState" o = Gst.Element.ElementContinueStateMethodInfo
    ResolveAudioDecoderMethod "createAllPads" o = Gst.Element.ElementCreateAllPadsMethodInfo
    ResolveAudioDecoderMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveAudioDecoderMethod "finishFrame" o = AudioDecoderFinishFrameMethodInfo
    ResolveAudioDecoderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAudioDecoderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAudioDecoderMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveAudioDecoderMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveAudioDecoderMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveAudioDecoderMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveAudioDecoderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAudioDecoderMethod "isLockedState" o = Gst.Element.ElementIsLockedStateMethodInfo
    ResolveAudioDecoderMethod "iteratePads" o = Gst.Element.ElementIteratePadsMethodInfo
    ResolveAudioDecoderMethod "iterateSinkPads" o = Gst.Element.ElementIterateSinkPadsMethodInfo
    ResolveAudioDecoderMethod "iterateSrcPads" o = Gst.Element.ElementIterateSrcPadsMethodInfo
    ResolveAudioDecoderMethod "link" o = Gst.Element.ElementLinkMethodInfo
    ResolveAudioDecoderMethod "linkFiltered" o = Gst.Element.ElementLinkFilteredMethodInfo
    ResolveAudioDecoderMethod "linkPads" o = Gst.Element.ElementLinkPadsMethodInfo
    ResolveAudioDecoderMethod "linkPadsFiltered" o = Gst.Element.ElementLinkPadsFilteredMethodInfo
    ResolveAudioDecoderMethod "linkPadsFull" o = Gst.Element.ElementLinkPadsFullMethodInfo
    ResolveAudioDecoderMethod "lostState" o = Gst.Element.ElementLostStateMethodInfo
    ResolveAudioDecoderMethod "mergeTags" o = AudioDecoderMergeTagsMethodInfo
    ResolveAudioDecoderMethod "messageFull" o = Gst.Element.ElementMessageFullMethodInfo
    ResolveAudioDecoderMethod "messageFullWithDetails" o = Gst.Element.ElementMessageFullWithDetailsMethodInfo
    ResolveAudioDecoderMethod "negotiate" o = AudioDecoderNegotiateMethodInfo
    ResolveAudioDecoderMethod "noMorePads" o = Gst.Element.ElementNoMorePadsMethodInfo
    ResolveAudioDecoderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAudioDecoderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAudioDecoderMethod "postMessage" o = Gst.Element.ElementPostMessageMethodInfo
    ResolveAudioDecoderMethod "provideClock" o = Gst.Element.ElementProvideClockMethodInfo
    ResolveAudioDecoderMethod "proxyGetcaps" o = AudioDecoderProxyGetcapsMethodInfo
    ResolveAudioDecoderMethod "query" o = Gst.Element.ElementQueryMethodInfo
    ResolveAudioDecoderMethod "queryConvert" o = Gst.Element.ElementQueryConvertMethodInfo
    ResolveAudioDecoderMethod "queryDuration" o = Gst.Element.ElementQueryDurationMethodInfo
    ResolveAudioDecoderMethod "queryPosition" o = Gst.Element.ElementQueryPositionMethodInfo
    ResolveAudioDecoderMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveAudioDecoderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAudioDecoderMethod "releaseRequestPad" o = Gst.Element.ElementReleaseRequestPadMethodInfo
    ResolveAudioDecoderMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveAudioDecoderMethod "removePad" o = Gst.Element.ElementRemovePadMethodInfo
    ResolveAudioDecoderMethod "removePropertyNotifyWatch" o = Gst.Element.ElementRemovePropertyNotifyWatchMethodInfo
    ResolveAudioDecoderMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveAudioDecoderMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveAudioDecoderMethod "requestPad" o = Gst.Element.ElementRequestPadMethodInfo
    ResolveAudioDecoderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAudioDecoderMethod "seek" o = Gst.Element.ElementSeekMethodInfo
    ResolveAudioDecoderMethod "seekSimple" o = Gst.Element.ElementSeekSimpleMethodInfo
    ResolveAudioDecoderMethod "sendEvent" o = Gst.Element.ElementSendEventMethodInfo
    ResolveAudioDecoderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAudioDecoderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAudioDecoderMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveAudioDecoderMethod "syncStateWithParent" o = Gst.Element.ElementSyncStateWithParentMethodInfo
    ResolveAudioDecoderMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveAudioDecoderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAudioDecoderMethod "unlink" o = Gst.Element.ElementUnlinkMethodInfo
    ResolveAudioDecoderMethod "unlinkPads" o = Gst.Element.ElementUnlinkPadsMethodInfo
    ResolveAudioDecoderMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveAudioDecoderMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveAudioDecoderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAudioDecoderMethod "getAllocator" o = AudioDecoderGetAllocatorMethodInfo
    ResolveAudioDecoderMethod "getAudioInfo" o = AudioDecoderGetAudioInfoMethodInfo
    ResolveAudioDecoderMethod "getBaseTime" o = Gst.Element.ElementGetBaseTimeMethodInfo
    ResolveAudioDecoderMethod "getBus" o = Gst.Element.ElementGetBusMethodInfo
    ResolveAudioDecoderMethod "getClock" o = Gst.Element.ElementGetClockMethodInfo
    ResolveAudioDecoderMethod "getCompatiblePad" o = Gst.Element.ElementGetCompatiblePadMethodInfo
    ResolveAudioDecoderMethod "getCompatiblePadTemplate" o = Gst.Element.ElementGetCompatiblePadTemplateMethodInfo
    ResolveAudioDecoderMethod "getContext" o = Gst.Element.ElementGetContextMethodInfo
    ResolveAudioDecoderMethod "getContextUnlocked" o = Gst.Element.ElementGetContextUnlockedMethodInfo
    ResolveAudioDecoderMethod "getContexts" o = Gst.Element.ElementGetContextsMethodInfo
    ResolveAudioDecoderMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveAudioDecoderMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveAudioDecoderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAudioDecoderMethod "getDelay" o = AudioDecoderGetDelayMethodInfo
    ResolveAudioDecoderMethod "getDrainable" o = AudioDecoderGetDrainableMethodInfo
    ResolveAudioDecoderMethod "getEstimateRate" o = AudioDecoderGetEstimateRateMethodInfo
    ResolveAudioDecoderMethod "getFactory" o = Gst.Element.ElementGetFactoryMethodInfo
    ResolveAudioDecoderMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveAudioDecoderMethod "getLatency" o = AudioDecoderGetLatencyMethodInfo
    ResolveAudioDecoderMethod "getMaxErrors" o = AudioDecoderGetMaxErrorsMethodInfo
    ResolveAudioDecoderMethod "getMinLatency" o = AudioDecoderGetMinLatencyMethodInfo
    ResolveAudioDecoderMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveAudioDecoderMethod "getNeedsFormat" o = AudioDecoderGetNeedsFormatMethodInfo
    ResolveAudioDecoderMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveAudioDecoderMethod "getParseState" o = AudioDecoderGetParseStateMethodInfo
    ResolveAudioDecoderMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveAudioDecoderMethod "getPlc" o = AudioDecoderGetPlcMethodInfo
    ResolveAudioDecoderMethod "getPlcAware" o = AudioDecoderGetPlcAwareMethodInfo
    ResolveAudioDecoderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAudioDecoderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAudioDecoderMethod "getRequestPad" o = Gst.Element.ElementGetRequestPadMethodInfo
    ResolveAudioDecoderMethod "getStartTime" o = Gst.Element.ElementGetStartTimeMethodInfo
    ResolveAudioDecoderMethod "getState" o = Gst.Element.ElementGetStateMethodInfo
    ResolveAudioDecoderMethod "getStaticPad" o = Gst.Element.ElementGetStaticPadMethodInfo
    ResolveAudioDecoderMethod "getTolerance" o = AudioDecoderGetToleranceMethodInfo
    ResolveAudioDecoderMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveAudioDecoderMethod "getValueArray" o = Gst.Object.ObjectGetValueArrayMethodInfo
    ResolveAudioDecoderMethod "setAllocationCaps" o = AudioDecoderSetAllocationCapsMethodInfo
    ResolveAudioDecoderMethod "setBaseTime" o = Gst.Element.ElementSetBaseTimeMethodInfo
    ResolveAudioDecoderMethod "setBus" o = Gst.Element.ElementSetBusMethodInfo
    ResolveAudioDecoderMethod "setClock" o = Gst.Element.ElementSetClockMethodInfo
    ResolveAudioDecoderMethod "setContext" o = Gst.Element.ElementSetContextMethodInfo
    ResolveAudioDecoderMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveAudioDecoderMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveAudioDecoderMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveAudioDecoderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAudioDecoderMethod "setDrainable" o = AudioDecoderSetDrainableMethodInfo
    ResolveAudioDecoderMethod "setEstimateRate" o = AudioDecoderSetEstimateRateMethodInfo
    ResolveAudioDecoderMethod "setLatency" o = AudioDecoderSetLatencyMethodInfo
    ResolveAudioDecoderMethod "setLockedState" o = Gst.Element.ElementSetLockedStateMethodInfo
    ResolveAudioDecoderMethod "setMaxErrors" o = AudioDecoderSetMaxErrorsMethodInfo
    ResolveAudioDecoderMethod "setMinLatency" o = AudioDecoderSetMinLatencyMethodInfo
    ResolveAudioDecoderMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveAudioDecoderMethod "setNeedsFormat" o = AudioDecoderSetNeedsFormatMethodInfo
    ResolveAudioDecoderMethod "setOutputFormat" o = AudioDecoderSetOutputFormatMethodInfo
    ResolveAudioDecoderMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveAudioDecoderMethod "setPlc" o = AudioDecoderSetPlcMethodInfo
    ResolveAudioDecoderMethod "setPlcAware" o = AudioDecoderSetPlcAwareMethodInfo
    ResolveAudioDecoderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAudioDecoderMethod "setStartTime" o = Gst.Element.ElementSetStartTimeMethodInfo
    ResolveAudioDecoderMethod "setState" o = Gst.Element.ElementSetStateMethodInfo
    ResolveAudioDecoderMethod "setTolerance" o = AudioDecoderSetToleranceMethodInfo
    ResolveAudioDecoderMethod "setUseDefaultPadAcceptcaps" o = AudioDecoderSetUseDefaultPadAcceptcapsMethodInfo
    ResolveAudioDecoderMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAudioDecoderMethod t AudioDecoder, O.MethodInfo info AudioDecoder p) => O.IsLabelProxy t (AudioDecoder -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAudioDecoderMethod t AudioDecoder, O.MethodInfo info AudioDecoder p) => O.IsLabel t (AudioDecoder -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "min-latency"
   -- Type: TBasicType TInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getAudioDecoderMinLatency :: (MonadIO m, IsAudioDecoder o) => o -> m Int64
getAudioDecoderMinLatency obj = liftIO $ getObjectPropertyInt64 obj "min-latency"

setAudioDecoderMinLatency :: (MonadIO m, IsAudioDecoder o) => o -> Int64 -> m ()
setAudioDecoderMinLatency obj val = liftIO $ setObjectPropertyInt64 obj "min-latency" val

constructAudioDecoderMinLatency :: (IsAudioDecoder o) => Int64 -> IO (GValueConstruct o)
constructAudioDecoderMinLatency val = constructObjectPropertyInt64 "min-latency" val

data AudioDecoderMinLatencyPropertyInfo
instance AttrInfo AudioDecoderMinLatencyPropertyInfo where
    type AttrAllowedOps AudioDecoderMinLatencyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AudioDecoderMinLatencyPropertyInfo = (~) Int64
    type AttrBaseTypeConstraint AudioDecoderMinLatencyPropertyInfo = IsAudioDecoder
    type AttrGetType AudioDecoderMinLatencyPropertyInfo = Int64
    type AttrLabel AudioDecoderMinLatencyPropertyInfo = "min-latency"
    type AttrOrigin AudioDecoderMinLatencyPropertyInfo = AudioDecoder
    attrGet _ = getAudioDecoderMinLatency
    attrSet _ = setAudioDecoderMinLatency
    attrConstruct _ = constructAudioDecoderMinLatency
    attrClear _ = undefined

-- VVV Prop "plc"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getAudioDecoderPlc :: (MonadIO m, IsAudioDecoder o) => o -> m Bool
getAudioDecoderPlc obj = liftIO $ getObjectPropertyBool obj "plc"

setAudioDecoderPlc :: (MonadIO m, IsAudioDecoder o) => o -> Bool -> m ()
setAudioDecoderPlc obj val = liftIO $ setObjectPropertyBool obj "plc" val

constructAudioDecoderPlc :: (IsAudioDecoder o) => Bool -> IO (GValueConstruct o)
constructAudioDecoderPlc val = constructObjectPropertyBool "plc" val

data AudioDecoderPlcPropertyInfo
instance AttrInfo AudioDecoderPlcPropertyInfo where
    type AttrAllowedOps AudioDecoderPlcPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AudioDecoderPlcPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint AudioDecoderPlcPropertyInfo = IsAudioDecoder
    type AttrGetType AudioDecoderPlcPropertyInfo = Bool
    type AttrLabel AudioDecoderPlcPropertyInfo = "plc"
    type AttrOrigin AudioDecoderPlcPropertyInfo = AudioDecoder
    attrGet _ = getAudioDecoderPlc
    attrSet _ = setAudioDecoderPlc
    attrConstruct _ = constructAudioDecoderPlc
    attrClear _ = undefined

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

getAudioDecoderTolerance :: (MonadIO m, IsAudioDecoder o) => o -> m Int64
getAudioDecoderTolerance obj = liftIO $ getObjectPropertyInt64 obj "tolerance"

setAudioDecoderTolerance :: (MonadIO m, IsAudioDecoder o) => o -> Int64 -> m ()
setAudioDecoderTolerance obj val = liftIO $ setObjectPropertyInt64 obj "tolerance" val

constructAudioDecoderTolerance :: (IsAudioDecoder o) => Int64 -> IO (GValueConstruct o)
constructAudioDecoderTolerance val = constructObjectPropertyInt64 "tolerance" val

data AudioDecoderTolerancePropertyInfo
instance AttrInfo AudioDecoderTolerancePropertyInfo where
    type AttrAllowedOps AudioDecoderTolerancePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AudioDecoderTolerancePropertyInfo = (~) Int64
    type AttrBaseTypeConstraint AudioDecoderTolerancePropertyInfo = IsAudioDecoder
    type AttrGetType AudioDecoderTolerancePropertyInfo = Int64
    type AttrLabel AudioDecoderTolerancePropertyInfo = "tolerance"
    type AttrOrigin AudioDecoderTolerancePropertyInfo = AudioDecoder
    attrGet _ = getAudioDecoderTolerance
    attrSet _ = setAudioDecoderTolerance
    attrConstruct _ = constructAudioDecoderTolerance
    attrClear _ = undefined

instance O.HasAttributeList AudioDecoder
type instance O.AttributeList AudioDecoder = AudioDecoderAttributeList
type AudioDecoderAttributeList = ('[ '("minLatency", AudioDecoderMinLatencyPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("plc", AudioDecoderPlcPropertyInfo), '("tolerance", AudioDecoderTolerancePropertyInfo)] :: [(Symbol, *)])

audioDecoderMinLatency :: AttrLabelProxy "minLatency"
audioDecoderMinLatency = AttrLabelProxy

audioDecoderPlc :: AttrLabelProxy "plc"
audioDecoderPlc = AttrLabelProxy

audioDecoderTolerance :: AttrLabelProxy "tolerance"
audioDecoderTolerance = AttrLabelProxy

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

-- method AudioDecoder::allocate_output_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "size of the buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_allocate_output_buffer" gst_audio_decoder_allocate_output_buffer :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Word64 ->                               -- size : TBasicType TUInt64
    IO (Ptr Gst.Buffer.Buffer)

{- |
Helper function that allocates a buffer to hold an audio frame
for /@dec@/\'s current output format.
-}
audioDecoderAllocateOutputBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Word64
    {- ^ /@size@/: size of the buffer -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ allocated buffer -}
audioDecoderAllocateOutputBuffer dec size = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_allocate_output_buffer dec' size
    checkUnexpectedReturnNULL "audioDecoderAllocateOutputBuffer" result
    result' <- (wrapBoxed Gst.Buffer.Buffer) result
    touchManagedPtr dec
    return result'

data AudioDecoderAllocateOutputBufferMethodInfo
instance (signature ~ (Word64 -> m Gst.Buffer.Buffer), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderAllocateOutputBufferMethodInfo a signature where
    overloadedMethod _ = audioDecoderAllocateOutputBuffer

-- method AudioDecoder::finish_frame
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buf", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "decoded data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frames", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of decoded frames represented by decoded data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_finish_frame" gst_audio_decoder_finish_frame :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr Gst.Buffer.Buffer ->                -- buf : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Int32 ->                                -- frames : TBasicType TInt
    IO CUInt

{- |
Collects decoded data and pushes it downstream.

/@buf@/ may be NULL in which case the indicated number of frames
are discarded and considered to have produced no output
(e.g. lead-in or setup frames).
Otherwise, source pad caps must be set when it is called with valid
data in /@buf@/.

Note that a frame received in @/gst_audio_decoder_handle_frame()/@ may be
invalidated by a call to this function.
-}
audioDecoderFinishFrame ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Gst.Buffer.Buffer
    {- ^ /@buf@/: decoded data -}
    -> Int32
    {- ^ /@frames@/: number of decoded frames represented by decoded data -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.FlowReturn' that should be escalated to caller (of caller) -}
audioDecoderFinishFrame dec buf frames = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    buf' <- unsafeManagedPtrGetPtr buf
    result <- gst_audio_decoder_finish_frame dec' buf' frames
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr dec
    touchManagedPtr buf
    return result'

data AudioDecoderFinishFrameMethodInfo
instance (signature ~ (Gst.Buffer.Buffer -> Int32 -> m Gst.Enums.FlowReturn), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderFinishFrameMethodInfo a signature where
    overloadedMethod _ = audioDecoderFinishFrame

-- method AudioDecoder::get_allocator
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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#GstAllocatorParams 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_audio_decoder_get_allocator" gst_audio_decoder_get_allocator :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    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.GstAudio.Objects.AudioDecoder.AudioDecoder' sub-classes to know the memory /@allocator@/
used by the base class and its /@params@/.

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

data AudioDecoderGetAllocatorMethodInfo
instance (signature ~ (m (Gst.Allocator.Allocator,Gst.AllocationParams.AllocationParams)), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetAllocatorMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetAllocator

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

foreign import ccall "gst_audio_decoder_get_audio_info" gst_audio_decoder_get_audio_info :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO (Ptr GstAudio.AudioInfo.AudioInfo)

{- |
/No description available in the introspection data./
-}
audioDecoderGetAudioInfo ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m GstAudio.AudioInfo.AudioInfo
    {- ^ __Returns:__ a 'GI.GstAudio.Structs.AudioInfo.AudioInfo' describing the input audio format -}
audioDecoderGetAudioInfo dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_audio_info dec'
    checkUnexpectedReturnNULL "audioDecoderGetAudioInfo" result
    result' <- (wrapBoxed GstAudio.AudioInfo.AudioInfo) result
    touchManagedPtr dec
    return result'

data AudioDecoderGetAudioInfoMethodInfo
instance (signature ~ (m GstAudio.AudioInfo.AudioInfo), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetAudioInfoMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetAudioInfo

-- method AudioDecoder::get_delay
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_get_delay" gst_audio_decoder_get_delay :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Int32

{- |
/No description available in the introspection data./
-}
audioDecoderGetDelay ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Int32
    {- ^ __Returns:__ currently configured decoder delay -}
audioDecoderGetDelay dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_delay dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetDelayMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetDelayMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetDelay

-- method AudioDecoder::get_drainable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_get_drainable" gst_audio_decoder_get_drainable :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO CInt

{- |
Queries decoder drain handling.
-}
audioDecoderGetDrainable ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Bool
    {- ^ __Returns:__ TRUE if drainable handling is enabled.

MT safe. -}
audioDecoderGetDrainable dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_drainable dec'
    let result' = (/= 0) result
    touchManagedPtr dec
    return result'

data AudioDecoderGetDrainableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetDrainableMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetDrainable

-- method AudioDecoder::get_estimate_rate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_get_estimate_rate" gst_audio_decoder_get_estimate_rate :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Int32

{- |
/No description available in the introspection data./
-}
audioDecoderGetEstimateRate ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Int32
    {- ^ __Returns:__ currently configured byte to time conversion setting -}
audioDecoderGetEstimateRate dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_estimate_rate dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetEstimateRateMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetEstimateRateMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetEstimateRate

-- method AudioDecoder::get_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "min", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to storage to hold minimum latency", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "max", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to storage to hold maximum latency", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_get_latency" gst_audio_decoder_get_latency :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr Word64 ->                           -- min : TBasicType TUInt64
    Ptr Word64 ->                           -- max : TBasicType TUInt64
    IO ()

{- |
Sets the variables pointed to by /@min@/ and /@max@/ to the currently configured
latency.
-}
audioDecoderGetLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m (Word64,Word64)
audioDecoderGetLatency dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    min <- allocMem :: IO (Ptr Word64)
    max <- allocMem :: IO (Ptr Word64)
    gst_audio_decoder_get_latency dec' min max
    min' <- peek min
    max' <- peek max
    touchManagedPtr dec
    freeMem min
    freeMem max
    return (min', max')

data AudioDecoderGetLatencyMethodInfo
instance (signature ~ (m (Word64,Word64)), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetLatencyMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetLatency

-- method AudioDecoder::get_max_errors
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_get_max_errors" gst_audio_decoder_get_max_errors :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Int32

{- |
/No description available in the introspection data./
-}
audioDecoderGetMaxErrors ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Int32
    {- ^ __Returns:__ currently configured decoder tolerated error count. -}
audioDecoderGetMaxErrors dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_max_errors dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetMaxErrorsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetMaxErrorsMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetMaxErrors

-- method AudioDecoder::get_min_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_get_min_latency" gst_audio_decoder_get_min_latency :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Word64

{- |
Queries decoder\'s latency aggregation.
-}
audioDecoderGetMinLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Word64
    {- ^ __Returns:__ aggregation latency.

MT safe. -}
audioDecoderGetMinLatency dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_min_latency dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetMinLatencyMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetMinLatencyMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetMinLatency

-- method AudioDecoder::get_needs_format
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_get_needs_format" gst_audio_decoder_get_needs_format :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO CInt

{- |
Queries decoder required format handling.
-}
audioDecoderGetNeedsFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Bool
    {- ^ __Returns:__ TRUE if required format handling is enabled.

MT safe. -}
audioDecoderGetNeedsFormat dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_needs_format dec'
    let result' = (/= 0) result
    touchManagedPtr dec
    return result'

data AudioDecoderGetNeedsFormatMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetNeedsFormatMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetNeedsFormat

-- method AudioDecoder::get_parse_state
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sync", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to a variable to hold the current sync state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "eos", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to a variable to hold the current eos 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_audio_decoder_get_parse_state" gst_audio_decoder_get_parse_state :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- sync : TBasicType TBoolean
    CInt ->                                 -- eos : TBasicType TBoolean
    IO ()

{- |
Return current parsing (sync and eos) state.
-}
audioDecoderGetParseState ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@sync@/: a pointer to a variable to hold the current sync state -}
    -> Bool
    {- ^ /@eos@/: a pointer to a variable to hold the current eos state -}
    -> m ()
audioDecoderGetParseState dec sync eos = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let sync' = (fromIntegral . fromEnum) sync
    let eos' = (fromIntegral . fromEnum) eos
    gst_audio_decoder_get_parse_state dec' sync' eos'
    touchManagedPtr dec
    return ()

data AudioDecoderGetParseStateMethodInfo
instance (signature ~ (Bool -> Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetParseStateMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetParseState

-- method AudioDecoder::get_plc
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_get_plc" gst_audio_decoder_get_plc :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO CInt

{- |
Queries decoder packet loss concealment handling.
-}
audioDecoderGetPlc ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Bool
    {- ^ __Returns:__ TRUE if packet loss concealment is enabled.

MT safe. -}
audioDecoderGetPlc dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_plc dec'
    let result' = (/= 0) result
    touchManagedPtr dec
    return result'

data AudioDecoderGetPlcMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetPlcMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetPlc

-- method AudioDecoder::get_plc_aware
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_get_plc_aware" gst_audio_decoder_get_plc_aware :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Int32

{- |
/No description available in the introspection data./
-}
audioDecoderGetPlcAware ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Int32
    {- ^ __Returns:__ currently configured plc handling -}
audioDecoderGetPlcAware dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_plc_aware dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetPlcAwareMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetPlcAwareMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetPlcAware

-- method AudioDecoder::get_tolerance
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_get_tolerance" gst_audio_decoder_get_tolerance :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO Word64

{- |
Queries current audio jitter tolerance threshold.
-}
audioDecoderGetTolerance ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Word64
    {- ^ __Returns:__ decoder audio jitter tolerance threshold.

MT safe. -}
audioDecoderGetTolerance dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_get_tolerance dec'
    touchManagedPtr dec
    return result

data AudioDecoderGetToleranceMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderGetToleranceMethodInfo a signature where
    overloadedMethod _ = audioDecoderGetTolerance

-- method AudioDecoder::merge_tags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tags", argType = TInterface (Name {namespace = "Gst", name = "TagList"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstTagList to merge, or NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "Gst", name = "TagMergeMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstTagMergeMode to use, usually #GST_TAG_MERGE_REPLACE", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_merge_tags" gst_audio_decoder_merge_tags :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr Gst.TagList.TagList ->              -- tags : TInterface (Name {namespace = "Gst", name = "TagList"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "Gst", name = "TagMergeMode"})
    IO ()

{- |
Sets the audio decoder tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with 'GI.GstAudio.Objects.AudioDecoder.audioDecoderMergeTags'.

Note that this is provided for convenience, and the subclass is
not required to use this and can still do tag handling on its own.
-}
audioDecoderMergeTags ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Maybe (Gst.TagList.TagList)
    {- ^ /@tags@/: a 'GI.Gst.Structs.TagList.TagList' to merge, or NULL -}
    -> Gst.Enums.TagMergeMode
    {- ^ /@mode@/: the 'GI.Gst.Enums.TagMergeMode' to use, usually @/GST_TAG_MERGE_REPLACE/@ -}
    -> m ()
audioDecoderMergeTags dec tags mode = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    maybeTags <- case tags of
        Nothing -> return nullPtr
        Just jTags -> do
            jTags' <- unsafeManagedPtrGetPtr jTags
            return jTags'
    let mode' = (fromIntegral . fromEnum) mode
    gst_audio_decoder_merge_tags dec' maybeTags mode'
    touchManagedPtr dec
    whenJust tags touchManagedPtr
    return ()

data AudioDecoderMergeTagsMethodInfo
instance (signature ~ (Maybe (Gst.TagList.TagList) -> Gst.Enums.TagMergeMode -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderMergeTagsMethodInfo a signature where
    overloadedMethod _ = audioDecoderMergeTags

-- method AudioDecoder::negotiate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_negotiate" gst_audio_decoder_negotiate :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    IO CInt

{- |
Negotiate with downstream elements to currently configured 'GI.GstAudio.Structs.AudioInfo.AudioInfo'.
Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if
negotiate fails.
-}
audioDecoderNegotiate ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> m Bool
    {- ^ __Returns:__ @/TRUE/@ if the negotiation succeeded, else @/FALSE/@. -}
audioDecoderNegotiate dec = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    result <- gst_audio_decoder_negotiate dec'
    let result' = (/= 0) result
    touchManagedPtr dec
    return result'

data AudioDecoderNegotiateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderNegotiateMethodInfo a signature where
    overloadedMethod _ = audioDecoderNegotiate

-- method AudioDecoder::proxy_getcaps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "decoder", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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 "initial caps", 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 "filter caps", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Caps"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_proxy_getcaps" gst_audio_decoder_proxy_getcaps :: 
    Ptr AudioDecoder ->                     -- decoder : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr Gst.Caps.Caps ->                    -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    Ptr Gst.Caps.Caps ->                    -- filter : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO (Ptr Gst.Caps.Caps)

{- |
Returns caps that express /@caps@/ (or sink template caps if /@caps@/ == NULL)
restricted to rate\/channels\/... combinations supported by downstream
elements.

@since 1.6
-}
audioDecoderProxyGetcaps ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@decoder@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Maybe (Gst.Caps.Caps)
    {- ^ /@caps@/: initial caps -}
    -> Maybe (Gst.Caps.Caps)
    {- ^ /@filter@/: filter caps -}
    -> m Gst.Caps.Caps
    {- ^ __Returns:__ a 'GI.Gst.Structs.Caps.Caps' owned by caller -}
audioDecoderProxyGetcaps decoder caps filter = liftIO $ do
    decoder' <- unsafeManagedPtrCastPtr decoder
    maybeCaps <- case caps of
        Nothing -> return nullPtr
        Just jCaps -> do
            jCaps' <- unsafeManagedPtrGetPtr jCaps
            return jCaps'
    maybeFilter <- case filter of
        Nothing -> return nullPtr
        Just jFilter -> do
            jFilter' <- unsafeManagedPtrGetPtr jFilter
            return jFilter'
    result <- gst_audio_decoder_proxy_getcaps decoder' maybeCaps maybeFilter
    checkUnexpectedReturnNULL "audioDecoderProxyGetcaps" result
    result' <- (wrapBoxed Gst.Caps.Caps) result
    touchManagedPtr decoder
    whenJust caps touchManagedPtr
    whenJust filter touchManagedPtr
    return result'

data AudioDecoderProxyGetcapsMethodInfo
instance (signature ~ (Maybe (Gst.Caps.Caps) -> Maybe (Gst.Caps.Caps) -> m Gst.Caps.Caps), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderProxyGetcapsMethodInfo a signature where
    overloadedMethod _ = audioDecoderProxyGetcaps

-- method AudioDecoder::set_allocation_caps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "allocation_caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstCaps or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_allocation_caps" gst_audio_decoder_set_allocation_caps :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr Gst.Caps.Caps ->                    -- allocation_caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO ()

{- |
Sets a caps in allocation query which are different from the set
pad\'s caps. Use this function before calling
'GI.GstAudio.Objects.AudioDecoder.audioDecoderNegotiate'. Setting to 'Nothing' the allocation
query will use the caps from the pad.

@since 1.10
-}
audioDecoderSetAllocationCaps ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Maybe (Gst.Caps.Caps)
    {- ^ /@allocationCaps@/: a 'GI.Gst.Structs.Caps.Caps' or 'Nothing' -}
    -> m ()
audioDecoderSetAllocationCaps dec allocationCaps = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    maybeAllocationCaps <- case allocationCaps of
        Nothing -> return nullPtr
        Just jAllocationCaps -> do
            jAllocationCaps' <- unsafeManagedPtrGetPtr jAllocationCaps
            return jAllocationCaps'
    gst_audio_decoder_set_allocation_caps dec' maybeAllocationCaps
    touchManagedPtr dec
    whenJust allocationCaps touchManagedPtr
    return ()

data AudioDecoderSetAllocationCapsMethodInfo
instance (signature ~ (Maybe (Gst.Caps.Caps) -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetAllocationCapsMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetAllocationCaps

-- method AudioDecoder::set_drainable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_set_drainable" gst_audio_decoder_set_drainable :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Configures decoder drain handling.  If drainable, subclass might
be handed a NULL buffer to have it return any leftover decoded data.
Otherwise, it is not considered so capable and will only ever be passed
real data.

MT safe.
-}
audioDecoderSetDrainable ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@enabled@/: new state -}
    -> m ()
audioDecoderSetDrainable dec enabled = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_audio_decoder_set_drainable dec' enabled'
    touchManagedPtr dec
    return ()

data AudioDecoderSetDrainableMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetDrainableMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetDrainable

-- method AudioDecoder::set_estimate_rate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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 "whether to enable byte to time conversion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_estimate_rate" gst_audio_decoder_set_estimate_rate :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Allows baseclass to perform byte to time estimated conversion.
-}
audioDecoderSetEstimateRate ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@enabled@/: whether to enable byte to time conversion -}
    -> m ()
audioDecoderSetEstimateRate dec enabled = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_audio_decoder_set_estimate_rate dec' enabled'
    touchManagedPtr dec
    return ()

data AudioDecoderSetEstimateRateMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetEstimateRateMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetEstimateRate

-- method AudioDecoder::set_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "min", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "minimum latency", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "max", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "maximum latency", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_latency" gst_audio_decoder_set_latency :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Word64 ->                               -- min : TBasicType TUInt64
    Word64 ->                               -- max : TBasicType TUInt64
    IO ()

{- |
Sets decoder latency.
-}
audioDecoderSetLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Word64
    {- ^ /@min@/: minimum latency -}
    -> Word64
    {- ^ /@max@/: maximum latency -}
    -> m ()
audioDecoderSetLatency dec min max = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    gst_audio_decoder_set_latency dec' min max
    touchManagedPtr dec
    return ()

data AudioDecoderSetLatencyMethodInfo
instance (signature ~ (Word64 -> Word64 -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetLatencyMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetLatency

-- method AudioDecoder::set_max_errors
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "max tolerated errors", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_max_errors" gst_audio_decoder_set_max_errors :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Int32 ->                                -- num : TBasicType TInt
    IO ()

{- |
Sets numbers of tolerated decoder errors, where a tolerated one is then only
warned about, but more than tolerated will lead to fatal error. You can set
-1 for never returning fatal errors. Default is set to
GST_AUDIO_DECODER_MAX_ERRORS.
-}
audioDecoderSetMaxErrors ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Int32
    {- ^ /@num@/: max tolerated errors -}
    -> m ()
audioDecoderSetMaxErrors dec num = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    gst_audio_decoder_set_max_errors dec' num
    touchManagedPtr dec
    return ()

data AudioDecoderSetMaxErrorsMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetMaxErrorsMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetMaxErrors

-- method AudioDecoder::set_min_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "num", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "new minimum latency", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_min_latency" gst_audio_decoder_set_min_latency :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Word64 ->                               -- num : TBasicType TUInt64
    IO ()

{- |
Sets decoder minimum aggregation latency.

MT safe.
-}
audioDecoderSetMinLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Word64
    {- ^ /@num@/: new minimum latency -}
    -> m ()
audioDecoderSetMinLatency dec num = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    gst_audio_decoder_set_min_latency dec' num
    touchManagedPtr dec
    return ()

data AudioDecoderSetMinLatencyMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetMinLatencyMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetMinLatency

-- method AudioDecoder::set_needs_format
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_set_needs_format" gst_audio_decoder_set_needs_format :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Configures decoder format needs.  If enabled, subclass needs to be
negotiated with format caps before it can process any data.  It will then
never be handed any data before it has been configured.
Otherwise, it might be handed data without having been configured and
is then expected being able to do so either by default
or based on the input data.

MT safe.
-}
audioDecoderSetNeedsFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@enabled@/: new state -}
    -> m ()
audioDecoderSetNeedsFormat dec enabled = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_audio_decoder_set_needs_format dec' enabled'
    touchManagedPtr dec
    return ()

data AudioDecoderSetNeedsFormatMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetNeedsFormatMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetNeedsFormat

-- method AudioDecoder::set_output_format
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "info", argType = TInterface (Name {namespace = "GstAudio", name = "AudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "#GstAudioInfo", 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_audio_decoder_set_output_format" gst_audio_decoder_set_output_format :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Ptr GstAudio.AudioInfo.AudioInfo ->     -- info : TInterface (Name {namespace = "GstAudio", name = "AudioInfo"})
    IO CInt

{- |
Configure output info on the srcpad of /@dec@/.
-}
audioDecoderSetOutputFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> GstAudio.AudioInfo.AudioInfo
    {- ^ /@info@/: 'GI.GstAudio.Structs.AudioInfo.AudioInfo' -}
    -> m Bool
    {- ^ __Returns:__ 'True' on success. -}
audioDecoderSetOutputFormat dec info = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    info' <- unsafeManagedPtrGetPtr info
    result <- gst_audio_decoder_set_output_format dec' info'
    let result' = (/= 0) result
    touchManagedPtr dec
    touchManagedPtr info
    return result'

data AudioDecoderSetOutputFormatMethodInfo
instance (signature ~ (GstAudio.AudioInfo.AudioInfo -> m Bool), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetOutputFormatMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetOutputFormat

-- method AudioDecoder::set_plc
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", 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_audio_decoder_set_plc" gst_audio_decoder_set_plc :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Enable or disable decoder packet loss concealment, provided subclass
and codec are capable and allow handling plc.

MT safe.
-}
audioDecoderSetPlc ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@enabled@/: new state -}
    -> m ()
audioDecoderSetPlc dec enabled = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_audio_decoder_set_plc dec' enabled'
    touchManagedPtr dec
    return ()

data AudioDecoderSetPlcMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetPlcMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetPlc

-- method AudioDecoder::set_plc_aware
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "plc", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "new plc 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_audio_decoder_set_plc_aware" gst_audio_decoder_set_plc_aware :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- plc : TBasicType TBoolean
    IO ()

{- |
Indicates whether or not subclass handles packet loss concealment (plc).
-}
audioDecoderSetPlcAware ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@plc@/: new plc state -}
    -> m ()
audioDecoderSetPlcAware dec plc = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    let plc' = (fromIntegral . fromEnum) plc
    gst_audio_decoder_set_plc_aware dec' plc'
    touchManagedPtr dec
    return ()

data AudioDecoderSetPlcAwareMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetPlcAwareMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetPlcAware

-- method AudioDecoder::set_tolerance
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "dec", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tolerance", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "new tolerance", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_tolerance" gst_audio_decoder_set_tolerance :: 
    Ptr AudioDecoder ->                     -- dec : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    Word64 ->                               -- tolerance : TBasicType TUInt64
    IO ()

{- |
Configures decoder audio jitter tolerance threshold.

MT safe.
-}
audioDecoderSetTolerance ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@dec@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Word64
    {- ^ /@tolerance@/: new tolerance -}
    -> m ()
audioDecoderSetTolerance dec tolerance = liftIO $ do
    dec' <- unsafeManagedPtrCastPtr dec
    gst_audio_decoder_set_tolerance dec' tolerance
    touchManagedPtr dec
    return ()

data AudioDecoderSetToleranceMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetToleranceMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetTolerance

-- method AudioDecoder::set_use_default_pad_acceptcaps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "decoder", argType = TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstAudioDecoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "use", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "if the default pad accept-caps query handling should be used", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_audio_decoder_set_use_default_pad_acceptcaps" gst_audio_decoder_set_use_default_pad_acceptcaps :: 
    Ptr AudioDecoder ->                     -- decoder : TInterface (Name {namespace = "GstAudio", name = "AudioDecoder"})
    CInt ->                                 -- use : TBasicType TBoolean
    IO ()

{- |
Lets 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' sub-classes decide if they want the sink pad
to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default
handler with @/GST_PAD_SET_ACCEPT_INTERSECT/@ and
@/GST_PAD_SET_ACCEPT_TEMPLATE/@

@since 1.6
-}
audioDecoderSetUseDefaultPadAcceptcaps ::
    (B.CallStack.HasCallStack, MonadIO m, IsAudioDecoder a) =>
    a
    {- ^ /@decoder@/: a 'GI.GstAudio.Objects.AudioDecoder.AudioDecoder' -}
    -> Bool
    {- ^ /@use@/: if the default pad accept-caps query handling should be used -}
    -> m ()
audioDecoderSetUseDefaultPadAcceptcaps decoder use = liftIO $ do
    decoder' <- unsafeManagedPtrCastPtr decoder
    let use' = (fromIntegral . fromEnum) use
    gst_audio_decoder_set_use_default_pad_acceptcaps decoder' use'
    touchManagedPtr decoder
    return ()

data AudioDecoderSetUseDefaultPadAcceptcapsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAudioDecoder a) => O.MethodInfo AudioDecoderSetUseDefaultPadAcceptcapsMethodInfo a signature where
    overloadedMethod _ = audioDecoderSetUseDefaultPadAcceptcaps