| GStreamer 0.8 Library Reference Manual |
|---|
gstadaptergstadapter — |
#include <gst/bytestream/adapter.h>
GstAdapter;
GstAdapter* gst_adapter_new (void);
void gst_adapter_clear (GstAdapter *adapter);
void gst_adapter_push (GstAdapter *adapter,
GstBuffer *buf);
const guint8* gst_adapter_peek (GstAdapter *adapter,
guint size);
void gst_adapter_flush (GstAdapter *adapter,
guint flush);
guint gst_adapter_available (GstAdapter *adapter);
guint gst_adapter_available_fast (GstAdapter *adapter);
GstAdapter* gst_adapter_new (void);
Creates a new GstAdapter.
| Returns : | a new GstAdapter |
void gst_adapter_clear (GstAdapter *adapter);
Removes all buffers from the adapter.
adapter : | the GstAdapter to clear |
void gst_adapter_push (GstAdapter *adapter, GstBuffer *buf);
Adds the data from buf to the data stored inside adapter and takes
ownership of the buffer.
adapter : | a GstAdapter |
buf : | the GstBuffer to queue into the adapter |
const guint8* gst_adapter_peek (GstAdapter *adapter, guint size);
Gets the first size bytes stored in the adapter. If this many bytes are
not available, it returns NULL. The returned pointer is valid until the next
function is called on the adapter.
adapter : | a GstAdapter |
size : | number of bytes to peek |
| Returns : | a pointer to the first size bytes of data or NULL
|
void gst_adapter_flush (GstAdapter *adapter, guint flush);
Flushes the first flush bytes of the adapter.
adapter : | a GstAdapter |
flush : | number of bytes to flush |
guint gst_adapter_available (GstAdapter *adapter);
Gets the maximum amount of bytes available, that is it returns the maximum
value that can be supplied to gst_adapter_peek() without that function
returning NULL.
adapter : | a GstAdapter |
| Returns : | amount of bytes available in adapter
|
guint gst_adapter_available_fast (GstAdapter *adapter);
Gets the maximum amount of bytes available without the need to do expensive operations (like copying the data into a temporary buffer).
adapter : | a GstAdapter |
| Returns : | amount of bytes available in adapter without expensive operations
|
| << Part I. GStreamer Libraries | gstbytestream >> |