giostreamsink

This plugin writes incoming data to a custom GIO GOutputStream.

It can, for example, be used to write a stream to memory with a GMemoryOutputStream or to write to a file with a GFileOutputStream.

Example code

The following example writes the received data to a GMemoryOutputStream.


#include <gst/gst.h>
#include <gio/gio.h>

...

GstElement *sink;
GMemoryOuputStream *stream;
// out_data will contain the received data
guint8 *out_data;

...

stream = G_MEMORY_OUTPUT_STREAM (g_memory_output_stream_new (NULL, 0,
          (GReallocFunc) g_realloc, (GDestroyNotify) g_free));
sink = gst_element_factory_make ("giostreamsink", "sink");
g_object_set (G_OBJECT (sink), "stream", stream, NULL);

...

// after processing get the written data
out_data = g_memory_ouput_stream_get_data (G_MEMORY_OUTPUT_STREAM (stream));

...

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseSink
                    ╰──GstGioBaseSink
                        ╰──giostreamsink

Factory details

Authors: – Sebastian Dröge

Classification:Sink

Rank – none

Plugin – gio

Package – GStreamer Base Plug-ins

Pad Templates

sink

ANY

Presencealways

Directionsink

Object typeGstPad


Properties

stream

“stream” GOutputStream *

Stream to write to

Flags : Read / Write


The results of the search are