From: Thomas V. S. <tho...@us...> - 2002-06-13 15:09:07
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: thomasvs Date: Thu Jun 13 2002 08:09:04 PDT Log message: strange this didn't get commited on a regular commit Modified files: gst : gstelement.h gstelementfactory.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.h.diff?r1=1.99&r2=1.100 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelementfactory.c.diff?r1=1.66&r2=1.67 ====Begin Diffs==== Index: gstelement.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.h,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- gstelement.h 9 Jun 2002 21:14:48 -0000 1.99 +++ gstelement.h 13 Jun 2002 15:08:52 -0000 1.100 @@ -346,8 +346,8 @@ GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name); -/* FIXME this name is wrong, probably so is the one above it */ GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name); +GstElement* gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name); void gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank); Index: gstelementfactory.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelementfactory.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- gstelementfactory.c 31 May 2002 08:17:15 -0000 1.66 +++ gstelementfactory.c 13 Jun 2002 15:08:51 -0000 1.67 @@ -260,6 +260,28 @@ } /** + * gst_element_factory_make_or_warn: + * @factoryname: a named factory to instantiate + * @name: name of new element + * + * Create a new element of the type defined by the given element factory + * using #gst_element_factory_make. + * Will use g_warning if the element could not be created. + * + * Returns: new #GstElement (or NULL if unable to create element) + */ +GstElement* +gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name) +{ + GstElement *element = gst_element_factory_make (factoryname, name); + + if (element == NULL) + g_warning ("Could not create element from factory %s !\n", factoryname); + + return element; +} + +/** * gst_element_factory_add_pad_template : * @elementfactory: factory to add the src id to * @templ: the padtemplate to add |