{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstVideo.Structs.VideoVBIParser
(
VideoVBIParser(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveVideoVBIParserMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
VideoVBIParserAddLineMethodInfo ,
#endif
videoVBIParserAddLine ,
#if defined(ENABLE_OVERLOADING)
VideoVBIParserCopyMethodInfo ,
#endif
videoVBIParserCopy ,
#if defined(ENABLE_OVERLOADING)
VideoVBIParserFreeMethodInfo ,
#endif
videoVBIParserFree ,
#if defined(ENABLE_OVERLOADING)
VideoVBIParserGetAncillaryMethodInfo ,
#endif
videoVBIParserGetAncillary ,
videoVBIParserNew ,
) 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.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 {-# SOURCE #-} qualified GI.GstVideo.Enums as GstVideo.Enums
import {-# SOURCE #-} qualified GI.GstVideo.Structs.VideoAncillary as GstVideo.VideoAncillary
newtype VideoVBIParser = VideoVBIParser (SP.ManagedPtr VideoVBIParser)
deriving (VideoVBIParser -> VideoVBIParser -> Bool
(VideoVBIParser -> VideoVBIParser -> Bool)
-> (VideoVBIParser -> VideoVBIParser -> Bool) -> Eq VideoVBIParser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoVBIParser -> VideoVBIParser -> Bool
$c/= :: VideoVBIParser -> VideoVBIParser -> Bool
== :: VideoVBIParser -> VideoVBIParser -> Bool
$c== :: VideoVBIParser -> VideoVBIParser -> Bool
Eq)
instance SP.ManagedPtrNewtype VideoVBIParser where
toManagedPtr :: VideoVBIParser -> ManagedPtr VideoVBIParser
toManagedPtr (VideoVBIParser ManagedPtr VideoVBIParser
p) = ManagedPtr VideoVBIParser
p
foreign import ccall "gst_video_vbi_parser_get_type" c_gst_video_vbi_parser_get_type ::
IO GType
type instance O.ParentTypes VideoVBIParser = '[]
instance O.HasParentTypes VideoVBIParser
instance B.Types.TypedObject VideoVBIParser where
glibType :: IO GType
glibType = IO GType
c_gst_video_vbi_parser_get_type
instance B.Types.GBoxed VideoVBIParser
instance B.GValue.IsGValue VideoVBIParser where
toGValue :: VideoVBIParser -> IO GValue
toGValue VideoVBIParser
o = do
GType
gtype <- IO GType
c_gst_video_vbi_parser_get_type
VideoVBIParser -> (Ptr VideoVBIParser -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr VideoVBIParser
o (GType
-> (GValue -> Ptr VideoVBIParser -> IO ())
-> Ptr VideoVBIParser
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr VideoVBIParser -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO VideoVBIParser
fromGValue GValue
gv = do
Ptr VideoVBIParser
ptr <- GValue -> IO (Ptr VideoVBIParser)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr VideoVBIParser)
(ManagedPtr VideoVBIParser -> VideoVBIParser)
-> Ptr VideoVBIParser -> IO VideoVBIParser
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr VideoVBIParser -> VideoVBIParser
VideoVBIParser Ptr VideoVBIParser
ptr
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList VideoVBIParser
type instance O.AttributeList VideoVBIParser = VideoVBIParserAttributeList
type VideoVBIParserAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gst_video_vbi_parser_new" gst_video_vbi_parser_new ::
CUInt ->
Word32 ->
IO (Ptr VideoVBIParser)
videoVBIParserNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
GstVideo.Enums.VideoFormat
-> Word32
-> m VideoVBIParser
videoVBIParserNew :: VideoFormat -> Word32 -> m VideoVBIParser
videoVBIParserNew VideoFormat
format Word32
pixelWidth = IO VideoVBIParser -> m VideoVBIParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoVBIParser -> m VideoVBIParser)
-> IO VideoVBIParser -> m VideoVBIParser
forall a b. (a -> b) -> a -> b
$ do
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 VideoVBIParser
result <- CUInt -> Word32 -> IO (Ptr VideoVBIParser)
gst_video_vbi_parser_new CUInt
format' Word32
pixelWidth
Text -> Ptr VideoVBIParser -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoVBIParserNew" Ptr VideoVBIParser
result
VideoVBIParser
result' <- ((ManagedPtr VideoVBIParser -> VideoVBIParser)
-> Ptr VideoVBIParser -> IO VideoVBIParser
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VideoVBIParser -> VideoVBIParser
VideoVBIParser) Ptr VideoVBIParser
result
VideoVBIParser -> IO VideoVBIParser
forall (m :: * -> *) a. Monad m => a -> m a
return VideoVBIParser
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_video_vbi_parser_add_line" gst_video_vbi_parser_add_line ::
Ptr VideoVBIParser ->
Ptr Word8 ->
IO ()
videoVBIParserAddLine ::
(B.CallStack.HasCallStack, MonadIO m) =>
VideoVBIParser
-> Ptr Word8
-> m ()
videoVBIParserAddLine :: VideoVBIParser -> Ptr Word8 -> m ()
videoVBIParserAddLine VideoVBIParser
parser Ptr Word8
data_ = 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 VideoVBIParser
parser' <- VideoVBIParser -> IO (Ptr VideoVBIParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoVBIParser
parser
Ptr VideoVBIParser -> Ptr Word8 -> IO ()
gst_video_vbi_parser_add_line Ptr VideoVBIParser
parser' Ptr Word8
data_
VideoVBIParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoVBIParser
parser
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VideoVBIParserAddLineMethodInfo
instance (signature ~ (Ptr Word8 -> m ()), MonadIO m) => O.MethodInfo VideoVBIParserAddLineMethodInfo VideoVBIParser signature where
overloadedMethod = videoVBIParserAddLine
#endif
foreign import ccall "gst_video_vbi_parser_copy" gst_video_vbi_parser_copy ::
Ptr VideoVBIParser ->
IO (Ptr VideoVBIParser)
videoVBIParserCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
VideoVBIParser
-> m VideoVBIParser
videoVBIParserCopy :: VideoVBIParser -> m VideoVBIParser
videoVBIParserCopy VideoVBIParser
parser = IO VideoVBIParser -> m VideoVBIParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VideoVBIParser -> m VideoVBIParser)
-> IO VideoVBIParser -> m VideoVBIParser
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoVBIParser
parser' <- VideoVBIParser -> IO (Ptr VideoVBIParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoVBIParser
parser
Ptr VideoVBIParser
result <- Ptr VideoVBIParser -> IO (Ptr VideoVBIParser)
gst_video_vbi_parser_copy Ptr VideoVBIParser
parser'
Text -> Ptr VideoVBIParser -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"videoVBIParserCopy" Ptr VideoVBIParser
result
VideoVBIParser
result' <- ((ManagedPtr VideoVBIParser -> VideoVBIParser)
-> Ptr VideoVBIParser -> IO VideoVBIParser
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VideoVBIParser -> VideoVBIParser
VideoVBIParser) Ptr VideoVBIParser
result
VideoVBIParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoVBIParser
parser
VideoVBIParser -> IO VideoVBIParser
forall (m :: * -> *) a. Monad m => a -> m a
return VideoVBIParser
result'
#if defined(ENABLE_OVERLOADING)
data VideoVBIParserCopyMethodInfo
instance (signature ~ (m VideoVBIParser), MonadIO m) => O.MethodInfo VideoVBIParserCopyMethodInfo VideoVBIParser signature where
overloadedMethod = videoVBIParserCopy
#endif
foreign import ccall "gst_video_vbi_parser_free" gst_video_vbi_parser_free ::
Ptr VideoVBIParser ->
IO ()
videoVBIParserFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
VideoVBIParser
-> m ()
videoVBIParserFree :: VideoVBIParser -> m ()
videoVBIParserFree VideoVBIParser
parser = 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 VideoVBIParser
parser' <- VideoVBIParser -> IO (Ptr VideoVBIParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoVBIParser
parser
Ptr VideoVBIParser -> IO ()
gst_video_vbi_parser_free Ptr VideoVBIParser
parser'
VideoVBIParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoVBIParser
parser
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VideoVBIParserFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo VideoVBIParserFreeMethodInfo VideoVBIParser signature where
overloadedMethod = videoVBIParserFree
#endif
foreign import ccall "gst_video_vbi_parser_get_ancillary" gst_video_vbi_parser_get_ancillary ::
Ptr VideoVBIParser ->
Ptr GstVideo.VideoAncillary.VideoAncillary ->
IO CUInt
videoVBIParserGetAncillary ::
(B.CallStack.HasCallStack, MonadIO m) =>
VideoVBIParser
-> m ((GstVideo.Enums.VideoVBIParserResult, GstVideo.VideoAncillary.VideoAncillary))
videoVBIParserGetAncillary :: VideoVBIParser -> m (VideoVBIParserResult, VideoAncillary)
videoVBIParserGetAncillary VideoVBIParser
parser = IO (VideoVBIParserResult, VideoAncillary)
-> m (VideoVBIParserResult, VideoAncillary)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (VideoVBIParserResult, VideoAncillary)
-> m (VideoVBIParserResult, VideoAncillary))
-> IO (VideoVBIParserResult, VideoAncillary)
-> m (VideoVBIParserResult, VideoAncillary)
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoVBIParser
parser' <- VideoVBIParser -> IO (Ptr VideoVBIParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VideoVBIParser
parser
Ptr VideoAncillary
anc <- Int -> IO (Ptr VideoAncillary)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
48 :: IO (Ptr GstVideo.VideoAncillary.VideoAncillary)
CUInt
result <- Ptr VideoVBIParser -> Ptr VideoAncillary -> IO CUInt
gst_video_vbi_parser_get_ancillary Ptr VideoVBIParser
parser' Ptr VideoAncillary
anc
let result' :: VideoVBIParserResult
result' = (Int -> VideoVBIParserResult
forall a. Enum a => Int -> a
toEnum (Int -> VideoVBIParserResult)
-> (CUInt -> Int) -> CUInt -> VideoVBIParserResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
VideoAncillary
anc' <- ((ManagedPtr VideoAncillary -> VideoAncillary)
-> Ptr VideoAncillary -> IO VideoAncillary
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr VideoAncillary -> VideoAncillary
GstVideo.VideoAncillary.VideoAncillary) Ptr VideoAncillary
anc
VideoVBIParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VideoVBIParser
parser
(VideoVBIParserResult, VideoAncillary)
-> IO (VideoVBIParserResult, VideoAncillary)
forall (m :: * -> *) a. Monad m => a -> m a
return (VideoVBIParserResult
result', VideoAncillary
anc')
#if defined(ENABLE_OVERLOADING)
data VideoVBIParserGetAncillaryMethodInfo
instance (signature ~ (m ((GstVideo.Enums.VideoVBIParserResult, GstVideo.VideoAncillary.VideoAncillary))), MonadIO m) => O.MethodInfo VideoVBIParserGetAncillaryMethodInfo VideoVBIParser signature where
overloadedMethod = videoVBIParserGetAncillary
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveVideoVBIParserMethod (t :: Symbol) (o :: *) :: * where
ResolveVideoVBIParserMethod "addLine" o = VideoVBIParserAddLineMethodInfo
ResolveVideoVBIParserMethod "copy" o = VideoVBIParserCopyMethodInfo
ResolveVideoVBIParserMethod "free" o = VideoVBIParserFreeMethodInfo
ResolveVideoVBIParserMethod "getAncillary" o = VideoVBIParserGetAncillaryMethodInfo
ResolveVideoVBIParserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVideoVBIParserMethod t VideoVBIParser, O.MethodInfo info VideoVBIParser p) => OL.IsLabel t (VideoVBIParser -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif