gstreamer-0.12.0: Binding to the GStreamer open source multimedia framework.

Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net

Media.Streaming.GStreamer.Core.Buffer

Contents

Description

Data-passing buffer type, supporting sub-buffers.

Synopsis

Types

Buffers are the basic unit of data transfer in GStreamer. The Buffer type provides all the state necessary to define a region of memory as part of a stream. Sub-buffers are also supported, allowing a smaller region of a Buffer to become its own Buffer, with mechansims in place to ensure that neither memory space goes away prematurely.

data BufferFlags Source

The flags a Buffer may have.

Constructors

BufferPreroll

the buffer is part of a preroll and should not be displayed

BufferDiscont

the buffer marks a discontinuity in the stream

BufferInCaps

the buffer has been added as a field in a Caps

BufferGap

the buffer has been created to fill a gap in the stream

BufferDeltaUnit

the buffer cannot be decoded independently

Buffer Operations

bufferOffsetNone :: BufferOffsetSource

The undefined BufferOffset value.

bufferGetFlagsSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a Buffer

-> [BufferFlags]

the flags set on buffer

Get the flags set on buffer.

bufferGetFlagsMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m [BufferFlags]

the flags set on the current Buffer

Get the flags set on the current Buffer.

bufferSetFlagsMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> [BufferFlags]

flags - the flags to set on the current Buffer

-> MiniObjectT bufferT m () 

Set flags on the current Buffer.

bufferUnsetFlagsMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> [BufferFlags]

flags - the flags to unset on the current Buffer

-> MiniObjectT bufferT m () 

Unset flags on the current Buffer.

bufferGetSizeSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a Buffer

-> Word

the size of buffer in bytes

Get buffer's size in bytes.

bufferGetSizeMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m Word

the size of the current Buffer in bytes

Get the size of the current Buffer in bytes.

unsafeBufferGetPtrMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Ptr Word8)

a pointer to the data stored in the current Buffer

Get a raw pointer to the internal data area for the current buffer. The pointer may be used to write into the data area if desired. This function is unsafe in that the pointer should not be used once the Buffer is returned.

bufferGetTimestampSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a Buffer

-> Maybe ClockTime

the timestamp on buffer

Get the timestamp on buffer.

bufferGetTimestampMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Maybe ClockTime)

the timestamp on the current Buffer

Get the timestamp on the current Buffer.

bufferSetTimestampMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> Maybe ClockTime

timestamp - the timestamp to set on the current Buffer

-> MiniObjectT bufferT m () 

Set the timestamp on the current Buffer.

bufferGetDurationSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a Buffer

-> Maybe ClockTime

the duration of buffer

Get the duration of buffer.

bufferGetDurationMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Maybe ClockTime)

the duration of the current Buffer

Get the duration of the current Buffer.

bufferSetDurationMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> Maybe ClockTime

duration - the duration to set on the current Buffer

-> MiniObjectT bufferT m () 

Set the duration of the current Buffer.

bufferGetCapsSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a buffer

-> Maybe Caps

the Caps of buffer if set, otherwise Nothing

Get the Caps of buffer.

bufferGetCapsMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Maybe Caps)

the Caps of the current Buffer if set, otherwise Nothing

Get the caps of the current Buffer.

bufferSetCapsMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> Maybe Caps

caps - the Caps to set on the current Buffer, or Nothing to unset them

-> MiniObjectT bufferT m () 

Set the caps of the current Buffer.

bufferGetOffsetSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a buffer

-> Maybe Word64

the start offset of buffer if set, otherwise Nothing

Get the start offset of the Buffer.

bufferGetOffsetMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Maybe Word64)

the start offset of the current Buffer if set, otherwise Nothing

Get the start offset of the current Buffer.

bufferSetOffsetMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> Maybe Word64

offset - the start offset to set on the current buffer

-> MiniObjectT bufferT m () 

Set the start offset of the current Buffer.

bufferGetOffsetEndSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a buffer

-> Maybe Word64

the end offset of buffer if set, otherwise Nothing

Get the end offset of the Buffer.

bufferGetOffsetEndMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m (Maybe Word64)

the start offset of the current Buffer if set, otherwise Nothing

Get the end offset of the current Buffer.

bufferSetOffsetEndMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> Maybe Word64

offset - the end offset to set on the current buffer

-> MiniObjectT bufferT m () 

Set the end offset of the current Buffer.

bufferIsDiscontSource

Arguments

:: BufferClass bufferT 
=> bufferT

buffer - a buffer

-> Bool

True if buffer marks a discontinuity in a stream

Return True if the Buffer marks a discontinuity in a stream, or False otherwise. This typically occurs after a seek or a dropped buffer from a live or network source.

bufferIsDiscontMSource

Arguments

:: (BufferClass bufferT, MonadIO m) 
=> MiniObjectT bufferT m Bool

True if the current buffer marks a discontinuity in a stream

Return True if the current Buffer marks a discontinuity in a stream, or False otherwise.

bufferCreateEmptySource

Arguments

:: MonadIO m 
=> MiniObjectT Buffer m a

mutate - the mutating action

-> m (Buffer, a)

the new buffer and the action's result

Create an empty Buffer and mutate it according to the given action. Once this function returns, the Buffer is immutable.

bufferCreateSource

Arguments

:: MonadIO m 
=> Word

size - the size of the Buffer to be created

-> MiniObjectT Buffer m a

mutate - the mutating action

-> m (Buffer, a)

the new Buffer and the action's result

Create and mutate a Buffer of the given size.

bufferCreateSubSource

Arguments

:: BufferClass bufferT 
=> bufferT

parent - the parent buffer

-> Word

offset - the offset

-> Word

size - the size

-> Maybe Buffer

the new sub-buffer

Create a sub-buffer from an existing Buffer with the given offset and size. This sub-buffer uses the actual memory space of the parent buffer. Thus function will copy the offset and timestamp fields when the offset is 0. Otherwise, they will both be set to Nothing. If the offset is 0 and the size is the total size of the parent, the duration and offset end fields are also copied. Otherwise they will be set to Nothing.

bufferIsSpanFastSource

Arguments

:: (BufferClass bufferT1, BufferClass bufferT2) 
=> bufferT1

buffer1 - the first buffer

-> bufferT2

buffer2 - the second buffer

-> Bool

True if the buffers are contiguous, or False if copying would be required

Return True if bufferSpan can be done without copying the data, or False otherwise.

bufferSpanSource

Arguments

:: (BufferClass bufferT1, BufferClass bufferT2) 
=> bufferT1

buffer1 - the first buffer

-> Word32

offset - the offset into the concatenated buffer

-> bufferT2

buffer2 - the second buffer

-> Word32

len - the length of the final buffer

-> Maybe Buffer

the spanning buffer, or Nothing if the arguments are invalid

Create a new Buffer that consists of a span across the given buffers. Logically, the buffers are concatenated to make a larger buffer, and a new buffer is created at the given offset and with the given size.

If the two buffers are children of the same larger buffer, and are contiguous, no copying is necessary. You can use bufferIsSpanFast to determine if copying is needed.

bufferMergeSource

Arguments

:: (BufferClass bufferT1, BufferClass bufferT2) 
=> bufferT1

buffer1 - a buffer

-> bufferT2

buffer2 - a buffer

-> Buffer

the concatenation of the buffers

Concatenate two buffers. If the buffers point to contiguous memory areas, no copying will occur.