Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Buffer lists are an object containing a list of buffers.
Buffer lists are created with bufferListNew
and filled with data
using a bufferListInsert
.
Buffer lists can be pushed on a srcpad with padPushList
. This is
interesting when multiple buffers need to be pushed in one go because it
can reduce the amount of overhead for pushing each buffer individually.
Synopsis
- newtype BufferList = BufferList (ManagedPtr BufferList)
- bufferListCalculateSize :: (HasCallStack, MonadIO m) => BufferList -> m Word64
- bufferListCopyDeep :: (HasCallStack, MonadIO m) => BufferList -> m BufferList
- bufferListForeach :: (HasCallStack, MonadIO m) => BufferList -> BufferListFunc -> m Bool
- bufferListGet :: (HasCallStack, MonadIO m) => BufferList -> Word32 -> m (Maybe Buffer)
- bufferListGetWritable :: (HasCallStack, MonadIO m) => BufferList -> Word32 -> m (Maybe Buffer)
- bufferListInsert :: (HasCallStack, MonadIO m) => BufferList -> Int32 -> Buffer -> m ()
- bufferListLength :: (HasCallStack, MonadIO m) => BufferList -> m Word32
- bufferListNew :: (HasCallStack, MonadIO m) => m BufferList
- bufferListNewSized :: (HasCallStack, MonadIO m) => Word32 -> m BufferList
- bufferListRemove :: (HasCallStack, MonadIO m) => BufferList -> Word32 -> Word32 -> m ()
Exported types
newtype BufferList Source #
Memory-managed wrapper type.
BufferList (ManagedPtr BufferList) |
Instances
Eq BufferList Source # | |
Defined in GI.Gst.Structs.BufferList (==) :: BufferList -> BufferList -> Bool # (/=) :: BufferList -> BufferList -> Bool # | |
GBoxed BufferList Source # | |
Defined in GI.Gst.Structs.BufferList | |
ManagedPtrNewtype BufferList Source # | |
Defined in GI.Gst.Structs.BufferList toManagedPtr :: BufferList -> ManagedPtr BufferList | |
TypedObject BufferList Source # | |
Defined in GI.Gst.Structs.BufferList | |
HasParentTypes BufferList Source # | |
Defined in GI.Gst.Structs.BufferList | |
IsGValue (Maybe BufferList) Source # | Convert |
Defined in GI.Gst.Structs.BufferList gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe BufferList -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe BufferList) | |
type ParentTypes BufferList Source # | |
Defined in GI.Gst.Structs.BufferList |
Methods
Click to display all available methods, including inherited ones
calculateSize
bufferListCalculateSize Source #
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> m Word64 | Returns: the size of the data contained in buffer list in bytes. |
Calculates the size of the data contained in buffer list by adding the size of all buffers.
Since: 1.14
copyDeep
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> m BufferList | Returns: a new copy of |
Create a copy of the given buffer list. This will make a newly allocated copy of the buffer that the source buffer list contains.
Since: 1.6
foreach
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> BufferListFunc |
|
-> m Bool | Returns: |
Call func
with data
for each buffer in list
.
func
can modify the passed buffer pointer or its contents. The return value
of func
define if this function returns or if the remaining buffers in
the list should be skipped.
get
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> Word32 |
|
-> m (Maybe Buffer) | Returns: the buffer at |
Get the buffer at idx
.
You must make sure that idx
does not exceed the number of
buffers available.
getWritable
bufferListGetWritable Source #
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> Word32 |
|
-> m (Maybe Buffer) | Returns: the buffer at |
Gets the buffer at idx
, ensuring it is a writable buffer.
You must make sure that idx
does not exceed the number of
buffers available.
Since: 1.14
insert
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> Int32 |
|
-> Buffer |
|
-> m () |
Insert buffer
at idx
in list
. Other buffers are moved to make room for
this new buffer.
A -1 value for idx
will append the buffer at the end.
length
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> m Word32 | Returns: the number of buffers in the buffer list |
Returns the number of buffers in list
.
new
:: (HasCallStack, MonadIO m) | |
=> m BufferList | Returns: the new |
Creates a new, empty BufferList
. The caller is responsible for unreffing
the returned BufferList
.
Free-function: gst_buffer_list_unref
newSized
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m BufferList | Returns: the new |
Creates a new, empty BufferList
. The caller is responsible for unreffing
the returned BufferList
. The list will have size
space preallocated so
that memory reallocations can be avoided.
Free-function: gst_buffer_list_unref
remove
:: (HasCallStack, MonadIO m) | |
=> BufferList |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Remove length
buffers starting from idx
in list
. The following buffers
are moved to close the gap.