/**
* SECTION:gstelementfactory
+ * @title: GstElementFactory
* @short_description: Create GstElements from a factory
* @see_also: #GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
*
*
* The following code example shows you how to create a GstFileSrc element.
*
- * <example>
- * <title>Using an element factory</title>
- * <programlisting language="c">
+ * ## Using an element factory
+ * |[<!-- language="C" -->
* #include <gst/gst.h>
*
* GstElement *src;
* src = gst_element_factory_create (srcfactory, "src");
* g_return_if_fail (src != NULL);
* ...
- * </programlisting>
- * </example>
+ * ]|
*/
#include "gst_private.h"
if (!g_atomic_pointer_compare_and_exchange (&oclass->elementfactory, NULL,
factory))
gst_object_unref (factory);
+ else
+ /* This ref will never be dropped as the class is never destroyed */
+ GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED);
GST_DEBUG ("created element \"%s\"", GST_OBJECT_NAME (factory));
goto create_failed;
gst_object_unref (factory);
+
return element;
/* ERRORS */
if (!res && (type & GST_ELEMENT_FACTORY_TYPE_DECRYPTOR))
res = (strstr (klass, "Decryptor") != NULL);
+ if (!res && (type & GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR))
+ res = (strstr (klass, "Encryptor") != NULL);
+
/* Filter by media type now, we only test if it
* matched any of the types above or only checking the media
* type was requested. */