-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

module GI.GstVideo.Functions
    ( 

 -- * Methods


-- ** bufferAddVideoAfdMeta #method:bufferAddVideoAfdMeta#

    bufferAddVideoAfdMeta                   ,


-- ** bufferAddVideoAffineTransformationMeta #method:bufferAddVideoAffineTransformationMeta#

    bufferAddVideoAffineTransformationMeta  ,


-- ** bufferAddVideoBarMeta #method:bufferAddVideoBarMeta#

    bufferAddVideoBarMeta                   ,


-- ** bufferAddVideoCaptionMeta #method:bufferAddVideoCaptionMeta#

    bufferAddVideoCaptionMeta               ,


-- ** 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,


-- ** videoAfdMetaApiGetType #method:videoAfdMetaApiGetType#

    videoAfdMetaApiGetType                  ,


-- ** videoAffineTransformationMetaApiGetType #method:videoAffineTransformationMetaApiGetType#

    videoAffineTransformationMetaApiGetType ,


-- ** videoBarMetaApiGetType #method:videoBarMetaApiGetType#

    videoBarMetaApiGetType                  ,


-- ** videoBlend #method:videoBlend#

    videoBlend                              ,


-- ** videoBlendScaleLinearRGBA #method:videoBlendScaleLinearRGBA#

    videoBlendScaleLinearRGBA               ,


-- ** videoCalculateDisplayRatio #method:videoCalculateDisplayRatio#

    videoCalculateDisplayRatio              ,


-- ** videoCaptionMetaApiGetType #method:videoCaptionMetaApiGetType#

    videoCaptionMetaApiGetType              ,


-- ** 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     ,


-- ** videoFormatsRaw #method:videoFormatsRaw#

    videoFormatsRaw                         ,


-- ** videoGlTextureUploadMetaApiGetType #method:videoGlTextureUploadMetaApiGetType#

    videoGlTextureUploadMetaApiGetType      ,


-- ** videoGuessFramerate #method:videoGuessFramerate#

    videoGuessFramerate                     ,


-- ** videoMakeRawCaps #method:videoMakeRawCaps#

    videoMakeRawCaps                        ,


-- ** videoMakeRawCapsWithFeatures #method:videoMakeRawCapsWithFeatures#

    videoMakeRawCapsWithFeatures            ,


-- ** 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

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.CapsFeatures as Gst.CapsFeatures
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.VideoAFDMeta as GstVideo.VideoAFDMeta
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.VideoBarMeta as GstVideo.VideoBarMeta
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoCaptionMeta as GstVideo.VideoCaptionMeta
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 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoTimeCodeMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_time_code_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 'GI.GstVideo.Enums.VideoTileTypeIndexed'.
-- 
-- /Since: 1.4/
videoTileGetIndex ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.Enums.VideoTileMode
    -- ^ /@mode@/: a t'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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoTileMode -> Int32 -> Int32 -> Int32 -> Int32 -> m Word32
videoTileGetIndex VideoTileMode
mode Int32
x Int32
y Int32
xTiles Int32
yTiles = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoTileMode -> Int) -> VideoTileMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoTileMode -> Int
forall a. Enum a => a -> Int
fromEnum) VideoTileMode
mode
    Word32
result <- CUInt -> Int32 -> Int32 -> Int32 -> Int32 -> IO Word32
gst_video_tile_get_index CUInt
mode' Int32
x Int32
y Int32
xTiles Int32
yTiles
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoRegionOfInterestMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_region_of_interest_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoOverlayCompositionMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_overlay_composition_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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"})
    CInt ->                                 -- 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 t'GI.GstVideo.Structs.VideoInfo.VideoInfo' into
-- the requested mode.
-- 
-- /Since: 1.6/
videoMultiviewVideoInfoChangeMode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoInfo.VideoInfo
    -- ^ /@info@/: A t'GI.GstVideo.Structs.VideoInfo.VideoInfo' structure to operate on
    -> GstVideo.Enums.VideoMultiviewMode
    -- ^ /@outMviewMode@/: A t'GI.GstVideo.Enums.VideoMultiviewMode' value
    -> [GstVideo.Flags.VideoMultiviewFlags]
    -- ^ /@outMviewFlags@/: A set of t'GI.GstVideo.Flags.VideoMultiviewFlags'
    -> m ()
videoMultiviewVideoInfoChangeMode :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoInfo -> VideoMultiviewMode -> [VideoMultiviewFlags] -> m ()
videoMultiviewVideoInfoChangeMode VideoInfo
info VideoMultiviewMode
outMviewMode [VideoMultiviewFlags]
outMviewFlags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr VideoInfo
info' <- VideoInfo -> IO (Ptr VideoInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoInfo
info
    let outMviewMode' :: CInt
outMviewMode' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (VideoMultiviewMode -> Int) -> VideoMultiviewMode -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoMultiviewMode -> Int
forall a. Enum a => a -> Int
fromEnum) VideoMultiviewMode
outMviewMode
    let outMviewFlags' :: CUInt
outMviewFlags' = [VideoMultiviewFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [VideoMultiviewFlags]
outMviewFlags
    Ptr VideoInfo -> CInt -> CUInt -> IO ()
gst_video_multiview_video_info_change_mode Ptr VideoInfo
info' CInt
outMviewMode' CUInt
outMviewFlags'
    VideoInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoInfo
info
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function 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 :: 
    CInt ->                                 -- 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 t'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_FLAGS_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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoMultiviewMode
-> Word32 -> Word32 -> Word32 -> Word32 -> m Bool
videoMultiviewGuessHalfAspect VideoMultiviewMode
mvMode Word32
width Word32
height Word32
parN Word32
parD = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    let mvMode' :: CInt
mvMode' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (VideoMultiviewMode -> Int) -> VideoMultiviewMode -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoMultiviewMode -> Int
forall a. Enum a => a -> Int
fromEnum) VideoMultiviewMode
mvMode
    CInt
result <- CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO CInt
gst_video_multiview_guess_half_aspect CInt
mvMode' Word32
width Word32
height Word32
parN Word32
parD
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function video_multiview_get_unpacked_modes
-- Args: []
-- Lengths: []
-- returnType: Just TGValue
-- 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 t'GI.GObject.Structs.Value.Value' containing a list of \'unpacked\' stereo video modes
    -- 
    -- Utility function that returns a t'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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GValue
videoMultiviewGetUnpackedModes  = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
result <- IO (Ptr GValue)
gst_video_multiview_get_unpacked_modes
    Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMultiviewGetUnpackedModes" Ptr GValue
result
    GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'


-- function video_multiview_get_mono_modes
-- Args: []
-- Lengths: []
-- returnType: Just TGValue
-- 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 t'GI.GObject.Structs.Value.Value' containing a list of mono video modes
    -- 
    -- Utility function that returns a t'GI.GObject.Structs.Value.Value' with a GstList of mono video
    -- modes (mono\/left\/right) for use in caps negotiations.
videoMultiviewGetMonoModes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GValue
videoMultiviewGetMonoModes  = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
result <- IO (Ptr GValue)
gst_video_multiview_get_mono_modes
    Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMultiviewGetMonoModes" Ptr GValue
result
    GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'


-- function video_multiview_get_doubled_width_modes
-- Args: []
-- Lengths: []
-- returnType: Just TGValue
-- 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 t'GI.GObject.Structs.Value.Value' containing a list of stereo video modes
    -- 
    -- Utility function that returns a t'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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GValue
videoMultiviewGetDoubledWidthModes  = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
result <- IO (Ptr GValue)
gst_video_multiview_get_doubled_width_modes
    Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMultiviewGetDoubledWidthModes" Ptr GValue
result
    GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'


-- function video_multiview_get_doubled_size_modes
-- Args: []
-- Lengths: []
-- returnType: Just TGValue
-- 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 t'GI.GObject.Structs.Value.Value' containing a list of stereo video modes
    -- 
    -- Utility function that returns a t'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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GValue
videoMultiviewGetDoubledSizeModes  = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
result <- IO (Ptr GValue)
gst_video_multiview_get_doubled_size_modes
    Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMultiviewGetDoubledSizeModes" Ptr GValue
result
    GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'


-- function video_multiview_get_doubled_height_modes
-- Args: []
-- Lengths: []
-- returnType: Just TGValue
-- 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 t'GI.GObject.Structs.Value.Value' containing a list of stereo video modes
    -- 
    -- Utility function that returns a t'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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GValue
videoMultiviewGetDoubledHeightModes  = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
result <- IO (Ptr GValue)
gst_video_multiview_get_doubled_height_modes
    Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMultiviewGetDoubledHeightModes" Ptr GValue
result
    GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function video_make_raw_caps_with_features
-- Args: [ Arg
--           { argCName = "formats"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 1
--                 (TInterface Name { namespace = "GstVideo" , name = "VideoFormat" })
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of raw #GstVideoFormat, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the size of @formats"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "features"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstCapsFeatures to set on the caps"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the size of @formats"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Caps" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_make_raw_caps_with_features" gst_video_make_raw_caps_with_features :: 
    Ptr CUInt ->                            -- formats : TCArray False (-1) 1 (TInterface (Name {namespace = "GstVideo", name = "VideoFormat"}))
    Word32 ->                               -- len : TBasicType TUInt
    Ptr Gst.CapsFeatures.CapsFeatures ->    -- features : TInterface (Name {namespace = "Gst", name = "CapsFeatures"})
    IO (Ptr Gst.Caps.Caps)

-- | Return a generic raw video caps for formats defined in /@formats@/ with features
-- /@features@/.
-- If /@formats@/ is 'P.Nothing' returns a caps for all the supported video formats,
-- see 'GI.GstVideo.Functions.videoFormatsRaw'.
-- 
-- /Since: 1.18/
videoMakeRawCapsWithFeatures ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe ([GstVideo.Enums.VideoFormat])
    -- ^ /@formats@/: an array of raw t'GI.GstVideo.Enums.VideoFormat', or 'P.Nothing'
    -> Maybe (Gst.CapsFeatures.CapsFeatures)
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures' to set on the caps
    -> m Gst.Caps.Caps
    -- ^ __Returns:__ a video /@gstCaps@/
videoMakeRawCapsWithFeatures :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe [VideoFormat] -> Maybe CapsFeatures -> m Caps
videoMakeRawCapsWithFeatures Maybe [VideoFormat]
formats Maybe CapsFeatures
features = IO Caps -> m Caps
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Caps -> m Caps) -> IO Caps -> m Caps
forall a b. (a -> b) -> a -> b
$ do
    let len :: Word32
len = case Maybe [VideoFormat]
formats of
            Maybe [VideoFormat]
Nothing -> Word32
0
            Just [VideoFormat]
jFormats -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [VideoFormat] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [VideoFormat]
jFormats
    Ptr CUInt
maybeFormats <- case Maybe [VideoFormat]
formats of
        Maybe [VideoFormat]
Nothing -> Ptr CUInt -> IO (Ptr CUInt)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CUInt
forall a. Ptr a
nullPtr
        Just [VideoFormat]
jFormats -> do
            let jFormats' :: [CUInt]
jFormats' = (VideoFormat -> CUInt) -> [VideoFormat] -> [CUInt]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoFormat -> Int) -> VideoFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoFormat -> Int
forall a. Enum a => a -> Int
fromEnum) [VideoFormat]
jFormats
            Ptr CUInt
jFormats'' <- [CUInt] -> IO (Ptr CUInt)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CUInt]
jFormats'
            Ptr CUInt -> IO (Ptr CUInt)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CUInt
jFormats''
    Ptr CapsFeatures
maybeFeatures <- case Maybe CapsFeatures
features of
        Maybe CapsFeatures
Nothing -> Ptr CapsFeatures -> IO (Ptr CapsFeatures)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CapsFeatures
forall a. Ptr a
nullPtr
        Just CapsFeatures
jFeatures -> do
            Ptr CapsFeatures
jFeatures' <- CapsFeatures -> IO (Ptr CapsFeatures)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed CapsFeatures
jFeatures
            Ptr CapsFeatures -> IO (Ptr CapsFeatures)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CapsFeatures
jFeatures'
    Ptr Caps
result <- Ptr CUInt -> Word32 -> Ptr CapsFeatures -> IO (Ptr Caps)
gst_video_make_raw_caps_with_features Ptr CUInt
maybeFormats Word32
len Ptr CapsFeatures
maybeFeatures
    Text -> Ptr Caps -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMakeRawCapsWithFeatures" Ptr Caps
result
    Caps
result' <- ((ManagedPtr Caps -> Caps) -> Ptr Caps -> IO Caps
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Caps -> Caps
Gst.Caps.Caps) Ptr Caps
result
    Maybe CapsFeatures -> (CapsFeatures -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe CapsFeatures
features CapsFeatures -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
maybeFormats
    Caps -> IO Caps
forall (m :: * -> *) a. Monad m => a -> m a
return Caps
result'


-- function video_make_raw_caps
-- Args: [ Arg
--           { argCName = "formats"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 1
--                 (TInterface Name { namespace = "GstVideo" , name = "VideoFormat" })
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of raw #GstVideoFormat, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the size of @formats"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the size of @formats"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Caps" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_make_raw_caps" gst_video_make_raw_caps :: 
    Ptr CUInt ->                            -- formats : TCArray False (-1) 1 (TInterface (Name {namespace = "GstVideo", name = "VideoFormat"}))
    Word32 ->                               -- len : TBasicType TUInt
    IO (Ptr Gst.Caps.Caps)

-- | Return a generic raw video caps for formats defined in /@formats@/.
-- If /@formats@/ is 'P.Nothing' returns a caps for all the supported raw video formats,
-- see 'GI.GstVideo.Functions.videoFormatsRaw'.
-- 
-- /Since: 1.18/
videoMakeRawCaps ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe ([GstVideo.Enums.VideoFormat])
    -- ^ /@formats@/: an array of raw t'GI.GstVideo.Enums.VideoFormat', or 'P.Nothing'
    -> m Gst.Caps.Caps
    -- ^ __Returns:__ a video /@gstCaps@/
videoMakeRawCaps :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe [VideoFormat] -> m Caps
videoMakeRawCaps Maybe [VideoFormat]
formats = IO Caps -> m Caps
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Caps -> m Caps) -> IO Caps -> m Caps
forall a b. (a -> b) -> a -> b
$ do
    let len :: Word32
len = case Maybe [VideoFormat]
formats of
            Maybe [VideoFormat]
Nothing -> Word32
0
            Just [VideoFormat]
jFormats -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [VideoFormat] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [VideoFormat]
jFormats
    Ptr CUInt
maybeFormats <- case Maybe [VideoFormat]
formats of
        Maybe [VideoFormat]
Nothing -> Ptr CUInt -> IO (Ptr CUInt)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CUInt
forall a. Ptr a
nullPtr
        Just [VideoFormat]
jFormats -> do
            let jFormats' :: [CUInt]
jFormats' = (VideoFormat -> CUInt) -> [VideoFormat] -> [CUInt]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoFormat -> Int) -> VideoFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoFormat -> Int
forall a. Enum a => a -> Int
fromEnum) [VideoFormat]
jFormats
            Ptr CUInt
jFormats'' <- [CUInt] -> IO (Ptr CUInt)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CUInt]
jFormats'
            Ptr CUInt -> IO (Ptr CUInt)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CUInt
jFormats''
    Ptr Caps
result <- Ptr CUInt -> Word32 -> IO (Ptr Caps)
gst_video_make_raw_caps Ptr CUInt
maybeFormats Word32
len
    Text -> Ptr Caps -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoMakeRawCaps" Ptr Caps
result
    Caps
result' <- ((ManagedPtr Caps -> Caps) -> Ptr Caps -> IO Caps
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Caps -> Caps
Gst.Caps.Caps) Ptr Caps
result
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
maybeFormats
    Caps -> IO Caps
forall (m :: * -> *) a. Monad m => a -> m a
return Caps
result'


-- function 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 'P.False'.
-- 
-- It returns 'P.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:__ 'P.True' if a close \"standard\" framerate was
    -- recognised, and 'P.False' otherwise.
videoGuessFramerate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
CGType -> m (Bool, Int32, Int32)
videoGuessFramerate CGType
duration = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Int32
destN <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
destD <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    CInt
result <- CGType -> Ptr Int32 -> Ptr Int32 -> IO CInt
gst_video_guess_framerate CGType
duration Ptr Int32
destN Ptr Int32
destD
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Int32
destN' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
destN
    Int32
destD' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
destD
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
destN
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
destD
    (Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
destN', Int32
destD')


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoGlTextureUploadMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_gl_texture_upload_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function video_formats_raw
-- Args: [ Arg
--           { argCName = "len"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of elements in the returned array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the number of elements in the returned array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just
--               (TCArray
--                  False
--                  (-1)
--                  0
--                  (TInterface
--                     Name { namespace = "GstVideo" , name = "VideoFormat" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_video_formats_raw" gst_video_formats_raw :: 
    Ptr Word32 ->                           -- len : TBasicType TUInt
    IO (Ptr CUInt)

-- | Return all the raw video formats supported by GStreamer.
-- 
-- /Since: 1.18/
videoFormatsRaw ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [GstVideo.Enums.VideoFormat]
    -- ^ __Returns:__ an array of t'GI.GstVideo.Enums.VideoFormat'
videoFormatsRaw :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [VideoFormat]
videoFormatsRaw  = IO [VideoFormat] -> m [VideoFormat]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [VideoFormat] -> m [VideoFormat])
-> IO [VideoFormat] -> m [VideoFormat]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Word32
len <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CUInt
result <- Ptr Word32 -> IO (Ptr CUInt)
gst_video_formats_raw Ptr Word32
len
    Word32
len' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
len
    Text -> Ptr CUInt -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoFormatsRaw" Ptr CUInt
result
    [CUInt]
result' <- (Word32 -> Ptr CUInt -> IO [CUInt]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
len') Ptr CUInt
result
    let result'' :: [VideoFormat]
result'' = (CUInt -> VideoFormat) -> [CUInt] -> [VideoFormat]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> VideoFormat
forall a. Enum a => Int -> a
toEnum (Int -> VideoFormat) -> (CUInt -> Int) -> CUInt -> VideoFormat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) [CUInt]
result'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
len
    [VideoFormat] -> IO [VideoFormat]
forall (m :: * -> *) a. Monad m => a -> m a
return [VideoFormat]
result''


-- function 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 t'GI.Gst.Structs.Event.Event' to parse
    -> m ((Bool, Word64, Bool, Word32))
    -- ^ __Returns:__ 'P.True' if the event is a valid upstream force-key-unit event. 'P.False' if not
videoEventParseUpstreamForceKeyUnit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Event -> m (Bool, CGType, Bool, Word32)
videoEventParseUpstreamForceKeyUnit Event
event = IO (Bool, CGType, Bool, Word32) -> m (Bool, CGType, Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, CGType, Bool, Word32) -> m (Bool, CGType, Bool, Word32))
-> IO (Bool, CGType, Bool, Word32)
-> m (Bool, CGType, Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr CGType
runningTime <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
    Ptr CInt
allHeaders <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    Ptr Word32
count <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CInt
result <- Ptr Event -> Ptr CGType -> Ptr CInt -> Ptr Word32 -> IO CInt
gst_video_event_parse_upstream_force_key_unit Ptr Event
event' Ptr CGType
runningTime Ptr CInt
allHeaders Ptr Word32
count
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CGType
runningTime' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
runningTime
    CInt
allHeaders' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
allHeaders
    let allHeaders'' :: Bool
allHeaders'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
allHeaders'
    Word32
count' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
count
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
runningTime
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
allHeaders
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
count
    (Bool, CGType, Bool, Word32) -> IO (Bool, CGType, Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', CGType
runningTime', Bool
allHeaders'', Word32
count')


-- function 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 = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "\n    A boolean to receive the still-frame status from the event, or NULL"
--                 , 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_still_frame" gst_video_event_parse_still_frame :: 
    Ptr Gst.Event.Event ->                  -- event : TInterface (Name {namespace = "Gst", name = "Event"})
    Ptr CInt ->                             -- in_still : TBasicType TBoolean
    IO CInt

-- | Parse a t'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 t'GI.Gst.Structs.Event.Event' to parse
    -> m ((Bool, Bool))
    -- ^ __Returns:__ 'P.True' if the event is a valid still-frame event. 'P.False' if not
videoEventParseStillFrame :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Event -> m (Bool, Bool)
videoEventParseStillFrame Event
event = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr CInt
inStill <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    CInt
result <- Ptr Event -> Ptr CInt -> IO CInt
gst_video_event_parse_still_frame Ptr Event
event' Ptr CInt
inStill
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CInt
inStill' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
inStill
    let inStill'' :: Bool
inStill'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
inStill'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
inStill
    (Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
inStill'')


-- function 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 t'GI.Gst.Structs.Event.Event' to parse
    -> m ((Bool, Word64, Word64, Word64, Bool, Word32))
    -- ^ __Returns:__ 'P.True' if the event is a valid downstream force key unit event.
videoEventParseDownstreamForceKeyUnit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Event -> m (Bool, CGType, CGType, CGType, Bool, Word32)
videoEventParseDownstreamForceKeyUnit Event
event = IO (Bool, CGType, CGType, CGType, Bool, Word32)
-> m (Bool, CGType, CGType, CGType, Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, CGType, CGType, CGType, Bool, Word32)
 -> m (Bool, CGType, CGType, CGType, Bool, Word32))
-> IO (Bool, CGType, CGType, CGType, Bool, Word32)
-> m (Bool, CGType, CGType, CGType, Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr CGType
timestamp <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
    Ptr CGType
streamTime <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
    Ptr CGType
runningTime <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
    Ptr CInt
allHeaders <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    Ptr Word32
count <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CInt
result <- Ptr Event
-> Ptr CGType
-> Ptr CGType
-> Ptr CGType
-> Ptr CInt
-> Ptr Word32
-> IO CInt
gst_video_event_parse_downstream_force_key_unit Ptr Event
event' Ptr CGType
timestamp Ptr CGType
streamTime Ptr CGType
runningTime Ptr CInt
allHeaders Ptr Word32
count
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CGType
timestamp' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
timestamp
    CGType
streamTime' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
streamTime
    CGType
runningTime' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
runningTime
    CInt
allHeaders' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
allHeaders
    let allHeaders'' :: Bool
allHeaders'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
allHeaders'
    Word32
count' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
count
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
timestamp
    Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
streamTime
    Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
runningTime
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
allHeaders
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
count
    (Bool, CGType, CGType, CGType, Bool, Word32)
-> IO (Bool, CGType, CGType, CGType, Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', CGType
timestamp', CGType
streamTime', CGType
runningTime', Bool
allHeaders'', Word32
count')


-- function 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@/: 'P.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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
CGType -> Bool -> Word32 -> m Event
videoEventNewUpstreamForceKeyUnit CGType
runningTime Bool
allHeaders Word32
count = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> IO Event -> m Event
forall a b. (a -> b) -> a -> b
$ do
    let allHeaders' :: CInt
allHeaders' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allHeaders
    Ptr Event
result <- CGType -> CInt -> Word32 -> IO (Ptr Event)
gst_video_event_new_upstream_force_key_unit CGType
runningTime CInt
allHeaders' Word32
count
    Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoEventNewUpstreamForceKeyUnit" Ptr Event
result
    Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Gst.Event.Event) Ptr Event
result
    Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result'


-- function 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 'P.True', then the event
-- represents the start of a still frame sequence. If it is 'P.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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Bool -> m Event
videoEventNewStillFrame Bool
inStill = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> IO Event -> m Event
forall a b. (a -> b) -> a -> b
$ do
    let inStill' :: CInt
inStill' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
inStill
    Ptr Event
result <- CInt -> IO (Ptr Event)
gst_video_event_new_still_frame CInt
inStill'
    Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoEventNewStillFrame" Ptr Event
result
    Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Gst.Event.Event) Ptr Event
result
    Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result'


-- function 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@/: 'P.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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
CGType -> CGType -> CGType -> Bool -> Word32 -> m Event
videoEventNewDownstreamForceKeyUnit CGType
timestamp CGType
streamTime CGType
runningTime Bool
allHeaders Word32
count = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> IO Event -> m Event
forall a b. (a -> b) -> a -> b
$ do
    let allHeaders' :: CInt
allHeaders' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allHeaders
    Ptr Event
result <- CGType -> CGType -> CGType -> CInt -> Word32 -> IO (Ptr Event)
gst_video_event_new_downstream_force_key_unit CGType
timestamp CGType
streamTime CGType
runningTime CInt
allHeaders' Word32
count
    Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoEventNewDownstreamForceKeyUnit" Ptr Event
result
    Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Gst.Event.Event) Ptr Event
result
    Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result'


-- function 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 t'GI.Gst.Structs.Event.Event' to check
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the event is a valid force key unit event
videoEventIsForceKeyUnit :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Event -> m Bool
videoEventIsForceKeyUnit Event
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    CInt
result <- Ptr Event -> IO CInt
gst_video_event_is_force_key_unit Ptr Event
event'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoCropMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_crop_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 occurred 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 t'GI.Gst.Structs.Sample.Sample'
    -> Gst.Caps.Caps
    -- ^ /@toCaps@/: the t'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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sample -> Caps -> CGType -> VideoConvertSampleCallback -> m ()
videoConvertSampleAsync Sample
sample Caps
toCaps CGType
timeout VideoConvertSampleCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sample
sample' <- Sample -> IO (Ptr Sample)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sample
sample
    Ptr Caps
toCaps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
toCaps
    FunPtr C_VideoConvertSampleCallback
callback' <- C_VideoConvertSampleCallback
-> IO (FunPtr C_VideoConvertSampleCallback)
GstVideo.Callbacks.mk_VideoConvertSampleCallback (Maybe (Ptr (FunPtr C_VideoConvertSampleCallback))
-> VideoConvertSampleCallback_WithClosures
-> C_VideoConvertSampleCallback
GstVideo.Callbacks.wrap_VideoConvertSampleCallback Maybe (Ptr (FunPtr C_VideoConvertSampleCallback))
forall a. Maybe a
Nothing (VideoConvertSampleCallback
-> VideoConvertSampleCallback_WithClosures
GstVideo.Callbacks.drop_closures_VideoConvertSampleCallback VideoConvertSampleCallback
callback))
    let userData :: Ptr ()
userData = FunPtr C_VideoConvertSampleCallback -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_VideoConvertSampleCallback
callback'
    let destroyNotify :: FunPtr (Ptr a -> IO ())
destroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
    Ptr Sample
-> Ptr Caps
-> CGType
-> FunPtr C_VideoConvertSampleCallback
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gst_video_convert_sample_async Ptr Sample
sample' Ptr Caps
toCaps' CGType
timeout FunPtr C_VideoConvertSampleCallback
callback' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
destroyNotify
    Sample -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sample
sample
    Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
toCaps
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function 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 t'GI.Gst.Structs.Sample.Sample'
    -> Gst.Caps.Caps
    -- ^ /@toCaps@/: the t'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 t'GI.Gst.Structs.Sample.Sample', or 'P.Nothing' if an error happened (in which case /@err@/
    -- will point to the t'GError'). /(Can throw 'Data.GI.Base.GError.GError')/
videoConvertSample :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sample -> Caps -> CGType -> m Sample
videoConvertSample Sample
sample Caps
toCaps CGType
timeout = IO Sample -> m Sample
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sample -> m Sample) -> IO Sample -> m Sample
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sample
sample' <- Sample -> IO (Ptr Sample)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sample
sample
    Ptr Caps
toCaps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
toCaps
    IO Sample -> IO () -> IO Sample
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Sample
result <- (Ptr (Ptr GError) -> IO (Ptr Sample)) -> IO (Ptr Sample)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Sample)) -> IO (Ptr Sample))
-> (Ptr (Ptr GError) -> IO (Ptr Sample)) -> IO (Ptr Sample)
forall a b. (a -> b) -> a -> b
$ Ptr Sample
-> Ptr Caps -> CGType -> Ptr (Ptr GError) -> IO (Ptr Sample)
gst_video_convert_sample Ptr Sample
sample' Ptr Caps
toCaps' CGType
timeout
        Text -> Ptr Sample -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoConvertSample" Ptr Sample
result
        Sample
result' <- ((ManagedPtr Sample -> Sample) -> Ptr Sample -> IO Sample
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sample -> Sample
Gst.Sample.Sample) Ptr Sample
result
        Sample -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sample
sample
        Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
toCaps
        Sample -> IO Sample
forall (m :: * -> *) a. Monad m => a -> m a
return Sample
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )


-- function 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 t'GI.GstVideo.Enums.VideoTransferFunction'
    -> Double
    -- ^ /@val@/: a value
    -> m Double
    -- ^ __Returns:__ the gamma encoded value of /@val@/
videoColorTransferEncode :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoTransferFunction -> Double -> m Double
videoColorTransferEncode VideoTransferFunction
func Double
val = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
    let func' :: CUInt
func' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (VideoTransferFunction -> Int) -> VideoTransferFunction -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoTransferFunction -> Int
forall a. Enum a => a -> Int
fromEnum) VideoTransferFunction
func
    let val' :: CDouble
val' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
val
    CDouble
result <- CUInt -> CDouble -> IO CDouble
gst_video_color_transfer_encode CUInt
func' CDouble
val'
    let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
    Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'


-- function 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 t'GI.GstVideo.Enums.VideoTransferFunction'
    -> Double
    -- ^ /@val@/: a value
    -> m Double
    -- ^ __Returns:__ the gamma decoded value of /@val@/
videoColorTransferDecode :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoTransferFunction -> Double -> m Double
videoColorTransferDecode VideoTransferFunction
func Double
val = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
    let func' :: CUInt
func' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (VideoTransferFunction -> Int) -> VideoTransferFunction -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoTransferFunction -> Int
forall a. Enum a => a -> Int
fromEnum) VideoTransferFunction
func
    let val' :: CDouble
val' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
val
    CDouble
result <- CUInt -> CDouble -> IO CDouble
gst_video_color_transfer_decode CUInt
func' CDouble
val'
    let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
    Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'


-- function 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 t'GI.GstVideo.Flags.VideoChromaSite'
    -> m T.Text
    -- ^ __Returns:__ a string describing /@site@/.
videoChromaToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[VideoChromaSite] -> m Text
videoChromaToString [VideoChromaSite]
site = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let site' :: CUInt
site' = [VideoChromaSite] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [VideoChromaSite]
site
    CString
result <- CUInt -> IO CString
gst_video_chroma_to_string CUInt
site'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoChromaToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function 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 t'GI.GstVideo.Structs.VideoChromaResample.VideoChromaResample'
    -> Ptr ()
    -- ^ /@lines@/: pixel lines
    -> Int32
    -- ^ /@width@/: the number of pixels on one line
    -> m ()
videoChromaResample :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoChromaResample -> Ptr () -> Int32 -> m ()
videoChromaResample VideoChromaResample
resample Ptr ()
lines Int32
width = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr VideoChromaResample
resample' <- VideoChromaResample -> IO (Ptr VideoChromaResample)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoChromaResample
resample
    Ptr VideoChromaResample -> Ptr () -> Int32 -> IO ()
gst_video_chroma_resample Ptr VideoChromaResample
resample' Ptr ()
lines Int32
width
    VideoChromaResample -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoChromaResample
resample
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function 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 t'GI.GstVideo.Flags.VideoChromaSite'
videoChromaFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@s@/: a chromasite string
    -> m [GstVideo.Flags.VideoChromaSite]
    -- ^ __Returns:__ a t'GI.GstVideo.Flags.VideoChromaSite' or 'GI.GstVideo.Flags.VideoChromaSiteUnknown' when /@s@/ does
    -- not contain a valid chroma description.
videoChromaFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [VideoChromaSite]
videoChromaFromString Text
s = IO [VideoChromaSite] -> m [VideoChromaSite]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [VideoChromaSite] -> m [VideoChromaSite])
-> IO [VideoChromaSite] -> m [VideoChromaSite]
forall a b. (a -> b) -> a -> b
$ do
    CString
s' <- Text -> IO CString
textToCString Text
s
    CUInt
result <- CString -> IO CUInt
gst_video_chroma_from_string CString
s'
    let result' :: [VideoChromaSite]
result' = CUInt -> [VideoChromaSite]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
s'
    [VideoChromaSite] -> IO [VideoChromaSite]
forall (m :: * -> *) a. Monad m => a -> m a
return [VideoChromaSite]
result'


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

foreign import ccall "gst_video_caption_meta_api_get_type" gst_video_caption_meta_api_get_type :: 
    IO CGType

-- | /No description available in the introspection data./
videoCaptionMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoCaptionMetaApiGetType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoCaptionMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_caption_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> m (Bool, Word32, Word32)
videoCalculateDisplayRatio Word32
videoWidth Word32
videoHeight Word32
videoParN Word32
videoParD Word32
displayParN Word32
displayParD = IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32))
-> IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Word32
darN <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
darD <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CInt
result <- Ptr Word32
-> Ptr Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> IO CInt
gst_video_calculate_display_ratio Ptr Word32
darN Ptr Word32
darD Word32
videoWidth Word32
videoHeight Word32
videoParN Word32
videoParD Word32
displayParN Word32
displayParD
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word32
darN' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
darN
    Word32
darD' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
darD
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
darN
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
darD
    (Bool, Word32, Word32) -> IO (Bool, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
darN', Word32
darD')


-- function 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 t'GI.GstVideo.Structs.VideoScaler.VideoScaler' to scale video buffers
-- instead.
videoBlendScaleLinearRGBA ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GstVideo.VideoInfo.VideoInfo
    -- ^ /@src@/: the t'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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoInfo -> Buffer -> Int32 -> Int32 -> m (VideoInfo, Buffer)
videoBlendScaleLinearRGBA VideoInfo
src Buffer
srcBuffer Int32
destHeight Int32
destWidth = IO (VideoInfo, Buffer) -> m (VideoInfo, Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (VideoInfo, Buffer) -> m (VideoInfo, Buffer))
-> IO (VideoInfo, Buffer) -> m (VideoInfo, Buffer)
forall a b. (a -> b) -> a -> b
$ do
    Ptr VideoInfo
src' <- VideoInfo -> IO (Ptr VideoInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoInfo
src
    Ptr Buffer
srcBuffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
srcBuffer
    Ptr VideoInfo
dest <- Int -> IO (Ptr VideoInfo)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
120 :: IO (Ptr GstVideo.VideoInfo.VideoInfo)
    Ptr (Ptr Buffer)
destBuffer <- IO (Ptr (Ptr Buffer))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
    Ptr VideoInfo
-> Ptr Buffer
-> Int32
-> Int32
-> Ptr VideoInfo
-> Ptr (Ptr Buffer)
-> IO ()
gst_video_blend_scale_linear_RGBA Ptr VideoInfo
src' Ptr Buffer
srcBuffer' Int32
destHeight Int32
destWidth Ptr VideoInfo
dest Ptr (Ptr Buffer)
destBuffer
    VideoInfo
dest' <- ((ManagedPtr VideoInfo -> VideoInfo)
-> Ptr VideoInfo -> IO VideoInfo
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VideoInfo -> VideoInfo
GstVideo.VideoInfo.VideoInfo) Ptr VideoInfo
dest
    Ptr Buffer
destBuffer' <- Ptr (Ptr Buffer) -> IO (Ptr Buffer)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Buffer)
destBuffer
    Buffer
destBuffer'' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer) Ptr Buffer
destBuffer'
    VideoInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoInfo
src
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
srcBuffer
    Ptr (Ptr Buffer) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Buffer)
destBuffer
    (VideoInfo, Buffer) -> IO (VideoInfo, Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return (VideoInfo
dest', Buffer
destBuffer'')


-- function 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 t'GI.GstVideo.Structs.VideoFrame.VideoFrame' where to blend /@src@/ in
    -> GstVideo.VideoFrame.VideoFrame
    -- ^ /@src@/: the t'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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VideoFrame -> VideoFrame -> Int32 -> Int32 -> Float -> m Bool
videoBlend VideoFrame
dest VideoFrame
src Int32
x Int32
y Float
globalAlpha = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr VideoFrame
dest' <- VideoFrame -> IO (Ptr VideoFrame)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoFrame
dest
    Ptr VideoFrame
src' <- VideoFrame -> IO (Ptr VideoFrame)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoFrame
src
    let globalAlpha' :: CFloat
globalAlpha' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
globalAlpha
    CInt
result <- Ptr VideoFrame
-> Ptr VideoFrame -> Int32 -> Int32 -> CFloat -> IO CInt
gst_video_blend Ptr VideoFrame
dest' Ptr VideoFrame
src' Int32
x Int32
y CFloat
globalAlpha'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    VideoFrame -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoFrame
dest
    VideoFrame -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoFrame
src
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


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

foreign import ccall "gst_video_bar_meta_api_get_type" gst_video_bar_meta_api_get_type :: 
    IO CGType

-- | /No description available in the introspection data./
videoBarMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoBarMetaApiGetType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoBarMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_bar_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoAffineTransformationMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_affine_transformation_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


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

foreign import ccall "gst_video_afd_meta_api_get_type" gst_video_afd_meta_api_get_type :: 
    IO CGType

-- | /No description available in the introspection data./
videoAfdMetaApiGetType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GType
videoAfdMetaApiGetType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m GType
videoAfdMetaApiGetType  = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
    CGType
result <- IO CGType
gst_video_afd_meta_api_get_type
    let result' :: GType
result' = CGType -> GType
GType CGType
result
    GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'


-- function 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 t'GI.GstVideo.Interfaces.VideoOverlay.VideoOverlay'.
isVideoOverlayPrepareWindowHandleMessage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Message.Message
    -- ^ /@msg@/: a t'GI.Gst.Structs.Message.Message'
    -> m Bool
    -- ^ __Returns:__ whether /@msg@/ is a \"prepare-window-handle\" message
isVideoOverlayPrepareWindowHandleMessage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Message -> m Bool
isVideoOverlayPrepareWindowHandleMessage Message
msg = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Message
msg' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Message
msg
    CInt
result <- Ptr Message -> IO CInt
gst_is_video_overlay_prepare_window_handle_message Ptr Message
msg'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Message -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
msg
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function 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 t'GI.Gst.Structs.Structure.Structure'
    -> GstVideo.VideoAlignment.VideoAlignment
    -- ^ /@align@/: a t'GI.GstVideo.Structs.VideoAlignment.VideoAlignment'
    -> m ()
bufferPoolConfigSetVideoAlignment :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> VideoAlignment -> m ()
bufferPoolConfigSetVideoAlignment Structure
config VideoAlignment
align = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
    Ptr VideoAlignment
align' <- VideoAlignment -> IO (Ptr VideoAlignment)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoAlignment
align
    Ptr Structure -> Ptr VideoAlignment -> IO ()
gst_buffer_pool_config_set_video_alignment Ptr Structure
config' Ptr VideoAlignment
align'
    Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
    VideoAlignment -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoAlignment
align
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function 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 t'GI.Gst.Structs.Structure.Structure'
    -> GstVideo.VideoAlignment.VideoAlignment
    -- ^ /@align@/: a t'GI.GstVideo.Structs.VideoAlignment.VideoAlignment'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@config@/ could be parsed correctly.
bufferPoolConfigGetVideoAlignment :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Structure -> VideoAlignment -> m Bool
bufferPoolConfigGetVideoAlignment Structure
config VideoAlignment
align = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Structure
config' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
config
    Ptr VideoAlignment
align' <- VideoAlignment -> IO (Ptr VideoAlignment)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoAlignment
align
    CInt
result <- Ptr Structure -> Ptr VideoAlignment -> IO CInt
gst_buffer_pool_config_get_video_alignment Ptr Structure
config' Ptr VideoAlignment
align'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
config
    VideoAlignment -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoAlignment
align
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function 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 t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/ with the given /@id@/.
-- 
-- Buffers can contain multiple t'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 t'GI.Gst.Structs.Buffer.Buffer'
    -> Int32
    -- ^ /@id@/: a metadata id
    -> m GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' with /@id@/ or 'P.Nothing' when there is
    -- no such metadata on /@buffer@/.
bufferGetVideoRegionOfInterestMetaId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> Int32 -> m VideoRegionOfInterestMeta
bufferGetVideoRegionOfInterestMetaId Buffer
buffer Int32
id = IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta)
-> IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoRegionOfInterestMeta
result <- Ptr Buffer -> Int32 -> IO (Ptr VideoRegionOfInterestMeta)
gst_buffer_get_video_region_of_interest_meta_id Ptr Buffer
buffer' Int32
id
    Text -> Ptr VideoRegionOfInterestMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetVideoRegionOfInterestMetaId" Ptr VideoRegionOfInterestMeta
result
    VideoRegionOfInterestMeta
result' <- ((ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta)
-> Ptr VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta
GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) Ptr VideoRegionOfInterestMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoRegionOfInterestMeta
result'


-- function 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 t'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/ with the given /@id@/.
-- 
-- Buffers can contain multiple t'GI.GstVideo.Structs.VideoMeta.VideoMeta' metadata items when dealing with
-- multiview buffers.
bufferGetVideoMetaId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Int32
    -- ^ /@id@/: a metadata id
    -> m GstVideo.VideoMeta.VideoMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoMeta.VideoMeta' with /@id@/ or 'P.Nothing' when there is no such metadata
    -- on /@buffer@/.
bufferGetVideoMetaId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> Int32 -> m VideoMeta
bufferGetVideoMetaId Buffer
buffer Int32
id = IO VideoMeta -> m VideoMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoMeta -> m VideoMeta) -> IO VideoMeta -> m VideoMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoMeta
result <- Ptr Buffer -> Int32 -> IO (Ptr VideoMeta)
gst_buffer_get_video_meta_id Ptr Buffer
buffer' Int32
id
    Text -> Ptr VideoMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetVideoMetaId" Ptr VideoMeta
result
    VideoMeta
result' <- ((ManagedPtr VideoMeta -> VideoMeta)
-> Ptr VideoMeta -> IO VideoMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoMeta -> VideoMeta
GstVideo.VideoMeta.VideoMeta) Ptr VideoMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoMeta -> IO VideoMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoMeta
result'


-- function 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 t'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/ with the lowest /@id@/.
-- 
-- Buffers can contain multiple t'GI.GstVideo.Structs.VideoMeta.VideoMeta' metadata items when dealing with
-- multiview buffers.
bufferGetVideoMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> m GstVideo.VideoMeta.VideoMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoMeta.VideoMeta' with lowest id (usually 0) or 'P.Nothing' when there
    -- is no such metadata on /@buffer@/.
bufferGetVideoMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> m VideoMeta
bufferGetVideoMeta Buffer
buffer = IO VideoMeta -> m VideoMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoMeta -> m VideoMeta) -> IO VideoMeta -> m VideoMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoMeta
result <- Ptr Buffer -> IO (Ptr VideoMeta)
gst_buffer_get_video_meta Ptr Buffer
buffer'
    Text -> Ptr VideoMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetVideoMeta" Ptr VideoMeta
result
    VideoMeta
result' <- ((ManagedPtr VideoMeta -> VideoMeta)
-> Ptr VideoMeta -> IO VideoMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoMeta -> VideoMeta
GstVideo.VideoMeta.VideoMeta) Ptr VideoMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoMeta -> IO VideoMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoMeta
result'


-- function 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 t'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 t'GI.Gst.Structs.Buffer.Buffer'
    -> Word32
    -- ^ /@fpsN@/: framerate numerator
    -> Word32
    -- ^ /@fpsD@/: framerate denominator
    -> GLib.DateTime.DateTime
    -- ^ /@latestDailyJam@/: a t'GI.GLib.Structs.DateTime.DateTime' for the latest daily jam
    -> [GstVideo.Flags.VideoTimeCodeFlags]
    -- ^ /@flags@/: a t'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 t'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' on /@buffer@/, or
    -- (since 1.16) 'P.Nothing' if the timecode was invalid.
bufferAddVideoTimeCodeMetaFull :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> Word32
-> Word32
-> DateTime
-> [VideoTimeCodeFlags]
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> m VideoTimeCodeMeta
bufferAddVideoTimeCodeMetaFull Buffer
buffer Word32
fpsN Word32
fpsD DateTime
latestDailyJam [VideoTimeCodeFlags]
flags Word32
hours Word32
minutes Word32
seconds Word32
frames Word32
fieldCount = IO VideoTimeCodeMeta -> m VideoTimeCodeMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoTimeCodeMeta -> m VideoTimeCodeMeta)
-> IO VideoTimeCodeMeta -> m VideoTimeCodeMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr DateTime
latestDailyJam' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
latestDailyJam
    let flags' :: CUInt
flags' = [VideoTimeCodeFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [VideoTimeCodeFlags]
flags
    Ptr VideoTimeCodeMeta
result <- Ptr Buffer
-> Word32
-> Word32
-> Ptr DateTime
-> CUInt
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> IO (Ptr VideoTimeCodeMeta)
gst_buffer_add_video_time_code_meta_full Ptr Buffer
buffer' Word32
fpsN Word32
fpsD Ptr DateTime
latestDailyJam' CUInt
flags' Word32
hours Word32
minutes Word32
seconds Word32
frames Word32
fieldCount
    Text -> Ptr VideoTimeCodeMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoTimeCodeMetaFull" Ptr VideoTimeCodeMeta
result
    VideoTimeCodeMeta
result' <- ((ManagedPtr VideoTimeCodeMeta -> VideoTimeCodeMeta)
-> Ptr VideoTimeCodeMeta -> IO VideoTimeCodeMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoTimeCodeMeta -> VideoTimeCodeMeta
GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta) Ptr VideoTimeCodeMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
latestDailyJam
    VideoTimeCodeMeta -> IO VideoTimeCodeMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoTimeCodeMeta
result'


-- function 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 t'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 t'GI.Gst.Structs.Buffer.Buffer'
    -> GstVideo.VideoTimeCode.VideoTimeCode
    -- ^ /@tc@/: a t'GI.GstVideo.Structs.VideoTimeCode.VideoTimeCode'
    -> m (Maybe GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta)
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoTimeCodeMeta.VideoTimeCodeMeta' on /@buffer@/, or
    -- (since 1.16) 'P.Nothing' if the timecode was invalid.
bufferAddVideoTimeCodeMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> VideoTimeCode -> m (Maybe VideoTimeCodeMeta)
bufferAddVideoTimeCodeMeta Buffer
buffer VideoTimeCode
tc = IO (Maybe VideoTimeCodeMeta) -> m (Maybe VideoTimeCodeMeta)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe VideoTimeCodeMeta) -> m (Maybe VideoTimeCodeMeta))
-> IO (Maybe VideoTimeCodeMeta) -> m (Maybe VideoTimeCodeMeta)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoTimeCode
tc' <- VideoTimeCode -> IO (Ptr VideoTimeCode)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoTimeCode
tc
    Ptr VideoTimeCodeMeta
result <- Ptr Buffer -> Ptr VideoTimeCode -> IO (Ptr VideoTimeCodeMeta)
gst_buffer_add_video_time_code_meta Ptr Buffer
buffer' Ptr VideoTimeCode
tc'
    Maybe VideoTimeCodeMeta
maybeResult <- Ptr VideoTimeCodeMeta
-> (Ptr VideoTimeCodeMeta -> IO VideoTimeCodeMeta)
-> IO (Maybe VideoTimeCodeMeta)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr VideoTimeCodeMeta
result ((Ptr VideoTimeCodeMeta -> IO VideoTimeCodeMeta)
 -> IO (Maybe VideoTimeCodeMeta))
-> (Ptr VideoTimeCodeMeta -> IO VideoTimeCodeMeta)
-> IO (Maybe VideoTimeCodeMeta)
forall a b. (a -> b) -> a -> b
$ \Ptr VideoTimeCodeMeta
result' -> do
        VideoTimeCodeMeta
result'' <- ((ManagedPtr VideoTimeCodeMeta -> VideoTimeCodeMeta)
-> Ptr VideoTimeCodeMeta -> IO VideoTimeCodeMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoTimeCodeMeta -> VideoTimeCodeMeta
GstVideo.VideoTimeCodeMeta.VideoTimeCodeMeta) Ptr VideoTimeCodeMeta
result'
        VideoTimeCodeMeta -> IO VideoTimeCodeMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoTimeCodeMeta
result''
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoTimeCode -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoTimeCode
tc
    Maybe VideoTimeCodeMeta -> IO (Maybe VideoTimeCodeMeta)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe VideoTimeCodeMeta
maybeResult


-- function 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 t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' metadata to /@buffer@/ with the given
-- parameters.
bufferAddVideoRegionOfInterestMetaId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'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 t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/.
bufferAddVideoRegionOfInterestMetaId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> m VideoRegionOfInterestMeta
bufferAddVideoRegionOfInterestMetaId Buffer
buffer Word32
roiType Word32
x Word32
y Word32
w Word32
h = IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta)
-> IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoRegionOfInterestMeta
result <- Ptr Buffer
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> IO (Ptr VideoRegionOfInterestMeta)
gst_buffer_add_video_region_of_interest_meta_id Ptr Buffer
buffer' Word32
roiType Word32
x Word32
y Word32
w Word32
h
    Text -> Ptr VideoRegionOfInterestMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoRegionOfInterestMetaId" Ptr VideoRegionOfInterestMeta
result
    VideoRegionOfInterestMeta
result' <- ((ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta)
-> Ptr VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta
GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) Ptr VideoRegionOfInterestMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoRegionOfInterestMeta
result'


-- function 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 t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' metadata to /@buffer@/ with the given
-- parameters.
bufferAddVideoRegionOfInterestMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'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 t'GI.GstVideo.Structs.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta' on /@buffer@/.
bufferAddVideoRegionOfInterestMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> Text
-> Word32
-> Word32
-> Word32
-> Word32
-> m VideoRegionOfInterestMeta
bufferAddVideoRegionOfInterestMeta Buffer
buffer Text
roiType Word32
x Word32
y Word32
w Word32
h = IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta)
-> IO VideoRegionOfInterestMeta -> m VideoRegionOfInterestMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    CString
roiType' <- Text -> IO CString
textToCString Text
roiType
    Ptr VideoRegionOfInterestMeta
result <- Ptr Buffer
-> CString
-> Word32
-> Word32
-> Word32
-> Word32
-> IO (Ptr VideoRegionOfInterestMeta)
gst_buffer_add_video_region_of_interest_meta Ptr Buffer
buffer' CString
roiType' Word32
x Word32
y Word32
w Word32
h
    Text -> Ptr VideoRegionOfInterestMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoRegionOfInterestMeta" Ptr VideoRegionOfInterestMeta
result
    VideoRegionOfInterestMeta
result' <- ((ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta)
-> Ptr VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoRegionOfInterestMeta -> VideoRegionOfInterestMeta
GstVideo.VideoRegionOfInterestMeta.VideoRegionOfInterestMeta) Ptr VideoRegionOfInterestMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
roiType'
    VideoRegionOfInterestMeta -> IO VideoRegionOfInterestMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoRegionOfInterestMeta
result'


-- function 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 t'GI.Gst.Structs.Buffer.Buffer'
    -> Maybe (GstVideo.VideoOverlayComposition.VideoOverlayComposition)
    -- ^ /@comp@/: a t'GI.GstVideo.Structs.VideoOverlayComposition.VideoOverlayComposition'
    -> m GstVideo.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta
    -- ^ __Returns:__ a t'GI.GstVideo.Structs.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta'
bufferAddVideoOverlayCompositionMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> Maybe VideoOverlayComposition -> m VideoOverlayCompositionMeta
bufferAddVideoOverlayCompositionMeta Buffer
buf Maybe VideoOverlayComposition
comp = IO VideoOverlayCompositionMeta -> m VideoOverlayCompositionMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoOverlayCompositionMeta -> m VideoOverlayCompositionMeta)
-> IO VideoOverlayCompositionMeta -> m VideoOverlayCompositionMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buf' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buf
    Ptr VideoOverlayComposition
maybeComp <- case Maybe VideoOverlayComposition
comp of
        Maybe VideoOverlayComposition
Nothing -> Ptr VideoOverlayComposition -> IO (Ptr VideoOverlayComposition)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VideoOverlayComposition
forall a. Ptr a
nullPtr
        Just VideoOverlayComposition
jComp -> do
            Ptr VideoOverlayComposition
jComp' <- VideoOverlayComposition -> IO (Ptr VideoOverlayComposition)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoOverlayComposition
jComp
            Ptr VideoOverlayComposition -> IO (Ptr VideoOverlayComposition)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr VideoOverlayComposition
jComp'
    Ptr VideoOverlayCompositionMeta
result <- Ptr Buffer
-> Ptr VideoOverlayComposition
-> IO (Ptr VideoOverlayCompositionMeta)
gst_buffer_add_video_overlay_composition_meta Ptr Buffer
buf' Ptr VideoOverlayComposition
maybeComp
    Text -> Ptr VideoOverlayCompositionMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoOverlayCompositionMeta" Ptr VideoOverlayCompositionMeta
result
    VideoOverlayCompositionMeta
result' <- ((ManagedPtr VideoOverlayCompositionMeta
 -> VideoOverlayCompositionMeta)
-> Ptr VideoOverlayCompositionMeta
-> IO VideoOverlayCompositionMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoOverlayCompositionMeta
-> VideoOverlayCompositionMeta
GstVideo.VideoOverlayCompositionMeta.VideoOverlayCompositionMeta) Ptr VideoOverlayCompositionMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buf
    Maybe VideoOverlayComposition
-> (VideoOverlayComposition -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe VideoOverlayComposition
comp VideoOverlayComposition -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    VideoOverlayCompositionMeta -> IO VideoOverlayCompositionMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoOverlayCompositionMeta
result'


-- function 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 = TCArray False 4 (-1) (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 = TCArray False 4 (-1) (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
    Ptr Word64 ->                           -- offset : TCArray False 4 (-1) (TBasicType TUInt64)
    Ptr Int32 ->                            -- stride : TCArray False 4 (-1) (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 t'GI.Gst.Structs.Buffer.Buffer'
    -> [GstVideo.Flags.VideoFrameFlags]
    -- ^ /@flags@/: t'GI.GstVideo.Flags.VideoFrameFlags'
    -> GstVideo.Enums.VideoFormat
    -- ^ /@format@/: a t'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 t'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/.
bufferAddVideoMetaFull :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> [VideoFrameFlags]
-> VideoFormat
-> Word32
-> Word32
-> Word32
-> [CGType]
-> [Int32]
-> m VideoMeta
bufferAddVideoMetaFull Buffer
buffer [VideoFrameFlags]
flags VideoFormat
format Word32
width Word32
height Word32
nPlanes [CGType]
offset [Int32]
stride = IO VideoMeta -> m VideoMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoMeta -> m VideoMeta) -> IO VideoMeta -> m VideoMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let flags' :: CUInt
flags' = [VideoFrameFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [VideoFrameFlags]
flags
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoFormat -> Int) -> VideoFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoFormat -> Int
forall a. Enum a => a -> Int
fromEnum) VideoFormat
format
    Ptr CGType
offset' <- [CGType] -> IO (Ptr CGType)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CGType]
offset
    Ptr Int32
stride' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
stride
    Ptr VideoMeta
result <- Ptr Buffer
-> CUInt
-> CUInt
-> Word32
-> Word32
-> Word32
-> Ptr CGType
-> Ptr Int32
-> IO (Ptr VideoMeta)
gst_buffer_add_video_meta_full Ptr Buffer
buffer' CUInt
flags' CUInt
format' Word32
width Word32
height Word32
nPlanes Ptr CGType
offset' Ptr Int32
stride'
    Text -> Ptr VideoMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoMetaFull" Ptr VideoMeta
result
    VideoMeta
result' <- ((ManagedPtr VideoMeta -> VideoMeta)
-> Ptr VideoMeta -> IO VideoMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoMeta -> VideoMeta
GstVideo.VideoMeta.VideoMeta) Ptr VideoMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
offset'
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
stride'
    VideoMeta -> IO VideoMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoMeta
result'


-- function 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 t'GI.Gst.Structs.Buffer.Buffer'
    -> [GstVideo.Flags.VideoFrameFlags]
    -- ^ /@flags@/: t'GI.GstVideo.Flags.VideoFrameFlags'
    -> GstVideo.Enums.VideoFormat
    -- ^ /@format@/: a t'GI.GstVideo.Enums.VideoFormat'
    -> Word32
    -- ^ /@width@/: the width
    -> Word32
    -- ^ /@height@/: the height
    -> m GstVideo.VideoMeta.VideoMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoMeta.VideoMeta' on /@buffer@/.
bufferAddVideoMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> [VideoFrameFlags]
-> VideoFormat
-> Word32
-> Word32
-> m VideoMeta
bufferAddVideoMeta Buffer
buffer [VideoFrameFlags]
flags VideoFormat
format Word32
width Word32
height = IO VideoMeta -> m VideoMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoMeta -> m VideoMeta) -> IO VideoMeta -> m VideoMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let flags' :: CUInt
flags' = [VideoFrameFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [VideoFrameFlags]
flags
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoFormat -> Int) -> VideoFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoFormat -> Int
forall a. Enum a => a -> Int
fromEnum) VideoFormat
format
    Ptr VideoMeta
result <- Ptr Buffer
-> CUInt -> CUInt -> Word32 -> Word32 -> IO (Ptr VideoMeta)
gst_buffer_add_video_meta Ptr Buffer
buffer' CUInt
flags' CUInt
format' Word32
width Word32
height
    Text -> Ptr VideoMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoMeta" Ptr VideoMeta
result
    VideoMeta
result' <- ((ManagedPtr VideoMeta -> VideoMeta)
-> Ptr VideoMeta -> IO VideoMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoMeta -> VideoMeta
GstVideo.VideoMeta.VideoMeta) Ptr VideoMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoMeta -> IO VideoMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoMeta
result'


-- function 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 t'GI.Gst.Structs.Buffer.Buffer'
    -> GstVideo.Enums.VideoGLTextureOrientation
    -- ^ /@textureOrientation@/: the t'GI.GstVideo.Enums.VideoGLTextureOrientation'
    -> Word32
    -- ^ /@nTextures@/: the number of textures
    -> GstVideo.Enums.VideoGLTextureType
    -- ^ /@textureType@/: array of t'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 t'GI.GstVideo.Structs.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta' on /@buffer@/.
bufferAddVideoGlTextureUploadMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer
-> VideoGLTextureOrientation
-> Word32
-> VideoGLTextureType
-> VideoGLTextureUpload
-> BoxedCopyFunc
-> C_DestroyNotify
-> m VideoGLTextureUploadMeta
bufferAddVideoGlTextureUploadMeta Buffer
buffer VideoGLTextureOrientation
textureOrientation Word32
nTextures VideoGLTextureType
textureType VideoGLTextureUpload
upload BoxedCopyFunc
userDataCopy C_DestroyNotify
userDataFree = IO VideoGLTextureUploadMeta -> m VideoGLTextureUploadMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoGLTextureUploadMeta -> m VideoGLTextureUploadMeta)
-> IO VideoGLTextureUploadMeta -> m VideoGLTextureUploadMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let textureOrientation' :: CUInt
textureOrientation' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (VideoGLTextureOrientation -> Int)
-> VideoGLTextureOrientation
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoGLTextureOrientation -> Int
forall a. Enum a => a -> Int
fromEnum) VideoGLTextureOrientation
textureOrientation
    let textureType' :: CUInt
textureType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (VideoGLTextureType -> Int) -> VideoGLTextureType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoGLTextureType -> Int
forall a. Enum a => a -> Int
fromEnum) VideoGLTextureType
textureType
    FunPtr C_VideoGLTextureUpload
upload' <- C_VideoGLTextureUpload -> IO (FunPtr C_VideoGLTextureUpload)
GstVideo.Callbacks.mk_VideoGLTextureUpload (Maybe (Ptr (FunPtr C_VideoGLTextureUpload))
-> VideoGLTextureUpload -> C_VideoGLTextureUpload
GstVideo.Callbacks.wrap_VideoGLTextureUpload Maybe (Ptr (FunPtr C_VideoGLTextureUpload))
forall a. Maybe a
Nothing VideoGLTextureUpload
upload)
    FunPtr BoxedCopyFunc
userDataCopy' <- BoxedCopyFunc -> IO (FunPtr BoxedCopyFunc)
GObject.Callbacks.mk_BoxedCopyFunc (Maybe (Ptr (FunPtr BoxedCopyFunc))
-> BoxedCopyFunc -> BoxedCopyFunc
GObject.Callbacks.wrap_BoxedCopyFunc Maybe (Ptr (FunPtr BoxedCopyFunc))
forall a. Maybe a
Nothing BoxedCopyFunc
userDataCopy)
    FunPtr C_DestroyNotify
userDataFree' <- C_DestroyNotify -> IO (FunPtr C_DestroyNotify)
GObject.Callbacks.mk_BoxedFreeFunc (Maybe (Ptr (FunPtr C_DestroyNotify))
-> C_DestroyNotify -> C_DestroyNotify
GObject.Callbacks.wrap_BoxedFreeFunc Maybe (Ptr (FunPtr C_DestroyNotify))
forall a. Maybe a
Nothing C_DestroyNotify
userDataFree)
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr VideoGLTextureUploadMeta
result <- Ptr Buffer
-> CUInt
-> Word32
-> CUInt
-> FunPtr C_VideoGLTextureUpload
-> Ptr ()
-> FunPtr BoxedCopyFunc
-> FunPtr C_DestroyNotify
-> IO (Ptr VideoGLTextureUploadMeta)
gst_buffer_add_video_gl_texture_upload_meta Ptr Buffer
buffer' CUInt
textureOrientation' Word32
nTextures CUInt
textureType' FunPtr C_VideoGLTextureUpload
upload' Ptr ()
forall a. Ptr a
userData FunPtr BoxedCopyFunc
userDataCopy' FunPtr C_DestroyNotify
userDataFree'
    Text -> Ptr VideoGLTextureUploadMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoGlTextureUploadMeta" Ptr VideoGLTextureUploadMeta
result
    VideoGLTextureUploadMeta
result' <- ((ManagedPtr VideoGLTextureUploadMeta -> VideoGLTextureUploadMeta)
-> Ptr VideoGLTextureUploadMeta -> IO VideoGLTextureUploadMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoGLTextureUploadMeta -> VideoGLTextureUploadMeta
GstVideo.VideoGLTextureUploadMeta.VideoGLTextureUploadMeta) Ptr VideoGLTextureUploadMeta
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_VideoGLTextureUpload -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_VideoGLTextureUpload
upload'
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr BoxedCopyFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr BoxedCopyFunc
userDataCopy'
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_DestroyNotify -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_DestroyNotify
userDataFree'
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoGLTextureUploadMeta -> IO VideoGLTextureUploadMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoGLTextureUploadMeta
result'


-- function buffer_add_video_caption_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 = "caption_type"
--           , argType =
--               TInterface
--                 Name { namespace = "GstVideo" , name = "VideoCaptionType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The type of Closed Caption to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Closed Caption data"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The size of @data in bytes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The size of @data in bytes"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GstVideo" , name = "VideoCaptionMeta" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_caption_meta" gst_buffer_add_video_caption_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    CUInt ->                                -- caption_type : TInterface (Name {namespace = "GstVideo", name = "VideoCaptionType"})
    Ptr Word8 ->                            -- data : TCArray False (-1) 3 (TBasicType TUInt8)
    Word64 ->                               -- size : TBasicType TUInt64
    IO (Ptr GstVideo.VideoCaptionMeta.VideoCaptionMeta)

-- | Attaches t'GI.GstVideo.Structs.VideoCaptionMeta.VideoCaptionMeta' metadata to /@buffer@/ with the given
-- parameters.
-- 
-- /Since: 1.16/
bufferAddVideoCaptionMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> GstVideo.Enums.VideoCaptionType
    -- ^ /@captionType@/: The type of Closed Caption to add
    -> ByteString
    -- ^ /@data@/: The Closed Caption data
    -> m GstVideo.VideoCaptionMeta.VideoCaptionMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoCaptionMeta.VideoCaptionMeta' on /@buffer@/.
bufferAddVideoCaptionMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> VideoCaptionType -> ByteString -> m VideoCaptionMeta
bufferAddVideoCaptionMeta Buffer
buffer VideoCaptionType
captionType ByteString
data_ = IO VideoCaptionMeta -> m VideoCaptionMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoCaptionMeta -> m VideoCaptionMeta)
-> IO VideoCaptionMeta -> m VideoCaptionMeta
forall a b. (a -> b) -> a -> b
$ do
    let size :: CGType
size = Int -> CGType
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CGType) -> Int -> CGType
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
data_
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let captionType' :: CUInt
captionType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (VideoCaptionType -> Int) -> VideoCaptionType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoCaptionType -> Int
forall a. Enum a => a -> Int
fromEnum) VideoCaptionType
captionType
    Ptr Word8
data_' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
data_
    Ptr VideoCaptionMeta
result <- Ptr Buffer
-> CUInt -> Ptr Word8 -> CGType -> IO (Ptr VideoCaptionMeta)
gst_buffer_add_video_caption_meta Ptr Buffer
buffer' CUInt
captionType' Ptr Word8
data_' CGType
size
    Text -> Ptr VideoCaptionMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoCaptionMeta" Ptr VideoCaptionMeta
result
    VideoCaptionMeta
result' <- ((ManagedPtr VideoCaptionMeta -> VideoCaptionMeta)
-> Ptr VideoCaptionMeta -> IO VideoCaptionMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoCaptionMeta -> VideoCaptionMeta
GstVideo.VideoCaptionMeta.VideoCaptionMeta) Ptr VideoCaptionMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
data_'
    VideoCaptionMeta -> IO VideoCaptionMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoCaptionMeta
result'


-- function buffer_add_video_bar_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 = "field"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "0 for progressive or field 1 and 1 for field 2"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_letterbox"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if true then bar data specifies letterbox, otherwise pillarbox"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bar_data1"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "If @is_letterbox is true, then the value specifies the\n     last line of a horizontal letterbox bar area at top of reconstructed frame.\n     Otherwise, it specifies the last horizontal luminance sample of a vertical pillarbox\n     bar area at the left side of the reconstructed frame"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bar_data2"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "If @is_letterbox is true, then the value specifies the\n     first line of a horizontal letterbox bar area at bottom of reconstructed frame.\n     Otherwise, it specifies the first horizontal\n     luminance sample of a vertical pillarbox bar area at the right side of the reconstructed frame."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GstVideo" , name = "VideoBarMeta" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_bar_meta" gst_buffer_add_video_bar_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Word8 ->                                -- field : TBasicType TUInt8
    CInt ->                                 -- is_letterbox : TBasicType TBoolean
    Word32 ->                               -- bar_data1 : TBasicType TUInt
    Word32 ->                               -- bar_data2 : TBasicType TUInt
    IO (Ptr GstVideo.VideoBarMeta.VideoBarMeta)

-- | Attaches t'GI.GstVideo.Structs.VideoBarMeta.VideoBarMeta' metadata to /@buffer@/ with the given
-- parameters.
-- 
-- /Since: 1.18/
bufferAddVideoBarMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Word8
    -- ^ /@field@/: 0 for progressive or field 1 and 1 for field 2
    -> Bool
    -- ^ /@isLetterbox@/: if true then bar data specifies letterbox, otherwise pillarbox
    -> Word32
    -- ^ /@barData1@/: If /@isLetterbox@/ is true, then the value specifies the
    --      last line of a horizontal letterbox bar area at top of reconstructed frame.
    --      Otherwise, it specifies the last horizontal luminance sample of a vertical pillarbox
    --      bar area at the left side of the reconstructed frame
    -> Word32
    -- ^ /@barData2@/: If /@isLetterbox@/ is true, then the value specifies the
    --      first line of a horizontal letterbox bar area at bottom of reconstructed frame.
    --      Otherwise, it specifies the first horizontal
    --      luminance sample of a vertical pillarbox bar area at the right side of the reconstructed frame.
    -> m GstVideo.VideoBarMeta.VideoBarMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoBarMeta.VideoBarMeta' on /@buffer@/.
    -- 
    -- See Table 6.11 Bar Data Syntax
    -- 
    -- https:\/\/www.atsc.org\/wp-content\/uploads\/2015\/03\/a_53-Part-4-2009.pdf
bufferAddVideoBarMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> Word8 -> Bool -> Word32 -> Word32 -> m VideoBarMeta
bufferAddVideoBarMeta Buffer
buffer Word8
field Bool
isLetterbox Word32
barData1 Word32
barData2 = IO VideoBarMeta -> m VideoBarMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoBarMeta -> m VideoBarMeta)
-> IO VideoBarMeta -> m VideoBarMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let isLetterbox' :: CInt
isLetterbox' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
isLetterbox
    Ptr VideoBarMeta
result <- Ptr Buffer
-> Word8 -> CInt -> Word32 -> Word32 -> IO (Ptr VideoBarMeta)
gst_buffer_add_video_bar_meta Ptr Buffer
buffer' Word8
field CInt
isLetterbox' Word32
barData1 Word32
barData2
    Text -> Ptr VideoBarMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoBarMeta" Ptr VideoBarMeta
result
    VideoBarMeta
result' <- ((ManagedPtr VideoBarMeta -> VideoBarMeta)
-> Ptr VideoBarMeta -> IO VideoBarMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoBarMeta -> VideoBarMeta
GstVideo.VideoBarMeta.VideoBarMeta) Ptr VideoBarMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoBarMeta -> IO VideoBarMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoBarMeta
result'


-- function 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 t'GI.Gst.Structs.Buffer.Buffer'
    -> m GstVideo.VideoAffineTransformationMeta.VideoAffineTransformationMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoAffineTransformationMeta.VideoAffineTransformationMeta' on /@buffer@/.
bufferAddVideoAffineTransformationMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> m VideoAffineTransformationMeta
bufferAddVideoAffineTransformationMeta Buffer
buffer = IO VideoAffineTransformationMeta -> m VideoAffineTransformationMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoAffineTransformationMeta
 -> m VideoAffineTransformationMeta)
-> IO VideoAffineTransformationMeta
-> m VideoAffineTransformationMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr VideoAffineTransformationMeta
result <- Ptr Buffer -> IO (Ptr VideoAffineTransformationMeta)
gst_buffer_add_video_affine_transformation_meta Ptr Buffer
buffer'
    Text -> Ptr VideoAffineTransformationMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoAffineTransformationMeta" Ptr VideoAffineTransformationMeta
result
    VideoAffineTransformationMeta
result' <- ((ManagedPtr VideoAffineTransformationMeta
 -> VideoAffineTransformationMeta)
-> Ptr VideoAffineTransformationMeta
-> IO VideoAffineTransformationMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoAffineTransformationMeta
-> VideoAffineTransformationMeta
GstVideo.VideoAffineTransformationMeta.VideoAffineTransformationMeta) Ptr VideoAffineTransformationMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoAffineTransformationMeta -> IO VideoAffineTransformationMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoAffineTransformationMeta
result'


-- function buffer_add_video_afd_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 = "field"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "0 for progressive or field 1 and 1 for field 2"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "spec"
--           , argType =
--               TInterface Name { namespace = "GstVideo" , name = "VideoAFDSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GstVideoAFDSpec that applies to AFD value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "afd"
--           , argType =
--               TInterface Name { namespace = "GstVideo" , name = "VideoAFDValue" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GstVideoAFDValue AFD enumeration"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GstVideo" , name = "VideoAFDMeta" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_buffer_add_video_afd_meta" gst_buffer_add_video_afd_meta :: 
    Ptr Gst.Buffer.Buffer ->                -- buffer : TInterface (Name {namespace = "Gst", name = "Buffer"})
    Word8 ->                                -- field : TBasicType TUInt8
    CUInt ->                                -- spec : TInterface (Name {namespace = "GstVideo", name = "VideoAFDSpec"})
    CUInt ->                                -- afd : TInterface (Name {namespace = "GstVideo", name = "VideoAFDValue"})
    IO (Ptr GstVideo.VideoAFDMeta.VideoAFDMeta)

-- | Attaches t'GI.GstVideo.Structs.VideoAFDMeta.VideoAFDMeta' metadata to /@buffer@/ with the given
-- parameters.
-- 
-- /Since: 1.18/
bufferAddVideoAfdMeta ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Word8
    -- ^ /@field@/: 0 for progressive or field 1 and 1 for field 2
    -> GstVideo.Enums.VideoAFDSpec
    -- ^ /@spec@/: t'GI.GstVideo.Enums.VideoAFDSpec' that applies to AFD value
    -> GstVideo.Enums.VideoAFDValue
    -- ^ /@afd@/: t'GI.GstVideo.Enums.VideoAFDValue' AFD enumeration
    -> m GstVideo.VideoAFDMeta.VideoAFDMeta
    -- ^ __Returns:__ the t'GI.GstVideo.Structs.VideoAFDMeta.VideoAFDMeta' on /@buffer@/.
bufferAddVideoAfdMeta :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Buffer -> Word8 -> VideoAFDSpec -> VideoAFDValue -> m VideoAFDMeta
bufferAddVideoAfdMeta Buffer
buffer Word8
field VideoAFDSpec
spec VideoAFDValue
afd = IO VideoAFDMeta -> m VideoAFDMeta
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoAFDMeta -> m VideoAFDMeta)
-> IO VideoAFDMeta -> m VideoAFDMeta
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    let spec' :: CUInt
spec' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoAFDSpec -> Int) -> VideoAFDSpec -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoAFDSpec -> Int
forall a. Enum a => a -> Int
fromEnum) VideoAFDSpec
spec
    let afd' :: CUInt
afd' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (VideoAFDValue -> Int) -> VideoAFDValue -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VideoAFDValue -> Int
forall a. Enum a => a -> Int
fromEnum) VideoAFDValue
afd
    Ptr VideoAFDMeta
result <- Ptr Buffer -> Word8 -> CUInt -> CUInt -> IO (Ptr VideoAFDMeta)
gst_buffer_add_video_afd_meta Ptr Buffer
buffer' Word8
field CUInt
spec' CUInt
afd'
    Text -> Ptr VideoAFDMeta -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferAddVideoAfdMeta" Ptr VideoAFDMeta
result
    VideoAFDMeta
result' <- ((ManagedPtr VideoAFDMeta -> VideoAFDMeta)
-> Ptr VideoAFDMeta -> IO VideoAFDMeta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr VideoAFDMeta -> VideoAFDMeta
GstVideo.VideoAFDMeta.VideoAFDMeta) Ptr VideoAFDMeta
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    VideoAFDMeta -> IO VideoAFDMeta
forall (m :: * -> *) a. Monad m => a -> m a
return VideoAFDMeta
result'