X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgsttypefindfactory.c;h=fb5c098495b04bc036dfb2e54b3ac48b3a909a01;hb=ce43de86902c4e9c8ed4e9682602664cb9bce2ee;hp=be461cbefd95645e67747db249dc9ab8ee91ec56;hpb=c2c977602754ca2c471482839deb421925014025;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gsttypefindfactory.c b/gst/gsttypefindfactory.c index be461cb..fb5c098 100644 --- a/gst/gsttypefindfactory.c +++ b/gst/gsttypefindfactory.c @@ -15,22 +15,24 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /** * SECTION:gsttypefindfactory + * @title: GstTypeFindFactory * @short_description: Information about registered typefind functions * - * These functions allow querying informations about registered typefind + * These functions allow querying information about registered typefind * functions. How to create and register these functions is described in * the section * "Writing typefind functions". * - * - * how to write a simple typefinder - * + * The following example shows how to write a very simple typefinder that + * identifies the given data. You can get quite a bit more complicated than + * that though. + * |[ * typedef struct { * guint8 *data; * guint size; @@ -70,14 +72,7 @@ * g_list_free (type_list); * return find.caps; * }; - * - * - * - * The above example shows how to write a very simple typefinder that - * identifies the given data. You can get quite a bit more complicated than - * that though. - * - * Last reviewed on 2005-11-09 (0.9.4) + * ]| */ #include "gst_private.h" @@ -144,7 +139,7 @@ gst_type_find_factory_dispose (GObject * object) * list using gst_plugin_feature_list_free(). * * The returned factories are sorted by highest rank first, and then by - * factory name. (behaviour change since 0.10.26) + * factory name. * * Free-function: gst_plugin_feature_list_free * @@ -154,7 +149,7 @@ gst_type_find_factory_dispose (GObject * object) GList * gst_type_find_factory_get_list (void) { - return gst_registry_get_feature_list (gst_registry_get_default (), + return gst_registry_get_feature_list (gst_registry_get (), GST_TYPE_TYPE_FIND_FACTORY); } @@ -180,18 +175,18 @@ gst_type_find_factory_get_caps (GstTypeFindFactory * factory) * * Gets the extensions associated with a #GstTypeFindFactory. The returned * array should not be changed. If you need to change stuff in it, you should - * copy it using g_strdupv(). This function may return NULL to indicate + * copy it using g_strdupv(). This function may return %NULL to indicate * a 0-length list. * - * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a - * NULL-terminated array of extensions associated with this factory + * Returns: (transfer none) (array zero-terminated=1) (element-type utf8) (nullable): + * a %NULL-terminated array of extensions associated with this factory */ -gchar ** +const gchar *const * gst_type_find_factory_get_extensions (GstTypeFindFactory * factory) { g_return_val_if_fail (GST_IS_TYPE_FIND_FACTORY (factory), NULL); - return factory->extensions; + return (const gchar * const *) factory->extensions; } /** @@ -222,3 +217,21 @@ gst_type_find_factory_call_function (GstTypeFindFactory * factory, gst_object_unref (new_factory); } } + +/** + * gst_type_find_factory_has_function: + * @factory: A #GstTypeFindFactory + * + * Check whether the factory has a typefind function. Typefind factories + * without typefind functions are a last-effort fallback mechanism to + * e.g. assume a certain media type based on the file extension. + * + * Returns: %TRUE if the factory has a typefind functions set, otherwise %FALSE + */ +gboolean +gst_type_find_factory_has_function (GstTypeFindFactory * factory) +{ + g_return_val_if_fail (GST_IS_TYPE_FIND_FACTORY (factory), FALSE); + + return (factory->function != NULL); +}