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

This base class is for video encoders turning raw video into
encoded video data.

GstVideoEncoder and subclass should cooperate as follows.

== Configuration

  * Initially, GstVideoEncoder calls /@start@/ when the encoder element
    is activated, which allows subclass to perform any global setup.
  * GstVideoEncoder calls /@setFormat@/ to inform subclass of the format
    of input video data that it is about to receive.  Subclass should
    setup for encoding and configure base class as appropriate
    (e.g. latency). While unlikely, it might be called more than once,
    if changing input parameters require reconfiguration.  Baseclass
    will ensure that processing of current configuration is finished.
  * GstVideoEncoder calls /@stop@/ at end of all processing.

== Data processing

    * Base class collects input data and metadata into a frame and hands
      this to subclass\' /@handleFrame@/.

    * If codec processing results in encoded data, subclass should call
      /@gstVideoEncoderFinishFrame@/ to have encoded data pushed
      downstream.

    * If implemented, baseclass calls subclass /@prePush@/ just prior to
      pushing to allow subclasses to modify some metadata on the buffer.
      If it returns GST_FLOW_OK, the buffer is pushed downstream.

    * GstVideoEncoderClass will handle both srcpad and sinkpad events.
      Sink events will be passed to subclass if /@event@/ callback has been
      provided.

== Shutdown phase

  * GstVideoEncoder class calls /@stop@/ to inform the subclass that data
    parsing will be stopped.

Subclass is responsible for providing pad template caps for
source and sink pads. The pads need to be named \"sink\" and \"src\". It should
also be able to provide fixed src pad caps in /@getcaps@/ by the time it calls
/@gstVideoEncoderFinishFrame@/.

Things that subclass need to take care of:

  * Provide pad templates
  * Provide source pad caps before pushing the first buffer
  * Accept data in /@handleFrame@/ and provide encoded results to
     /@gstVideoEncoderFinishFrame@/.
-}

module GI.GstVideo.Objects.VideoEncoder
    ( 

-- * Exported types
    VideoEncoder(..)                        ,
    IsVideoEncoder                          ,
    toVideoEncoder                          ,
    noVideoEncoder                          ,


 -- * Methods
-- ** allocateOutputBuffer #method:allocateOutputBuffer#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderAllocateOutputBufferMethodInfo,
#endif
    videoEncoderAllocateOutputBuffer        ,


-- ** allocateOutputFrame #method:allocateOutputFrame#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderAllocateOutputFrameMethodInfo,
#endif
    videoEncoderAllocateOutputFrame         ,


-- ** finishFrame #method:finishFrame#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderFinishFrameMethodInfo       ,
#endif
    videoEncoderFinishFrame                 ,


-- ** getAllocator #method:getAllocator#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderGetAllocatorMethodInfo      ,
#endif
    videoEncoderGetAllocator                ,


-- ** getFrame #method:getFrame#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderGetFrameMethodInfo          ,
#endif
    videoEncoderGetFrame                    ,


-- ** getFrames #method:getFrames#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderGetFramesMethodInfo         ,
#endif
    videoEncoderGetFrames                   ,


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


-- ** getOldestFrame #method:getOldestFrame#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderGetOldestFrameMethodInfo    ,
#endif
    videoEncoderGetOldestFrame              ,


-- ** getOutputState #method:getOutputState#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderGetOutputStateMethodInfo    ,
#endif
    videoEncoderGetOutputState              ,


-- ** mergeTags #method:mergeTags#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderMergeTagsMethodInfo         ,
#endif
    videoEncoderMergeTags                   ,


-- ** negotiate #method:negotiate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderNegotiateMethodInfo         ,
#endif
    videoEncoderNegotiate                   ,


-- ** proxyGetcaps #method:proxyGetcaps#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderProxyGetcapsMethodInfo      ,
#endif
    videoEncoderProxyGetcaps                ,


-- ** setHeaders #method:setHeaders#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderSetHeadersMethodInfo        ,
#endif
    videoEncoderSetHeaders                  ,


-- ** setLatency #method:setLatency#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderSetLatencyMethodInfo        ,
#endif
    videoEncoderSetLatency                  ,


-- ** setMinPts #method:setMinPts#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderSetMinPtsMethodInfo         ,
#endif
    videoEncoderSetMinPts                   ,


-- ** setOutputState #method:setOutputState#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoEncoderSetOutputStateMethodInfo    ,
#endif
    videoEncoderSetOutputState              ,




    ) 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.Interfaces.Preset as Gst.Preset
import qualified GI.Gst.Objects.Allocator as Gst.Allocator
import qualified GI.Gst.Objects.Element as Gst.Element
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Structs.AllocationParams as Gst.AllocationParams
import qualified GI.Gst.Structs.Buffer as Gst.Buffer
import qualified GI.Gst.Structs.Caps as Gst.Caps
import qualified GI.Gst.Structs.TagList as Gst.TagList
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoCodecFrame as GstVideo.VideoCodecFrame
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoCodecState as GstVideo.VideoCodecState

newtype VideoEncoder = VideoEncoder (ManagedPtr VideoEncoder)
foreign import ccall "gst_video_encoder_get_type"
    c_gst_video_encoder_get_type :: IO GType

instance GObject VideoEncoder where
    gobjectType _ = c_gst_video_encoder_get_type
    

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

toVideoEncoder :: (MonadIO m, IsVideoEncoder o) => o -> m VideoEncoder
toVideoEncoder = liftIO . unsafeCastTo VideoEncoder

noVideoEncoder :: Maybe VideoEncoder
noVideoEncoder = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveVideoEncoderMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoEncoderMethod "abortState" o = Gst.Element.ElementAbortStateMethodInfo
    ResolveVideoEncoderMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveVideoEncoderMethod "addPad" o = Gst.Element.ElementAddPadMethodInfo
    ResolveVideoEncoderMethod "addPropertyDeepNotifyWatch" o = Gst.Element.ElementAddPropertyDeepNotifyWatchMethodInfo
    ResolveVideoEncoderMethod "addPropertyNotifyWatch" o = Gst.Element.ElementAddPropertyNotifyWatchMethodInfo
    ResolveVideoEncoderMethod "allocateOutputBuffer" o = VideoEncoderAllocateOutputBufferMethodInfo
    ResolveVideoEncoderMethod "allocateOutputFrame" o = VideoEncoderAllocateOutputFrameMethodInfo
    ResolveVideoEncoderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveVideoEncoderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveVideoEncoderMethod "callAsync" o = Gst.Element.ElementCallAsyncMethodInfo
    ResolveVideoEncoderMethod "changeState" o = Gst.Element.ElementChangeStateMethodInfo
    ResolveVideoEncoderMethod "continueState" o = Gst.Element.ElementContinueStateMethodInfo
    ResolveVideoEncoderMethod "createAllPads" o = Gst.Element.ElementCreateAllPadsMethodInfo
    ResolveVideoEncoderMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveVideoEncoderMethod "deletePreset" o = Gst.Preset.PresetDeletePresetMethodInfo
    ResolveVideoEncoderMethod "finishFrame" o = VideoEncoderFinishFrameMethodInfo
    ResolveVideoEncoderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveVideoEncoderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveVideoEncoderMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveVideoEncoderMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveVideoEncoderMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveVideoEncoderMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveVideoEncoderMethod "isEditable" o = Gst.Preset.PresetIsEditableMethodInfo
    ResolveVideoEncoderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveVideoEncoderMethod "isLockedState" o = Gst.Element.ElementIsLockedStateMethodInfo
    ResolveVideoEncoderMethod "iteratePads" o = Gst.Element.ElementIteratePadsMethodInfo
    ResolveVideoEncoderMethod "iterateSinkPads" o = Gst.Element.ElementIterateSinkPadsMethodInfo
    ResolveVideoEncoderMethod "iterateSrcPads" o = Gst.Element.ElementIterateSrcPadsMethodInfo
    ResolveVideoEncoderMethod "link" o = Gst.Element.ElementLinkMethodInfo
    ResolveVideoEncoderMethod "linkFiltered" o = Gst.Element.ElementLinkFilteredMethodInfo
    ResolveVideoEncoderMethod "linkPads" o = Gst.Element.ElementLinkPadsMethodInfo
    ResolveVideoEncoderMethod "linkPadsFiltered" o = Gst.Element.ElementLinkPadsFilteredMethodInfo
    ResolveVideoEncoderMethod "linkPadsFull" o = Gst.Element.ElementLinkPadsFullMethodInfo
    ResolveVideoEncoderMethod "loadPreset" o = Gst.Preset.PresetLoadPresetMethodInfo
    ResolveVideoEncoderMethod "lostState" o = Gst.Element.ElementLostStateMethodInfo
    ResolveVideoEncoderMethod "mergeTags" o = VideoEncoderMergeTagsMethodInfo
    ResolveVideoEncoderMethod "messageFull" o = Gst.Element.ElementMessageFullMethodInfo
    ResolveVideoEncoderMethod "messageFullWithDetails" o = Gst.Element.ElementMessageFullWithDetailsMethodInfo
    ResolveVideoEncoderMethod "negotiate" o = VideoEncoderNegotiateMethodInfo
    ResolveVideoEncoderMethod "noMorePads" o = Gst.Element.ElementNoMorePadsMethodInfo
    ResolveVideoEncoderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveVideoEncoderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveVideoEncoderMethod "postMessage" o = Gst.Element.ElementPostMessageMethodInfo
    ResolveVideoEncoderMethod "provideClock" o = Gst.Element.ElementProvideClockMethodInfo
    ResolveVideoEncoderMethod "proxyGetcaps" o = VideoEncoderProxyGetcapsMethodInfo
    ResolveVideoEncoderMethod "query" o = Gst.Element.ElementQueryMethodInfo
    ResolveVideoEncoderMethod "queryConvert" o = Gst.Element.ElementQueryConvertMethodInfo
    ResolveVideoEncoderMethod "queryDuration" o = Gst.Element.ElementQueryDurationMethodInfo
    ResolveVideoEncoderMethod "queryPosition" o = Gst.Element.ElementQueryPositionMethodInfo
    ResolveVideoEncoderMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveVideoEncoderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveVideoEncoderMethod "releaseRequestPad" o = Gst.Element.ElementReleaseRequestPadMethodInfo
    ResolveVideoEncoderMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveVideoEncoderMethod "removePad" o = Gst.Element.ElementRemovePadMethodInfo
    ResolveVideoEncoderMethod "removePropertyNotifyWatch" o = Gst.Element.ElementRemovePropertyNotifyWatchMethodInfo
    ResolveVideoEncoderMethod "renamePreset" o = Gst.Preset.PresetRenamePresetMethodInfo
    ResolveVideoEncoderMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveVideoEncoderMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveVideoEncoderMethod "requestPad" o = Gst.Element.ElementRequestPadMethodInfo
    ResolveVideoEncoderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveVideoEncoderMethod "savePreset" o = Gst.Preset.PresetSavePresetMethodInfo
    ResolveVideoEncoderMethod "seek" o = Gst.Element.ElementSeekMethodInfo
    ResolveVideoEncoderMethod "seekSimple" o = Gst.Element.ElementSeekSimpleMethodInfo
    ResolveVideoEncoderMethod "sendEvent" o = Gst.Element.ElementSendEventMethodInfo
    ResolveVideoEncoderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveVideoEncoderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveVideoEncoderMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveVideoEncoderMethod "syncStateWithParent" o = Gst.Element.ElementSyncStateWithParentMethodInfo
    ResolveVideoEncoderMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveVideoEncoderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveVideoEncoderMethod "unlink" o = Gst.Element.ElementUnlinkMethodInfo
    ResolveVideoEncoderMethod "unlinkPads" o = Gst.Element.ElementUnlinkPadsMethodInfo
    ResolveVideoEncoderMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveVideoEncoderMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveVideoEncoderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveVideoEncoderMethod "getAllocator" o = VideoEncoderGetAllocatorMethodInfo
    ResolveVideoEncoderMethod "getBaseTime" o = Gst.Element.ElementGetBaseTimeMethodInfo
    ResolveVideoEncoderMethod "getBus" o = Gst.Element.ElementGetBusMethodInfo
    ResolveVideoEncoderMethod "getClock" o = Gst.Element.ElementGetClockMethodInfo
    ResolveVideoEncoderMethod "getCompatiblePad" o = Gst.Element.ElementGetCompatiblePadMethodInfo
    ResolveVideoEncoderMethod "getCompatiblePadTemplate" o = Gst.Element.ElementGetCompatiblePadTemplateMethodInfo
    ResolveVideoEncoderMethod "getContext" o = Gst.Element.ElementGetContextMethodInfo
    ResolveVideoEncoderMethod "getContextUnlocked" o = Gst.Element.ElementGetContextUnlockedMethodInfo
    ResolveVideoEncoderMethod "getContexts" o = Gst.Element.ElementGetContextsMethodInfo
    ResolveVideoEncoderMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveVideoEncoderMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveVideoEncoderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveVideoEncoderMethod "getFactory" o = Gst.Element.ElementGetFactoryMethodInfo
    ResolveVideoEncoderMethod "getFrame" o = VideoEncoderGetFrameMethodInfo
    ResolveVideoEncoderMethod "getFrames" o = VideoEncoderGetFramesMethodInfo
    ResolveVideoEncoderMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveVideoEncoderMethod "getLatency" o = VideoEncoderGetLatencyMethodInfo
    ResolveVideoEncoderMethod "getMeta" o = Gst.Preset.PresetGetMetaMethodInfo
    ResolveVideoEncoderMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveVideoEncoderMethod "getOldestFrame" o = VideoEncoderGetOldestFrameMethodInfo
    ResolveVideoEncoderMethod "getOutputState" o = VideoEncoderGetOutputStateMethodInfo
    ResolveVideoEncoderMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveVideoEncoderMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveVideoEncoderMethod "getPresetNames" o = Gst.Preset.PresetGetPresetNamesMethodInfo
    ResolveVideoEncoderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveVideoEncoderMethod "getPropertyNames" o = Gst.Preset.PresetGetPropertyNamesMethodInfo
    ResolveVideoEncoderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveVideoEncoderMethod "getRequestPad" o = Gst.Element.ElementGetRequestPadMethodInfo
    ResolveVideoEncoderMethod "getStartTime" o = Gst.Element.ElementGetStartTimeMethodInfo
    ResolveVideoEncoderMethod "getState" o = Gst.Element.ElementGetStateMethodInfo
    ResolveVideoEncoderMethod "getStaticPad" o = Gst.Element.ElementGetStaticPadMethodInfo
    ResolveVideoEncoderMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveVideoEncoderMethod "setBaseTime" o = Gst.Element.ElementSetBaseTimeMethodInfo
    ResolveVideoEncoderMethod "setBus" o = Gst.Element.ElementSetBusMethodInfo
    ResolveVideoEncoderMethod "setClock" o = Gst.Element.ElementSetClockMethodInfo
    ResolveVideoEncoderMethod "setContext" o = Gst.Element.ElementSetContextMethodInfo
    ResolveVideoEncoderMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveVideoEncoderMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveVideoEncoderMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveVideoEncoderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveVideoEncoderMethod "setHeaders" o = VideoEncoderSetHeadersMethodInfo
    ResolveVideoEncoderMethod "setLatency" o = VideoEncoderSetLatencyMethodInfo
    ResolveVideoEncoderMethod "setLockedState" o = Gst.Element.ElementSetLockedStateMethodInfo
    ResolveVideoEncoderMethod "setMeta" o = Gst.Preset.PresetSetMetaMethodInfo
    ResolveVideoEncoderMethod "setMinPts" o = VideoEncoderSetMinPtsMethodInfo
    ResolveVideoEncoderMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveVideoEncoderMethod "setOutputState" o = VideoEncoderSetOutputStateMethodInfo
    ResolveVideoEncoderMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveVideoEncoderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveVideoEncoderMethod "setStartTime" o = Gst.Element.ElementSetStartTimeMethodInfo
    ResolveVideoEncoderMethod "setState" o = Gst.Element.ElementSetStateMethodInfo
    ResolveVideoEncoderMethod l o = O.MethodResolutionFailed l o

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

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

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

#endif

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

foreign import ccall "gst_video_encoder_allocate_output_buffer" gst_video_encoder_allocate_output_buffer :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Word64 ->                               -- size : TBasicType TUInt64
    IO (Ptr Gst.Buffer.Buffer)

{- |
Helper function that allocates a buffer to hold an encoded video frame
for /@encoder@/\'s current 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState'.
-}
videoEncoderAllocateOutputBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Word64
    {- ^ /@size@/: size of the buffer -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ allocated buffer -}
videoEncoderAllocateOutputBuffer encoder size = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    result <- gst_video_encoder_allocate_output_buffer encoder' size
    checkUnexpectedReturnNULL "videoEncoderAllocateOutputBuffer" result
    result' <- (wrapBoxed Gst.Buffer.Buffer) result
    touchManagedPtr encoder
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderAllocateOutputBufferMethodInfo
instance (signature ~ (Word64 -> m Gst.Buffer.Buffer), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderAllocateOutputBufferMethodInfo a signature where
    overloadedMethod _ = videoEncoderAllocateOutputBuffer

#endif

-- method VideoEncoder::allocate_output_frame
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frame", argType = TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoCodecFrame", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "size of the buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_allocate_output_frame" gst_video_encoder_allocate_output_frame :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr GstVideo.VideoCodecFrame.VideoCodecFrame -> -- frame : TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"})
    Word64 ->                               -- size : TBasicType TUInt64
    IO CUInt

{- |
Helper function that allocates a buffer to hold an encoded video frame for /@encoder@/\'s
current 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState'.  Subclass should already have configured video
state and set src pad caps.

The buffer allocated here is owned by the frame and you should only
keep references to the frame, not the buffer.
-}
videoEncoderAllocateOutputFrame ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> GstVideo.VideoCodecFrame.VideoCodecFrame
    {- ^ /@frame@/: a 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame' -}
    -> Word64
    {- ^ /@size@/: size of the buffer -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturnOk' if an output buffer could be allocated -}
videoEncoderAllocateOutputFrame encoder frame size = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    frame' <- unsafeManagedPtrGetPtr frame
    result <- gst_video_encoder_allocate_output_frame encoder' frame' size
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr encoder
    touchManagedPtr frame
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderAllocateOutputFrameMethodInfo
instance (signature ~ (GstVideo.VideoCodecFrame.VideoCodecFrame -> Word64 -> m Gst.Enums.FlowReturn), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderAllocateOutputFrameMethodInfo a signature where
    overloadedMethod _ = videoEncoderAllocateOutputFrame

#endif

-- method VideoEncoder::finish_frame
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frame", argType = TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an encoded #GstVideoCodecFrame", 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_video_encoder_finish_frame" gst_video_encoder_finish_frame :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr GstVideo.VideoCodecFrame.VideoCodecFrame -> -- frame : TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"})
    IO CUInt

{- |
/@frame@/ must have a valid encoded data buffer, whose metadata fields
are then appropriately set according to frame data or no buffer at
all if the frame should be dropped.
It is subsequently pushed downstream or provided to /@prePush@/.
In any case, the frame is considered finished and released.

After calling this function the output buffer of the frame is to be
considered read-only. This function will also change the metadata
of the buffer.
-}
videoEncoderFinishFrame ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> GstVideo.VideoCodecFrame.VideoCodecFrame
    {- ^ /@frame@/: an encoded 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame' -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.FlowReturn' resulting from sending data downstream -}
videoEncoderFinishFrame encoder frame = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    frame' <- B.ManagedPtr.disownBoxed frame
    result <- gst_video_encoder_finish_frame encoder' frame'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr encoder
    touchManagedPtr frame
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderFinishFrameMethodInfo
instance (signature ~ (GstVideo.VideoCodecFrame.VideoCodecFrame -> m Gst.Enums.FlowReturn), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderFinishFrameMethodInfo a signature where
    overloadedMethod _ = videoEncoderFinishFrame

#endif

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

foreign import ccall "gst_video_encoder_get_allocator" gst_video_encoder_get_allocator :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr (Ptr Gst.Allocator.Allocator) ->    -- allocator : TInterface (Name {namespace = "Gst", name = "Allocator"})
    Ptr Gst.AllocationParams.AllocationParams -> -- params : TInterface (Name {namespace = "Gst", name = "AllocationParams"})
    IO ()

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderGetAllocatorMethodInfo
instance (signature ~ (m ((Gst.Allocator.Allocator, Gst.AllocationParams.AllocationParams))), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderGetAllocatorMethodInfo a signature where
    overloadedMethod _ = videoEncoderGetAllocator

#endif

-- method VideoEncoder::get_frame
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEnccoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frame_number", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "system_frame_number of a frame", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_get_frame" gst_video_encoder_get_frame :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Int32 ->                                -- frame_number : TBasicType TInt
    IO (Ptr GstVideo.VideoCodecFrame.VideoCodecFrame)

{- |
Get a pending unfinished 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame'
-}
videoEncoderGetFrame ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a @/GstVideoEnccoder/@ -}
    -> Int32
    {- ^ /@frameNumber@/: system_frame_number of a frame -}
    -> m GstVideo.VideoCodecFrame.VideoCodecFrame
    {- ^ __Returns:__ pending unfinished 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame' identified by /@frameNumber@/. -}
videoEncoderGetFrame encoder frameNumber = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    result <- gst_video_encoder_get_frame encoder' frameNumber
    checkUnexpectedReturnNULL "videoEncoderGetFrame" result
    result' <- (wrapBoxed GstVideo.VideoCodecFrame.VideoCodecFrame) result
    touchManagedPtr encoder
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderGetFrameMethodInfo
instance (signature ~ (Int32 -> m GstVideo.VideoCodecFrame.VideoCodecFrame), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderGetFrameMethodInfo a signature where
    overloadedMethod _ = videoEncoderGetFrame

#endif

-- method VideoEncoder::get_frames
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "GstVideo", name = "VideoCodecFrame"})))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_get_frames" gst_video_encoder_get_frames :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    IO (Ptr (GList (Ptr GstVideo.VideoCodecFrame.VideoCodecFrame)))

{- |
Get all pending unfinished 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame'
-}
videoEncoderGetFrames ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> m [GstVideo.VideoCodecFrame.VideoCodecFrame]
    {- ^ __Returns:__ pending unfinished 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame'. -}
videoEncoderGetFrames encoder = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    result <- gst_video_encoder_get_frames encoder'
    result' <- unpackGList result
    result'' <- mapM (wrapBoxed GstVideo.VideoCodecFrame.VideoCodecFrame) result'
    g_list_free result
    touchManagedPtr encoder
    return result''

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderGetFramesMethodInfo
instance (signature ~ (m [GstVideo.VideoCodecFrame.VideoCodecFrame]), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderGetFramesMethodInfo a signature where
    overloadedMethod _ = videoEncoderGetFrames

#endif

-- method VideoEncoder::get_latency
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "min_latency", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "address of variable in which to store the\n    configured minimum latency, or %NULL", 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 "address of variable in which to store the\n    configured maximum latency, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_get_latency" gst_video_encoder_get_latency :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr Word64 ->                           -- min_latency : TBasicType TUInt64
    Ptr Word64 ->                           -- max_latency : TBasicType TUInt64
    IO ()

{- |
Query the configured encoding latency. Results will be returned via
/@minLatency@/ and /@maxLatency@/.
-}
videoEncoderGetLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> m ((Word64, Word64))
videoEncoderGetLatency encoder = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    minLatency <- allocMem :: IO (Ptr Word64)
    maxLatency <- allocMem :: IO (Ptr Word64)
    gst_video_encoder_get_latency encoder' minLatency maxLatency
    minLatency' <- peek minLatency
    maxLatency' <- peek maxLatency
    touchManagedPtr encoder
    freeMem minLatency
    freeMem maxLatency
    return (minLatency', maxLatency')

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

#endif

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

foreign import ccall "gst_video_encoder_get_oldest_frame" gst_video_encoder_get_oldest_frame :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    IO (Ptr GstVideo.VideoCodecFrame.VideoCodecFrame)

{- |
Get the oldest unfinished pending 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame'
-}
videoEncoderGetOldestFrame ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> m GstVideo.VideoCodecFrame.VideoCodecFrame
    {- ^ __Returns:__ oldest unfinished pending 'GI.GstVideo.Structs.VideoCodecFrame.VideoCodecFrame' -}
videoEncoderGetOldestFrame encoder = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    result <- gst_video_encoder_get_oldest_frame encoder'
    checkUnexpectedReturnNULL "videoEncoderGetOldestFrame" result
    result' <- (wrapBoxed GstVideo.VideoCodecFrame.VideoCodecFrame) result
    touchManagedPtr encoder
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderGetOldestFrameMethodInfo
instance (signature ~ (m GstVideo.VideoCodecFrame.VideoCodecFrame), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderGetOldestFrameMethodInfo a signature where
    overloadedMethod _ = videoEncoderGetOldestFrame

#endif

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

foreign import ccall "gst_video_encoder_get_output_state" gst_video_encoder_get_output_state :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    IO (Ptr GstVideo.VideoCodecState.VideoCodecState)

{- |
Get the current 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState'
-}
videoEncoderGetOutputState ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> m GstVideo.VideoCodecState.VideoCodecState
    {- ^ __Returns:__ 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState' describing format of video data. -}
videoEncoderGetOutputState encoder = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    result <- gst_video_encoder_get_output_state encoder'
    checkUnexpectedReturnNULL "videoEncoderGetOutputState" result
    result' <- (wrapBoxed GstVideo.VideoCodecState.VideoCodecState) result
    touchManagedPtr encoder
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderGetOutputStateMethodInfo
instance (signature ~ (m GstVideo.VideoCodecState.VideoCodecState), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderGetOutputStateMethodInfo a signature where
    overloadedMethod _ = videoEncoderGetOutputState

#endif

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

foreign import ccall "gst_video_encoder_merge_tags" gst_video_encoder_merge_tags :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr Gst.TagList.TagList ->              -- tags : TInterface (Name {namespace = "Gst", name = "TagList"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "Gst", name = "TagMergeMode"})
    IO ()

{- |
Sets the video encoder tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with 'GI.GstVideo.Objects.VideoEncoder.videoEncoderMergeTags'.

Note that this is provided for convenience, and the subclass is
not required to use this and can still do tag handling on its own.

MT safe.
-}
videoEncoderMergeTags ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Maybe (Gst.TagList.TagList)
    {- ^ /@tags@/: a 'GI.Gst.Structs.TagList.TagList' to merge, or NULL to unset
    previously-set tags -}
    -> Gst.Enums.TagMergeMode
    {- ^ /@mode@/: the 'GI.Gst.Enums.TagMergeMode' to use, usually @/GST_TAG_MERGE_REPLACE/@ -}
    -> m ()
videoEncoderMergeTags encoder tags mode = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    maybeTags <- case tags of
        Nothing -> return nullPtr
        Just jTags -> do
            jTags' <- unsafeManagedPtrGetPtr jTags
            return jTags'
    let mode' = (fromIntegral . fromEnum) mode
    gst_video_encoder_merge_tags encoder' maybeTags mode'
    touchManagedPtr encoder
    whenJust tags touchManagedPtr
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderMergeTagsMethodInfo
instance (signature ~ (Maybe (Gst.TagList.TagList) -> Gst.Enums.TagMergeMode -> m ()), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderMergeTagsMethodInfo a signature where
    overloadedMethod _ = videoEncoderMergeTags

#endif

-- method VideoEncoder::negotiate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", 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_video_encoder_negotiate" gst_video_encoder_negotiate :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    IO CInt

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

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

#endif

-- method VideoEncoder::proxy_getcaps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "enc", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "initial caps", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "filter caps", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Caps"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_proxy_getcaps" gst_video_encoder_proxy_getcaps :: 
    Ptr VideoEncoder ->                     -- enc : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr Gst.Caps.Caps ->                    -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    Ptr Gst.Caps.Caps ->                    -- filter : TInterface (Name {namespace = "Gst", name = "Caps"})
    IO (Ptr Gst.Caps.Caps)

{- |
Returns caps that express /@caps@/ (or sink template caps if /@caps@/ == NULL)
restricted to resolution\/format\/... combinations supported by downstream
elements (e.g. muxers).
-}
videoEncoderProxyGetcaps ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@enc@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Maybe (Gst.Caps.Caps)
    {- ^ /@caps@/: initial caps -}
    -> Maybe (Gst.Caps.Caps)
    {- ^ /@filter@/: filter caps -}
    -> m Gst.Caps.Caps
    {- ^ __Returns:__ a 'GI.Gst.Structs.Caps.Caps' owned by caller -}
videoEncoderProxyGetcaps enc caps filter = liftIO $ do
    enc' <- unsafeManagedPtrCastPtr enc
    maybeCaps <- case caps of
        Nothing -> return nullPtr
        Just jCaps -> do
            jCaps' <- unsafeManagedPtrGetPtr jCaps
            return jCaps'
    maybeFilter <- case filter of
        Nothing -> return nullPtr
        Just jFilter -> do
            jFilter' <- unsafeManagedPtrGetPtr jFilter
            return jFilter'
    result <- gst_video_encoder_proxy_getcaps enc' maybeCaps maybeFilter
    checkUnexpectedReturnNULL "videoEncoderProxyGetcaps" result
    result' <- (wrapBoxed Gst.Caps.Caps) result
    touchManagedPtr enc
    whenJust caps touchManagedPtr
    whenJust filter touchManagedPtr
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderProxyGetcapsMethodInfo
instance (signature ~ (Maybe (Gst.Caps.Caps) -> Maybe (Gst.Caps.Caps) -> m Gst.Caps.Caps), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderProxyGetcapsMethodInfo a signature where
    overloadedMethod _ = videoEncoderProxyGetcaps

#endif

-- method VideoEncoder::set_headers
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "headers", argType = TGList (TInterface (Name {namespace = "Gst", name = "Buffer"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a list of #GstBuffer containing the codec header", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_set_headers" gst_video_encoder_set_headers :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr (GList (Ptr Gst.Buffer.Buffer)) ->  -- headers : TGList (TInterface (Name {namespace = "Gst", name = "Buffer"}))
    IO ()

{- |
Set the codec headers to be sent downstream whenever requested.
-}
videoEncoderSetHeaders ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> [Gst.Buffer.Buffer]
    {- ^ /@headers@/: a list of 'GI.Gst.Structs.Buffer.Buffer' containing the codec header -}
    -> m ()
videoEncoderSetHeaders encoder headers = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    headers' <- mapM B.ManagedPtr.disownBoxed headers
    headers'' <- packGList headers'
    gst_video_encoder_set_headers encoder' headers''
    touchManagedPtr encoder
    mapM_ touchManagedPtr headers
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderSetHeadersMethodInfo
instance (signature ~ ([Gst.Buffer.Buffer] -> m ()), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderSetHeadersMethodInfo a signature where
    overloadedMethod _ = videoEncoderSetHeaders

#endif

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

foreign import ccall "gst_video_encoder_set_latency" gst_video_encoder_set_latency :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Word64 ->                               -- min_latency : TBasicType TUInt64
    Word64 ->                               -- max_latency : TBasicType TUInt64
    IO ()

{- |
Informs baseclass of encoding latency.
-}
videoEncoderSetLatency ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Word64
    {- ^ /@minLatency@/: minimum latency -}
    -> Word64
    {- ^ /@maxLatency@/: maximum latency -}
    -> m ()
videoEncoderSetLatency encoder minLatency maxLatency = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    gst_video_encoder_set_latency encoder' minLatency maxLatency
    touchManagedPtr encoder
    return ()

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

#endif

-- method VideoEncoder::set_min_pts
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "min_pts", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "minimal PTS that will be passed to handle_frame", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_set_min_pts" gst_video_encoder_set_min_pts :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Word64 ->                               -- min_pts : TBasicType TUInt64
    IO ()

{- |
Request minimal value for PTS passed to handle_frame.

For streams with reordered frames this can be used to ensure that there
is enough time to accomodate first DTS, which may be less than first PTS

Since 1.6
-}
videoEncoderSetMinPts ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Word64
    {- ^ /@minPts@/: minimal PTS that will be passed to handle_frame -}
    -> m ()
videoEncoderSetMinPts encoder minPts = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    gst_video_encoder_set_min_pts encoder' minPts
    touchManagedPtr encoder
    return ()

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

#endif

-- method VideoEncoder::set_output_state
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "encoder", argType = TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoEncoder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstCaps to use for the output", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "reference", argType = TInterface (Name {namespace = "GstVideo", name = "VideoCodecState"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "An optional reference @GstVideoCodecState", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoCodecState"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_encoder_set_output_state" gst_video_encoder_set_output_state :: 
    Ptr VideoEncoder ->                     -- encoder : TInterface (Name {namespace = "GstVideo", name = "VideoEncoder"})
    Ptr Gst.Caps.Caps ->                    -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    Ptr GstVideo.VideoCodecState.VideoCodecState -> -- reference : TInterface (Name {namespace = "GstVideo", name = "VideoCodecState"})
    IO (Ptr GstVideo.VideoCodecState.VideoCodecState)

{- |
Creates a new 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState' with the specified caps as the output state
for the encoder.
Any previously set output state on /@encoder@/ will be replaced by the newly
created one.

The specified /@caps@/ should not contain any resolution, pixel-aspect-ratio,
framerate, codec-data, .... Those should be specified instead in the returned
'GI.GstVideo.Structs.VideoCodecState.VideoCodecState'.

If the subclass wishes to copy over existing fields (like pixel aspect ratio,
or framerate) from an existing 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState', it can be provided as a
/@reference@/.

If the subclass wishes to override some fields from the output state (like
pixel-aspect-ratio or framerate) it can do so on the returned 'GI.GstVideo.Structs.VideoCodecState.VideoCodecState'.

The new output state will only take effect (set on pads and buffers) starting
from the next call to @/gst_video_encoder_finish_frame/@().
-}
videoEncoderSetOutputState ::
    (B.CallStack.HasCallStack, MonadIO m, IsVideoEncoder a) =>
    a
    {- ^ /@encoder@/: a 'GI.GstVideo.Objects.VideoEncoder.VideoEncoder' -}
    -> Gst.Caps.Caps
    {- ^ /@caps@/: the 'GI.Gst.Structs.Caps.Caps' to use for the output -}
    -> Maybe (GstVideo.VideoCodecState.VideoCodecState)
    {- ^ /@reference@/: An optional reference /@gstVideoCodecState@/ -}
    -> m GstVideo.VideoCodecState.VideoCodecState
    {- ^ __Returns:__ the newly configured output state. -}
videoEncoderSetOutputState encoder caps reference = liftIO $ do
    encoder' <- unsafeManagedPtrCastPtr encoder
    caps' <- B.ManagedPtr.disownBoxed caps
    maybeReference <- case reference of
        Nothing -> return nullPtr
        Just jReference -> do
            jReference' <- unsafeManagedPtrGetPtr jReference
            return jReference'
    result <- gst_video_encoder_set_output_state encoder' caps' maybeReference
    checkUnexpectedReturnNULL "videoEncoderSetOutputState" result
    result' <- (wrapBoxed GstVideo.VideoCodecState.VideoCodecState) result
    touchManagedPtr encoder
    touchManagedPtr caps
    whenJust reference touchManagedPtr
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data VideoEncoderSetOutputStateMethodInfo
instance (signature ~ (Gst.Caps.Caps -> Maybe (GstVideo.VideoCodecState.VideoCodecState) -> m GstVideo.VideoCodecState.VideoCodecState), MonadIO m, IsVideoEncoder a) => O.MethodInfo VideoEncoderSetOutputStateMethodInfo a signature where
    overloadedMethod _ = videoEncoderSetOutputState

#endif