gi-gstvideo-1.0.18: GI/GstVideo/Structs/VideoAncillary.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
Video Ancillary data, according to SMPTE-291M specification.
Note that the contents of the data are always stored as 8bit data (i.e. do not contain
the parity check bits).
/Since: 1.16/
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GstVideo.Structs.VideoAncillary
(
-- * Exported types
VideoAncillary(..) ,
newZeroVideoAncillary ,
noVideoAncillary ,
-- * Properties
-- ** dID #attr:dID#
{- | The Data Identifier
-}
getVideoAncillaryDID ,
setVideoAncillaryDID ,
#if ENABLE_OVERLOADING
videoAncillary_dID ,
#endif
-- ** dataCount #attr:dataCount#
{- | The amount of data (in bytes) in /@data@/ (max 255 bytes)
-}
getVideoAncillaryDataCount ,
setVideoAncillaryDataCount ,
#if ENABLE_OVERLOADING
videoAncillary_dataCount ,
#endif
-- ** sDIDBlockNumber #attr:sDIDBlockNumber#
{- | The Secondary Data Identifier (if type 2) or the Data
Block Number (if type 1)
-}
getVideoAncillarySDIDBlockNumber ,
setVideoAncillarySDIDBlockNumber ,
#if ENABLE_OVERLOADING
videoAncillary_sDIDBlockNumber ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.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.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
-- | Memory-managed wrapper type.
newtype VideoAncillary = VideoAncillary (ManagedPtr VideoAncillary)
instance WrappedPtr VideoAncillary where
wrappedPtrCalloc = callocBytes 48
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr VideoAncillary)
wrappedPtrFree = Just ptr_to_g_free
-- | Construct a `VideoAncillary` struct initialized to zero.
newZeroVideoAncillary :: MonadIO m => m VideoAncillary
newZeroVideoAncillary = liftIO $ wrappedPtrCalloc >>= wrapPtr VideoAncillary
instance tag ~ 'AttrSet => Constructible VideoAncillary tag where
new _ attrs = do
o <- newZeroVideoAncillary
GI.Attributes.set o attrs
return o
-- | A convenience alias for `Nothing` :: `Maybe` `VideoAncillary`.
noVideoAncillary :: Maybe VideoAncillary
noVideoAncillary = Nothing
{- |
Get the value of the “@DID@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' videoAncillary #dID
@
-}
getVideoAncillaryDID :: MonadIO m => VideoAncillary -> m Word8
getVideoAncillaryDID s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Word8
return val
{- |
Set the value of the “@DID@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' videoAncillary [ #dID 'Data.GI.Base.Attributes.:=' value ]
@
-}
setVideoAncillaryDID :: MonadIO m => VideoAncillary -> Word8 -> m ()
setVideoAncillaryDID s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Word8)
#if ENABLE_OVERLOADING
data VideoAncillaryDIDFieldInfo
instance AttrInfo VideoAncillaryDIDFieldInfo where
type AttrAllowedOps VideoAncillaryDIDFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoAncillaryDIDFieldInfo = (~) Word8
type AttrBaseTypeConstraint VideoAncillaryDIDFieldInfo = (~) VideoAncillary
type AttrGetType VideoAncillaryDIDFieldInfo = Word8
type AttrLabel VideoAncillaryDIDFieldInfo = "DID"
type AttrOrigin VideoAncillaryDIDFieldInfo = VideoAncillary
attrGet _ = getVideoAncillaryDID
attrSet _ = setVideoAncillaryDID
attrConstruct = undefined
attrClear _ = undefined
videoAncillary_dID :: AttrLabelProxy "dID"
videoAncillary_dID = AttrLabelProxy
#endif
{- |
Get the value of the “@SDID_block_number@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' videoAncillary #sDIDBlockNumber
@
-}
getVideoAncillarySDIDBlockNumber :: MonadIO m => VideoAncillary -> m Word8
getVideoAncillarySDIDBlockNumber s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 1) :: IO Word8
return val
{- |
Set the value of the “@SDID_block_number@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' videoAncillary [ #sDIDBlockNumber 'Data.GI.Base.Attributes.:=' value ]
@
-}
setVideoAncillarySDIDBlockNumber :: MonadIO m => VideoAncillary -> Word8 -> m ()
setVideoAncillarySDIDBlockNumber s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 1) (val :: Word8)
#if ENABLE_OVERLOADING
data VideoAncillarySDIDBlockNumberFieldInfo
instance AttrInfo VideoAncillarySDIDBlockNumberFieldInfo where
type AttrAllowedOps VideoAncillarySDIDBlockNumberFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoAncillarySDIDBlockNumberFieldInfo = (~) Word8
type AttrBaseTypeConstraint VideoAncillarySDIDBlockNumberFieldInfo = (~) VideoAncillary
type AttrGetType VideoAncillarySDIDBlockNumberFieldInfo = Word8
type AttrLabel VideoAncillarySDIDBlockNumberFieldInfo = "SDID_block_number"
type AttrOrigin VideoAncillarySDIDBlockNumberFieldInfo = VideoAncillary
attrGet _ = getVideoAncillarySDIDBlockNumber
attrSet _ = setVideoAncillarySDIDBlockNumber
attrConstruct = undefined
attrClear _ = undefined
videoAncillary_sDIDBlockNumber :: AttrLabelProxy "sDIDBlockNumber"
videoAncillary_sDIDBlockNumber = AttrLabelProxy
#endif
{- |
Get the value of the “@data_count@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' videoAncillary #dataCount
@
-}
getVideoAncillaryDataCount :: MonadIO m => VideoAncillary -> m Word8
getVideoAncillaryDataCount s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 2) :: IO Word8
return val
{- |
Set the value of the “@data_count@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' videoAncillary [ #dataCount 'Data.GI.Base.Attributes.:=' value ]
@
-}
setVideoAncillaryDataCount :: MonadIO m => VideoAncillary -> Word8 -> m ()
setVideoAncillaryDataCount s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 2) (val :: Word8)
#if ENABLE_OVERLOADING
data VideoAncillaryDataCountFieldInfo
instance AttrInfo VideoAncillaryDataCountFieldInfo where
type AttrAllowedOps VideoAncillaryDataCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoAncillaryDataCountFieldInfo = (~) Word8
type AttrBaseTypeConstraint VideoAncillaryDataCountFieldInfo = (~) VideoAncillary
type AttrGetType VideoAncillaryDataCountFieldInfo = Word8
type AttrLabel VideoAncillaryDataCountFieldInfo = "data_count"
type AttrOrigin VideoAncillaryDataCountFieldInfo = VideoAncillary
attrGet _ = getVideoAncillaryDataCount
attrSet _ = setVideoAncillaryDataCount
attrConstruct = undefined
attrClear _ = undefined
videoAncillary_dataCount :: AttrLabelProxy "dataCount"
videoAncillary_dataCount = AttrLabelProxy
#endif
-- XXX Skipped attribute for "VideoAncillary:data" :: Not implemented: "Don't know how to unpack C array of type TCArray False (-1) 2 (TBasicType TUInt8)"
#if ENABLE_OVERLOADING
instance O.HasAttributeList VideoAncillary
type instance O.AttributeList VideoAncillary = VideoAncillaryAttributeList
type VideoAncillaryAttributeList = ('[ '("dID", VideoAncillaryDIDFieldInfo), '("sDIDBlockNumber", VideoAncillarySDIDBlockNumberFieldInfo), '("dataCount", VideoAncillaryDataCountFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveVideoAncillaryMethod (t :: Symbol) (o :: *) :: * where
ResolveVideoAncillaryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVideoAncillaryMethod t VideoAncillary, O.MethodInfo info VideoAncillary p) => OL.IsLabel t (VideoAncillary -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif