• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  *
4  *  Copyright 2013 Collabora Ltd
5  *   @author: Olivier Crete <olivier.crete@collabora.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 
25 
26 #ifndef __GST_INSERT_BIN_H__
27 #define __GST_INSERT_BIN_H__
28 
29 #ifndef GST_USE_UNSTABLE_API
30 #warning "The GStreamer insertbin library is unstable API and may change in future."
31 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
32 #endif
33 
34 #include <gst/gst.h>
35 
36 #ifndef GST_INSERT_BIN_API
37 # ifdef BUILDING_GST_INSERT_BIN
38 #  define GST_INSERT_BIN_API GST_API_EXPORT         /* from config.h */
39 # else
40 #  define GST_INSERT_BIN_API GST_API_IMPORT
41 # endif
42 #endif
43 
44 G_BEGIN_DECLS
45 #define GST_TYPE_INSERT_BIN            (gst_insert_bin_get_type())
46 #define GST_INSERT_BIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_INSERT_BIN,GstInsertBin))
47 #define GST_IS_INSERT_BIN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_INSERT_BIN))
48 #define GST_INSERT_BIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_INSERT_BIN,GstInsertBinClass))
49 #define GST_IS_INSERT_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_INSERT_BIN))
50 #define GST_INSERT_BIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_INSERT_BIN,GstInsertBinClass))
51 typedef struct _GstInsertBin GstInsertBin;
52 typedef struct _GstInsertBinClass GstInsertBinClass;
53 typedef struct _GstInsertBinPrivate GstInsertBinPrivate;
54 
55 /**
56  * GstInsertBinCallback:
57  * @insertbin: A #GstInsertBin
58  * @element: The #GstElement on which the operation was performed
59  * @success: %TRUE if the operation was successful
60  * @user_data: The user data passed
61  *
62  * This is the prototype of callbacks to be called when the operation completes.
63  * It could be called at any time, including as a re-entrant call while the
64  * operation is requested.
65  */
66 
67 typedef void (*GstInsertBinCallback) (GstInsertBin *insertbin,
68     GstElement *element,
69     gboolean success,
70     gpointer user_data);
71 
72 /**
73  * GstInsertBin:
74  *
75  * The object structure.
76  */
77 struct _GstInsertBin
78 {
79   GstBin parent;
80 
81   /*< private >*/
82   GstInsertBinPrivate *priv;
83 };
84 
85 /**
86  * GstInsertBinClass:
87  *
88  * The object class structure.
89  */
90 struct _GstInsertBinClass
91 {
92   GstBinClass parent_class;
93 };
94 
95 GST_INSERT_BIN_API
96 GType gst_insert_bin_get_type (void);
97 
98 GST_INSERT_BIN_API
99 GstElement *gst_insert_bin_new (const gchar * name);
100 
101 GST_INSERT_BIN_API
102 void gst_insert_bin_prepend (GstInsertBin * self, GstElement * element,
103     GstInsertBinCallback callback, gpointer user_data);
104 
105 GST_INSERT_BIN_API
106 void gst_insert_bin_append (GstInsertBin * self, GstElement * element,
107     GstInsertBinCallback callback, gpointer user_data);
108 
109 GST_INSERT_BIN_API
110 void gst_insert_bin_insert_before (GstInsertBin * self,
111     GstElement * element, GstElement * sibling,
112     GstInsertBinCallback callback, gpointer user_data);
113 
114 GST_INSERT_BIN_API
115 void gst_insert_bin_insert_after (GstInsertBin * self,
116     GstElement * element, GstElement * sibling,
117     GstInsertBinCallback callback, gpointer user_data);
118 
119 GST_INSERT_BIN_API
120 void gst_insert_bin_remove (GstInsertBin * self, GstElement * element,
121     GstInsertBinCallback callback, gpointer user_data);
122 
123 
124 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstInsertBin, gst_object_unref)
125 
126 G_END_DECLS
127 #endif /* __GST_INSERT_BIN_H__ */
128