## giostreamsrc

giostreamsrc

## Properties

GInputStream * | stream | Read / Write

## Types and Values

struct | GstGioStreamSrc

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSrc
                        ╰── GstGioBaseSrc
                            ╰── GstGioStreamSrc

## Description

This plugin reads data from a custom GIO GInputStream.

It can, for example, be used to read data from memory with a GMemoryInputStream or to read from a file with a GFileInputStream.

#### Example code

The following example reads data from a GMemoryInputStream.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

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

    ...

    GstElement *src;
    GMemoryInputStream *stream;
    // in_data will contain the data to send
    guint8 *in_data;
    gint i;

    ...
    in_data = g_new (guint8, 512);
    for (i = 0; i < 512; i++)
      in_data[i] = i % 256;

    stream = G_MEMORY_INPUT_STREAM (g_memory_input_stream_new_from_data (in_data, 512,
              (GDestroyNotify) g_free));
    src = gst_element_factory_make ("giostreamsrc", "src");
    g_object_set (G_OBJECT (src), "stream", stream, NULL);

    ...

## Synopsis

### Element Information

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

### Element Pads

name | src
direction | source
presence | always
details | ANY

## Functions

## Types and Values

### struct GstGioStreamSrc

    struct GstGioStreamSrc;

Opaque data structure.

## Property Details

### The `“stream”` property

      “stream”                   GInputStream *

Stream to read from.

Flags: Read / Write