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>
29 #include <gst/gststreams.h>
33 #define GST_TYPE_STREAM_COLLECTION (gst_stream_collection_get_type ())
34 #define GST_IS_STREAM_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_STREAM_COLLECTION))
35 #define GST_IS_STREAM_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_STREAM_COLLECTION))
36 #define GST_STREAM_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_STREAM_COLLECTION, GstStreamCollectionClass))
37 #define GST_STREAM_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_STREAM_COLLECTION, GstStreamCollection))
38 #define GST_STREAM_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_STREAM_COLLECTION, GstStreamCollectionClass))
39 #define GST_STREAM_COLLECTION_CAST(obj) ((GstStreamCollection*)(obj))
41 typedef struct _GstStreamCollection GstStreamCollection;
42 typedef struct _GstStreamCollectionClass GstStreamCollectionClass;
43 typedef struct _GstStreamCollectionPrivate GstStreamCollectionPrivate;
46 * GstStreamCollection:
48 * A collection of #GstStream that are available.
50 * A #GstStreamCollection will be provided by elements that can make those
51 * streams available. Applications can use the collection to show the user
52 * what streams are available by using %gst_stream_collection_get_stream()
54 * Once posted, a #GstStreamCollection is immutable. Updates are made by sending
55 * a new #GstStreamCollection message, which may or may not share some of
56 * the #GstStream objects from the collection it replaces. The receiver can check
57 * the sender of a stream collection message to know which collection is
60 * Several elements in a pipeline can provide #GstStreamCollection.
62 * Applications can activate streams from a collection by using the
63 * #GST_EVENT_SELECT_STREAMS event on a pipeline, bin or element.
67 struct _GstStreamCollection {
72 GstStreamCollectionPrivate *priv;
74 gpointer _gst_reserved[GST_PADDING];
78 * GstStreamCollectionClass:
79 * @parent_class: the parent class structure
80 * @stream_notify: default signal handler for the stream-notify signal
82 * GstStreamCollection class structure
84 struct _GstStreamCollectionClass {
85 GstObjectClass parent_class;
88 void (*stream_notify) (GstStreamCollection *collection, GstStream *stream, GParamSpec * pspec);
91 gpointer _gst_reserved[GST_PADDING];
94 GType gst_stream_collection_get_type (void);
96 GstStreamCollection *gst_stream_collection_new (const gchar *upstream_id);
98 const gchar *gst_stream_collection_get_upstream_id (GstStreamCollection *collection);
100 guint gst_stream_collection_get_size (GstStreamCollection *collection);
101 GstStream *gst_stream_collection_get_stream (GstStreamCollection *collection, guint index);
103 gboolean gst_stream_collection_add_stream (GstStreamCollection *collection,
106 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
107 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstStreamCollection, gst_object_unref)
112 #endif /* __GST_STREAM_COLLECTION_H__ */