41 static void gst_index_factory_finalize (GObject * object); |
41 static void gst_index_factory_finalize (GObject * object); |
42 |
42 |
43 static GstPluginFeatureClass *factory_parent_class = NULL; |
43 static GstPluginFeatureClass *factory_parent_class = NULL; |
44 |
44 |
45 /* static guint gst_index_factory_signals[LAST_SIGNAL] = { 0 }; */ |
45 /* static guint gst_index_factory_signals[LAST_SIGNAL] = { 0 }; */ |
46 #ifdef __SYMBIAN32__ |
46 G_DEFINE_TYPE (GstIndexFactory, gst_index_factory, GST_TYPE_PLUGIN_FEATURE); |
47 EXPORT_C |
|
48 #endif |
|
49 |
|
50 |
|
51 GType |
|
52 gst_index_factory_get_type (void) |
|
53 { |
|
54 static GType indexfactory_type = 0; |
|
55 |
|
56 if (G_UNLIKELY (indexfactory_type == 0)) { |
|
57 static const GTypeInfo indexfactory_info = { |
|
58 sizeof (GstIndexFactoryClass), |
|
59 NULL, |
|
60 NULL, |
|
61 (GClassInitFunc) gst_index_factory_class_init, |
|
62 NULL, |
|
63 NULL, |
|
64 sizeof (GstIndexFactory), |
|
65 0, |
|
66 NULL, |
|
67 NULL |
|
68 }; |
|
69 |
|
70 indexfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE, |
|
71 "GstIndexFactory", &indexfactory_info, 0); |
|
72 } |
|
73 return indexfactory_type; |
|
74 } |
|
75 |
47 |
76 static void |
48 static void |
77 gst_index_factory_class_init (GstIndexFactoryClass * klass) |
49 gst_index_factory_class_init (GstIndexFactoryClass * klass) |
78 { |
50 { |
79 GObjectClass *gobject_class; |
51 GObjectClass *gobject_class = (GObjectClass *) klass; |
80 GstObjectClass *gstobject_class; |
|
81 GstPluginFeatureClass *gstpluginfeature_class; |
|
82 |
|
83 gobject_class = (GObjectClass *) klass; |
|
84 gstobject_class = (GstObjectClass *) klass; |
|
85 gstpluginfeature_class = (GstPluginFeatureClass *) klass; |
|
86 |
52 |
87 factory_parent_class = g_type_class_peek_parent (klass); |
53 factory_parent_class = g_type_class_peek_parent (klass); |
88 |
54 |
89 gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_index_factory_finalize); |
55 gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_index_factory_finalize); |
|
56 } |
|
57 |
|
58 static void |
|
59 gst_index_factory_init (GstIndexFactory * factory) |
|
60 { |
90 } |
61 } |
91 |
62 |
92 static void |
63 static void |
93 gst_index_factory_finalize (GObject * object) |
64 gst_index_factory_finalize (GObject * object) |
94 { |
65 { |
227 |
198 |
228 GstIndex * |
199 GstIndex * |
229 gst_index_factory_make (const gchar * name) |
200 gst_index_factory_make (const gchar * name) |
230 { |
201 { |
231 GstIndexFactory *factory; |
202 GstIndexFactory *factory; |
|
203 GstIndex *index; |
232 |
204 |
233 g_return_val_if_fail (name != NULL, NULL); |
205 g_return_val_if_fail (name != NULL, NULL); |
234 |
206 |
235 factory = gst_index_factory_find (name); |
207 factory = gst_index_factory_find (name); |
236 |
208 |
237 if (factory == NULL) |
209 if (factory == NULL) |
|
210 goto no_factory; |
|
211 |
|
212 index = gst_index_factory_create (factory); |
|
213 |
|
214 if (index == NULL) |
|
215 goto create_failed; |
|
216 |
|
217 gst_object_unref (factory); |
|
218 return index; |
|
219 |
|
220 /* ERRORS */ |
|
221 no_factory: |
|
222 { |
|
223 GST_INFO ("no such index factory \"%s\"!", name); |
238 return NULL; |
224 return NULL; |
239 |
225 } |
240 return gst_index_factory_create (factory); |
226 create_failed: |
241 } |
227 { |
|
228 GST_INFO_OBJECT (factory, "couldn't create instance!"); |
|
229 gst_object_unref (factory); |
|
230 return NULL; |
|
231 } |
|
232 } |