giostreamsink

## giostreamsink giostreamsink — Write to any GIO stream |

## Synopsis

    struct              GstGioStreamSink;

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GstObject
                   +----GstElement
                         +----GstBaseSink
                               +----GstGioBaseSink
                                     +----GstGioStreamSink

## Properties

      "stream"                   GOutputStream*        : Read / Write

## Description

This plugin writes incoming data to a custom GIO GOutputStream.

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

### Example code

The following example writes the received data to a GMemoryOutputStream.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    #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));

    ...

## Synopsis

### Element Information

plugin | gio
author | Sebastian Dröge <sebastian.droege@collabora.co.uk>
class | Sink

### Element Pads

name | sink
direction | sink
presence | always
details | ANY

## Details

### struct GstGioStreamSink

    struct GstGioStreamSink;

Opaque data structure.

## Property Details

### The `"stream"` property

      "stream"                   GOutputStream*        : Read / Write

Stream to write to.