2 * Copyright (C) 2015 Centricular Ltd
3 * @author: Edward Hervey <edward@centricular.com>
4 * @author: Jan Schmidt <jan@centricular.com>
6 * gststreams.h : Header for GstStreamCollection subsystem
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
25 #ifndef __GST_STREAM_COLLECTION_H__
26 #define __GST_STREAM_COLLECTION_H__
28 #include <gst/gstobject.h>
32 #define GST_TYPE_STREAM_COLLECTION (gst_stream_collection_get_type ())
33 #define GST_IS_STREAM_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_STREAM_COLLECTION))
34 #define GST_IS_STREAM_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_STREAM_COLLECTION))
35 #define GST_STREAM_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_STREAM_COLLECTION, GstStreamCollectionClass))
36 #define GST_STREAM_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_STREAM_COLLECTION, GstStreamCollection))
37 #define GST_STREAM_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_STREAM_COLLECTION, GstStreamCollectionClass))
38 #define GST_STREAM_COLLECTION_CAST(obj) ((GstStreamCollection*)(obj))
40 typedef struct _GstStreamCollection GstStreamCollection;
41 typedef struct _GstStreamCollectionClass GstStreamCollectionClass;
42 typedef struct _GstStreamCollectionPrivate GstStreamCollectionPrivate;
44 #include <gst/gststreamcollection.h>
45 #include <gst/gststreams.h>
48 * GstStreamCollection:
50 * A collection of #GstStream that are available.
52 * A #GstStreamCollection will be provided by elements that can make those
53 * streams available. Applications can use the collection to show the user
54 * what streams are available by using %gst_stream_collection_get_stream()
56 * Once posted, a #GstStreamCollection is immutable. Updates are made by sending
57 * a new #GstStreamCollection message, which may or may not share some of
58 * the #GstStream objects from the collection it replaces. The receiver can check
59 * the sender of a stream collection message to know which collection is
62 * Several elements in a pipeline can provide #GstStreamCollection.
64 * Applications can activate streams from a collection by using the
65 * #GST_EVENT_SELECT_STREAMS event on a pipeline, bin or element.
69 struct _GstStreamCollection {
74 GstStreamCollectionPrivate *priv;
76 gpointer _gst_reserved[GST_PADDING];
80 * GstStreamCollectionClass:
81 * @parent_class: the parent class structure
82 * @stream_notify: default signal handler for the stream-notify signal
84 * GstStreamCollection class structure
86 struct _GstStreamCollectionClass {
87 GstObjectClass parent_class;
90 void (*stream_notify) (GstStreamCollection *collection, GstStream *stream, GParamSpec * pspec);
93 gpointer _gst_reserved[GST_PADDING];
97 GType gst_stream_collection_get_type (void);
100 GstStreamCollection *gst_stream_collection_new (const gchar *upstream_id);
103 const gchar *gst_stream_collection_get_upstream_id (GstStreamCollection *collection);
106 guint gst_stream_collection_get_size (GstStreamCollection *collection);
109 GstStream *gst_stream_collection_get_stream (GstStreamCollection *collection, guint index);
112 gboolean gst_stream_collection_add_stream (GstStreamCollection *collection,
115 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
116 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstStreamCollection, gst_object_unref)
121 #endif /* __GST_STREAM_COLLECTION_H__ */