module GI.Gst.Objects.StreamCollection
(
StreamCollection(..) ,
IsStreamCollection ,
toStreamCollection ,
noStreamCollection ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionAddStreamMethodInfo ,
#endif
streamCollectionAddStream ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionGetSizeMethodInfo ,
#endif
streamCollectionGetSize ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionGetStreamMethodInfo ,
#endif
streamCollectionGetStream ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionGetUpstreamIdMethodInfo ,
#endif
streamCollectionGetUpstreamId ,
streamCollectionNew ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionUpstreamIdPropertyInfo ,
#endif
clearStreamCollectionUpstreamId ,
constructStreamCollectionUpstreamId ,
getStreamCollectionUpstreamId ,
setStreamCollectionUpstreamId ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
streamCollectionUpstreamId ,
#endif
C_StreamCollectionStreamNotifyCallback ,
StreamCollectionStreamNotifyCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
StreamCollectionStreamNotifySignalInfo ,
#endif
afterStreamCollectionStreamNotify ,
genClosure_StreamCollectionStreamNotify ,
mk_StreamCollectionStreamNotifyCallback ,
noStreamCollectionStreamNotifyCallback ,
onStreamCollectionStreamNotify ,
wrap_StreamCollectionStreamNotifyCallback,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Objects.Stream as Gst.Stream
newtype StreamCollection = StreamCollection (ManagedPtr StreamCollection)
foreign import ccall "gst_stream_collection_get_type"
c_gst_stream_collection_get_type :: IO GType
instance GObject StreamCollection where
gobjectType _ = c_gst_stream_collection_get_type
class GObject o => IsStreamCollection o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError StreamCollection a) =>
IsStreamCollection a
#endif
instance IsStreamCollection StreamCollection
instance Gst.Object.IsObject StreamCollection
instance GObject.Object.IsObject StreamCollection
toStreamCollection :: (MonadIO m, IsStreamCollection o) => o -> m StreamCollection
toStreamCollection = liftIO . unsafeCastTo StreamCollection
noStreamCollection :: Maybe StreamCollection
noStreamCollection = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveStreamCollectionMethod (t :: Symbol) (o :: *) :: * where
ResolveStreamCollectionMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveStreamCollectionMethod "addStream" o = StreamCollectionAddStreamMethodInfo
ResolveStreamCollectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveStreamCollectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveStreamCollectionMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveStreamCollectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveStreamCollectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveStreamCollectionMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveStreamCollectionMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveStreamCollectionMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveStreamCollectionMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveStreamCollectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveStreamCollectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveStreamCollectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveStreamCollectionMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveStreamCollectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveStreamCollectionMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveStreamCollectionMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveStreamCollectionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveStreamCollectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveStreamCollectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveStreamCollectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveStreamCollectionMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveStreamCollectionMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveStreamCollectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveStreamCollectionMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveStreamCollectionMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveStreamCollectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveStreamCollectionMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveStreamCollectionMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveStreamCollectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveStreamCollectionMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveStreamCollectionMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveStreamCollectionMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveStreamCollectionMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveStreamCollectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveStreamCollectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveStreamCollectionMethod "getSize" o = StreamCollectionGetSizeMethodInfo
ResolveStreamCollectionMethod "getStream" o = StreamCollectionGetStreamMethodInfo
ResolveStreamCollectionMethod "getUpstreamId" o = StreamCollectionGetUpstreamIdMethodInfo
ResolveStreamCollectionMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveStreamCollectionMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveStreamCollectionMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveStreamCollectionMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveStreamCollectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveStreamCollectionMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveStreamCollectionMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveStreamCollectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveStreamCollectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStreamCollectionMethod t StreamCollection, O.MethodInfo info StreamCollection p) => O.IsLabelProxy t (StreamCollection -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveStreamCollectionMethod t StreamCollection, O.MethodInfo info StreamCollection p) => O.IsLabel t (StreamCollection -> 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
#endif
type StreamCollectionStreamNotifyCallback =
Gst.Stream.Stream ->
GParamSpec ->
IO ()
noStreamCollectionStreamNotifyCallback :: Maybe StreamCollectionStreamNotifyCallback
noStreamCollectionStreamNotifyCallback = Nothing
type C_StreamCollectionStreamNotifyCallback =
Ptr () ->
Ptr Gst.Stream.Stream ->
Ptr GParamSpec ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_StreamCollectionStreamNotifyCallback :: C_StreamCollectionStreamNotifyCallback -> IO (FunPtr C_StreamCollectionStreamNotifyCallback)
genClosure_StreamCollectionStreamNotify :: StreamCollectionStreamNotifyCallback -> IO Closure
genClosure_StreamCollectionStreamNotify cb = do
let cb' = wrap_StreamCollectionStreamNotifyCallback cb
mk_StreamCollectionStreamNotifyCallback cb' >>= newCClosure
wrap_StreamCollectionStreamNotifyCallback ::
StreamCollectionStreamNotifyCallback ->
Ptr () ->
Ptr Gst.Stream.Stream ->
Ptr GParamSpec ->
Ptr () ->
IO ()
wrap_StreamCollectionStreamNotifyCallback _cb _ object p0 _ = do
object' <- (newObject Gst.Stream.Stream) object
p0' <- newGParamSpecFromPtr p0
_cb object' p0'
onStreamCollectionStreamNotify :: (IsStreamCollection a, MonadIO m) => a -> StreamCollectionStreamNotifyCallback -> m SignalHandlerId
onStreamCollectionStreamNotify obj cb = liftIO $ do
let cb' = wrap_StreamCollectionStreamNotifyCallback cb
cb'' <- mk_StreamCollectionStreamNotifyCallback cb'
connectSignalFunPtr obj "stream-notify" cb'' SignalConnectBefore
afterStreamCollectionStreamNotify :: (IsStreamCollection a, MonadIO m) => a -> StreamCollectionStreamNotifyCallback -> m SignalHandlerId
afterStreamCollectionStreamNotify obj cb = liftIO $ do
let cb' = wrap_StreamCollectionStreamNotifyCallback cb
cb'' <- mk_StreamCollectionStreamNotifyCallback cb'
connectSignalFunPtr obj "stream-notify" cb'' SignalConnectAfter
getStreamCollectionUpstreamId :: (MonadIO m, IsStreamCollection o) => o -> m T.Text
getStreamCollectionUpstreamId obj = liftIO $ checkUnexpectedNothing "getStreamCollectionUpstreamId" $ getObjectPropertyString obj "upstream-id"
setStreamCollectionUpstreamId :: (MonadIO m, IsStreamCollection o) => o -> T.Text -> m ()
setStreamCollectionUpstreamId obj val = liftIO $ setObjectPropertyString obj "upstream-id" (Just val)
constructStreamCollectionUpstreamId :: (IsStreamCollection o) => T.Text -> IO (GValueConstruct o)
constructStreamCollectionUpstreamId val = constructObjectPropertyString "upstream-id" (Just val)
clearStreamCollectionUpstreamId :: (MonadIO m, IsStreamCollection o) => o -> m ()
clearStreamCollectionUpstreamId obj = liftIO $ setObjectPropertyString obj "upstream-id" (Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionUpstreamIdPropertyInfo
instance AttrInfo StreamCollectionUpstreamIdPropertyInfo where
type AttrAllowedOps StreamCollectionUpstreamIdPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StreamCollectionUpstreamIdPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint StreamCollectionUpstreamIdPropertyInfo = IsStreamCollection
type AttrGetType StreamCollectionUpstreamIdPropertyInfo = T.Text
type AttrLabel StreamCollectionUpstreamIdPropertyInfo = "upstream-id"
type AttrOrigin StreamCollectionUpstreamIdPropertyInfo = StreamCollection
attrGet _ = getStreamCollectionUpstreamId
attrSet _ = setStreamCollectionUpstreamId
attrConstruct _ = constructStreamCollectionUpstreamId
attrClear _ = clearStreamCollectionUpstreamId
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList StreamCollection
type instance O.AttributeList StreamCollection = StreamCollectionAttributeList
type StreamCollectionAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("upstreamId", StreamCollectionUpstreamIdPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
streamCollectionUpstreamId :: AttrLabelProxy "upstreamId"
streamCollectionUpstreamId = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionStreamNotifySignalInfo
instance SignalInfo StreamCollectionStreamNotifySignalInfo where
type HaskellCallbackType StreamCollectionStreamNotifySignalInfo = StreamCollectionStreamNotifyCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_StreamCollectionStreamNotifyCallback cb
cb'' <- mk_StreamCollectionStreamNotifyCallback cb'
connectSignalFunPtr obj "stream-notify" cb'' connectMode
type instance O.SignalList StreamCollection = StreamCollectionSignalList
type StreamCollectionSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("streamNotify", StreamCollectionStreamNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_stream_collection_new" gst_stream_collection_new ::
CString ->
IO (Ptr StreamCollection)
streamCollectionNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> m StreamCollection
streamCollectionNew upstreamId = liftIO $ do
maybeUpstreamId <- case upstreamId of
Nothing -> return nullPtr
Just jUpstreamId -> do
jUpstreamId' <- textToCString jUpstreamId
return jUpstreamId'
result <- gst_stream_collection_new maybeUpstreamId
checkUnexpectedReturnNULL "streamCollectionNew" result
result' <- (newObject StreamCollection) result
freeMem maybeUpstreamId
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
foreign import ccall "gst_stream_collection_add_stream" gst_stream_collection_add_stream ::
Ptr StreamCollection ->
Ptr Gst.Stream.Stream ->
IO CInt
streamCollectionAddStream ::
(B.CallStack.HasCallStack, MonadIO m, IsStreamCollection a, Gst.Stream.IsStream b) =>
a
-> b
-> m Bool
streamCollectionAddStream collection stream = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
stream' <- B.ManagedPtr.disownObject stream
result <- gst_stream_collection_add_stream collection' stream'
let result' = (/= 0) result
touchManagedPtr collection
touchManagedPtr stream
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionAddStreamMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsStreamCollection a, Gst.Stream.IsStream b) => O.MethodInfo StreamCollectionAddStreamMethodInfo a signature where
overloadedMethod _ = streamCollectionAddStream
#endif
foreign import ccall "gst_stream_collection_get_size" gst_stream_collection_get_size ::
Ptr StreamCollection ->
IO Word32
streamCollectionGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsStreamCollection a) =>
a
-> m Word32
streamCollectionGetSize collection = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
result <- gst_stream_collection_get_size collection'
touchManagedPtr collection
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionGetSizeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsStreamCollection a) => O.MethodInfo StreamCollectionGetSizeMethodInfo a signature where
overloadedMethod _ = streamCollectionGetSize
#endif
foreign import ccall "gst_stream_collection_get_stream" gst_stream_collection_get_stream ::
Ptr StreamCollection ->
Word32 ->
IO (Ptr Gst.Stream.Stream)
streamCollectionGetStream ::
(B.CallStack.HasCallStack, MonadIO m, IsStreamCollection a) =>
a
-> Word32
-> m Gst.Stream.Stream
streamCollectionGetStream collection index = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
result <- gst_stream_collection_get_stream collection' index
checkUnexpectedReturnNULL "streamCollectionGetStream" result
result' <- (newObject Gst.Stream.Stream) result
touchManagedPtr collection
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionGetStreamMethodInfo
instance (signature ~ (Word32 -> m Gst.Stream.Stream), MonadIO m, IsStreamCollection a) => O.MethodInfo StreamCollectionGetStreamMethodInfo a signature where
overloadedMethod _ = streamCollectionGetStream
#endif
foreign import ccall "gst_stream_collection_get_upstream_id" gst_stream_collection_get_upstream_id ::
Ptr StreamCollection ->
IO CString
streamCollectionGetUpstreamId ::
(B.CallStack.HasCallStack, MonadIO m, IsStreamCollection a) =>
a
-> m T.Text
streamCollectionGetUpstreamId collection = liftIO $ do
collection' <- unsafeManagedPtrCastPtr collection
result <- gst_stream_collection_get_upstream_id collection'
checkUnexpectedReturnNULL "streamCollectionGetUpstreamId" result
result' <- cstringToText result
touchManagedPtr collection
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data StreamCollectionGetUpstreamIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsStreamCollection a) => O.MethodInfo StreamCollectionGetUpstreamIdMethodInfo a signature where
overloadedMethod _ = streamCollectionGetUpstreamId
#endif