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

'GI.GstBase.Objects.BaseSink.BaseSink' is the base class for sink elements in GStreamer, such as
xvimagesink or filesink. It is a layer on top of 'GI.Gst.Objects.Element.Element' that provides a
simplified interface to plugin writers. 'GI.GstBase.Objects.BaseSink.BaseSink' handles many details
for you, for example: preroll, clock synchronization, state changes,
activation in push or pull mode, and queries.

In most cases, when writing sink elements, there is no need to implement
class methods from 'GI.Gst.Objects.Element.Element' or to set functions on pads, because the
'GI.GstBase.Objects.BaseSink.BaseSink' infrastructure should be sufficient.

'GI.GstBase.Objects.BaseSink.BaseSink' provides support for exactly one sink pad, which should be
named \"sink\". A sink implementation (subclass of 'GI.GstBase.Objects.BaseSink.BaseSink') should
install a pad template in its class_init function, like so:

=== /C code/
>
>static void
>my_element_class_init (GstMyElementClass *klass)
>{
>  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
>
>  // sinktemplate should be a #GstStaticPadTemplate with direction
>  // %GST_PAD_SINK and name "sink"
>  gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
>
>  gst_element_class_set_static_metadata (gstelement_class,
>      "Sink name",
>      "Sink",
>      "My Sink element",
>      "The author <my.sink@my.email>");
>}


'GI.GstBase.Objects.BaseSink.BaseSink' will handle the prerolling correctly. This means that it will
return 'GI.Gst.Enums.StateChangeReturnAsync' from a state change to PAUSED until the first
buffer arrives in this element. The base class will call the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/preroll/@() vmethod with this preroll buffer and will then
commit the state change to the next asynchronously pending state.

When the element is set to PLAYING, 'GI.GstBase.Objects.BaseSink.BaseSink' will synchronise on the
clock using the times returned from 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/get_times/@(). If this
function returns 'GI.Gst.Constants.CLOCK_TIME_NONE' for the start time, no synchronisation
will be done. Synchronisation can be disabled entirely by setting the object
'GI.GstBase.Objects.BaseSink.BaseSink':@/sync/@ property to 'False'.

After synchronisation the virtual method 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() will be
called. Subclasses should minimally implement this method.

Subclasses that synchronise on the clock in the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@()
method are supported as well. These classes typically receive a buffer in
the render method and can then potentially block on the clock while
rendering. A typical example is an audiosink.
These subclasses can use 'GI.GstBase.Objects.BaseSink.baseSinkWaitPreroll' to perform the
blocking wait.

Upon receiving the EOS event in the PLAYING state, 'GI.GstBase.Objects.BaseSink.BaseSink' will wait
for the clock to reach the time indicated by the stop time of the last
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/get_times/@() call before posting an EOS message. When the
element receives EOS in PAUSED, preroll completes, the event is queued and an
EOS message is posted when going to PLAYING.

'GI.GstBase.Objects.BaseSink.BaseSink' will internally use the 'GI.Gst.Enums.EventTypeSegment' events to schedule
synchronisation and clipping of buffers. Buffers that fall completely outside
of the current segment are dropped. Buffers that fall partially in the
segment are rendered (and prerolled). Subclasses should do any subbuffer
clipping themselves when needed.

'GI.GstBase.Objects.BaseSink.BaseSink' will by default report the current playback position in
'GI.Gst.Enums.FormatTime' based on the current clock time and segment information.
If no clock has been set on the element, the query will be forwarded
upstream.

The 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/set_caps/@() function will be called when the subclass
should configure itself to process a specific media type.

The 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/start/@() and 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/stop/@() virtual methods
will be called when resources should be allocated. Any
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/preroll/@(), 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() and
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/set_caps/@() function will be called between the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/start/@() and 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/stop/@() calls.

The 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/event/@() virtual method will be called when an event is
received by 'GI.GstBase.Objects.BaseSink.BaseSink'. Normally this method should only be overridden by
very specific elements (such as file sinks) which need to handle the
newsegment event specially.

The 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/unlock/@() method is called when the elements should
unblock any blocking operations they perform in the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() method. This is mostly useful when the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() method performs a blocking write on a file
descriptor, for example.

The 'GI.GstBase.Objects.BaseSink.BaseSink':@/max-lateness/@ property affects how the sink deals with
buffers that arrive too late in the sink. A buffer arrives too late in the
sink when the presentation time (as a combination of the last segment, buffer
timestamp and element base_time) plus the duration is before the current
time of the clock.
If the frame is later than max-lateness, the sink will drop the buffer
without calling the render method.
This feature is disabled if sync is disabled, the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/get_times/@() method does not return a valid start time or
max-lateness is set to -1 (the default).
Subclasses can use 'GI.GstBase.Objects.BaseSink.baseSinkSetMaxLateness' to configure the
max-lateness value.

The 'GI.GstBase.Objects.BaseSink.BaseSink':@/qos/@ property will enable the quality-of-service features of
the basesink which gather statistics about the real-time performance of the
clock synchronisation. For each buffer received in the sink, statistics are
gathered and a QOS event is sent upstream with these numbers. This
information can then be used by upstream elements to reduce their processing
rate, for example.

The 'GI.GstBase.Objects.BaseSink.BaseSink':@/async/@ property can be used to instruct the sink to never
perform an ASYNC state change. This feature is mostly usable when dealing
with non-synchronized streams or sparse streams.
-}

module GI.GstBase.Objects.BaseSink
    ( 

-- * Exported types
    BaseSink(..)                            ,
    IsBaseSink                              ,
    toBaseSink                              ,
    noBaseSink                              ,


 -- * Methods
-- ** doPreroll #method:doPreroll#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkDoPrerollMethodInfo             ,
#endif
    baseSinkDoPreroll                       ,


-- ** getBlocksize #method:getBlocksize#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetBlocksizeMethodInfo          ,
#endif
    baseSinkGetBlocksize                    ,


-- ** getDropOutOfSegment #method:getDropOutOfSegment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetDropOutOfSegmentMethodInfo   ,
#endif
    baseSinkGetDropOutOfSegment             ,


-- ** getLastSample #method:getLastSample#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetLastSampleMethodInfo         ,
#endif
    baseSinkGetLastSample                   ,


-- ** getLatency #method:getLatency#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetLatencyMethodInfo            ,
#endif
    baseSinkGetLatency                      ,


-- ** getMaxBitrate #method:getMaxBitrate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetMaxBitrateMethodInfo         ,
#endif
    baseSinkGetMaxBitrate                   ,


-- ** getMaxLateness #method:getMaxLateness#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetMaxLatenessMethodInfo        ,
#endif
    baseSinkGetMaxLateness                  ,


-- ** getRenderDelay #method:getRenderDelay#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetRenderDelayMethodInfo        ,
#endif
    baseSinkGetRenderDelay                  ,


-- ** getSync #method:getSync#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetSyncMethodInfo               ,
#endif
    baseSinkGetSync                         ,


-- ** getThrottleTime #method:getThrottleTime#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetThrottleTimeMethodInfo       ,
#endif
    baseSinkGetThrottleTime                 ,


-- ** getTsOffset #method:getTsOffset#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkGetTsOffsetMethodInfo           ,
#endif
    baseSinkGetTsOffset                     ,


-- ** isAsyncEnabled #method:isAsyncEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkIsAsyncEnabledMethodInfo        ,
#endif
    baseSinkIsAsyncEnabled                  ,


-- ** isLastSampleEnabled #method:isLastSampleEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkIsLastSampleEnabledMethodInfo   ,
#endif
    baseSinkIsLastSampleEnabled             ,


-- ** isQosEnabled #method:isQosEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkIsQosEnabledMethodInfo          ,
#endif
    baseSinkIsQosEnabled                    ,


-- ** queryLatency #method:queryLatency#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkQueryLatencyMethodInfo          ,
#endif
    baseSinkQueryLatency                    ,


-- ** setAsyncEnabled #method:setAsyncEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetAsyncEnabledMethodInfo       ,
#endif
    baseSinkSetAsyncEnabled                 ,


-- ** setBlocksize #method:setBlocksize#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetBlocksizeMethodInfo          ,
#endif
    baseSinkSetBlocksize                    ,


-- ** setDropOutOfSegment #method:setDropOutOfSegment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetDropOutOfSegmentMethodInfo   ,
#endif
    baseSinkSetDropOutOfSegment             ,


-- ** setLastSampleEnabled #method:setLastSampleEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetLastSampleEnabledMethodInfo  ,
#endif
    baseSinkSetLastSampleEnabled            ,


-- ** setMaxBitrate #method:setMaxBitrate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetMaxBitrateMethodInfo         ,
#endif
    baseSinkSetMaxBitrate                   ,


-- ** setMaxLateness #method:setMaxLateness#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetMaxLatenessMethodInfo        ,
#endif
    baseSinkSetMaxLateness                  ,


-- ** setQosEnabled #method:setQosEnabled#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetQosEnabledMethodInfo         ,
#endif
    baseSinkSetQosEnabled                   ,


-- ** setRenderDelay #method:setRenderDelay#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetRenderDelayMethodInfo        ,
#endif
    baseSinkSetRenderDelay                  ,


-- ** setSync #method:setSync#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetSyncMethodInfo               ,
#endif
    baseSinkSetSync                         ,


-- ** setThrottleTime #method:setThrottleTime#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetThrottleTimeMethodInfo       ,
#endif
    baseSinkSetThrottleTime                 ,


-- ** setTsOffset #method:setTsOffset#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSetTsOffsetMethodInfo           ,
#endif
    baseSinkSetTsOffset                     ,


-- ** wait #method:wait#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkWaitMethodInfo                  ,
#endif
    baseSinkWait                            ,


-- ** waitClock #method:waitClock#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkWaitClockMethodInfo             ,
#endif
    baseSinkWaitClock                       ,


-- ** waitPreroll #method:waitPreroll#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkWaitPrerollMethodInfo           ,
#endif
    baseSinkWaitPreroll                     ,




 -- * Properties
-- ** async #attr:async#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkAsyncPropertyInfo               ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkAsync                           ,
#endif
    constructBaseSinkAsync                  ,
    getBaseSinkAsync                        ,
    setBaseSinkAsync                        ,


-- ** blocksize #attr:blocksize#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkBlocksizePropertyInfo           ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkBlocksize                       ,
#endif
    constructBaseSinkBlocksize              ,
    getBaseSinkBlocksize                    ,
    setBaseSinkBlocksize                    ,


-- ** enableLastSample #attr:enableLastSample#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkEnableLastSamplePropertyInfo    ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkEnableLastSample                ,
#endif
    constructBaseSinkEnableLastSample       ,
    getBaseSinkEnableLastSample             ,
    setBaseSinkEnableLastSample             ,


-- ** lastSample #attr:lastSample#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkLastSamplePropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkLastSample                      ,
#endif
    getBaseSinkLastSample                   ,


-- ** maxBitrate #attr:maxBitrate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkMaxBitratePropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkMaxBitrate                      ,
#endif
    constructBaseSinkMaxBitrate             ,
    getBaseSinkMaxBitrate                   ,
    setBaseSinkMaxBitrate                   ,


-- ** maxLateness #attr:maxLateness#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkMaxLatenessPropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkMaxLateness                     ,
#endif
    constructBaseSinkMaxLateness            ,
    getBaseSinkMaxLateness                  ,
    setBaseSinkMaxLateness                  ,


-- ** qos #attr:qos#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkQosPropertyInfo                 ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkQos                             ,
#endif
    constructBaseSinkQos                    ,
    getBaseSinkQos                          ,
    setBaseSinkQos                          ,


-- ** renderDelay #attr:renderDelay#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkRenderDelayPropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkRenderDelay                     ,
#endif
    constructBaseSinkRenderDelay            ,
    getBaseSinkRenderDelay                  ,
    setBaseSinkRenderDelay                  ,


-- ** sync #attr:sync#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkSyncPropertyInfo                ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkSync                            ,
#endif
    constructBaseSinkSync                   ,
    getBaseSinkSync                         ,
    setBaseSinkSync                         ,


-- ** throttleTime #attr:throttleTime#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkThrottleTimePropertyInfo        ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkThrottleTime                    ,
#endif
    constructBaseSinkThrottleTime           ,
    getBaseSinkThrottleTime                 ,
    setBaseSinkThrottleTime                 ,


-- ** tsOffset #attr:tsOffset#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    BaseSinkTsOffsetPropertyInfo            ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    baseSinkTsOffset                        ,
#endif
    constructBaseSinkTsOffset               ,
    getBaseSinkTsOffset                     ,
    setBaseSinkTsOffset                     ,




    ) 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.Element as Gst.Element
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Structs.MiniObject as Gst.MiniObject
import qualified GI.Gst.Structs.Sample as Gst.Sample

newtype BaseSink = BaseSink (ManagedPtr BaseSink)
foreign import ccall "gst_base_sink_get_type"
    c_gst_base_sink_get_type :: IO GType

instance GObject BaseSink where
    gobjectType _ = c_gst_base_sink_get_type
    

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

toBaseSink :: (MonadIO m, IsBaseSink o) => o -> m BaseSink
toBaseSink = liftIO . unsafeCastTo BaseSink

noBaseSink :: Maybe BaseSink
noBaseSink = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveBaseSinkMethod (t :: Symbol) (o :: *) :: * where
    ResolveBaseSinkMethod "abortState" o = Gst.Element.ElementAbortStateMethodInfo
    ResolveBaseSinkMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveBaseSinkMethod "addPad" o = Gst.Element.ElementAddPadMethodInfo
    ResolveBaseSinkMethod "addPropertyDeepNotifyWatch" o = Gst.Element.ElementAddPropertyDeepNotifyWatchMethodInfo
    ResolveBaseSinkMethod "addPropertyNotifyWatch" o = Gst.Element.ElementAddPropertyNotifyWatchMethodInfo
    ResolveBaseSinkMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveBaseSinkMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveBaseSinkMethod "callAsync" o = Gst.Element.ElementCallAsyncMethodInfo
    ResolveBaseSinkMethod "changeState" o = Gst.Element.ElementChangeStateMethodInfo
    ResolveBaseSinkMethod "continueState" o = Gst.Element.ElementContinueStateMethodInfo
    ResolveBaseSinkMethod "createAllPads" o = Gst.Element.ElementCreateAllPadsMethodInfo
    ResolveBaseSinkMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveBaseSinkMethod "doPreroll" o = BaseSinkDoPrerollMethodInfo
    ResolveBaseSinkMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveBaseSinkMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveBaseSinkMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveBaseSinkMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveBaseSinkMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveBaseSinkMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveBaseSinkMethod "isAsyncEnabled" o = BaseSinkIsAsyncEnabledMethodInfo
    ResolveBaseSinkMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveBaseSinkMethod "isLastSampleEnabled" o = BaseSinkIsLastSampleEnabledMethodInfo
    ResolveBaseSinkMethod "isLockedState" o = Gst.Element.ElementIsLockedStateMethodInfo
    ResolveBaseSinkMethod "isQosEnabled" o = BaseSinkIsQosEnabledMethodInfo
    ResolveBaseSinkMethod "iteratePads" o = Gst.Element.ElementIteratePadsMethodInfo
    ResolveBaseSinkMethod "iterateSinkPads" o = Gst.Element.ElementIterateSinkPadsMethodInfo
    ResolveBaseSinkMethod "iterateSrcPads" o = Gst.Element.ElementIterateSrcPadsMethodInfo
    ResolveBaseSinkMethod "link" o = Gst.Element.ElementLinkMethodInfo
    ResolveBaseSinkMethod "linkFiltered" o = Gst.Element.ElementLinkFilteredMethodInfo
    ResolveBaseSinkMethod "linkPads" o = Gst.Element.ElementLinkPadsMethodInfo
    ResolveBaseSinkMethod "linkPadsFiltered" o = Gst.Element.ElementLinkPadsFilteredMethodInfo
    ResolveBaseSinkMethod "linkPadsFull" o = Gst.Element.ElementLinkPadsFullMethodInfo
    ResolveBaseSinkMethod "lostState" o = Gst.Element.ElementLostStateMethodInfo
    ResolveBaseSinkMethod "messageFull" o = Gst.Element.ElementMessageFullMethodInfo
    ResolveBaseSinkMethod "messageFullWithDetails" o = Gst.Element.ElementMessageFullWithDetailsMethodInfo
    ResolveBaseSinkMethod "noMorePads" o = Gst.Element.ElementNoMorePadsMethodInfo
    ResolveBaseSinkMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveBaseSinkMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveBaseSinkMethod "postMessage" o = Gst.Element.ElementPostMessageMethodInfo
    ResolveBaseSinkMethod "provideClock" o = Gst.Element.ElementProvideClockMethodInfo
    ResolveBaseSinkMethod "query" o = Gst.Element.ElementQueryMethodInfo
    ResolveBaseSinkMethod "queryConvert" o = Gst.Element.ElementQueryConvertMethodInfo
    ResolveBaseSinkMethod "queryDuration" o = Gst.Element.ElementQueryDurationMethodInfo
    ResolveBaseSinkMethod "queryLatency" o = BaseSinkQueryLatencyMethodInfo
    ResolveBaseSinkMethod "queryPosition" o = Gst.Element.ElementQueryPositionMethodInfo
    ResolveBaseSinkMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveBaseSinkMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveBaseSinkMethod "releaseRequestPad" o = Gst.Element.ElementReleaseRequestPadMethodInfo
    ResolveBaseSinkMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveBaseSinkMethod "removePad" o = Gst.Element.ElementRemovePadMethodInfo
    ResolveBaseSinkMethod "removePropertyNotifyWatch" o = Gst.Element.ElementRemovePropertyNotifyWatchMethodInfo
    ResolveBaseSinkMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveBaseSinkMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveBaseSinkMethod "requestPad" o = Gst.Element.ElementRequestPadMethodInfo
    ResolveBaseSinkMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveBaseSinkMethod "seek" o = Gst.Element.ElementSeekMethodInfo
    ResolveBaseSinkMethod "seekSimple" o = Gst.Element.ElementSeekSimpleMethodInfo
    ResolveBaseSinkMethod "sendEvent" o = Gst.Element.ElementSendEventMethodInfo
    ResolveBaseSinkMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveBaseSinkMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveBaseSinkMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveBaseSinkMethod "syncStateWithParent" o = Gst.Element.ElementSyncStateWithParentMethodInfo
    ResolveBaseSinkMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveBaseSinkMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveBaseSinkMethod "unlink" o = Gst.Element.ElementUnlinkMethodInfo
    ResolveBaseSinkMethod "unlinkPads" o = Gst.Element.ElementUnlinkPadsMethodInfo
    ResolveBaseSinkMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveBaseSinkMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveBaseSinkMethod "wait" o = BaseSinkWaitMethodInfo
    ResolveBaseSinkMethod "waitClock" o = BaseSinkWaitClockMethodInfo
    ResolveBaseSinkMethod "waitPreroll" o = BaseSinkWaitPrerollMethodInfo
    ResolveBaseSinkMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveBaseSinkMethod "getBaseTime" o = Gst.Element.ElementGetBaseTimeMethodInfo
    ResolveBaseSinkMethod "getBlocksize" o = BaseSinkGetBlocksizeMethodInfo
    ResolveBaseSinkMethod "getBus" o = Gst.Element.ElementGetBusMethodInfo
    ResolveBaseSinkMethod "getClock" o = Gst.Element.ElementGetClockMethodInfo
    ResolveBaseSinkMethod "getCompatiblePad" o = Gst.Element.ElementGetCompatiblePadMethodInfo
    ResolveBaseSinkMethod "getCompatiblePadTemplate" o = Gst.Element.ElementGetCompatiblePadTemplateMethodInfo
    ResolveBaseSinkMethod "getContext" o = Gst.Element.ElementGetContextMethodInfo
    ResolveBaseSinkMethod "getContextUnlocked" o = Gst.Element.ElementGetContextUnlockedMethodInfo
    ResolveBaseSinkMethod "getContexts" o = Gst.Element.ElementGetContextsMethodInfo
    ResolveBaseSinkMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveBaseSinkMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveBaseSinkMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveBaseSinkMethod "getDropOutOfSegment" o = BaseSinkGetDropOutOfSegmentMethodInfo
    ResolveBaseSinkMethod "getFactory" o = Gst.Element.ElementGetFactoryMethodInfo
    ResolveBaseSinkMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveBaseSinkMethod "getLastSample" o = BaseSinkGetLastSampleMethodInfo
    ResolveBaseSinkMethod "getLatency" o = BaseSinkGetLatencyMethodInfo
    ResolveBaseSinkMethod "getMaxBitrate" o = BaseSinkGetMaxBitrateMethodInfo
    ResolveBaseSinkMethod "getMaxLateness" o = BaseSinkGetMaxLatenessMethodInfo
    ResolveBaseSinkMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveBaseSinkMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveBaseSinkMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveBaseSinkMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveBaseSinkMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveBaseSinkMethod "getRenderDelay" o = BaseSinkGetRenderDelayMethodInfo
    ResolveBaseSinkMethod "getRequestPad" o = Gst.Element.ElementGetRequestPadMethodInfo
    ResolveBaseSinkMethod "getStartTime" o = Gst.Element.ElementGetStartTimeMethodInfo
    ResolveBaseSinkMethod "getState" o = Gst.Element.ElementGetStateMethodInfo
    ResolveBaseSinkMethod "getStaticPad" o = Gst.Element.ElementGetStaticPadMethodInfo
    ResolveBaseSinkMethod "getSync" o = BaseSinkGetSyncMethodInfo
    ResolveBaseSinkMethod "getThrottleTime" o = BaseSinkGetThrottleTimeMethodInfo
    ResolveBaseSinkMethod "getTsOffset" o = BaseSinkGetTsOffsetMethodInfo
    ResolveBaseSinkMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveBaseSinkMethod "setAsyncEnabled" o = BaseSinkSetAsyncEnabledMethodInfo
    ResolveBaseSinkMethod "setBaseTime" o = Gst.Element.ElementSetBaseTimeMethodInfo
    ResolveBaseSinkMethod "setBlocksize" o = BaseSinkSetBlocksizeMethodInfo
    ResolveBaseSinkMethod "setBus" o = Gst.Element.ElementSetBusMethodInfo
    ResolveBaseSinkMethod "setClock" o = Gst.Element.ElementSetClockMethodInfo
    ResolveBaseSinkMethod "setContext" o = Gst.Element.ElementSetContextMethodInfo
    ResolveBaseSinkMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveBaseSinkMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveBaseSinkMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveBaseSinkMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveBaseSinkMethod "setDropOutOfSegment" o = BaseSinkSetDropOutOfSegmentMethodInfo
    ResolveBaseSinkMethod "setLastSampleEnabled" o = BaseSinkSetLastSampleEnabledMethodInfo
    ResolveBaseSinkMethod "setLockedState" o = Gst.Element.ElementSetLockedStateMethodInfo
    ResolveBaseSinkMethod "setMaxBitrate" o = BaseSinkSetMaxBitrateMethodInfo
    ResolveBaseSinkMethod "setMaxLateness" o = BaseSinkSetMaxLatenessMethodInfo
    ResolveBaseSinkMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveBaseSinkMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveBaseSinkMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveBaseSinkMethod "setQosEnabled" o = BaseSinkSetQosEnabledMethodInfo
    ResolveBaseSinkMethod "setRenderDelay" o = BaseSinkSetRenderDelayMethodInfo
    ResolveBaseSinkMethod "setStartTime" o = Gst.Element.ElementSetStartTimeMethodInfo
    ResolveBaseSinkMethod "setState" o = Gst.Element.ElementSetStateMethodInfo
    ResolveBaseSinkMethod "setSync" o = BaseSinkSetSyncMethodInfo
    ResolveBaseSinkMethod "setThrottleTime" o = BaseSinkSetThrottleTimeMethodInfo
    ResolveBaseSinkMethod "setTsOffset" o = BaseSinkSetTsOffsetMethodInfo
    ResolveBaseSinkMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveBaseSinkMethod t BaseSink, O.MethodInfo info BaseSink p) => O.IsLabel t (BaseSink -> 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

#endif

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

getBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> m Bool
getBaseSinkAsync obj = liftIO $ getObjectPropertyBool obj "async"

setBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
setBaseSinkAsync obj val = liftIO $ setObjectPropertyBool obj "async" val

constructBaseSinkAsync :: (IsBaseSink o) => Bool -> IO (GValueConstruct o)
constructBaseSinkAsync val = constructObjectPropertyBool "async" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkAsyncPropertyInfo
instance AttrInfo BaseSinkAsyncPropertyInfo where
    type AttrAllowedOps BaseSinkAsyncPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkAsyncPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint BaseSinkAsyncPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkAsyncPropertyInfo = Bool
    type AttrLabel BaseSinkAsyncPropertyInfo = "async"
    type AttrOrigin BaseSinkAsyncPropertyInfo = BaseSink
    attrGet _ = getBaseSinkAsync
    attrSet _ = setBaseSinkAsync
    attrConstruct _ = constructBaseSinkAsync
    attrClear _ = undefined
#endif

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

getBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> m Word32
getBaseSinkBlocksize obj = liftIO $ getObjectPropertyUInt32 obj "blocksize"

setBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> Word32 -> m ()
setBaseSinkBlocksize obj val = liftIO $ setObjectPropertyUInt32 obj "blocksize" val

constructBaseSinkBlocksize :: (IsBaseSink o) => Word32 -> IO (GValueConstruct o)
constructBaseSinkBlocksize val = constructObjectPropertyUInt32 "blocksize" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkBlocksizePropertyInfo
instance AttrInfo BaseSinkBlocksizePropertyInfo where
    type AttrAllowedOps BaseSinkBlocksizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkBlocksizePropertyInfo = (~) Word32
    type AttrBaseTypeConstraint BaseSinkBlocksizePropertyInfo = IsBaseSink
    type AttrGetType BaseSinkBlocksizePropertyInfo = Word32
    type AttrLabel BaseSinkBlocksizePropertyInfo = "blocksize"
    type AttrOrigin BaseSinkBlocksizePropertyInfo = BaseSink
    attrGet _ = getBaseSinkBlocksize
    attrSet _ = setBaseSinkBlocksize
    attrConstruct _ = constructBaseSinkBlocksize
    attrClear _ = undefined
#endif

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

getBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> m Bool
getBaseSinkEnableLastSample obj = liftIO $ getObjectPropertyBool obj "enable-last-sample"

setBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
setBaseSinkEnableLastSample obj val = liftIO $ setObjectPropertyBool obj "enable-last-sample" val

constructBaseSinkEnableLastSample :: (IsBaseSink o) => Bool -> IO (GValueConstruct o)
constructBaseSinkEnableLastSample val = constructObjectPropertyBool "enable-last-sample" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkEnableLastSamplePropertyInfo
instance AttrInfo BaseSinkEnableLastSamplePropertyInfo where
    type AttrAllowedOps BaseSinkEnableLastSamplePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkEnableLastSamplePropertyInfo = (~) Bool
    type AttrBaseTypeConstraint BaseSinkEnableLastSamplePropertyInfo = IsBaseSink
    type AttrGetType BaseSinkEnableLastSamplePropertyInfo = Bool
    type AttrLabel BaseSinkEnableLastSamplePropertyInfo = "enable-last-sample"
    type AttrOrigin BaseSinkEnableLastSamplePropertyInfo = BaseSink
    attrGet _ = getBaseSinkEnableLastSample
    attrSet _ = setBaseSinkEnableLastSample
    attrConstruct _ = constructBaseSinkEnableLastSample
    attrClear _ = undefined
#endif

-- VVV Prop "last-sample"
   -- Type: TInterface (Name {namespace = "Gst", name = "Sample"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getBaseSinkLastSample :: (MonadIO m, IsBaseSink o) => o -> m (Maybe Gst.Sample.Sample)
getBaseSinkLastSample obj = liftIO $ getObjectPropertyBoxed obj "last-sample" Gst.Sample.Sample

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkLastSamplePropertyInfo
instance AttrInfo BaseSinkLastSamplePropertyInfo where
    type AttrAllowedOps BaseSinkLastSamplePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint BaseSinkLastSamplePropertyInfo = (~) ()
    type AttrBaseTypeConstraint BaseSinkLastSamplePropertyInfo = IsBaseSink
    type AttrGetType BaseSinkLastSamplePropertyInfo = (Maybe Gst.Sample.Sample)
    type AttrLabel BaseSinkLastSamplePropertyInfo = "last-sample"
    type AttrOrigin BaseSinkLastSamplePropertyInfo = BaseSink
    attrGet _ = getBaseSinkLastSample
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "max-bitrate"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> m Word64
getBaseSinkMaxBitrate obj = liftIO $ getObjectPropertyUInt64 obj "max-bitrate"

setBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
setBaseSinkMaxBitrate obj val = liftIO $ setObjectPropertyUInt64 obj "max-bitrate" val

constructBaseSinkMaxBitrate :: (IsBaseSink o) => Word64 -> IO (GValueConstruct o)
constructBaseSinkMaxBitrate val = constructObjectPropertyUInt64 "max-bitrate" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkMaxBitratePropertyInfo
instance AttrInfo BaseSinkMaxBitratePropertyInfo where
    type AttrAllowedOps BaseSinkMaxBitratePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkMaxBitratePropertyInfo = (~) Word64
    type AttrBaseTypeConstraint BaseSinkMaxBitratePropertyInfo = IsBaseSink
    type AttrGetType BaseSinkMaxBitratePropertyInfo = Word64
    type AttrLabel BaseSinkMaxBitratePropertyInfo = "max-bitrate"
    type AttrOrigin BaseSinkMaxBitratePropertyInfo = BaseSink
    attrGet _ = getBaseSinkMaxBitrate
    attrSet _ = setBaseSinkMaxBitrate
    attrConstruct _ = constructBaseSinkMaxBitrate
    attrClear _ = undefined
#endif

-- VVV Prop "max-lateness"
   -- Type: TBasicType TInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> m Int64
getBaseSinkMaxLateness obj = liftIO $ getObjectPropertyInt64 obj "max-lateness"

setBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m ()
setBaseSinkMaxLateness obj val = liftIO $ setObjectPropertyInt64 obj "max-lateness" val

constructBaseSinkMaxLateness :: (IsBaseSink o) => Int64 -> IO (GValueConstruct o)
constructBaseSinkMaxLateness val = constructObjectPropertyInt64 "max-lateness" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkMaxLatenessPropertyInfo
instance AttrInfo BaseSinkMaxLatenessPropertyInfo where
    type AttrAllowedOps BaseSinkMaxLatenessPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkMaxLatenessPropertyInfo = (~) Int64
    type AttrBaseTypeConstraint BaseSinkMaxLatenessPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkMaxLatenessPropertyInfo = Int64
    type AttrLabel BaseSinkMaxLatenessPropertyInfo = "max-lateness"
    type AttrOrigin BaseSinkMaxLatenessPropertyInfo = BaseSink
    attrGet _ = getBaseSinkMaxLateness
    attrSet _ = setBaseSinkMaxLateness
    attrConstruct _ = constructBaseSinkMaxLateness
    attrClear _ = undefined
#endif

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

getBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> m Bool
getBaseSinkQos obj = liftIO $ getObjectPropertyBool obj "qos"

setBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
setBaseSinkQos obj val = liftIO $ setObjectPropertyBool obj "qos" val

constructBaseSinkQos :: (IsBaseSink o) => Bool -> IO (GValueConstruct o)
constructBaseSinkQos val = constructObjectPropertyBool "qos" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkQosPropertyInfo
instance AttrInfo BaseSinkQosPropertyInfo where
    type AttrAllowedOps BaseSinkQosPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkQosPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint BaseSinkQosPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkQosPropertyInfo = Bool
    type AttrLabel BaseSinkQosPropertyInfo = "qos"
    type AttrOrigin BaseSinkQosPropertyInfo = BaseSink
    attrGet _ = getBaseSinkQos
    attrSet _ = setBaseSinkQos
    attrConstruct _ = constructBaseSinkQos
    attrClear _ = undefined
#endif

-- VVV Prop "render-delay"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> m Word64
getBaseSinkRenderDelay obj = liftIO $ getObjectPropertyUInt64 obj "render-delay"

setBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
setBaseSinkRenderDelay obj val = liftIO $ setObjectPropertyUInt64 obj "render-delay" val

constructBaseSinkRenderDelay :: (IsBaseSink o) => Word64 -> IO (GValueConstruct o)
constructBaseSinkRenderDelay val = constructObjectPropertyUInt64 "render-delay" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkRenderDelayPropertyInfo
instance AttrInfo BaseSinkRenderDelayPropertyInfo where
    type AttrAllowedOps BaseSinkRenderDelayPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkRenderDelayPropertyInfo = (~) Word64
    type AttrBaseTypeConstraint BaseSinkRenderDelayPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkRenderDelayPropertyInfo = Word64
    type AttrLabel BaseSinkRenderDelayPropertyInfo = "render-delay"
    type AttrOrigin BaseSinkRenderDelayPropertyInfo = BaseSink
    attrGet _ = getBaseSinkRenderDelay
    attrSet _ = setBaseSinkRenderDelay
    attrConstruct _ = constructBaseSinkRenderDelay
    attrClear _ = undefined
#endif

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

getBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> m Bool
getBaseSinkSync obj = liftIO $ getObjectPropertyBool obj "sync"

setBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
setBaseSinkSync obj val = liftIO $ setObjectPropertyBool obj "sync" val

constructBaseSinkSync :: (IsBaseSink o) => Bool -> IO (GValueConstruct o)
constructBaseSinkSync val = constructObjectPropertyBool "sync" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSyncPropertyInfo
instance AttrInfo BaseSinkSyncPropertyInfo where
    type AttrAllowedOps BaseSinkSyncPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkSyncPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint BaseSinkSyncPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkSyncPropertyInfo = Bool
    type AttrLabel BaseSinkSyncPropertyInfo = "sync"
    type AttrOrigin BaseSinkSyncPropertyInfo = BaseSink
    attrGet _ = getBaseSinkSync
    attrSet _ = setBaseSinkSync
    attrConstruct _ = constructBaseSinkSync
    attrClear _ = undefined
#endif

-- VVV Prop "throttle-time"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> m Word64
getBaseSinkThrottleTime obj = liftIO $ getObjectPropertyUInt64 obj "throttle-time"

setBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
setBaseSinkThrottleTime obj val = liftIO $ setObjectPropertyUInt64 obj "throttle-time" val

constructBaseSinkThrottleTime :: (IsBaseSink o) => Word64 -> IO (GValueConstruct o)
constructBaseSinkThrottleTime val = constructObjectPropertyUInt64 "throttle-time" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkThrottleTimePropertyInfo
instance AttrInfo BaseSinkThrottleTimePropertyInfo where
    type AttrAllowedOps BaseSinkThrottleTimePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkThrottleTimePropertyInfo = (~) Word64
    type AttrBaseTypeConstraint BaseSinkThrottleTimePropertyInfo = IsBaseSink
    type AttrGetType BaseSinkThrottleTimePropertyInfo = Word64
    type AttrLabel BaseSinkThrottleTimePropertyInfo = "throttle-time"
    type AttrOrigin BaseSinkThrottleTimePropertyInfo = BaseSink
    attrGet _ = getBaseSinkThrottleTime
    attrSet _ = setBaseSinkThrottleTime
    attrConstruct _ = constructBaseSinkThrottleTime
    attrClear _ = undefined
#endif

-- VVV Prop "ts-offset"
   -- Type: TBasicType TInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> m Int64
getBaseSinkTsOffset obj = liftIO $ getObjectPropertyInt64 obj "ts-offset"

setBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m ()
setBaseSinkTsOffset obj val = liftIO $ setObjectPropertyInt64 obj "ts-offset" val

constructBaseSinkTsOffset :: (IsBaseSink o) => Int64 -> IO (GValueConstruct o)
constructBaseSinkTsOffset val = constructObjectPropertyInt64 "ts-offset" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkTsOffsetPropertyInfo
instance AttrInfo BaseSinkTsOffsetPropertyInfo where
    type AttrAllowedOps BaseSinkTsOffsetPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint BaseSinkTsOffsetPropertyInfo = (~) Int64
    type AttrBaseTypeConstraint BaseSinkTsOffsetPropertyInfo = IsBaseSink
    type AttrGetType BaseSinkTsOffsetPropertyInfo = Int64
    type AttrLabel BaseSinkTsOffsetPropertyInfo = "ts-offset"
    type AttrOrigin BaseSinkTsOffsetPropertyInfo = BaseSink
    attrGet _ = getBaseSinkTsOffset
    attrSet _ = setBaseSinkTsOffset
    attrConstruct _ = constructBaseSinkTsOffset
    attrClear _ = undefined
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList BaseSink
type instance O.AttributeList BaseSink = BaseSinkAttributeList
type BaseSinkAttributeList = ('[ '("async", BaseSinkAsyncPropertyInfo), '("blocksize", BaseSinkBlocksizePropertyInfo), '("enableLastSample", BaseSinkEnableLastSamplePropertyInfo), '("lastSample", BaseSinkLastSamplePropertyInfo), '("maxBitrate", BaseSinkMaxBitratePropertyInfo), '("maxLateness", BaseSinkMaxLatenessPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("qos", BaseSinkQosPropertyInfo), '("renderDelay", BaseSinkRenderDelayPropertyInfo), '("sync", BaseSinkSyncPropertyInfo), '("throttleTime", BaseSinkThrottleTimePropertyInfo), '("tsOffset", BaseSinkTsOffsetPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
baseSinkAsync :: AttrLabelProxy "async"
baseSinkAsync = AttrLabelProxy

baseSinkBlocksize :: AttrLabelProxy "blocksize"
baseSinkBlocksize = AttrLabelProxy

baseSinkEnableLastSample :: AttrLabelProxy "enableLastSample"
baseSinkEnableLastSample = AttrLabelProxy

baseSinkLastSample :: AttrLabelProxy "lastSample"
baseSinkLastSample = AttrLabelProxy

baseSinkMaxBitrate :: AttrLabelProxy "maxBitrate"
baseSinkMaxBitrate = AttrLabelProxy

baseSinkMaxLateness :: AttrLabelProxy "maxLateness"
baseSinkMaxLateness = AttrLabelProxy

baseSinkQos :: AttrLabelProxy "qos"
baseSinkQos = AttrLabelProxy

baseSinkRenderDelay :: AttrLabelProxy "renderDelay"
baseSinkRenderDelay = AttrLabelProxy

baseSinkSync :: AttrLabelProxy "sync"
baseSinkSync = AttrLabelProxy

baseSinkThrottleTime :: AttrLabelProxy "throttleTime"
baseSinkThrottleTime = AttrLabelProxy

baseSinkTsOffset :: AttrLabelProxy "tsOffset"
baseSinkTsOffset = AttrLabelProxy

#endif

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

#endif

-- method BaseSink::do_preroll
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mini object that caused the preroll", 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_base_sink_do_preroll" gst_base_sink_do_preroll :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Ptr Gst.MiniObject.MiniObject ->        -- obj : TInterface (Name {namespace = "Gst", name = "MiniObject"})
    IO CUInt

{- |
If the /@sink@/ spawns its own thread for pulling buffers from upstream it
should call this method after it has pulled a buffer. If the element needed
to preroll, this function will perform the preroll and will then block
until the element state is changed.

This function should be called with the PREROLL_LOCK held.
-}
baseSinkDoPreroll ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Gst.MiniObject.MiniObject
    {- ^ /@obj@/: the mini object that caused the preroll -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturnOk' if the preroll completed and processing can
continue. Any other return value should be returned from the render vmethod. -}
baseSinkDoPreroll sink obj = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    obj' <- unsafeManagedPtrGetPtr obj
    result <- gst_base_sink_do_preroll sink' obj'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr sink
    touchManagedPtr obj
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkDoPrerollMethodInfo
instance (signature ~ (Gst.MiniObject.MiniObject -> m Gst.Enums.FlowReturn), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkDoPrerollMethodInfo a signature where
    overloadedMethod _ = baseSinkDoPreroll

#endif

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

foreign import ccall "gst_base_sink_get_blocksize" gst_base_sink_get_blocksize :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Word32

{- |
Get the number of bytes that the sink will pull when it is operating in pull
mode.
-}
baseSinkGetBlocksize ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> m Word32
    {- ^ __Returns:__ the number of bytes /@sink@/ will pull in pull mode. -}
baseSinkGetBlocksize sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_blocksize sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetBlocksizeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetBlocksizeMethodInfo a signature where
    overloadedMethod _ = baseSinkGetBlocksize

#endif

-- method BaseSink::get_drop_out_of_segment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_sink_get_drop_out_of_segment" gst_base_sink_get_drop_out_of_segment :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CInt

{- |
Checks if /@sink@/ is currently configured to drop buffers which are outside
the current segment

@since 1.12
-}
baseSinkGetDropOutOfSegment ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the sink is configured to drop buffers outside the
current segment. -}
baseSinkGetDropOutOfSegment sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_drop_out_of_segment sink'
    let result' = (/= 0) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetDropOutOfSegmentMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetDropOutOfSegmentMethodInfo a signature where
    overloadedMethod _ = baseSinkGetDropOutOfSegment

#endif

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

foreign import ccall "gst_base_sink_get_last_sample" gst_base_sink_get_last_sample :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO (Ptr Gst.Sample.Sample)

{- |
Get the last sample that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails.

The 'GI.Gst.Structs.Caps.Caps' on the sample can be used to determine the type of the buffer.

Free-function: gst_sample_unref
-}
baseSinkGetLastSample ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m (Maybe Gst.Sample.Sample)
    {- ^ __Returns:__ a 'GI.Gst.Structs.Sample.Sample'. @/gst_sample_unref()/@ after
    usage.  This function returns 'Nothing' when no buffer has arrived in the
    sink yet or when the sink is not in PAUSED or PLAYING. -}
baseSinkGetLastSample sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_last_sample sink'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Gst.Sample.Sample) result'
        return result''
    touchManagedPtr sink
    return maybeResult

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetLastSampleMethodInfo
instance (signature ~ (m (Maybe Gst.Sample.Sample)), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetLastSampleMethodInfo a signature where
    overloadedMethod _ = baseSinkGetLastSample

#endif

-- method BaseSink::get_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_base_sink_get_latency" gst_base_sink_get_latency :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Word64

{- |
Get the currently configured latency.
-}
baseSinkGetLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Word64
    {- ^ __Returns:__ The configured latency. -}
baseSinkGetLatency sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_latency sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetLatencyMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetLatencyMethodInfo a signature where
    overloadedMethod _ = baseSinkGetLatency

#endif

-- method BaseSink::get_max_bitrate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", 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_base_sink_get_max_bitrate" gst_base_sink_get_max_bitrate :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Word64

{- |
Get the maximum amount of bits per second that the sink will render.

@since 1.2
-}
baseSinkGetMaxBitrate ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> m Word64
    {- ^ __Returns:__ the maximum number of bits per second /@sink@/ will render. -}
baseSinkGetMaxBitrate sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_max_bitrate sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetMaxBitrateMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetMaxBitrateMethodInfo a signature where
    overloadedMethod _ = baseSinkGetMaxBitrate

#endif

-- method BaseSink::get_max_lateness
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_sink_get_max_lateness" gst_base_sink_get_max_lateness :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Int64

{- |
Gets the max lateness value. See 'GI.GstBase.Objects.BaseSink.baseSinkSetMaxLateness' for
more details.
-}
baseSinkGetMaxLateness ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Int64
    {- ^ __Returns:__ The maximum time in nanoseconds that a buffer can be late
before it is dropped and not rendered. A value of -1 means an
unlimited time. -}
baseSinkGetMaxLateness sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_max_lateness sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetMaxLatenessMethodInfo
instance (signature ~ (m Int64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetMaxLatenessMethodInfo a signature where
    overloadedMethod _ = baseSinkGetMaxLateness

#endif

-- method BaseSink::get_render_delay
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", 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_base_sink_get_render_delay" gst_base_sink_get_render_delay :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Word64

{- |
Get the render delay of /@sink@/. see 'GI.GstBase.Objects.BaseSink.baseSinkSetRenderDelay' for more
information about the render delay.
-}
baseSinkGetRenderDelay ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> m Word64
    {- ^ __Returns:__ the render delay of /@sink@/. -}
baseSinkGetRenderDelay sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_render_delay sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetRenderDelayMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetRenderDelayMethodInfo a signature where
    overloadedMethod _ = baseSinkGetRenderDelay

#endif

-- method BaseSink::get_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_sink_get_sync" gst_base_sink_get_sync :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CInt

{- |
Checks if /@sink@/ is currently configured to synchronize against the
clock.
-}
baseSinkGetSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the sink is configured to synchronize against the clock. -}
baseSinkGetSync sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_sync sink'
    let result' = (/= 0) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetSyncMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetSyncMethodInfo a signature where
    overloadedMethod _ = baseSinkGetSync

#endif

-- method BaseSink::get_throttle_time
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", 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_base_sink_get_throttle_time" gst_base_sink_get_throttle_time :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Word64

{- |
Get the time that will be inserted between frames to control the
maximum buffers per second.
-}
baseSinkGetThrottleTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> m Word64
    {- ^ __Returns:__ the number of nanoseconds /@sink@/ will put between frames. -}
baseSinkGetThrottleTime sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_throttle_time sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetThrottleTimeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetThrottleTimeMethodInfo a signature where
    overloadedMethod _ = baseSinkGetThrottleTime

#endif

-- method BaseSink::get_ts_offset
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt64)
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_sink_get_ts_offset" gst_base_sink_get_ts_offset :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO Int64

{- |
Get the synchronisation offset of /@sink@/.
-}
baseSinkGetTsOffset ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Int64
    {- ^ __Returns:__ The synchronisation offset. -}
baseSinkGetTsOffset sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_get_ts_offset sink'
    touchManagedPtr sink
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkGetTsOffsetMethodInfo
instance (signature ~ (m Int64), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkGetTsOffsetMethodInfo a signature where
    overloadedMethod _ = baseSinkGetTsOffset

#endif

-- method BaseSink::is_async_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_sink_is_async_enabled" gst_base_sink_is_async_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CInt

{- |
Checks if /@sink@/ is currently configured to perform asynchronous state
changes to PAUSED.
-}
baseSinkIsAsyncEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the sink is configured to perform asynchronous state
changes. -}
baseSinkIsAsyncEnabled sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_is_async_enabled sink'
    let result' = (/= 0) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkIsAsyncEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkIsAsyncEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkIsAsyncEnabled

#endif

-- method BaseSink::is_last_sample_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_sink_is_last_sample_enabled" gst_base_sink_is_last_sample_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CInt

{- |
Checks if /@sink@/ is currently configured to store the last received sample in
the last-sample property.
-}
baseSinkIsLastSampleEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the sink is configured to store the last received sample. -}
baseSinkIsLastSampleEnabled sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_is_last_sample_enabled sink'
    let result' = (/= 0) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkIsLastSampleEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkIsLastSampleEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkIsLastSampleEnabled

#endif

-- method BaseSink::is_qos_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_sink_is_qos_enabled" gst_base_sink_is_qos_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CInt

{- |
Checks if /@sink@/ is currently configured to send Quality-of-Service events
upstream.
-}
baseSinkIsQosEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the sink is configured to perform Quality-of-Service. -}
baseSinkIsQosEnabled sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_is_qos_enabled sink'
    let result' = (/= 0) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkIsQosEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkIsQosEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkIsQosEnabled

#endif

-- method BaseSink::query_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "live", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "if the sink is live", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "upstream_live", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "if an upstream element is live", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "min_latency", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the min latency of the upstream elements", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "max_latency", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the max latency of the upstream elements", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_sink_query_latency" gst_base_sink_query_latency :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Ptr CInt ->                             -- live : TBasicType TBoolean
    Ptr CInt ->                             -- upstream_live : TBasicType TBoolean
    Ptr Word64 ->                           -- min_latency : TBasicType TUInt64
    Ptr Word64 ->                           -- max_latency : TBasicType TUInt64
    IO CInt

{- |
Query the sink for the latency parameters. The latency will be queried from
the upstream elements. /@live@/ will be 'True' if /@sink@/ is configured to
synchronize against the clock. /@upstreamLive@/ will be 'True' if an upstream
element is live.

If both /@live@/ and /@upstreamLive@/ are 'True', the sink will want to compensate
for the latency introduced by the upstream elements by setting the
/@minLatency@/ to a strictly positive value.

This function is mostly used by subclasses.
-}
baseSinkQueryLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m ((Bool, Bool, Bool, Word64, Word64))
    {- ^ __Returns:__ 'True' if the query succeeded. -}
baseSinkQueryLatency sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    live <- allocMem :: IO (Ptr CInt)
    upstreamLive <- allocMem :: IO (Ptr CInt)
    minLatency <- allocMem :: IO (Ptr Word64)
    maxLatency <- allocMem :: IO (Ptr Word64)
    result <- gst_base_sink_query_latency sink' live upstreamLive minLatency maxLatency
    let result' = (/= 0) result
    live' <- peek live
    let live'' = (/= 0) live'
    upstreamLive' <- peek upstreamLive
    let upstreamLive'' = (/= 0) upstreamLive'
    minLatency' <- peek minLatency
    maxLatency' <- peek maxLatency
    touchManagedPtr sink
    freeMem live
    freeMem upstreamLive
    freeMem minLatency
    freeMem maxLatency
    return (result', live'', upstreamLive'', minLatency', maxLatency')

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkQueryLatencyMethodInfo
instance (signature ~ (m ((Bool, Bool, Bool, Word64, Word64))), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkQueryLatencyMethodInfo a signature where
    overloadedMethod _ = baseSinkQueryLatency

#endif

-- method BaseSink::set_async_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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 "the new async value.", 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_sink_set_async_enabled" gst_base_sink_set_async_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Configures /@sink@/ to perform all state changes asynchronously. When async is
disabled, the sink will immediately go to PAUSED instead of waiting for a
preroll buffer. This feature is useful if the sink does not synchronize
against the clock or when it is dealing with sparse streams.
-}
baseSinkSetAsyncEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Bool
    {- ^ /@enabled@/: the new async value. -}
    -> m ()
baseSinkSetAsyncEnabled sink enabled = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_base_sink_set_async_enabled sink' enabled'
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetAsyncEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetAsyncEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkSetAsyncEnabled

#endif

-- method BaseSink::set_blocksize
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "blocksize", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the blocksize in bytes", 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_sink_set_blocksize" gst_base_sink_set_blocksize :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word32 ->                               -- blocksize : TBasicType TUInt
    IO ()

{- |
Set the number of bytes that the sink will pull when it is operating in pull
mode.
-}
baseSinkSetBlocksize ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> Word32
    {- ^ /@blocksize@/: the blocksize in bytes -}
    -> m ()
baseSinkSetBlocksize sink blocksize = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_blocksize sink' blocksize
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetBlocksizeMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetBlocksizeMethodInfo a signature where
    overloadedMethod _ = baseSinkSetBlocksize

#endif

-- method BaseSink::set_drop_out_of_segment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "drop_out_of_segment", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "drop buffers outside the segment", 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_sink_set_drop_out_of_segment" gst_base_sink_set_drop_out_of_segment :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    CInt ->                                 -- drop_out_of_segment : TBasicType TBoolean
    IO ()

{- |
Configure /@sink@/ to drop buffers which are outside the current segment

@since 1.12
-}
baseSinkSetDropOutOfSegment ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Bool
    {- ^ /@dropOutOfSegment@/: drop buffers outside the segment -}
    -> m ()
baseSinkSetDropOutOfSegment sink dropOutOfSegment = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    let dropOutOfSegment' = (fromIntegral . fromEnum) dropOutOfSegment
    gst_base_sink_set_drop_out_of_segment sink' dropOutOfSegment'
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetDropOutOfSegmentMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetDropOutOfSegmentMethodInfo a signature where
    overloadedMethod _ = baseSinkSetDropOutOfSegment

#endif

-- method BaseSink::set_last_sample_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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 "the new enable-last-sample value.", 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_sink_set_last_sample_enabled" gst_base_sink_set_last_sample_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Configures /@sink@/ to store the last received sample in the last-sample
property.
-}
baseSinkSetLastSampleEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Bool
    {- ^ /@enabled@/: the new enable-last-sample value. -}
    -> m ()
baseSinkSetLastSampleEnabled sink enabled = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_base_sink_set_last_sample_enabled sink' enabled'
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetLastSampleEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetLastSampleEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkSetLastSampleEnabled

#endif

-- method BaseSink::set_max_bitrate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "max_bitrate", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the max_bitrate in bits per second", 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_sink_set_max_bitrate" gst_base_sink_set_max_bitrate :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word64 ->                               -- max_bitrate : TBasicType TUInt64
    IO ()

{- |
Set the maximum amount of bits per second that the sink will render.

@since 1.2
-}
baseSinkSetMaxBitrate ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> Word64
    {- ^ /@maxBitrate@/: the max_bitrate in bits per second -}
    -> m ()
baseSinkSetMaxBitrate sink maxBitrate = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_max_bitrate sink' maxBitrate
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetMaxBitrateMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetMaxBitrateMethodInfo a signature where
    overloadedMethod _ = baseSinkSetMaxBitrate

#endif

-- method BaseSink::set_max_lateness
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "max_lateness", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new max lateness value.", 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_sink_set_max_lateness" gst_base_sink_set_max_lateness :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Int64 ->                                -- max_lateness : TBasicType TInt64
    IO ()

{- |
Sets the new max lateness value to /@maxLateness@/. This value is
used to decide if a buffer should be dropped or not based on the
buffer timestamp and the current clock time. A value of -1 means
an unlimited time.
-}
baseSinkSetMaxLateness ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Int64
    {- ^ /@maxLateness@/: the new max lateness value. -}
    -> m ()
baseSinkSetMaxLateness sink maxLateness = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_max_lateness sink' maxLateness
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetMaxLatenessMethodInfo
instance (signature ~ (Int64 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetMaxLatenessMethodInfo a signature where
    overloadedMethod _ = baseSinkSetMaxLateness

#endif

-- method BaseSink::set_qos_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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 "the new qos value.", 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_sink_set_qos_enabled" gst_base_sink_set_qos_enabled :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Configures /@sink@/ to send Quality-of-Service events upstream.
-}
baseSinkSetQosEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Bool
    {- ^ /@enabled@/: the new qos value. -}
    -> m ()
baseSinkSetQosEnabled sink enabled = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    let enabled' = (fromIntegral . fromEnum) enabled
    gst_base_sink_set_qos_enabled sink' enabled'
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetQosEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetQosEnabledMethodInfo a signature where
    overloadedMethod _ = baseSinkSetQosEnabled

#endif

-- method BaseSink::set_render_delay
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "delay", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new delay", 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_sink_set_render_delay" gst_base_sink_set_render_delay :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word64 ->                               -- delay : TBasicType TUInt64
    IO ()

{- |
Set the render delay in /@sink@/ to /@delay@/. The render delay is the time
between actual rendering of a buffer and its synchronisation time. Some
devices might delay media rendering which can be compensated for with this
function.

After calling this function, this sink will report additional latency and
other sinks will adjust their latency to delay the rendering of their media.

This function is usually called by subclasses.
-}
baseSinkSetRenderDelay ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> Word64
    {- ^ /@delay@/: the new delay -}
    -> m ()
baseSinkSetRenderDelay sink delay = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_render_delay sink' delay
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetRenderDelayMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetRenderDelayMethodInfo a signature where
    overloadedMethod _ = baseSinkSetRenderDelay

#endif

-- method BaseSink::set_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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 "the new sync value.", 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_sink_set_sync" gst_base_sink_set_sync :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    CInt ->                                 -- sync : TBasicType TBoolean
    IO ()

{- |
Configures /@sink@/ to synchronize on the clock or not. When
/@sync@/ is 'False', incoming samples will be played as fast as
possible. If /@sync@/ is 'True', the timestamps of the incoming
buffers will be used to schedule the exact render time of its
contents.
-}
baseSinkSetSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Bool
    {- ^ /@sync@/: the new sync value. -}
    -> m ()
baseSinkSetSync sink sync = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    let sync' = (fromIntegral . fromEnum) sync
    gst_base_sink_set_sync sink' sync'
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetSyncMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetSyncMethodInfo a signature where
    overloadedMethod _ = baseSinkSetSync

#endif

-- method BaseSink::set_throttle_time
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBaseSink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "throttle", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the throttle time in nanoseconds", 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_sink_set_throttle_time" gst_base_sink_set_throttle_time :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word64 ->                               -- throttle : TBasicType TUInt64
    IO ()

{- |
Set the time that will be inserted between rendered buffers. This
can be used to control the maximum buffers per second that the sink
will render.
-}
baseSinkSetThrottleTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: a 'GI.GstBase.Objects.BaseSink.BaseSink' -}
    -> Word64
    {- ^ /@throttle@/: the throttle time in nanoseconds -}
    -> m ()
baseSinkSetThrottleTime sink throttle = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_throttle_time sink' throttle
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetThrottleTimeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetThrottleTimeMethodInfo a signature where
    overloadedMethod _ = baseSinkSetThrottleTime

#endif

-- method BaseSink::set_ts_offset
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new offset", 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_sink_set_ts_offset" gst_base_sink_set_ts_offset :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Int64 ->                                -- offset : TBasicType TInt64
    IO ()

{- |
Adjust the synchronisation of /@sink@/ with /@offset@/. A negative value will
render buffers earlier than their timestamp. A positive value will delay
rendering. This function can be used to fix playback of badly timestamped
buffers.
-}
baseSinkSetTsOffset ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Int64
    {- ^ /@offset@/: the new offset -}
    -> m ()
baseSinkSetTsOffset sink offset = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    gst_base_sink_set_ts_offset sink' offset
    touchManagedPtr sink
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkSetTsOffsetMethodInfo
instance (signature ~ (Int64 -> m ()), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkSetTsOffsetMethodInfo a signature where
    overloadedMethod _ = baseSinkSetTsOffset

#endif

-- method BaseSink::wait
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the running_time to be reached", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "jitter", argType = TBasicType TInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the jitter to be filled with time diff, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_sink_wait" gst_base_sink_wait :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word64 ->                               -- time : TBasicType TUInt64
    Ptr Int64 ->                            -- jitter : TBasicType TInt64
    IO CUInt

{- |
This function will wait for preroll to complete and will then block until /@time@/
is reached. It is usually called by subclasses that use their own internal
synchronisation but want to let some synchronization (like EOS) be handled
by the base class.

This function should only be called with the PREROLL_LOCK held (like when
receiving an EOS event in the ::event vmethod or when handling buffers in
::render).

The /@time@/ argument should be the running_time of when the timeout should happen
and will be adjusted with any latency and offset configured in the sink.
-}
baseSinkWait ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Word64
    {- ^ /@time@/: the running_time to be reached -}
    -> m ((Gst.Enums.FlowReturn, Int64))
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturn' -}
baseSinkWait sink time = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    jitter <- allocMem :: IO (Ptr Int64)
    result <- gst_base_sink_wait sink' time jitter
    let result' = (toEnum . fromIntegral) result
    jitter' <- peek jitter
    touchManagedPtr sink
    freeMem jitter
    return (result', jitter')

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkWaitMethodInfo
instance (signature ~ (Word64 -> m ((Gst.Enums.FlowReturn, Int64))), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkWaitMethodInfo a signature where
    overloadedMethod _ = baseSinkWait

#endif

-- method BaseSink::wait_clock
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the running_time to be reached", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "jitter", argType = TBasicType TInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the jitter to be filled with time diff, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "ClockReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_base_sink_wait_clock" gst_base_sink_wait_clock :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    Word64 ->                               -- time : TBasicType TUInt64
    Ptr Int64 ->                            -- jitter : TBasicType TInt64
    IO CUInt

{- |
This function will block until /@time@/ is reached. It is usually called by
subclasses that use their own internal synchronisation.

If /@time@/ is not valid, no synchronisation is done and 'GI.Gst.Enums.ClockReturnBadtime' is
returned. Likewise, if synchronisation is disabled in the element or there
is no clock, no synchronisation is done and 'GI.Gst.Enums.ClockReturnBadtime' is returned.

This function should only be called with the PREROLL_LOCK held, like when
receiving an EOS event in the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/event/@() vmethod or when
receiving a buffer in
the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() vmethod.

The /@time@/ argument should be the running_time of when this method should
return and is not adjusted with any latency or offset configured in the
sink.
-}
baseSinkWaitClock ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> Word64
    {- ^ /@time@/: the running_time to be reached -}
    -> m ((Gst.Enums.ClockReturn, Int64))
    {- ^ __Returns:__ 'GI.Gst.Enums.ClockReturn' -}
baseSinkWaitClock sink time = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    jitter <- allocMem :: IO (Ptr Int64)
    result <- gst_base_sink_wait_clock sink' time jitter
    let result' = (toEnum . fromIntegral) result
    jitter' <- peek jitter
    touchManagedPtr sink
    freeMem jitter
    return (result', jitter')

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkWaitClockMethodInfo
instance (signature ~ (Word64 -> m ((Gst.Enums.ClockReturn, Int64))), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkWaitClockMethodInfo a signature where
    overloadedMethod _ = baseSinkWaitClock

#endif

-- method BaseSink::wait_preroll
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "sink", argType = TInterface (Name {namespace = "GstBase", name = "BaseSink"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink", 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_base_sink_wait_preroll" gst_base_sink_wait_preroll :: 
    Ptr BaseSink ->                         -- sink : TInterface (Name {namespace = "GstBase", name = "BaseSink"})
    IO CUInt

{- |
If the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() method performs its own synchronisation
against the clock it must unblock when going from PLAYING to the PAUSED state
and call this method before continuing to render the remaining data.

If the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() method can block on something else than
the clock, it must also be ready to unblock immediately on
the 'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/unlock/@() method and cause the
'GI.GstBase.Structs.BaseSinkClass.BaseSinkClass'.@/render/@() method to immediately call this function.
In this case, the subclass must be prepared to continue rendering where it
left off if this function returns 'GI.Gst.Enums.FlowReturnOk'.

This function will block until a state change to PLAYING happens (in which
case this function returns 'GI.Gst.Enums.FlowReturnOk') or the processing must be stopped due
to a state change to READY or a FLUSH event (in which case this function
returns 'GI.Gst.Enums.FlowReturnFlushing').

This function should only be called with the PREROLL_LOCK held, like in the
render function.
-}
baseSinkWaitPreroll ::
    (B.CallStack.HasCallStack, MonadIO m, IsBaseSink a) =>
    a
    {- ^ /@sink@/: the sink -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturnOk' if the preroll completed and processing can
continue. Any other return value should be returned from the render vmethod. -}
baseSinkWaitPreroll sink = liftIO $ do
    sink' <- unsafeManagedPtrCastPtr sink
    result <- gst_base_sink_wait_preroll sink'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr sink
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data BaseSinkWaitPrerollMethodInfo
instance (signature ~ (m Gst.Enums.FlowReturn), MonadIO m, IsBaseSink a) => O.MethodInfo BaseSinkWaitPrerollMethodInfo a signature where
    overloadedMethod _ = baseSinkWaitPreroll

#endif