gi-gst-1.0.18: GI/Gst/Objects/Stream.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)
A high-level object representing a single stream. It might be backed, or
not, by an actual flow of data in a pipeline ('GI.Gst.Objects.Pad.Pad').
A 'GI.Gst.Objects.Stream.Stream' does not care about data changes (such as decoding, encoding,
parsing,...) as long as the underlying data flow corresponds to the same
high-level flow (ex: a certain audio track).
A 'GI.Gst.Objects.Stream.Stream' contains all the information pertinent to a stream, such as
stream-id, tags, caps, type, ...
Elements can subclass a 'GI.Gst.Objects.Stream.Stream' for internal usage (to contain information
pertinent to streams of data).
/Since: 1.10/
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gst.Objects.Stream
(
-- * Exported types
Stream(..) ,
IsStream ,
toStream ,
noStream ,
-- * Methods
-- ** getCaps #method:getCaps#
#if ENABLE_OVERLOADING
StreamGetCapsMethodInfo ,
#endif
streamGetCaps ,
-- ** getStreamFlags #method:getStreamFlags#
#if ENABLE_OVERLOADING
StreamGetStreamFlagsMethodInfo ,
#endif
streamGetStreamFlags ,
-- ** getStreamId #method:getStreamId#
#if ENABLE_OVERLOADING
StreamGetStreamIdMethodInfo ,
#endif
streamGetStreamId ,
-- ** getStreamType #method:getStreamType#
#if ENABLE_OVERLOADING
StreamGetStreamTypeMethodInfo ,
#endif
streamGetStreamType ,
-- ** getTags #method:getTags#
#if ENABLE_OVERLOADING
StreamGetTagsMethodInfo ,
#endif
streamGetTags ,
-- ** new #method:new#
streamNew ,
-- ** setCaps #method:setCaps#
#if ENABLE_OVERLOADING
StreamSetCapsMethodInfo ,
#endif
streamSetCaps ,
-- ** setStreamFlags #method:setStreamFlags#
#if ENABLE_OVERLOADING
StreamSetStreamFlagsMethodInfo ,
#endif
streamSetStreamFlags ,
-- ** setStreamType #method:setStreamType#
#if ENABLE_OVERLOADING
StreamSetStreamTypeMethodInfo ,
#endif
streamSetStreamType ,
-- ** setTags #method:setTags#
#if ENABLE_OVERLOADING
StreamSetTagsMethodInfo ,
#endif
streamSetTags ,
-- * Properties
-- ** caps #attr:caps#
{- | The 'GI.Gst.Structs.Caps.Caps' of the 'GI.Gst.Objects.Stream.Stream'.
-}
#if ENABLE_OVERLOADING
StreamCapsPropertyInfo ,
#endif
clearStreamCaps ,
constructStreamCaps ,
getStreamCaps ,
setStreamCaps ,
#if ENABLE_OVERLOADING
streamCaps ,
#endif
-- ** streamFlags #attr:streamFlags#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
StreamStreamFlagsPropertyInfo ,
#endif
constructStreamStreamFlags ,
getStreamStreamFlags ,
setStreamStreamFlags ,
#if ENABLE_OVERLOADING
streamStreamFlags ,
#endif
-- ** streamId #attr:streamId#
{- | The unique identifier of the 'GI.Gst.Objects.Stream.Stream'. Can only be set at construction
time.
-}
#if ENABLE_OVERLOADING
StreamStreamIdPropertyInfo ,
#endif
constructStreamStreamId ,
getStreamStreamId ,
#if ENABLE_OVERLOADING
streamStreamId ,
#endif
-- ** streamType #attr:streamType#
{- | The 'GI.Gst.Flags.StreamType' of the 'GI.Gst.Objects.Stream.Stream'. Can only be set at construction time.
-}
#if ENABLE_OVERLOADING
StreamStreamTypePropertyInfo ,
#endif
constructStreamStreamType ,
getStreamStreamType ,
setStreamStreamType ,
#if ENABLE_OVERLOADING
streamStreamType ,
#endif
-- ** tags #attr:tags#
{- | The 'GI.Gst.Structs.TagList.TagList' of the 'GI.Gst.Objects.Stream.Stream'.
-}
#if ENABLE_OVERLOADING
StreamTagsPropertyInfo ,
#endif
clearStreamTags ,
constructStreamTags ,
getStreamTags ,
setStreamTags ,
#if ENABLE_OVERLOADING
streamTags ,
#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
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Flags as Gst.Flags
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.TagList as Gst.TagList
-- | Memory-managed wrapper type.
newtype Stream = Stream (ManagedPtr Stream)
foreign import ccall "gst_stream_get_type"
c_gst_stream_get_type :: IO GType
instance GObject Stream where
gobjectType = c_gst_stream_get_type
-- | Type class for types which can be safely cast to `Stream`, for instance with `toStream`.
class (GObject o, O.IsDescendantOf Stream o) => IsStream o
instance (GObject o, O.IsDescendantOf Stream o) => IsStream o
instance O.HasParentTypes Stream
type instance O.ParentTypes Stream = '[Gst.Object.Object, GObject.Object.Object]
-- | Cast to `Stream`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toStream :: (MonadIO m, IsStream o) => o -> m Stream
toStream = liftIO . unsafeCastTo Stream
-- | A convenience alias for `Nothing` :: `Maybe` `Stream`.
noStream :: Maybe Stream
noStream = Nothing
#if ENABLE_OVERLOADING
type family ResolveStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveStreamMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveStreamMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveStreamMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveStreamMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveStreamMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveStreamMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveStreamMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveStreamMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveStreamMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveStreamMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveStreamMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveStreamMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveStreamMethod "getCaps" o = StreamGetCapsMethodInfo
ResolveStreamMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveStreamMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveStreamMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveStreamMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveStreamMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveStreamMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveStreamMethod "getStreamFlags" o = StreamGetStreamFlagsMethodInfo
ResolveStreamMethod "getStreamId" o = StreamGetStreamIdMethodInfo
ResolveStreamMethod "getStreamType" o = StreamGetStreamTypeMethodInfo
ResolveStreamMethod "getTags" o = StreamGetTagsMethodInfo
ResolveStreamMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveStreamMethod "setCaps" o = StreamSetCapsMethodInfo
ResolveStreamMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveStreamMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveStreamMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveStreamMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveStreamMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveStreamMethod "setStreamFlags" o = StreamSetStreamFlagsMethodInfo
ResolveStreamMethod "setStreamType" o = StreamSetStreamTypeMethodInfo
ResolveStreamMethod "setTags" o = StreamSetTagsMethodInfo
ResolveStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStreamMethod t Stream, O.MethodInfo info Stream p) => OL.IsLabel t (Stream -> 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
-- VVV Prop "caps"
-- Type: TInterface (Name {namespace = "Gst", name = "Caps"})
-- Flags: [PropertyReadable,PropertyWritable]
-- Nullable: (Nothing,Just True)
{- |
Get the value of the “@caps@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' stream #caps
@
-}
getStreamCaps :: (MonadIO m, IsStream o) => o -> m (Maybe Gst.Caps.Caps)
getStreamCaps obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "caps" Gst.Caps.Caps
{- |
Set the value of the “@caps@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' stream [ #caps 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStreamCaps :: (MonadIO m, IsStream o) => o -> Gst.Caps.Caps -> m ()
setStreamCaps obj val = liftIO $ B.Properties.setObjectPropertyBoxed obj "caps" (Just val)
{- |
Construct a `GValueConstruct` with valid value for the “@caps@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStreamCaps :: (IsStream o) => Gst.Caps.Caps -> IO (GValueConstruct o)
constructStreamCaps val = B.Properties.constructObjectPropertyBoxed "caps" (Just val)
{- |
Set the value of the “@caps@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.clear' #caps
@
-}
clearStreamCaps :: (MonadIO m, IsStream o) => o -> m ()
clearStreamCaps obj = liftIO $ B.Properties.setObjectPropertyBoxed obj "caps" (Nothing :: Maybe Gst.Caps.Caps)
#if ENABLE_OVERLOADING
data StreamCapsPropertyInfo
instance AttrInfo StreamCapsPropertyInfo where
type AttrAllowedOps StreamCapsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StreamCapsPropertyInfo = (~) Gst.Caps.Caps
type AttrBaseTypeConstraint StreamCapsPropertyInfo = IsStream
type AttrGetType StreamCapsPropertyInfo = (Maybe Gst.Caps.Caps)
type AttrLabel StreamCapsPropertyInfo = "caps"
type AttrOrigin StreamCapsPropertyInfo = Stream
attrGet _ = getStreamCaps
attrSet _ = setStreamCaps
attrConstruct _ = constructStreamCaps
attrClear _ = clearStreamCaps
#endif
-- VVV Prop "stream-flags"
-- Type: TInterface (Name {namespace = "Gst", name = "StreamFlags"})
-- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
-- Nullable: (Just False,Just False)
{- |
Get the value of the “@stream-flags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' stream #streamFlags
@
-}
getStreamStreamFlags :: (MonadIO m, IsStream o) => o -> m [Gst.Flags.StreamFlags]
getStreamStreamFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "stream-flags"
{- |
Set the value of the “@stream-flags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' stream [ #streamFlags 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStreamStreamFlags :: (MonadIO m, IsStream o) => o -> [Gst.Flags.StreamFlags] -> m ()
setStreamStreamFlags obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "stream-flags" val
{- |
Construct a `GValueConstruct` with valid value for the “@stream-flags@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStreamStreamFlags :: (IsStream o) => [Gst.Flags.StreamFlags] -> IO (GValueConstruct o)
constructStreamStreamFlags val = B.Properties.constructObjectPropertyFlags "stream-flags" val
#if ENABLE_OVERLOADING
data StreamStreamFlagsPropertyInfo
instance AttrInfo StreamStreamFlagsPropertyInfo where
type AttrAllowedOps StreamStreamFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint StreamStreamFlagsPropertyInfo = (~) [Gst.Flags.StreamFlags]
type AttrBaseTypeConstraint StreamStreamFlagsPropertyInfo = IsStream
type AttrGetType StreamStreamFlagsPropertyInfo = [Gst.Flags.StreamFlags]
type AttrLabel StreamStreamFlagsPropertyInfo = "stream-flags"
type AttrOrigin StreamStreamFlagsPropertyInfo = Stream
attrGet _ = getStreamStreamFlags
attrSet _ = setStreamStreamFlags
attrConstruct _ = constructStreamStreamFlags
attrClear _ = undefined
#endif
-- VVV Prop "stream-id"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
-- Nullable: (Just True,Nothing)
{- |
Get the value of the “@stream-id@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' stream #streamId
@
-}
getStreamStreamId :: (MonadIO m, IsStream o) => o -> m (Maybe T.Text)
getStreamStreamId obj = liftIO $ B.Properties.getObjectPropertyString obj "stream-id"
{- |
Construct a `GValueConstruct` with valid value for the “@stream-id@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStreamStreamId :: (IsStream o) => T.Text -> IO (GValueConstruct o)
constructStreamStreamId val = B.Properties.constructObjectPropertyString "stream-id" (Just val)
#if ENABLE_OVERLOADING
data StreamStreamIdPropertyInfo
instance AttrInfo StreamStreamIdPropertyInfo where
type AttrAllowedOps StreamStreamIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StreamStreamIdPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint StreamStreamIdPropertyInfo = IsStream
type AttrGetType StreamStreamIdPropertyInfo = (Maybe T.Text)
type AttrLabel StreamStreamIdPropertyInfo = "stream-id"
type AttrOrigin StreamStreamIdPropertyInfo = Stream
attrGet _ = getStreamStreamId
attrSet _ = undefined
attrConstruct _ = constructStreamStreamId
attrClear _ = undefined
#endif
-- VVV Prop "stream-type"
-- Type: TInterface (Name {namespace = "Gst", name = "StreamType"})
-- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
-- Nullable: (Just False,Just False)
{- |
Get the value of the “@stream-type@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' stream #streamType
@
-}
getStreamStreamType :: (MonadIO m, IsStream o) => o -> m [Gst.Flags.StreamType]
getStreamStreamType obj = liftIO $ B.Properties.getObjectPropertyFlags obj "stream-type"
{- |
Set the value of the “@stream-type@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' stream [ #streamType 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStreamStreamType :: (MonadIO m, IsStream o) => o -> [Gst.Flags.StreamType] -> m ()
setStreamStreamType obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "stream-type" val
{- |
Construct a `GValueConstruct` with valid value for the “@stream-type@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStreamStreamType :: (IsStream o) => [Gst.Flags.StreamType] -> IO (GValueConstruct o)
constructStreamStreamType val = B.Properties.constructObjectPropertyFlags "stream-type" val
#if ENABLE_OVERLOADING
data StreamStreamTypePropertyInfo
instance AttrInfo StreamStreamTypePropertyInfo where
type AttrAllowedOps StreamStreamTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint StreamStreamTypePropertyInfo = (~) [Gst.Flags.StreamType]
type AttrBaseTypeConstraint StreamStreamTypePropertyInfo = IsStream
type AttrGetType StreamStreamTypePropertyInfo = [Gst.Flags.StreamType]
type AttrLabel StreamStreamTypePropertyInfo = "stream-type"
type AttrOrigin StreamStreamTypePropertyInfo = Stream
attrGet _ = getStreamStreamType
attrSet _ = setStreamStreamType
attrConstruct _ = constructStreamStreamType
attrClear _ = undefined
#endif
-- VVV Prop "tags"
-- Type: TInterface (Name {namespace = "Gst", name = "TagList"})
-- Flags: [PropertyReadable,PropertyWritable]
-- Nullable: (Nothing,Just True)
{- |
Get the value of the “@tags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.get' stream #tags
@
-}
getStreamTags :: (MonadIO m, IsStream o) => o -> m (Maybe Gst.TagList.TagList)
getStreamTags obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "tags" Gst.TagList.TagList
{- |
Set the value of the “@tags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.set' stream [ #tags 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStreamTags :: (MonadIO m, IsStream o) => o -> Gst.TagList.TagList -> m ()
setStreamTags obj val = liftIO $ B.Properties.setObjectPropertyBoxed obj "tags" (Just val)
{- |
Construct a `GValueConstruct` with valid value for the “@tags@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStreamTags :: (IsStream o) => Gst.TagList.TagList -> IO (GValueConstruct o)
constructStreamTags val = B.Properties.constructObjectPropertyBoxed "tags" (Just val)
{- |
Set the value of the “@tags@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Attributes.clear' #tags
@
-}
clearStreamTags :: (MonadIO m, IsStream o) => o -> m ()
clearStreamTags obj = liftIO $ B.Properties.setObjectPropertyBoxed obj "tags" (Nothing :: Maybe Gst.TagList.TagList)
#if ENABLE_OVERLOADING
data StreamTagsPropertyInfo
instance AttrInfo StreamTagsPropertyInfo where
type AttrAllowedOps StreamTagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StreamTagsPropertyInfo = (~) Gst.TagList.TagList
type AttrBaseTypeConstraint StreamTagsPropertyInfo = IsStream
type AttrGetType StreamTagsPropertyInfo = (Maybe Gst.TagList.TagList)
type AttrLabel StreamTagsPropertyInfo = "tags"
type AttrOrigin StreamTagsPropertyInfo = Stream
attrGet _ = getStreamTags
attrSet _ = setStreamTags
attrConstruct _ = constructStreamTags
attrClear _ = clearStreamTags
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Stream
type instance O.AttributeList Stream = StreamAttributeList
type StreamAttributeList = ('[ '("caps", StreamCapsPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("streamFlags", StreamStreamFlagsPropertyInfo), '("streamId", StreamStreamIdPropertyInfo), '("streamType", StreamStreamTypePropertyInfo), '("tags", StreamTagsPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
streamCaps :: AttrLabelProxy "caps"
streamCaps = AttrLabelProxy
streamStreamFlags :: AttrLabelProxy "streamFlags"
streamStreamFlags = AttrLabelProxy
streamStreamId :: AttrLabelProxy "streamId"
streamStreamId = AttrLabelProxy
streamStreamType :: AttrLabelProxy "streamType"
streamStreamType = AttrLabelProxy
streamTags :: AttrLabelProxy "tags"
streamTags = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Stream = StreamSignalList
type StreamSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method Stream::new
-- method type : Constructor
-- Args : [Arg {argCName = "stream_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the id for the new stream. If %NULL,\na new one will be automatically generated", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #GstCaps of the stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TInterface (Name {namespace = "Gst", name = "StreamType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstStreamType of the stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gst", name = "StreamFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstStreamFlags of the stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Stream"}))
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_new" gst_stream_new ::
CString -> -- stream_id : TBasicType TUTF8
Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
CUInt -> -- type : TInterface (Name {namespace = "Gst", name = "StreamType"})
CUInt -> -- flags : TInterface (Name {namespace = "Gst", name = "StreamFlags"})
IO (Ptr Stream)
{- |
Create a new 'GI.Gst.Objects.Stream.Stream' for the given /@streamId@/, /@caps@/, /@type@/
and /@flags@/
/Since: 1.10/
-}
streamNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
{- ^ /@streamId@/: the id for the new stream. If 'Nothing',
a new one will be automatically generated -}
-> Maybe (Gst.Caps.Caps)
{- ^ /@caps@/: the 'GI.Gst.Structs.Caps.Caps' of the stream -}
-> [Gst.Flags.StreamType]
{- ^ /@type@/: the 'GI.Gst.Flags.StreamType' of the stream -}
-> [Gst.Flags.StreamFlags]
{- ^ /@flags@/: the 'GI.Gst.Flags.StreamFlags' of the stream -}
-> m Stream
{- ^ __Returns:__ The new 'GI.Gst.Objects.Stream.Stream' -}
streamNew streamId caps type_ flags = liftIO $ do
maybeStreamId <- case streamId of
Nothing -> return nullPtr
Just jStreamId -> do
jStreamId' <- textToCString jStreamId
return jStreamId'
maybeCaps <- case caps of
Nothing -> return nullPtr
Just jCaps -> do
jCaps' <- unsafeManagedPtrGetPtr jCaps
return jCaps'
let type_' = gflagsToWord type_
let flags' = gflagsToWord flags
result <- gst_stream_new maybeStreamId maybeCaps type_' flags'
checkUnexpectedReturnNULL "streamNew" result
result' <- (wrapObject Stream) result
whenJust caps touchManagedPtr
freeMem maybeStreamId
return result'
#if ENABLE_OVERLOADING
#endif
-- method Stream::get_caps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Caps"}))
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_get_caps" gst_stream_get_caps ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
IO (Ptr Gst.Caps.Caps)
{- |
Retrieve the caps for /@stream@/, if any
/Since: 1.10/
-}
streamGetCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> m (Maybe Gst.Caps.Caps)
{- ^ __Returns:__ The 'GI.Gst.Structs.Caps.Caps' for /@stream@/ -}
streamGetCaps stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- gst_stream_get_caps stream'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Gst.Caps.Caps) result'
return result''
touchManagedPtr stream
return maybeResult
#if ENABLE_OVERLOADING
data StreamGetCapsMethodInfo
instance (signature ~ (m (Maybe Gst.Caps.Caps)), MonadIO m, IsStream a) => O.MethodInfo StreamGetCapsMethodInfo a signature where
overloadedMethod _ = streamGetCaps
#endif
-- method Stream::get_stream_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "StreamFlags"}))
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_get_stream_flags" gst_stream_get_stream_flags ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
IO CUInt
{- |
Retrieve the current stream flags for /@stream@/
/Since: 1.10/
-}
streamGetStreamFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> m [Gst.Flags.StreamFlags]
{- ^ __Returns:__ The 'GI.Gst.Flags.StreamFlags' for /@stream@/ -}
streamGetStreamFlags stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- gst_stream_get_stream_flags stream'
let result' = wordToGFlags result
touchManagedPtr stream
return result'
#if ENABLE_OVERLOADING
data StreamGetStreamFlagsMethodInfo
instance (signature ~ (m [Gst.Flags.StreamFlags]), MonadIO m, IsStream a) => O.MethodInfo StreamGetStreamFlagsMethodInfo a signature where
overloadedMethod _ = streamGetStreamFlags
#endif
-- method Stream::get_stream_id
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", 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_stream_get_stream_id" gst_stream_get_stream_id ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
IO CString
{- |
Returns the stream ID of /@stream@/.
/Since: 1.10/
-}
streamGetStreamId ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> m (Maybe T.Text)
{- ^ __Returns:__ the stream ID of /@stream@/. Only valid
during the lifetime of /@stream@/. -}
streamGetStreamId stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- gst_stream_get_stream_id stream'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr stream
return maybeResult
#if ENABLE_OVERLOADING
data StreamGetStreamIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsStream a) => O.MethodInfo StreamGetStreamIdMethodInfo a signature where
overloadedMethod _ = streamGetStreamId
#endif
-- method Stream::get_stream_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "StreamType"}))
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_get_stream_type" gst_stream_get_stream_type ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
IO CUInt
{- |
Retrieve the stream type for /@stream@/
/Since: 1.10/
-}
streamGetStreamType ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> m [Gst.Flags.StreamType]
{- ^ __Returns:__ The 'GI.Gst.Flags.StreamType' for /@stream@/ -}
streamGetStreamType stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- gst_stream_get_stream_type stream'
let result' = wordToGFlags result
touchManagedPtr stream
return result'
#if ENABLE_OVERLOADING
data StreamGetStreamTypeMethodInfo
instance (signature ~ (m [Gst.Flags.StreamType]), MonadIO m, IsStream a) => O.MethodInfo StreamGetStreamTypeMethodInfo a signature where
overloadedMethod _ = streamGetStreamType
#endif
-- method Stream::get_tags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "TagList"}))
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_get_tags" gst_stream_get_tags ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
IO (Ptr Gst.TagList.TagList)
{- |
Retrieve the tags for /@stream@/, if any
/Since: 1.10/
-}
streamGetTags ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> m (Maybe Gst.TagList.TagList)
{- ^ __Returns:__ The 'GI.Gst.Structs.TagList.TagList' for /@stream@/ -}
streamGetTags stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- gst_stream_get_tags stream'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Gst.TagList.TagList) result'
return result''
touchManagedPtr stream
return maybeResult
#if ENABLE_OVERLOADING
data StreamGetTagsMethodInfo
instance (signature ~ (m (Maybe Gst.TagList.TagList)), MonadIO m, IsStream a) => O.MethodInfo StreamGetTagsMethodInfo a signature where
overloadedMethod _ = streamGetTags
#endif
-- method Stream::set_caps
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstCaps", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_set_caps" gst_stream_set_caps ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
Ptr Gst.Caps.Caps -> -- caps : TInterface (Name {namespace = "Gst", name = "Caps"})
IO ()
{- |
Set the caps for the 'GI.Gst.Objects.Stream.Stream'
/Since: 1.10/
-}
streamSetCaps ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> Maybe (Gst.Caps.Caps)
{- ^ /@caps@/: a 'GI.Gst.Structs.Caps.Caps' -}
-> m ()
streamSetCaps stream caps = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybeCaps <- case caps of
Nothing -> return nullPtr
Just jCaps -> do
jCaps' <- unsafeManagedPtrGetPtr jCaps
return jCaps'
gst_stream_set_caps stream' maybeCaps
touchManagedPtr stream
whenJust caps touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data StreamSetCapsMethodInfo
instance (signature ~ (Maybe (Gst.Caps.Caps) -> m ()), MonadIO m, IsStream a) => O.MethodInfo StreamSetCapsMethodInfo a signature where
overloadedMethod _ = streamSetCaps
#endif
-- method Stream::set_stream_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gst", name = "StreamFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the flags to set on @stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_set_stream_flags" gst_stream_set_stream_flags ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
CUInt -> -- flags : TInterface (Name {namespace = "Gst", name = "StreamFlags"})
IO ()
{- |
Set the /@flags@/ for the /@stream@/.
/Since: 1.10/
-}
streamSetStreamFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> [Gst.Flags.StreamFlags]
{- ^ /@flags@/: the flags to set on /@stream@/ -}
-> m ()
streamSetStreamFlags stream flags = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
let flags' = gflagsToWord flags
gst_stream_set_stream_flags stream' flags'
touchManagedPtr stream
return ()
#if ENABLE_OVERLOADING
data StreamSetStreamFlagsMethodInfo
instance (signature ~ ([Gst.Flags.StreamFlags] -> m ()), MonadIO m, IsStream a) => O.MethodInfo StreamSetStreamFlagsMethodInfo a signature where
overloadedMethod _ = streamSetStreamFlags
#endif
-- method Stream::set_stream_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "stream_type", argType = TInterface (Name {namespace = "Gst", name = "StreamType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the type to set on @stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_set_stream_type" gst_stream_set_stream_type ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
CUInt -> -- stream_type : TInterface (Name {namespace = "Gst", name = "StreamType"})
IO ()
{- |
Set the stream type of /@stream@/
/Since: 1.10/
-}
streamSetStreamType ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> [Gst.Flags.StreamType]
{- ^ /@streamType@/: the type to set on /@stream@/ -}
-> m ()
streamSetStreamType stream streamType = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
let streamType' = gflagsToWord streamType
gst_stream_set_stream_type stream' streamType'
touchManagedPtr stream
return ()
#if ENABLE_OVERLOADING
data StreamSetStreamTypeMethodInfo
instance (signature ~ ([Gst.Flags.StreamType] -> m ()), MonadIO m, IsStream a) => O.MethodInfo StreamSetStreamTypeMethodInfo a signature where
overloadedMethod _ = streamSetStreamType
#endif
-- method Stream::set_tags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gst", name = "Stream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstStream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tags", argType = TInterface (Name {namespace = "Gst", name = "TagList"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstTagList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gst_stream_set_tags" gst_stream_set_tags ::
Ptr Stream -> -- stream : TInterface (Name {namespace = "Gst", name = "Stream"})
Ptr Gst.TagList.TagList -> -- tags : TInterface (Name {namespace = "Gst", name = "TagList"})
IO ()
{- |
Set the tags for the 'GI.Gst.Objects.Stream.Stream'
/Since: 1.10/
-}
streamSetTags ::
(B.CallStack.HasCallStack, MonadIO m, IsStream a) =>
a
{- ^ /@stream@/: a 'GI.Gst.Objects.Stream.Stream' -}
-> Maybe (Gst.TagList.TagList)
{- ^ /@tags@/: a 'GI.Gst.Structs.TagList.TagList' -}
-> m ()
streamSetTags stream tags = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybeTags <- case tags of
Nothing -> return nullPtr
Just jTags -> do
jTags' <- unsafeManagedPtrGetPtr jTags
return jTags'
gst_stream_set_tags stream' maybeTags
touchManagedPtr stream
whenJust tags touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data StreamSetTagsMethodInfo
instance (signature ~ (Maybe (Gst.TagList.TagList) -> m ()), MonadIO m, IsStream a) => O.MethodInfo StreamSetTagsMethodInfo a signature where
overloadedMethod _ = streamSetTags
#endif