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

module GI.GstVideo.Functions
    ( 

 -- * Methods
-- ** bufferAddVideoAffineTransformationMeta #method:bufferAddVideoAffineTransformationMeta#
    bufferAddVideoAffineTransformationMeta  ,


-- ** bufferAddVideoGlTextureUploadMeta #method:bufferAddVideoGlTextureUploadMeta#
    bufferAddVideoGlTextureUploadMeta       ,


-- ** bufferAddVideoMeta #method:bufferAddVideoMeta#
    bufferAddVideoMeta                      ,


-- ** bufferAddVideoMetaFull #method:bufferAddVideoMetaFull#
    bufferAddVideoMetaFull                  ,


-- ** bufferAddVideoOverlayCompositionMeta #method:bufferAddVideoOverlayCompositionMeta#
    bufferAddVideoOverlayCompositionMeta    ,


-- ** bufferAddVideoRegionOfInterestMeta #method:bufferAddVideoRegionOfInterestMeta#
    bufferAddVideoRegionOfInterestMeta      ,


-- ** bufferAddVideoRegionOfInterestMetaId #method:bufferAddVideoRegionOfInterestMetaId#
    bufferAddVideoRegionOfInterestMetaId    ,


-- ** bufferAddVideoTimeCodeMeta #method:bufferAddVideoTimeCodeMeta#
    bufferAddVideoTimeCodeMeta              ,


-- ** bufferAddVideoTimeCodeMetaFull #method:bufferAddVideoTimeCodeMetaFull#
    bufferAddVideoTimeCodeMetaFull          ,


-- ** bufferGetVideoMeta #method:bufferGetVideoMeta#
    bufferGetVideoMeta                      ,


-- ** bufferGetVideoMetaId #method:bufferGetVideoMetaId#
    bufferGetVideoMetaId                    ,


-- ** bufferGetVideoRegionOfInterestMetaId #method:bufferGetVideoRegionOfInterestMetaId#
    bufferGetVideoRegionOfInterestMetaId    ,


-- ** bufferPoolConfigGetVideoAlignment #method:bufferPoolConfigGetVideoAlignment#
    bufferPoolConfigGetVideoAlignment       ,


-- ** bufferPoolConfigSetVideoAlignment #method:bufferPoolConfigSetVideoAlignment#
    bufferPoolConfigSetVideoAlignment       ,


-- ** isVideoOverlayPrepareWindowHandleMessage #method:isVideoOverlayPrepareWindowHandleMessage#
    isVideoOverlayPrepareWindowHandleMessage,


-- ** videoAffineTransformationMetaApiGetType #method:videoAffineTransformationMetaApiGetType#
    videoAffineTransformationMetaApiGetType ,


-- ** videoBlend #method:videoBlend#
    videoBlend                              ,


-- ** videoBlendScaleLinearRGBA #method:videoBlendScaleLinearRGBA#
    videoBlendScaleLinearRGBA               ,


-- ** videoCalculateDisplayRatio #method:videoCalculateDisplayRatio#
    videoCalculateDisplayRatio              ,


-- ** videoChromaFromString #method:videoChromaFromString#
    videoChromaFromString                   ,


-- ** videoChromaResample #method:videoChromaResample#
    videoChromaResample                     ,


-- ** videoChromaToString #method:videoChromaToString#
    videoChromaToString                     ,


-- ** videoColorTransferDecode #method:videoColorTransferDecode#
    videoColorTransferDecode                ,


-- ** videoColorTransferEncode #method:videoColorTransferEncode#
    videoColorTransferEncode                ,


-- ** videoConvertSample #method:videoConvertSample#
    videoConvertSample                      ,


-- ** videoConvertSampleAsync #method:videoConvertSampleAsync#
    videoConvertSampleAsync                 ,


-- ** videoCropMetaApiGetType #method:videoCropMetaApiGetType#
    videoCropMetaApiGetType                 ,


-- ** videoEventIsForceKeyUnit #method:videoEventIsForceKeyUnit#
    videoEventIsForceKeyUnit                ,


-- ** videoEventNewDownstreamForceKeyUnit #method:videoEventNewDownstreamForceKeyUnit#
    videoEventNewDownstreamForceKeyUnit     ,


-- ** videoEventNewStillFrame #method:videoEventNewStillFrame#
    videoEventNewStillFrame                 ,


-- ** videoEventNewUpstreamForceKeyUnit #method:videoEventNewUpstreamForceKeyUnit#
    videoEventNewUpstreamForceKeyUnit       ,


-- ** videoEventParseDownstreamForceKeyUnit #method:videoEventParseDownstreamForceKeyUnit#
    videoEventParseDownstreamForceKeyUnit   ,


-- ** videoEventParseStillFrame #method:videoEventParseStillFrame#
    videoEventParseStillFrame               ,


-- ** videoEventParseUpstreamForceKeyUnit #method:videoEventParseUpstreamForceKeyUnit#
    videoEventParseUpstreamForceKeyUnit     ,


-- ** videoGlTextureUploadMetaApiGetType #method:videoGlTextureUploadMetaApiGetType#
    videoGlTextureUploadMetaApiGetType      ,


-- ** videoGuessFramerate #method:videoGuessFramerate#
    videoGuessFramerate                     ,


-- ** videoMetaApiGetType #method:videoMetaApiGetType#
    videoMetaApiGetType                     ,


-- ** videoMultiviewGetDoubledHeightModes #method:videoMultiviewGetDoubledHeightModes#
    videoMultiviewGetDoubledHeightModes     ,


-- ** videoMultiviewGetDoubledSizeModes #method:videoMultiviewGetDoubledSizeModes#
    videoMultiviewGetDoubledSizeModes       ,


-- ** videoMultiviewGetDoubledWidthModes #method:videoMultiviewGetDoubledWidthModes#
    videoMultiviewGetDoubledWidthModes      ,


-- ** videoMultiviewGetMonoModes #method:videoMultiviewGetMonoModes#
    videoMultiviewGetMonoModes              ,


-- ** videoMultiviewGetUnpackedModes #method:videoMultiviewGetUnpackedModes#
    videoMultiviewGetUnpackedModes          ,


-- ** videoMultiviewGuessHalfAspect #method:videoMultiviewGuessHalfAspect#
    videoMultiviewGuessHalfAspect           ,


-- ** videoMultiviewVideoInfoChangeMode #method:videoMultiviewVideoInfoChangeMode#
    videoMultiviewVideoInfoChangeMode       ,


-- ** videoOverlayCompositionMetaApiGetType #method:videoOverlayCompositionMetaApiGetType#
    videoOverlayCompositionMetaApiGetType   ,


-- ** videoRegionOfInterestMetaApiGetType #method:videoRegionOfInterestMetaApiGetType#
    videoRegionOfInterestMetaApiGetType     ,


-- ** videoTileGetIndex #method:videoTileGetIndex#
    videoTileGetIndex                       ,


-- ** videoTimeCodeMetaApiGetType #method:videoTimeCodeMetaApiGetType#
    videoTimeCodeMetaApiGetType             ,




    ) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.Gst.Structs.Buffer as Gst.Buffer
import qualified GI.Gst.Structs.Caps as Gst.Caps
import qualified GI.Gst.Structs.Event as Gst.Event
import qualified GI.Gst.Structs.Message as Gst.Message
import qualified GI.Gst.Structs.Sample as Gst.Sample
import qualified GI.Gst.Structs.Structure as Gst.Structure
import qualified GI.GstVideo.Callbacks as GstVideo.Callbacks
import {-# SOURCE #-} qualified GI.GstVideo.Enums as GstVideo.Enums
import {-# SOURCE #-} qualified GI.GstVideo.Flags as GstVideo.Flags
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoAffineTransformationMeta as GstVideo.VideoAffineTransformationMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoAlignment as GstVideo.VideoAlignment
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoChromaResample as GstVideo.VideoChromaResample
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoFrame as GstVideo.VideoFrame
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoGLTextureUploadMeta as GstVideo.VideoGLTextureUploadMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoInfo as GstVideo.VideoInfo
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoMeta as GstVideo.VideoMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoOverlayComposition as GstVideo.VideoOverlayComposition
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoOverlayCompositionMeta as GstVideo.VideoOverlayCompositionMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoRegionOfInterestMeta as GstVideo.VideoRegionOfInterestMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoTimeCode as GstVideo.VideoTimeCode
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoTimeCodeMeta as GstVideo.VideoTimeCodeMeta

-- function gst_video_time_code_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_time_code_meta_api_get_type" gst_video_time_code_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoTimeCodeMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoTimeCodeMetaApiGetType  = liftIO $ do
    result <- gst_video_time_code_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_tile_get_index
-- Args : [Arg {argCName = "mode", argType = TInterface (Name {namespace = "GstVideo", name = "VideoTileMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoTileMode", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "x coordinate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "y coordinate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x_tiles", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of horizintal tiles", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y_tiles", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of vertical tiles", 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_video_tile_get_index" gst_video_tile_get_index :: 
    CUInt ->                                -- mode : TInterface (Name {namespace = "GstVideo", name = "VideoTileMode"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- x_tiles : TBasicType TInt
    Int32 ->                                -- y_tiles : TBasicType TInt
    IO Word32

{- |
Get the tile index of the tile at coordinates /@x@/ and /@y@/ in the tiled
image of /@xTiles@/ by /@yTiles@/.

Use this method when /@mode@/ is of type @/GST_VIDEO_TILE_MODE_INDEXED/@.

@since 1.4
-}
videoTileGetIndex ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.Enums.VideoTileMode
    {- ^ /@mode@/: a 'GI.GstVideo.Enums.VideoTileMode' -}
    -> Int32
    {- ^ /@x@/: x coordinate -}
    -> Int32
    {- ^ /@y@/: y coordinate -}
    -> Int32
    {- ^ /@xTiles@/: number of horizintal tiles -}
    -> Int32
    {- ^ /@yTiles@/: number of vertical tiles -}
    -> m Word32
    {- ^ __Returns:__ the index of the tile at /@x@/ and /@y@/ in the tiled image of
  /@xTiles@/ by /@yTiles@/. -}
videoTileGetIndex mode x y xTiles yTiles = liftIO $ do
    let mode' = (fromIntegral . fromEnum) mode
    result <- gst_video_tile_get_index mode' x y xTiles yTiles
    return result


-- function gst_video_region_of_interest_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_region_of_interest_meta_api_get_type" gst_video_region_of_interest_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoRegionOfInterestMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoRegionOfInterestMetaApiGetType  = liftIO $ do
    result <- gst_video_region_of_interest_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_overlay_composition_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_overlay_composition_meta_api_get_type" gst_video_overlay_composition_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoOverlayCompositionMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoOverlayCompositionMetaApiGetType  = liftIO $ do
    result <- gst_video_overlay_composition_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_multiview_video_info_change_mode
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstVideo", name = "VideoInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstVideoInfo structure to operate on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_mview_mode", argType = TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstVideoMultiviewMode value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_mview_flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A set of #GstVideoMultiviewFlags", 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_multiview_video_info_change_mode" gst_video_multiview_video_info_change_mode :: 
    Ptr GstVideo.VideoInfo.VideoInfo ->     -- info : TInterface (Name {namespace = "GstVideo", name = "VideoInfo"})
    CUInt ->                                -- out_mview_mode : TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewMode"})
    CUInt ->                                -- out_mview_flags : TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewFlags"})
    IO ()

{- |
Utility function that transforms the width\/height\/PAR
and multiview mode and flags of a 'GI.GstVideo.Structs.VideoInfo.VideoInfo' into
the requested mode.

@since 1.6
-}
videoMultiviewVideoInfoChangeMode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoInfo.VideoInfo
    {- ^ /@info@/: A 'GI.GstVideo.Structs.VideoInfo.VideoInfo' structure to operate on -}
    -> GstVideo.Enums.VideoMultiviewMode
    {- ^ /@outMviewMode@/: A 'GI.GstVideo.Enums.VideoMultiviewMode' value -}
    -> [GstVideo.Flags.VideoMultiviewFlags]
    {- ^ /@outMviewFlags@/: A set of 'GI.GstVideo.Flags.VideoMultiviewFlags' -}
    -> m ()
videoMultiviewVideoInfoChangeMode info outMviewMode outMviewFlags = liftIO $ do
    info' <- unsafeManagedPtrGetPtr info
    let outMviewMode' = (fromIntegral . fromEnum) outMviewMode
    let outMviewFlags' = gflagsToWord outMviewFlags
    gst_video_multiview_video_info_change_mode info' outMviewMode' outMviewFlags'
    touchManagedPtr info
    return ()


-- function gst_video_multiview_guess_half_aspect
-- Args : [Arg {argCName = "mv_mode", argType = TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstVideoMultiviewMode", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Video frame width in pixels", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Video frame height in pixels", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "par_n", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Numerator of the video pixel-aspect-ratio", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "par_d", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Denominator of the video pixel-aspect-ratio", 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_multiview_guess_half_aspect" gst_video_multiview_guess_half_aspect :: 
    CUInt ->                                -- mv_mode : TInterface (Name {namespace = "GstVideo", name = "VideoMultiviewMode"})
    Word32 ->                               -- width : TBasicType TUInt
    Word32 ->                               -- height : TBasicType TUInt
    Word32 ->                               -- par_n : TBasicType TUInt
    Word32 ->                               -- par_d : TBasicType TUInt
    IO CInt

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGuessHalfAspect ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.Enums.VideoMultiviewMode
    {- ^ /@mvMode@/: A 'GI.GstVideo.Enums.VideoMultiviewMode' -}
    -> Word32
    {- ^ /@width@/: Video frame width in pixels -}
    -> Word32
    {- ^ /@height@/: Video frame height in pixels -}
    -> Word32
    {- ^ /@parN@/: Numerator of the video pixel-aspect-ratio -}
    -> Word32
    {- ^ /@parD@/: Denominator of the video pixel-aspect-ratio -}
    -> m Bool
    {- ^ __Returns:__ A boolean indicating whether the
  @/GST_VIDEO_MULTIVIEW_FLAG_HALF_ASPECT/@ flag should be set.

Utility function that heuristically guess whether a
frame-packed stereoscopic video contains half width\/height
encoded views, or full-frame views by looking at the
overall display aspect ratio. -}
videoMultiviewGuessHalfAspect mvMode width height parN parD = liftIO $ do
    let mvMode' = (fromIntegral . fromEnum) mvMode
    result <- gst_video_multiview_guess_half_aspect mvMode' width height parN parD
    let result' = (/= 0) result
    return result'


-- function gst_video_multiview_get_unpacked_modes
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GObject", name = "Value"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_multiview_get_unpacked_modes" gst_video_multiview_get_unpacked_modes :: 
    IO (Ptr GValue)

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGetUnpackedModes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GValue
    {- ^ __Returns:__ A const 'GI.GObject.Structs.Value.Value' containing a list of \'unpacked\' stereo video modes

Utility function that returns a 'GI.GObject.Structs.Value.Value' with a GstList of unpacked
stereo video modes (separated\/frame-by-frame\/frame-by-frame-multiview)
for use in caps negotiations. -}
videoMultiviewGetUnpackedModes  = liftIO $ do
    result <- gst_video_multiview_get_unpacked_modes
    checkUnexpectedReturnNULL "videoMultiviewGetUnpackedModes" result
    result' <- (newBoxed GValue) result
    return result'


-- function gst_video_multiview_get_mono_modes
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GObject", name = "Value"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_multiview_get_mono_modes" gst_video_multiview_get_mono_modes :: 
    IO (Ptr GValue)

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGetMonoModes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GValue
    {- ^ __Returns:__ A const 'GI.GObject.Structs.Value.Value' containing a list of mono video modes

Utility function that returns a 'GI.GObject.Structs.Value.Value' with a GstList of mono video
modes (mono\/left\/right) for use in caps negotiations. -}
videoMultiviewGetMonoModes  = liftIO $ do
    result <- gst_video_multiview_get_mono_modes
    checkUnexpectedReturnNULL "videoMultiviewGetMonoModes" result
    result' <- (newBoxed GValue) result
    return result'


-- function gst_video_multiview_get_doubled_width_modes
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GObject", name = "Value"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_multiview_get_doubled_width_modes" gst_video_multiview_get_doubled_width_modes :: 
    IO (Ptr GValue)

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGetDoubledWidthModes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GValue
    {- ^ __Returns:__ A const 'GI.GObject.Structs.Value.Value' containing a list of stereo video modes

Utility function that returns a 'GI.GObject.Structs.Value.Value' with a GstList of packed stereo
video modes with double the width of a single view for use in
caps negotiations. Currently this is side-by-side, side-by-side-quincunx
and column-interleaved. -}
videoMultiviewGetDoubledWidthModes  = liftIO $ do
    result <- gst_video_multiview_get_doubled_width_modes
    checkUnexpectedReturnNULL "videoMultiviewGetDoubledWidthModes" result
    result' <- (newBoxed GValue) result
    return result'


-- function gst_video_multiview_get_doubled_size_modes
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GObject", name = "Value"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_multiview_get_doubled_size_modes" gst_video_multiview_get_doubled_size_modes :: 
    IO (Ptr GValue)

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGetDoubledSizeModes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GValue
    {- ^ __Returns:__ A const 'GI.GObject.Structs.Value.Value' containing a list of stereo video modes

Utility function that returns a 'GI.GObject.Structs.Value.Value' with a GstList of packed
stereo video modes that have double the width\/height of a single
view for use in caps negotiation. Currently this is just
\'checkerboard\' layout. -}
videoMultiviewGetDoubledSizeModes  = liftIO $ do
    result <- gst_video_multiview_get_doubled_size_modes
    checkUnexpectedReturnNULL "videoMultiviewGetDoubledSizeModes" result
    result' <- (newBoxed GValue) result
    return result'


-- function gst_video_multiview_get_doubled_height_modes
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GObject", name = "Value"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_multiview_get_doubled_height_modes" gst_video_multiview_get_doubled_height_modes :: 
    IO (Ptr GValue)

{- |
/No description available in the introspection data./

@since 1.6
-}
videoMultiviewGetDoubledHeightModes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GValue
    {- ^ __Returns:__ A const 'GI.GObject.Structs.Value.Value' containing a list of stereo video modes

Utility function that returns a 'GI.GObject.Structs.Value.Value' with a GstList of packed stereo
video modes with double the height of a single view for use in
caps negotiations. Currently this is top-bottom and row-interleaved. -}
videoMultiviewGetDoubledHeightModes  = liftIO $ do
    result <- gst_video_multiview_get_doubled_height_modes
    checkUnexpectedReturnNULL "videoMultiviewGetDoubledHeightModes" result
    result' <- (newBoxed GValue) result
    return result'


-- function gst_video_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_meta_api_get_type" gst_video_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoMetaApiGetType  = liftIO $ do
    result <- gst_video_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_guess_framerate
-- Args : [Arg {argCName = "duration", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Nominal duration of one frame", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest_n", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Numerator of the calculated framerate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "dest_d", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Denominator of the calculated framerate", 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_video_guess_framerate" gst_video_guess_framerate :: 
    Word64 ->                               -- duration : TBasicType TUInt64
    Ptr Int32 ->                            -- dest_n : TBasicType TInt
    Ptr Int32 ->                            -- dest_d : TBasicType TInt
    IO CInt

{- |
Given the nominal duration of one video frame,
this function will check some standard framerates for
a close match (within 0.1%) and return one if possible,

It will calculate an arbitrary framerate if no close
match was found, and return 'False'.

It returns 'False' if a duration of 0 is passed.

@since 1.6
-}
videoGuessFramerate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word64
    {- ^ /@duration@/: Nominal duration of one frame -}
    -> m (Bool,Int32,Int32)
    {- ^ __Returns:__ 'True' if a close \"standard\" framerate was
recognised, and 'False' otherwise. -}
videoGuessFramerate duration = liftIO $ do
    destN <- allocMem :: IO (Ptr Int32)
    destD <- allocMem :: IO (Ptr Int32)
    result <- gst_video_guess_framerate duration destN destD
    let result' = (/= 0) result
    destN' <- peek destN
    destD' <- peek destD
    freeMem destN
    freeMem destD
    return (result', destN', destD')


-- function gst_video_gl_texture_upload_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_gl_texture_upload_meta_api_get_type" gst_video_gl_texture_upload_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoGlTextureUploadMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoGlTextureUploadMetaApiGetType  = liftIO $ do
    result <- gst_video_gl_texture_upload_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_event_parse_upstream_force_key_unit
-- Args : [Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstEvent to parse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "running_time", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the running_time in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "all_headers", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the all_headers flag in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "count", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the count field in the event", 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_video_event_parse_upstream_force_key_unit" gst_video_event_parse_upstream_force_key_unit :: 
    Ptr Gst.Event.Event ->                  -- event : TInterface (Name {namespace = "Gst", name = "Event"})
    Ptr Word64 ->                           -- running_time : TBasicType TUInt64
    Ptr CInt ->                             -- all_headers : TBasicType TBoolean
    Ptr Word32 ->                           -- count : TBasicType TUInt
    IO CInt

{- |
Get running-time, all-headers and count in the force key unit event. See
'GI.GstVideo.Functions.videoEventNewUpstreamForceKeyUnit' for a full description of the
upstream force key unit event.

Create an upstream force key unit event using  'GI.GstVideo.Functions.videoEventNewUpstreamForceKeyUnit'

/@runningTime@/ will be adjusted for any pad offsets of pads it was passing through.
-}
videoEventParseUpstreamForceKeyUnit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Event.Event
    {- ^ /@event@/: A 'GI.Gst.Structs.Event.Event' to parse -}
    -> m (Bool,Word64,Bool,Word32)
    {- ^ __Returns:__ 'True' if the event is a valid upstream force-key-unit event. 'False' if not -}
videoEventParseUpstreamForceKeyUnit event = liftIO $ do
    event' <- unsafeManagedPtrGetPtr event
    runningTime <- allocMem :: IO (Ptr Word64)
    allHeaders <- allocMem :: IO (Ptr CInt)
    count <- allocMem :: IO (Ptr Word32)
    result <- gst_video_event_parse_upstream_force_key_unit event' runningTime allHeaders count
    let result' = (/= 0) result
    runningTime' <- peek runningTime
    allHeaders' <- peek allHeaders
    let allHeaders'' = (/= 0) allHeaders'
    count' <- peek count
    touchManagedPtr event
    freeMem runningTime
    freeMem allHeaders
    freeMem count
    return (result', runningTime', allHeaders'', count')


-- function gst_video_event_parse_still_frame
-- Args : [Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstEvent to parse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "in_still", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A boolean to receive the still-frame status from the event, or NULL", 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_event_parse_still_frame" gst_video_event_parse_still_frame :: 
    Ptr Gst.Event.Event ->                  -- event : TInterface (Name {namespace = "Gst", name = "Event"})
    CInt ->                                 -- in_still : TBasicType TBoolean
    IO CInt

{- |
Parse a 'GI.Gst.Structs.Event.Event', identify if it is a Still Frame event, and
return the still-frame state from the event if it is.
If the event represents the start of a still frame, the in_still
variable will be set to TRUE, otherwise FALSE. It is OK to pass NULL for the
in_still variable order to just check whether the event is a valid still-frame
event.

Create a still frame event using 'GI.GstVideo.Functions.videoEventNewStillFrame'
-}
videoEventParseStillFrame ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Event.Event
    {- ^ /@event@/: A 'GI.Gst.Structs.Event.Event' to parse -}
    -> Bool
    {- ^ /@inStill@/: A boolean to receive the still-frame status from the event, or NULL -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the event is a valid still-frame event. 'False' if not -}
videoEventParseStillFrame event inStill = liftIO $ do
    event' <- unsafeManagedPtrGetPtr event
    let inStill' = (fromIntegral . fromEnum) inStill
    result <- gst_video_event_parse_still_frame event' inStill'
    let result' = (/= 0) result
    touchManagedPtr event
    return result'


-- function gst_video_event_parse_downstream_force_key_unit
-- Args : [Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstEvent to parse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timestamp", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the timestamp in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "stream_time", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the stream-time in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "running_time", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the running-time in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "all_headers", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the all_headers flag in the event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "count", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to the count field of the event", 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_video_event_parse_downstream_force_key_unit" gst_video_event_parse_downstream_force_key_unit :: 
    Ptr Gst.Event.Event ->                  -- event : TInterface (Name {namespace = "Gst", name = "Event"})
    Ptr Word64 ->                           -- timestamp : TBasicType TUInt64
    Ptr Word64 ->                           -- stream_time : TBasicType TUInt64
    Ptr Word64 ->                           -- running_time : TBasicType TUInt64
    Ptr CInt ->                             -- all_headers : TBasicType TBoolean
    Ptr Word32 ->                           -- count : TBasicType TUInt
    IO CInt

{- |
Get timestamp, stream-time, running-time, all-headers and count in the force
key unit event. See 'GI.GstVideo.Functions.videoEventNewDownstreamForceKeyUnit' for a
full description of the downstream force key unit event.

/@runningTime@/ will be adjusted for any pad offsets of pads it was passing through.
-}
videoEventParseDownstreamForceKeyUnit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Event.Event
    {- ^ /@event@/: A 'GI.Gst.Structs.Event.Event' to parse -}
    -> m (Bool,Word64,Word64,Word64,Bool,Word32)
    {- ^ __Returns:__ 'True' if the event is a valid downstream force key unit event. -}
videoEventParseDownstreamForceKeyUnit event = liftIO $ do
    event' <- unsafeManagedPtrGetPtr event
    timestamp <- allocMem :: IO (Ptr Word64)
    streamTime <- allocMem :: IO (Ptr Word64)
    runningTime <- allocMem :: IO (Ptr Word64)
    allHeaders <- allocMem :: IO (Ptr CInt)
    count <- allocMem :: IO (Ptr Word32)
    result <- gst_video_event_parse_downstream_force_key_unit event' timestamp streamTime runningTime allHeaders count
    let result' = (/= 0) result
    timestamp' <- peek timestamp
    streamTime' <- peek streamTime
    runningTime' <- peek runningTime
    allHeaders' <- peek allHeaders
    let allHeaders'' = (/= 0) allHeaders'
    count' <- peek count
    touchManagedPtr event
    freeMem timestamp
    freeMem streamTime
    freeMem runningTime
    freeMem allHeaders
    freeMem count
    return (result', timestamp', streamTime', runningTime', allHeaders'', count')


-- function gst_video_event_new_upstream_force_key_unit
-- Args : [Arg {argCName = "running_time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the running_time at which a new key unit should be produced", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "all_headers", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to produce headers when starting a new key unit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "count", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "integer that can be used to number key units", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Event"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_event_new_upstream_force_key_unit" gst_video_event_new_upstream_force_key_unit :: 
    Word64 ->                               -- running_time : TBasicType TUInt64
    CInt ->                                 -- all_headers : TBasicType TBoolean
    Word32 ->                               -- count : TBasicType TUInt
    IO (Ptr Gst.Event.Event)

{- |
Creates a new upstream force key unit event. An upstream force key unit event
can be sent to request upstream elements to produce a key unit.

/@runningTime@/ can be set to request a new key unit at a specific
running_time. If set to GST_CLOCK_TIME_NONE, upstream elements will produce a
new key unit as soon as possible.

To parse an event created by 'GI.GstVideo.Functions.videoEventNewDownstreamForceKeyUnit' use
'GI.GstVideo.Functions.videoEventParseDownstreamForceKeyUnit'.
-}
videoEventNewUpstreamForceKeyUnit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word64
    {- ^ /@runningTime@/: the running_time at which a new key unit should be produced -}
    -> Bool
    {- ^ /@allHeaders@/: 'True' to produce headers when starting a new key unit -}
    -> Word32
    {- ^ /@count@/: integer that can be used to number key units -}
    -> m Gst.Event.Event
    {- ^ __Returns:__ The new GstEvent -}
videoEventNewUpstreamForceKeyUnit runningTime allHeaders count = liftIO $ do
    let allHeaders' = (fromIntegral . fromEnum) allHeaders
    result <- gst_video_event_new_upstream_force_key_unit runningTime allHeaders' count
    checkUnexpectedReturnNULL "videoEventNewUpstreamForceKeyUnit" result
    result' <- (wrapBoxed Gst.Event.Event) result
    return result'


-- function gst_video_event_new_still_frame
-- Args : [Arg {argCName = "in_still", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "boolean value for the still-frame state of the event.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Event"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_event_new_still_frame" gst_video_event_new_still_frame :: 
    CInt ->                                 -- in_still : TBasicType TBoolean
    IO (Ptr Gst.Event.Event)

{- |
Creates a new Still Frame event. If /@inStill@/ is 'True', then the event
represents the start of a still frame sequence. If it is 'False', then
the event ends a still frame sequence.

To parse an event created by 'GI.GstVideo.Functions.videoEventNewStillFrame' use
'GI.GstVideo.Functions.videoEventParseStillFrame'.
-}
videoEventNewStillFrame ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Bool
    {- ^ /@inStill@/: boolean value for the still-frame state of the event. -}
    -> m Gst.Event.Event
    {- ^ __Returns:__ The new GstEvent -}
videoEventNewStillFrame inStill = liftIO $ do
    let inStill' = (fromIntegral . fromEnum) inStill
    result <- gst_video_event_new_still_frame inStill'
    checkUnexpectedReturnNULL "videoEventNewStillFrame" result
    result' <- (wrapBoxed Gst.Event.Event) result
    return result'


-- function gst_video_event_new_downstream_force_key_unit
-- Args : [Arg {argCName = "timestamp", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the timestamp of the buffer that starts a new key unit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "stream_time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the stream_time of the buffer that starts a new key unit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "running_time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the running_time of the buffer that starts a new key unit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "all_headers", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to produce headers when starting a new key unit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "count", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "integer that can be used to number key units", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Event"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_event_new_downstream_force_key_unit" gst_video_event_new_downstream_force_key_unit :: 
    Word64 ->                               -- timestamp : TBasicType TUInt64
    Word64 ->                               -- stream_time : TBasicType TUInt64
    Word64 ->                               -- running_time : TBasicType TUInt64
    CInt ->                                 -- all_headers : TBasicType TBoolean
    Word32 ->                               -- count : TBasicType TUInt
    IO (Ptr Gst.Event.Event)

{- |
Creates a new downstream force key unit event. A downstream force key unit
event can be sent down the pipeline to request downstream elements to produce
a key unit. A downstream force key unit event must also be sent when handling
an upstream force key unit event to notify downstream that the latter has been
handled.

To parse an event created by 'GI.GstVideo.Functions.videoEventNewDownstreamForceKeyUnit' use
'GI.GstVideo.Functions.videoEventParseDownstreamForceKeyUnit'.
-}
videoEventNewDownstreamForceKeyUnit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word64
    {- ^ /@timestamp@/: the timestamp of the buffer that starts a new key unit -}
    -> Word64
    {- ^ /@streamTime@/: the stream_time of the buffer that starts a new key unit -}
    -> Word64
    {- ^ /@runningTime@/: the running_time of the buffer that starts a new key unit -}
    -> Bool
    {- ^ /@allHeaders@/: 'True' to produce headers when starting a new key unit -}
    -> Word32
    {- ^ /@count@/: integer that can be used to number key units -}
    -> m Gst.Event.Event
    {- ^ __Returns:__ The new GstEvent -}
videoEventNewDownstreamForceKeyUnit timestamp streamTime runningTime allHeaders count = liftIO $ do
    let allHeaders' = (fromIntegral . fromEnum) allHeaders
    result <- gst_video_event_new_downstream_force_key_unit timestamp streamTime runningTime allHeaders' count
    checkUnexpectedReturnNULL "videoEventNewDownstreamForceKeyUnit" result
    result' <- (wrapBoxed Gst.Event.Event) result
    return result'


-- function gst_video_event_is_force_key_unit
-- Args : [Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstEvent to check", 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_event_is_force_key_unit" gst_video_event_is_force_key_unit :: 
    Ptr Gst.Event.Event ->                  -- event : TInterface (Name {namespace = "Gst", name = "Event"})
    IO CInt

{- |
Checks if an event is a force key unit event. Returns true for both upstream
and downstream force key unit events.
-}
videoEventIsForceKeyUnit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Event.Event
    {- ^ /@event@/: A 'GI.Gst.Structs.Event.Event' to check -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the event is a valid force key unit event -}
videoEventIsForceKeyUnit event = liftIO $ do
    event' <- unsafeManagedPtrGetPtr event
    result <- gst_video_event_is_force_key_unit event'
    let result' = (/= 0) result
    touchManagedPtr event
    return result'


-- function gst_video_crop_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_crop_meta_api_get_type" gst_video_crop_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoCropMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoCropMetaApiGetType  = liftIO $ do
    result <- gst_video_crop_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_video_convert_sample_async
-- Args : [Arg {argCName = "sample", argType = TInterface (Name {namespace = "Gst", name = "Sample"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstSample", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "to_caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstCaps to convert to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum amount of time allowed for the processing.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "GstVideo", name = "VideoConvertSampleCallback"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%GstVideoConvertSampleCallback that will be called after conversion.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 4, argDestroy = 5, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "extra data that will be passed to the @callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%GDestroyNotify to be called after @user_data is not needed anymore", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_convert_sample_async" gst_video_convert_sample_async :: 
    Ptr Gst.Sample.Sample ->                -- sample : TInterface (Name {namespace = "Gst", name = "Sample"})
    Ptr Gst.Caps.Caps ->                    -- to_caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    Word64 ->                               -- timeout : TBasicType TUInt64
    FunPtr GstVideo.Callbacks.C_VideoConvertSampleCallback -> -- callback : TInterface (Name {namespace = "GstVideo", name = "VideoConvertSampleCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Converts a raw video buffer into the specified output caps.

The output caps can be any raw video formats or any image formats (jpeg, png, ...).

The width, height and pixel-aspect-ratio can also be specified in the output caps.

/@callback@/ will be called after conversion, when an error occured or if conversion didn\'t
finish after /@timeout@/. /@callback@/ will always be called from the thread default
@/GMainContext/@, see 'GI.GLib.Functions.mainContextGetThreadDefault'. If GLib before 2.22 is used,
this will always be the global default main context.

/@destroyNotify@/ will be called after the callback was called and /@userData@/ is not needed
anymore.
-}
videoConvertSampleAsync ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Sample.Sample
    {- ^ /@sample@/: a 'GI.Gst.Structs.Sample.Sample' -}
    -> Gst.Caps.Caps
    {- ^ /@toCaps@/: the 'GI.Gst.Structs.Caps.Caps' to convert to -}
    -> Word64
    {- ^ /@timeout@/: the maximum amount of time allowed for the processing. -}
    -> GstVideo.Callbacks.VideoConvertSampleCallback
    {- ^ /@callback@/: @/GstVideoConvertSampleCallback/@ that will be called after conversion. -}
    -> m ()
videoConvertSampleAsync sample toCaps timeout callback = liftIO $ do
    sample' <- unsafeManagedPtrGetPtr sample
    toCaps' <- unsafeManagedPtrGetPtr toCaps
    callback' <- GstVideo.Callbacks.mk_VideoConvertSampleCallback (GstVideo.Callbacks.wrap_VideoConvertSampleCallback Nothing (GstVideo.Callbacks.drop_closures_VideoConvertSampleCallback callback))
    let userData = castFunPtrToPtr callback'
    let destroyNotify = safeFreeFunPtrPtr
    gst_video_convert_sample_async sample' toCaps' timeout callback' userData destroyNotify
    touchManagedPtr sample
    touchManagedPtr toCaps
    return ()


-- function gst_video_convert_sample
-- Args : [Arg {argCName = "sample", argType = TInterface (Name {namespace = "Gst", name = "Sample"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstSample", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "to_caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstCaps to convert to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum amount of time allowed for the processing.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Sample"}))
-- throws : True
-- Skip return : False

foreign import ccall "gst_video_convert_sample" gst_video_convert_sample :: 
    Ptr Gst.Sample.Sample ->                -- sample : TInterface (Name {namespace = "Gst", name = "Sample"})
    Ptr Gst.Caps.Caps ->                    -- to_caps : TInterface (Name {namespace = "Gst", name = "Caps"})
    Word64 ->                               -- timeout : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gst.Sample.Sample)

{- |
Converts a raw video buffer into the specified output caps.

The output caps can be any raw video formats or any image formats (jpeg, png, ...).

The width, height and pixel-aspect-ratio can also be specified in the output caps.
-}
videoConvertSample ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Sample.Sample
    {- ^ /@sample@/: a 'GI.Gst.Structs.Sample.Sample' -}
    -> Gst.Caps.Caps
    {- ^ /@toCaps@/: the 'GI.Gst.Structs.Caps.Caps' to convert to -}
    -> Word64
    {- ^ /@timeout@/: the maximum amount of time allowed for the processing. -}
    -> m Gst.Sample.Sample
    {- ^ __Returns:__ The converted 'GI.Gst.Structs.Sample.Sample', or 'Nothing' if an error happened (in which case /@err@/
will point to the 'GError'). /(Can throw 'Data.GI.Base.GError.GError')/ -}
videoConvertSample sample toCaps timeout = liftIO $ do
    sample' <- unsafeManagedPtrGetPtr sample
    toCaps' <- unsafeManagedPtrGetPtr toCaps
    onException (do
        result <- propagateGError $ gst_video_convert_sample sample' toCaps' timeout
        checkUnexpectedReturnNULL "videoConvertSample" result
        result' <- (wrapBoxed Gst.Sample.Sample) result
        touchManagedPtr sample
        touchManagedPtr toCaps
        return result'
     ) (do
        return ()
     )


-- function gst_video_color_transfer_encode
-- Args : [Arg {argCName = "func", argType = TInterface (Name {namespace = "GstVideo", name = "VideoTransferFunction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoTransferFunction", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "val", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TDouble)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_color_transfer_encode" gst_video_color_transfer_encode :: 
    CUInt ->                                -- func : TInterface (Name {namespace = "GstVideo", name = "VideoTransferFunction"})
    CDouble ->                              -- val : TBasicType TDouble
    IO CDouble

{- |
Convert /@val@/ to its gamma encoded value.

For a linear value L in the range [0..1], conversion to the non-linear
(gamma encoded) L\' is in general performed with a power function like:

>
>   L' = L ^ (1 / gamma)


Depending on /@func@/, different formulas might be applied. Some formulas
encode a linear segment in the lower range.

@since 1.6
-}
videoColorTransferEncode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.Enums.VideoTransferFunction
    {- ^ /@func@/: a 'GI.GstVideo.Enums.VideoTransferFunction' -}
    -> Double
    {- ^ /@val@/: a value -}
    -> m Double
    {- ^ __Returns:__ the gamme encoded value of /@val@/ -}
videoColorTransferEncode func val = liftIO $ do
    let func' = (fromIntegral . fromEnum) func
    let val' = realToFrac val
    result <- gst_video_color_transfer_encode func' val'
    let result' = realToFrac result
    return result'


-- function gst_video_color_transfer_decode
-- Args : [Arg {argCName = "func", argType = TInterface (Name {namespace = "GstVideo", name = "VideoTransferFunction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoTransferFunction", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "val", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TDouble)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_color_transfer_decode" gst_video_color_transfer_decode :: 
    CUInt ->                                -- func : TInterface (Name {namespace = "GstVideo", name = "VideoTransferFunction"})
    CDouble ->                              -- val : TBasicType TDouble
    IO CDouble

{- |
Convert /@val@/ to its gamma decoded value. This is the inverse operation of
/@gstVideoColorTransferEncode@/().

For a non-linear value L\' in the range [0..1], conversion to the linear
L is in general performed with a power function like:

>
>   L = L' ^ gamma


Depending on /@func@/, different formulas might be applied. Some formulas
encode a linear segment in the lower range.

@since 1.6
-}
videoColorTransferDecode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.Enums.VideoTransferFunction
    {- ^ /@func@/: a 'GI.GstVideo.Enums.VideoTransferFunction' -}
    -> Double
    {- ^ /@val@/: a value -}
    -> m Double
    {- ^ __Returns:__ the gamme decoded value of /@val@/ -}
videoColorTransferDecode func val = liftIO $ do
    let func' = (fromIntegral . fromEnum) func
    let val' = realToFrac val
    result <- gst_video_color_transfer_decode func' val'
    let result' = realToFrac result
    return result'


-- function gst_video_chroma_to_string
-- Args : [Arg {argCName = "site", argType = TInterface (Name {namespace = "GstVideo", name = "VideoChromaSite"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoChromaSite", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_chroma_to_string" gst_video_chroma_to_string :: 
    CUInt ->                                -- site : TInterface (Name {namespace = "GstVideo", name = "VideoChromaSite"})
    IO CString

{- |
Converts /@site@/ to its string representation.
-}
videoChromaToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [GstVideo.Flags.VideoChromaSite]
    {- ^ /@site@/: a 'GI.GstVideo.Flags.VideoChromaSite' -}
    -> m T.Text
    {- ^ __Returns:__ a string describing /@site@/. -}
videoChromaToString site = liftIO $ do
    let site' = gflagsToWord site
    result <- gst_video_chroma_to_string site'
    checkUnexpectedReturnNULL "videoChromaToString" result
    result' <- cstringToText result
    return result'


-- function gst_video_chroma_resample
-- Args : [Arg {argCName = "resample", argType = TInterface (Name {namespace = "GstVideo", name = "VideoChromaResample"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoChromaResample", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "lines", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "pixel lines", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of pixels on one line", 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_chroma_resample" gst_video_chroma_resample :: 
    Ptr GstVideo.VideoChromaResample.VideoChromaResample -> -- resample : TInterface (Name {namespace = "GstVideo", name = "VideoChromaResample"})
    Ptr () ->                               -- lines : TBasicType TPtr
    Int32 ->                                -- width : TBasicType TInt
    IO ()

{- |
Perform resampling of /@width@/ chroma pixels in /@lines@/.
-}
videoChromaResample ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoChromaResample.VideoChromaResample
    {- ^ /@resample@/: a 'GI.GstVideo.Structs.VideoChromaResample.VideoChromaResample' -}
    -> Ptr ()
    {- ^ /@lines@/: pixel lines -}
    -> Int32
    {- ^ /@width@/: the number of pixels on one line -}
    -> m ()
videoChromaResample resample lines width = liftIO $ do
    resample' <- unsafeManagedPtrGetPtr resample
    gst_video_chroma_resample resample' lines width
    touchManagedPtr resample
    return ()


-- function gst_video_chroma_from_string
-- Args : [Arg {argCName = "s", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a chromasite string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoChromaSite"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_chroma_from_string" gst_video_chroma_from_string :: 
    CString ->                              -- s : TBasicType TUTF8
    IO CUInt

{- |
Convert /@s@/ to a 'GI.GstVideo.Flags.VideoChromaSite'
-}
videoChromaFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@s@/: a chromasite string -}
    -> m [GstVideo.Flags.VideoChromaSite]
    {- ^ __Returns:__ a 'GI.GstVideo.Flags.VideoChromaSite' or 'GI.GstVideo.Flags.VideoChromaSiteUnknown' when /@s@/ does
not contain a valid chroma description. -}
videoChromaFromString s = liftIO $ do
    s' <- textToCString s
    result <- gst_video_chroma_from_string s'
    let result' = wordToGFlags result
    freeMem s'
    return result'


-- function gst_video_calculate_display_ratio
-- Args : [Arg {argCName = "dar_n", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Numerator of the calculated display_ratio", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "dar_d", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Denominator of the calculated display_ratio", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "video_width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Width of the video frame in pixels", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "video_height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Height of the video frame in pixels", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "video_par_n", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Numerator of the pixel aspect ratio of the input video.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "video_par_d", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Denominator of the pixel aspect ratio of the input video.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "display_par_n", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Numerator of the pixel aspect ratio of the display device", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "display_par_d", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Denominator of the pixel aspect ratio of the display device", 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_calculate_display_ratio" gst_video_calculate_display_ratio :: 
    Ptr Word32 ->                           -- dar_n : TBasicType TUInt
    Ptr Word32 ->                           -- dar_d : TBasicType TUInt
    Word32 ->                               -- video_width : TBasicType TUInt
    Word32 ->                               -- video_height : TBasicType TUInt
    Word32 ->                               -- video_par_n : TBasicType TUInt
    Word32 ->                               -- video_par_d : TBasicType TUInt
    Word32 ->                               -- display_par_n : TBasicType TUInt
    Word32 ->                               -- display_par_d : TBasicType TUInt
    IO CInt

{- |
Given the Pixel Aspect Ratio and size of an input video frame, and the
pixel aspect ratio of the intended display device, calculates the actual
display ratio the video will be rendered with.
-}
videoCalculateDisplayRatio ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    {- ^ /@videoWidth@/: Width of the video frame in pixels -}
    -> Word32
    {- ^ /@videoHeight@/: Height of the video frame in pixels -}
    -> Word32
    {- ^ /@videoParN@/: Numerator of the pixel aspect ratio of the input video. -}
    -> Word32
    {- ^ /@videoParD@/: Denominator of the pixel aspect ratio of the input video. -}
    -> Word32
    {- ^ /@displayParN@/: Numerator of the pixel aspect ratio of the display device -}
    -> Word32
    {- ^ /@displayParD@/: Denominator of the pixel aspect ratio of the display device -}
    -> m (Bool,Word32,Word32)
    {- ^ __Returns:__ A boolean indicating success and a calculated Display Ratio in the
dar_n and dar_d parameters.
The return value is FALSE in the case of integer overflow or other error. -}
videoCalculateDisplayRatio videoWidth videoHeight videoParN videoParD displayParN displayParD = liftIO $ do
    darN <- allocMem :: IO (Ptr Word32)
    darD <- allocMem :: IO (Ptr Word32)
    result <- gst_video_calculate_display_ratio darN darD videoWidth videoHeight videoParN videoParD displayParN displayParD
    let result' = (/= 0) result
    darN' <- peek darN
    darD' <- peek darD
    freeMem darN
    freeMem darD
    return (result', darN', darD')


-- function gst_video_blend_scale_linear_RGBA
-- Args : [Arg {argCName = "src", argType = TInterface (Name {namespace = "GstVideo", name = "VideoInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstVideoInfo describing the video data in @src_buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "src_buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the source buffer containing video pixels to scale", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest_height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height in pixels to scale the video data in @src_buffer to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest_width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width in pixels to scale the video data in @src_buffer to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest", argType = TInterface (Name {namespace = "GstVideo", name = "VideoInfo"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "pointer to a #GstVideoInfo structure that will be filled in\n    with the details for @dest_buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing},Arg {argCName = "dest_buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to a #GstBuffer variable, which will be\n    set to a newly-allocated buffer containing the scaled pixels.", 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_blend_scale_linear_RGBA" gst_video_blend_scale_linear_RGBA :: 
    Ptr GstVideo.VideoInfo.VideoInfo ->     -- src : TInterface (Name {namespace = "GstVideo", name = "VideoInfo"})
    Ptr Gst.Buffer.Buffer ->                -- src_buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Int32 ->                                -- dest_height : TBasicType TInt
    Int32 ->                                -- dest_width : TBasicType TInt
    Ptr GstVideo.VideoInfo.VideoInfo ->     -- dest : TInterface (Name {namespace = "GstVideo", name = "VideoInfo"})
    Ptr (Ptr Gst.Buffer.Buffer) ->          -- dest_buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    IO ()

{- |
Scales a buffer containing RGBA (or AYUV) video. This is an internal
helper function which is used to scale subtitle overlays, and may be
deprecated in the near future. Use 'GI.GstVideo.Structs.VideoScaler.VideoScaler' to scale video buffers
instead.
-}
videoBlendScaleLinearRGBA ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoInfo.VideoInfo
    {- ^ /@src@/: the 'GI.GstVideo.Structs.VideoInfo.VideoInfo' describing the video data in /@srcBuffer@/ -}
    -> Gst.Buffer.Buffer
    {- ^ /@srcBuffer@/: the source buffer containing video pixels to scale -}
    -> Int32
    {- ^ /@destHeight@/: the height in pixels to scale the video data in /@srcBuffer@/ to -}
    -> Int32
    {- ^ /@destWidth@/: the width in pixels to scale the video data in /@srcBuffer@/ to -}
    -> m (GstVideo.VideoInfo.VideoInfo,Gst.Buffer.Buffer)
videoBlendScaleLinearRGBA src srcBuffer destHeight destWidth = liftIO $ do
    src' <- unsafeManagedPtrGetPtr src
    srcBuffer' <- unsafeManagedPtrGetPtr srcBuffer
    dest <- callocBoxedBytes 120 :: IO (Ptr GstVideo.VideoInfo.VideoInfo)
    destBuffer <- allocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
    gst_video_blend_scale_linear_RGBA src' srcBuffer' destHeight destWidth dest destBuffer
    dest' <- (wrapBoxed GstVideo.VideoInfo.VideoInfo) dest
    destBuffer' <- peek destBuffer
    destBuffer'' <- (wrapBoxed Gst.Buffer.Buffer) destBuffer'
    touchManagedPtr src
    touchManagedPtr srcBuffer
    freeMem destBuffer
    return (dest', destBuffer'')


-- function gst_video_blend
-- Args : [Arg {argCName = "dest", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFrame"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GstVideoFrame where to blend @src in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "src", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFrame"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstVideoFrame that we want to blend into", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The x offset in pixel where the @src image should be blended", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the y offset in pixel where the @src image should be blended", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "global_alpha", argType = TBasicType TFloat, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the global_alpha each per-pixel alpha value is multiplied\n               with", 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_blend" gst_video_blend :: 
    Ptr GstVideo.VideoFrame.VideoFrame ->   -- dest : TInterface (Name {namespace = "GstVideo", name = "VideoFrame"})
    Ptr GstVideo.VideoFrame.VideoFrame ->   -- src : TInterface (Name {namespace = "GstVideo", name = "VideoFrame"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    CFloat ->                               -- global_alpha : TBasicType TFloat
    IO CInt

{- |
Lets you blend the /@src@/ image into the /@dest@/ image
-}
videoBlend ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoFrame.VideoFrame
    {- ^ /@dest@/: The 'GI.GstVideo.Structs.VideoFrame.VideoFrame' where to blend /@src@/ in -}
    -> GstVideo.VideoFrame.VideoFrame
    {- ^ /@src@/: the 'GI.GstVideo.Structs.VideoFrame.VideoFrame' that we want to blend into -}
    -> Int32
    {- ^ /@x@/: The x offset in pixel where the /@src@/ image should be blended -}
    -> Int32
    {- ^ /@y@/: the y offset in pixel where the /@src@/ image should be blended -}
    -> Float
    {- ^ /@globalAlpha@/: the global_alpha each per-pixel alpha value is multiplied
               with -}
    -> m Bool
videoBlend dest src x y globalAlpha = liftIO $ do
    dest' <- unsafeManagedPtrGetPtr dest
    src' <- unsafeManagedPtrGetPtr src
    let globalAlpha' = realToFrac globalAlpha
    result <- gst_video_blend dest' src' x y globalAlpha'
    let result' = (/= 0) result
    touchManagedPtr dest
    touchManagedPtr src
    return result'


-- function gst_video_affine_transformation_meta_api_get_type
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TGType)
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_affine_transformation_meta_api_get_type" gst_video_affine_transformation_meta_api_get_type :: 
    IO CGType

{- |
/No description available in the introspection data./
-}
videoAffineTransformationMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoAffineTransformationMetaApiGetType  = liftIO $ do
    result <- gst_video_affine_transformation_meta_api_get_type
    let result' = GType result
    return result'


-- function gst_is_video_overlay_prepare_window_handle_message
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Gst", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstMessage", 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_is_video_overlay_prepare_window_handle_message" gst_is_video_overlay_prepare_window_handle_message :: 
    Ptr Gst.Message.Message ->              -- msg : TInterface (Name {namespace = "Gst", name = "Message"})
    IO CInt

{- |
Convenience function to check if the given message is a
\"prepare-window-handle\" message from a 'GI.GstVideo.Interfaces.VideoOverlay.VideoOverlay'.
-}
isVideoOverlayPrepareWindowHandleMessage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Message.Message
    {- ^ /@msg@/: a 'GI.Gst.Structs.Message.Message' -}
    -> m Bool
    {- ^ __Returns:__ whether /@msg@/ is a \"prepare-window-handle\" message -}
isVideoOverlayPrepareWindowHandleMessage msg = liftIO $ do
    msg' <- unsafeManagedPtrGetPtr msg
    result <- gst_is_video_overlay_prepare_window_handle_message msg'
    let result' = (/= 0) result
    touchManagedPtr msg
    return result'


-- function gst_buffer_pool_config_set_video_alignment
-- Args : [Arg {argCName = "config", argType = TInterface (Name {namespace = "Gst", name = "Structure"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStructure", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "align", argType = TInterface (Name {namespace = "GstVideo", name = "VideoAlignment"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoAlignment", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_pool_config_set_video_alignment" gst_buffer_pool_config_set_video_alignment :: 
    Ptr Gst.Structure.Structure ->          -- config : TInterface (Name {namespace = "Gst", name = "Structure"})
    Ptr GstVideo.VideoAlignment.VideoAlignment -> -- align : TInterface (Name {namespace = "GstVideo", name = "VideoAlignment"})
    IO ()

{- |
Set the video alignment in /@align@/ to the bufferpool configuration
/@config@/
-}
bufferPoolConfigSetVideoAlignment ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Structure.Structure
    {- ^ /@config@/: a 'GI.Gst.Structs.Structure.Structure' -}
    -> GstVideo.VideoAlignment.VideoAlignment
    {- ^ /@align@/: a 'GI.GstVideo.Structs.VideoAlignment.VideoAlignment' -}
    -> m ()
bufferPoolConfigSetVideoAlignment config align = liftIO $ do
    config' <- unsafeManagedPtrGetPtr config
    align' <- unsafeManagedPtrGetPtr align
    gst_buffer_pool_config_set_video_alignment config' align'
    touchManagedPtr config
    touchManagedPtr align
    return ()


-- function gst_buffer_pool_config_get_video_alignment
-- Args : [Arg {argCName = "config", argType = TInterface (Name {namespace = "Gst", name = "Structure"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStructure", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "align", argType = TInterface (Name {namespace = "GstVideo", name = "VideoAlignment"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoAlignment", 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_buffer_pool_config_get_video_alignment" gst_buffer_pool_config_get_video_alignment :: 
    Ptr Gst.Structure.Structure ->          -- config : TInterface (Name {namespace = "Gst", name = "Structure"})
    Ptr GstVideo.VideoAlignment.VideoAlignment -> -- align : TInterface (Name {namespace = "GstVideo", name = "VideoAlignment"})
    IO CInt

{- |
Get the video alignment from the bufferpool configuration /@config@/ in
in /@align@/
-}
bufferPoolConfigGetVideoAlignment ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Structure.Structure
    {- ^ /@config@/: a 'GI.Gst.Structs.Structure.Structure' -}
    -> GstVideo.VideoAlignment.VideoAlignment
    {- ^ /@align@/: a 'GI.GstVideo.Structs.VideoAlignment.VideoAlignment' -}
    -> m Bool
    {- ^ __Returns:__ @/TRUE/@ if /@config@/ could be parsed correctly. -}
bufferPoolConfigGetVideoAlignment config align = liftIO $ do
    config' <- unsafeManagedPtrGetPtr config
    align' <- unsafeManagedPtrGetPtr align
    result <- gst_buffer_pool_config_get_video_alignment config' align'
    let result' = (/= 0) result
    touchManagedPtr config
    touchManagedPtr align
    return result'


-- function gst_buffer_get_video_region_of_interest_meta_id
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a metadata id", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoRegionOfInterestMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_get_video_region_of_interest_meta_id" gst_buffer_get_video_region_of_interest_meta_id :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Int32 ->                                -- id : TBasicType TInt
    IO (Ptr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta)

{- |
Find the 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/ with the given /@id@/.

Buffers can contain multiple 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' metadata items if
multiple regions of interests are marked on a frame.
-}
bufferGetVideoRegionOfInterestMetaId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> Int32
    {- ^ /@id@/: a metadata id -}
    -> m GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' with /@id@/ or 'Nothing' when there is
no such metadata on /@buffer@/. -}
bufferGetVideoRegionOfInterestMetaId buffer id = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- gst_buffer_get_video_region_of_interest_meta_id buffer' id
    checkUnexpectedReturnNULL "bufferGetVideoRegionOfInterestMetaId" result
    result' <- (newPtr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_get_video_meta_id
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a metadata id", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_get_video_meta_id" gst_buffer_get_video_meta_id :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Int32 ->                                -- id : TBasicType TInt
    IO (Ptr GstVideo.VideoMeta.VideoMeta)

{- |
Find the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/ with the given /@id@/.

Buffers can contain multiple 'GI.GstVideo.Structs.VideoMeta.VideoMeta' metadata items when dealing with
multiview buffers.
-}
bufferGetVideoMetaId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> Int32
    {- ^ /@id@/: a metadata id -}
    -> m GstVideo.VideoMeta.VideoMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' with /@id@/ or 'Nothing' when there is no such metadata
on /@buffer@/. -}
bufferGetVideoMetaId buffer id = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- gst_buffer_get_video_meta_id buffer' id
    checkUnexpectedReturnNULL "bufferGetVideoMetaId" result
    result' <- (newPtr GstVideo.VideoMeta.VideoMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_get_video_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_get_video_meta" gst_buffer_get_video_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    IO (Ptr GstVideo.VideoMeta.VideoMeta)

{- |
Find the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/ with the lowest /@id@/.

Buffers can contain multiple 'GI.GstVideo.Structs.VideoMeta.VideoMeta' metadata items when dealing with
multiview buffers.
-}
bufferGetVideoMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> m GstVideo.VideoMeta.VideoMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' with lowest id (usually 0) or 'Nothing' when there
is no such metadata on /@buffer@/. -}
bufferGetVideoMeta buffer = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- gst_buffer_get_video_meta buffer'
    checkUnexpectedReturnNULL "bufferGetVideoMeta" result
    result' <- (newPtr GstVideo.VideoMeta.VideoMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_add_video_time_code_meta_full
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fps_n", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "framerate numerator", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fps_d", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "framerate denominator", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "latest_daily_jam", argType = TInterface (Name {namespace = "GLib", name = "DateTime"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDateTime for the latest daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoTimeCodeFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoTimeCodeFlags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "hours", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "hours since the daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "minutes", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "minutes since the daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "seconds", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "seconds since the daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frames", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "frames since the daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "field_count", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "fields since the daily jam", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoTimeCodeMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_time_code_meta_full" gst_buffer_add_video_time_code_meta_full :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Word32 ->                               -- fps_n : TBasicType TUInt
    Word32 ->                               -- fps_d : TBasicType TUInt
    Ptr GLib.DateTime.DateTime ->           -- latest_daily_jam : TInterface (Name {namespace = "GLib", name = "DateTime"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoTimeCodeFlags"})
    Word32 ->                               -- hours : TBasicType TUInt
    Word32 ->                               -- minutes : TBasicType TUInt
    Word32 ->                               -- seconds : TBasicType TUInt
    Word32 ->                               -- frames : TBasicType TUInt
    Word32 ->                               -- field_count : TBasicType TUInt
    IO (Ptr GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta)

{- |
Attaches 'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' metadata to /@buffer@/ with the given
parameters.

@since 1.10
-}
bufferAddVideoTimeCodeMetaFull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> Word32
    {- ^ /@fpsN@/: framerate numerator -}
    -> Word32
    {- ^ /@fpsD@/: framerate denominator -}
    -> GLib.DateTime.DateTime
    {- ^ /@latestDailyJam@/: a 'GI.GLib.Structs.DateTime.DateTime' for the latest daily jam -}
    -> [GstVideo.Flags.VideoTimeCodeFlags]
    {- ^ /@flags@/: a 'GI.GstVideo.Flags.VideoTimeCodeFlags' -}
    -> Word32
    {- ^ /@hours@/: hours since the daily jam -}
    -> Word32
    {- ^ /@minutes@/: minutes since the daily jam -}
    -> Word32
    {- ^ /@seconds@/: seconds since the daily jam -}
    -> Word32
    {- ^ /@frames@/: frames since the daily jam -}
    -> Word32
    {- ^ /@fieldCount@/: fields since the daily jam -}
    -> m GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' on /@buffer@/. -}
bufferAddVideoTimeCodeMetaFull buffer fpsN fpsD latestDailyJam flags hours minutes seconds frames fieldCount = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    latestDailyJam' <- unsafeManagedPtrGetPtr latestDailyJam
    let flags' = gflagsToWord flags
    result <- gst_buffer_add_video_time_code_meta_full buffer' fpsN fpsD latestDailyJam' flags' hours minutes seconds frames fieldCount
    checkUnexpectedReturnNULL "bufferAddVideoTimeCodeMetaFull" result
    result' <- (newPtr GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta) result
    touchManagedPtr buffer
    touchManagedPtr latestDailyJam
    return result'


-- function gst_buffer_add_video_time_code_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tc", argType = TInterface (Name {namespace = "GstVideo", name = "VideoTimeCode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoTimeCode", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoTimeCodeMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_time_code_meta" gst_buffer_add_video_time_code_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Ptr GstVideo.VideoTimeCode.VideoTimeCode -> -- tc : TInterface (Name {namespace = "GstVideo", name = "VideoTimeCode"})
    IO (Ptr GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta)

{- |
Attaches 'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' metadata to /@buffer@/ with the given
parameters.

@since 1.10
-}
bufferAddVideoTimeCodeMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> GstVideo.VideoTimeCode.VideoTimeCode
    {- ^ /@tc@/: a 'GI.GstVideo.Structs.VideoTimeCode.VideoTimeCode' -}
    -> m GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' on /@buffer@/. -}
bufferAddVideoTimeCodeMeta buffer tc = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    tc' <- unsafeManagedPtrGetPtr tc
    result <- gst_buffer_add_video_time_code_meta buffer' tc'
    checkUnexpectedReturnNULL "bufferAddVideoTimeCodeMeta" result
    result' <- (newPtr GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta) result
    touchManagedPtr buffer
    touchManagedPtr tc
    return result'


-- function gst_buffer_add_video_region_of_interest_meta_id
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "roi_type", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Type of the region of interest (e.g. \"face\")", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "X position", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Y position", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "w", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "h", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoRegionOfInterestMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_region_of_interest_meta_id" gst_buffer_add_video_region_of_interest_meta_id :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Word32 ->                               -- roi_type : TBasicType TUInt32
    Word32 ->                               -- x : TBasicType TUInt
    Word32 ->                               -- y : TBasicType TUInt
    Word32 ->                               -- w : TBasicType TUInt
    Word32 ->                               -- h : TBasicType TUInt
    IO (Ptr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta)

{- |
Attaches 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' metadata to /@buffer@/ with the given
parameters.
-}
bufferAddVideoRegionOfInterestMetaId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> Word32
    {- ^ /@roiType@/: Type of the region of interest (e.g. \"face\") -}
    -> Word32
    {- ^ /@x@/: X position -}
    -> Word32
    {- ^ /@y@/: Y position -}
    -> Word32
    {- ^ /@w@/: width -}
    -> Word32
    {- ^ /@h@/: height -}
    -> m GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/. -}
bufferAddVideoRegionOfInterestMetaId buffer roiType x y w h = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- gst_buffer_add_video_region_of_interest_meta_id buffer' roiType x y w h
    checkUnexpectedReturnNULL "bufferAddVideoRegionOfInterestMetaId" result
    result' <- (newPtr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_add_video_region_of_interest_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "roi_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Type of the region of interest (e.g. \"face\")", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "X position", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Y position", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "w", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "h", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoRegionOfInterestMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_region_of_interest_meta" gst_buffer_add_video_region_of_interest_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    CString ->                              -- roi_type : TBasicType TUTF8
    Word32 ->                               -- x : TBasicType TUInt
    Word32 ->                               -- y : TBasicType TUInt
    Word32 ->                               -- w : TBasicType TUInt
    Word32 ->                               -- h : TBasicType TUInt
    IO (Ptr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta)

{- |
Attaches 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' metadata to /@buffer@/ with the given
parameters.
-}
bufferAddVideoRegionOfInterestMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> T.Text
    {- ^ /@roiType@/: Type of the region of interest (e.g. \"face\") -}
    -> Word32
    {- ^ /@x@/: X position -}
    -> Word32
    {- ^ /@y@/: Y position -}
    -> Word32
    {- ^ /@w@/: width -}
    -> Word32
    {- ^ /@h@/: height -}
    -> m GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/. -}
bufferAddVideoRegionOfInterestMeta buffer roiType x y w h = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    roiType' <- textToCString roiType
    result <- gst_buffer_add_video_region_of_interest_meta buffer' roiType' x y w h
    checkUnexpectedReturnNULL "bufferAddVideoRegionOfInterestMeta" result
    result' <- (newPtr GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) result
    touchManagedPtr buffer
    freeMem roiType'
    return result'


-- function gst_buffer_add_video_overlay_composition_meta
-- Args : [Arg {argCName = "buf", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "comp", argType = TInterface (Name {namespace = "GstVideo", name = "VideoOverlayComposition"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstVideoOverlayComposition", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoOverlayCompositionMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_overlay_composition_meta" gst_buffer_add_video_overlay_composition_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buf : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Ptr GstVideo.VideoOverlayComposition.VideoOverlayComposition -> -- comp : TInterface (Name {namespace = "GstVideo", name = "VideoOverlayComposition"})
    IO (Ptr GstVideo.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta)

{- |
Sets an overlay composition on a buffer. The buffer will obtain its own
reference to the composition, meaning this function does not take ownership
of /@comp@/.
-}
bufferAddVideoOverlayCompositionMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buf@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> Maybe (GstVideo.VideoOverlayComposition.VideoOverlayComposition)
    {- ^ /@comp@/: a 'GI.GstVideo.Structs.VideoOverlayComposition.VideoOverlayComposition' -}
    -> m GstVideo.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta
    {- ^ __Returns:__ a 'GI.GstVideo.Structs.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta' -}
bufferAddVideoOverlayCompositionMeta buf comp = liftIO $ do
    buf' <- unsafeManagedPtrGetPtr buf
    maybeComp <- case comp of
        Nothing -> return nullPtr
        Just jComp -> do
            jComp' <- unsafeManagedPtrGetPtr jComp
            return jComp'
    result <- gst_buffer_add_video_overlay_composition_meta buf' maybeComp
    checkUnexpectedReturnNULL "bufferAddVideoOverlayCompositionMeta" result
    result' <- (newPtr GstVideo.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta) result
    touchManagedPtr buf
    whenJust comp touchManagedPtr
    return result'


-- function gst_buffer_add_video_meta_full
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFrameFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "#GstVideoFrameFlags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "format", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_planes", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of planes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "offset of each plane", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "stride", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "stride of each plane", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_meta_full" gst_buffer_add_video_meta_full :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoFrameFlags"})
    CUInt ->                                -- format : TInterface (Name {namespace = "GstVideo", name = "VideoFormat"})
    Word32 ->                               -- width : TBasicType TUInt
    Word32 ->                               -- height : TBasicType TUInt
    Word32 ->                               -- n_planes : TBasicType TUInt
    Word64 ->                               -- offset : TBasicType TUInt64
    Int32 ->                                -- stride : TBasicType TInt
    IO (Ptr GstVideo.VideoMeta.VideoMeta)

{- |
Attaches GstVideoMeta metadata to /@buffer@/ with the given parameters.
-}
bufferAddVideoMetaFull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> [GstVideo.Flags.VideoFrameFlags]
    {- ^ /@flags@/: 'GI.GstVideo.Flags.VideoFrameFlags' -}
    -> GstVideo.Enums.VideoFormat
    {- ^ /@format@/: a 'GI.GstVideo.Enums.VideoFormat' -}
    -> Word32
    {- ^ /@width@/: the width -}
    -> Word32
    {- ^ /@height@/: the height -}
    -> Word32
    {- ^ /@nPlanes@/: number of planes -}
    -> Word64
    {- ^ /@offset@/: offset of each plane -}
    -> Int32
    {- ^ /@stride@/: stride of each plane -}
    -> m GstVideo.VideoMeta.VideoMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/. -}
bufferAddVideoMetaFull buffer flags format width height nPlanes offset stride = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    let flags' = gflagsToWord flags
    let format' = (fromIntegral . fromEnum) format
    result <- gst_buffer_add_video_meta_full buffer' flags' format' width height nPlanes offset stride
    checkUnexpectedReturnNULL "bufferAddVideoMetaFull" result
    result' <- (newPtr GstVideo.VideoMeta.VideoMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_add_video_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFrameFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "#GstVideoFrameFlags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "format", argType = TInterface (Name {namespace = "GstVideo", name = "VideoFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstVideoFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_meta" gst_buffer_add_video_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GstVideo", name = "VideoFrameFlags"})
    CUInt ->                                -- format : TInterface (Name {namespace = "GstVideo", name = "VideoFormat"})
    Word32 ->                               -- width : TBasicType TUInt
    Word32 ->                               -- height : TBasicType TUInt
    IO (Ptr GstVideo.VideoMeta.VideoMeta)

{- |
Attaches GstVideoMeta metadata to /@buffer@/ with the given parameters and the
default offsets and strides for /@format@/ and /@width@/ x /@height@/.

This function calculates the default offsets and strides and then calls
'GI.GstVideo.Functions.bufferAddVideoMetaFull' with them.
-}
bufferAddVideoMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> [GstVideo.Flags.VideoFrameFlags]
    {- ^ /@flags@/: 'GI.GstVideo.Flags.VideoFrameFlags' -}
    -> GstVideo.Enums.VideoFormat
    {- ^ /@format@/: a 'GI.GstVideo.Enums.VideoFormat' -}
    -> Word32
    {- ^ /@width@/: the width -}
    -> Word32
    {- ^ /@height@/: the height -}
    -> m GstVideo.VideoMeta.VideoMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/. -}
bufferAddVideoMeta buffer flags format width height = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    let flags' = gflagsToWord flags
    let format' = (fromIntegral . fromEnum) format
    result <- gst_buffer_add_video_meta buffer' flags' format' width height
    checkUnexpectedReturnNULL "bufferAddVideoMeta" result
    result' <- (newPtr GstVideo.VideoMeta.VideoMeta) result
    touchManagedPtr buffer
    return result'


-- function gst_buffer_add_video_gl_texture_upload_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "texture_orientation", argType = TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureOrientation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstVideoGLTextureOrientation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_textures", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of textures", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "texture_type", argType = TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "array of #GstVideoGLTextureType", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "upload", argType = TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureUpload"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the function to upload the buffer to a specific texture ID", sinceVersion = Nothing}, argScope = ScopeTypeCall, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the implementor of @upload", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data_copy", argType = TInterface (Name {namespace = "GObject", name = "BoxedCopyFunc"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "function to copy @user_data", sinceVersion = Nothing}, argScope = ScopeTypeCall, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data_free", argType = TInterface (Name {namespace = "GObject", name = "BoxedFreeFunc"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "function to free @user_data", sinceVersion = Nothing}, argScope = ScopeTypeCall, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureUploadMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_gl_texture_upload_meta" gst_buffer_add_video_gl_texture_upload_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    CUInt ->                                -- texture_orientation : TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureOrientation"})
    Word32 ->                               -- n_textures : TBasicType TUInt
    CUInt ->                                -- texture_type : TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureType"})
    FunPtr GstVideo.Callbacks.C_VideoGLTextureUpload -> -- upload : TInterface (Name {namespace = "GstVideo", name = "VideoGLTextureUpload"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GObject.Callbacks.C_BoxedCopyFunc -> -- user_data_copy : TInterface (Name {namespace = "GObject", name = "BoxedCopyFunc"})
    FunPtr GObject.Callbacks.C_BoxedFreeFunc -> -- user_data_free : TInterface (Name {namespace = "GObject", name = "BoxedFreeFunc"})
    IO (Ptr GstVideo.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta)

{- |
Attaches GstVideoGLTextureUploadMeta metadata to /@buffer@/ with the given
parameters.
-}
bufferAddVideoGlTextureUploadMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> GstVideo.Enums.VideoGLTextureOrientation
    {- ^ /@textureOrientation@/: the 'GI.GstVideo.Enums.VideoGLTextureOrientation' -}
    -> Word32
    {- ^ /@nTextures@/: the number of textures -}
    -> GstVideo.Enums.VideoGLTextureType
    {- ^ /@textureType@/: array of 'GI.GstVideo.Enums.VideoGLTextureType' -}
    -> GstVideo.Callbacks.VideoGLTextureUpload
    {- ^ /@upload@/: the function to upload the buffer to a specific texture ID -}
    -> GObject.Callbacks.BoxedCopyFunc
    {- ^ /@userDataCopy@/: function to copy /@userData@/ -}
    -> GObject.Callbacks.BoxedFreeFunc
    {- ^ /@userDataFree@/: function to free /@userData@/ -}
    -> m GstVideo.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta' on /@buffer@/. -}
bufferAddVideoGlTextureUploadMeta buffer textureOrientation nTextures textureType upload userDataCopy userDataFree = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    let textureOrientation' = (fromIntegral . fromEnum) textureOrientation
    let textureType' = (fromIntegral . fromEnum) textureType
    upload' <- GstVideo.Callbacks.mk_VideoGLTextureUpload (GstVideo.Callbacks.wrap_VideoGLTextureUpload Nothing upload)
    userDataCopy' <- GObject.Callbacks.mk_BoxedCopyFunc (GObject.Callbacks.wrap_BoxedCopyFunc Nothing userDataCopy)
    userDataFree' <- GObject.Callbacks.mk_BoxedFreeFunc (GObject.Callbacks.wrap_BoxedFreeFunc Nothing userDataFree)
    let userData = nullPtr
    result <- gst_buffer_add_video_gl_texture_upload_meta buffer' textureOrientation' nTextures textureType' upload' userData userDataCopy' userDataFree'
    checkUnexpectedReturnNULL "bufferAddVideoGlTextureUploadMeta" result
    result' <- (newPtr GstVideo.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta) result
    safeFreeFunPtr $ castFunPtrToPtr upload'
    safeFreeFunPtr $ castFunPtrToPtr userDataCopy'
    safeFreeFunPtr $ castFunPtrToPtr userDataFree'
    touchManagedPtr buffer
    return result'


-- function gst_buffer_add_video_affine_transformation_meta
-- Args : [Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GstVideo", name = "VideoAffineTransformationMeta"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_affine_transformation_meta" gst_buffer_add_video_affine_transformation_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    IO (Ptr GstVideo.VideoAffineTransformationMeta.VideoAffineTransformationMeta)

{- |
Attaches GstVideoAffineTransformationMeta metadata to /@buffer@/ with
the given parameters.

@since 1.8
-}
bufferAddVideoAffineTransformationMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    {- ^ /@buffer@/: a 'GI.Gst.Structs.Buffer.Buffer' -}
    -> m GstVideo.VideoAffineTransformationMeta.VideoAffineTransformationMeta
    {- ^ __Returns:__ the 'GI.GstVideo.Structs.VideoAffineTransformationMeta.VideoAffineTransformationMeta' on /@buffer@/. -}
bufferAddVideoAffineTransformationMeta buffer = liftIO $ do
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- gst_buffer_add_video_affine_transformation_meta buffer'
    checkUnexpectedReturnNULL "bufferAddVideoAffineTransformationMeta" result
    result' <- (newPtr GstVideo.VideoAffineTransformationMeta.VideoAffineTransformationMeta) result
    touchManagedPtr buffer
    return result'