GstStream

GstStream — Base class for stream objects

Synopsis

#include <gst/gst.h>

struct              GstStream;
struct              GstStreamClass;
enum                GstStreamType;
GstStream *         gst_stream_new                      (const gchar *stream_id,
                                                         GstCaps *caps,
                                                         GstStreamType type,
                                                         GstStreamFlags flags);
GstCaps *           gst_stream_get_caps                 (GstStream *stream);
GstStreamFlags      gst_stream_get_stream_flags         (GstStream *stream);
const gchar *       gst_stream_get_stream_id            (GstStream *stream);
GstStreamType       gst_stream_get_stream_type          (GstStream *stream);
GstTagList *        gst_stream_get_tags                 (GstStream *stream);
void                gst_stream_set_caps                 (GstStream *stream,
                                                         GstCaps *caps);
void                gst_stream_set_stream_flags         (GstStream *stream,
                                                         GstStreamFlags flags);
void                gst_stream_set_stream_type          (GstStream *stream,
                                                         GstStreamType stream_type);
void                gst_stream_set_tags                 (GstStream *stream,
                                                         GstTagList *tags);
const gchar *       gst_stream_type_get_name            (GstStreamType stype);

Description

A GstStream is a high-level object defining a stream of data which is, or can be, present in a GstPipeline.

It is defined by a unique identifier, a "Stream ID". A GstStream does not automatically imply the stream is present within a pipeline or element.

Any element that can introduce new streams in a pipeline should create the appropriate GstStream object, and can convey that object via the GST_EVENT_STREAM_START event and/or the GstStreamCollection.

Elements that do not modify the nature of the stream can add extra information on it (such as enrich the GstCaps, or GstTagList). This is typically done by parsing elements.

Details

struct GstStream

struct GstStream {
  GstObject object;

  const gchar *stream_id;
};

A high-level object representing a single stream. It might be backed, or not, by an actual flow of data in a pipeline (GstPad).

A GstStream does not care about data changes (such as decoding, encoding, parsing,...) as long as the underlying data flow corresponds to the same high-level flow (ex: a certain audio track).

A GstStream contains all the information pertinent to a stream, such as stream-id, tags, caps, type, ...

Elements can subclass a GstStream for internal usage (to contain information pertinent to streams of data).

GstObject object;

const gchar *stream_id;

The Stream Identifier for this GstStream

struct GstStreamClass

struct GstStreamClass {
  GstObjectClass parent_class;
};

GstStream class structure

GstObjectClass parent_class;

the parent class structure

enum GstStreamType

typedef enum {
  GST_STREAM_TYPE_UNKNOWN   = 1 << 0,
  GST_STREAM_TYPE_AUDIO     = 1 << 1,
  GST_STREAM_TYPE_VIDEO     = 1 << 2,
  GST_STREAM_TYPE_CONTAINER = 1 << 3,
  GST_STREAM_TYPE_TEXT      = 1 << 4
} GstStreamType;

GstStreamType describes a high level classification set for flows of data in GstStream objects.

Note that this is a flag, and therefore users should not assume it will be a single value. Do not use the equality operator for checking whether a stream is of a certain type.

GST_STREAM_TYPE_UNKNOWN

The stream is of unknown (unclassified) type.

GST_STREAM_TYPE_AUDIO

The stream is of audio data

GST_STREAM_TYPE_VIDEO

The stream carries video data

GST_STREAM_TYPE_CONTAINER

The stream is a muxed container type

GST_STREAM_TYPE_TEXT

The stream contains subtitle / subpicture data.

gst_stream_new ()

GstStream *         gst_stream_new                      (const gchar *stream_id,
                                                         GstCaps *caps,
                                                         GstStreamType type,
                                                         GstStreamFlags flags);

Create a new GstStream for the given stream_id, caps, type and flags

stream_id :

the id for the new stream. If NULL, a new one will be automatically generated. [allow-none]

caps :

the GstCaps of the stream. [allow-none][transfer none]

type :

the GstStreamType of the stream

flags :

the GstStreamFlags of the stream

Returns :

The new GstStream

Since 1.10


gst_stream_get_caps ()

GstCaps *           gst_stream_get_caps                 (GstStream *stream);

Retrieve the caps for stream, if any

stream :

a GstStream

Returns :

The GstCaps for stream. [transfer full][nullable]

Since 1.10


gst_stream_get_stream_flags ()

GstStreamFlags      gst_stream_get_stream_flags         (GstStream *stream);

Retrieve the current stream flags for stream

stream :

a GstStream

Returns :

The GstStreamFlags for stream

Since 1.10


gst_stream_get_stream_id ()

const gchar *       gst_stream_get_stream_id            (GstStream *stream);

Returns the stream ID of stream.

stream :

a GstStream

Returns :

the stream ID of stream. Only valid during the lifetime of stream. [transfer none][nullable]

Since 1.10


gst_stream_get_stream_type ()

GstStreamType       gst_stream_get_stream_type          (GstStream *stream);

Retrieve the stream type for stream

stream :

a GstStream

Returns :

The GstStreamType for stream

Since 1.10


gst_stream_get_tags ()

GstTagList *        gst_stream_get_tags                 (GstStream *stream);

Retrieve the tags for stream, if any

stream :

a GstStream

Returns :

The GstTagList for stream. [transfer full][nullable]

Since 1.10


gst_stream_set_caps ()

void                gst_stream_set_caps                 (GstStream *stream,
                                                         GstCaps *caps);

Set the caps for the GstStream

stream :

a GstStream

caps :

a GstCaps. [transfer none][allow-none]

Since 1.10


gst_stream_set_stream_flags ()

void                gst_stream_set_stream_flags         (GstStream *stream,
                                                         GstStreamFlags flags);

Set the flags for the stream.

stream :

a GstStream

flags :

the flags to set on stream

Since 1.10


gst_stream_set_stream_type ()

void                gst_stream_set_stream_type          (GstStream *stream,
                                                         GstStreamType stream_type);

Set the stream type of stream

stream :

a GstStream

stream_type :

the type to set on stream

Since 1.10


gst_stream_set_tags ()

void                gst_stream_set_tags                 (GstStream *stream,
                                                         GstTagList *tags);

Set the tags for the GstStream

stream :

a GstStream

tags :

a GstTagList. [transfer none][allow-none]

Since 1.10


gst_stream_type_get_name ()

const gchar *       gst_stream_type_get_name            (GstStreamType stype);

Get a descriptive string for a given GstStreamType

stype :

a GstStreamType

Returns :

A string describing the stream type

Since 1.10