gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
--- a/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c	Tue Aug 31 15:30:33 2010 +0300
+++ b/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c	Wed Sep 01 12:16:41 2010 +0100
@@ -18,15 +18,7 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-/**
- * SECTION:gstpropertyprobe
- * @short_description: Interface for probing possible property values
- *
- * The property probe is a way to autodetect allowed values for a GObject
- * property. It's primary use is to autodetect device-names in several elements.
- *
- * The interface is implemented by many hardware sources and sinks.
- */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -81,15 +73,6 @@
   static gboolean initialized = FALSE;
 
   if (!initialized) {
-    /**
-     * GstPropertyProbe::probe-needed
-     * @pspec: #GParamSpec that needs a probe
-     *
-     */
-    /* FIXME:
-     * what is the purpose of this signal, I can't find any usage of it
-     * according to proto n *.h, it should be g_cclosure_marshal_VOID__PARAM
-     */
     gst_property_probe_signals[SIGNAL_PROBE_NEEDED] =
         g_signal_new ("probe-needed", G_TYPE_FROM_CLASS (iface),
         G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstPropertyProbeInterface,
@@ -116,13 +99,13 @@
 EXPORT_C
 #endif
 
+
 const GList *
 gst_property_probe_get_properties (GstPropertyProbe * probe)
 {
   GstPropertyProbeInterface *iface;
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
 
   iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
 
@@ -131,58 +114,35 @@
 
   return NULL;
 }
-
-/**
- * gst_property_probe_get_property:
- * @probe: the #GstPropertyProbe to get the properties for.
- * @name: name of the property.
- *
- * Get #GParamSpec for a property for which probing is supported.
- *
- * Returns: the #GParamSpec of %NULL.
- */
 #ifdef __SYMBIAN32__
 EXPORT_C
 #endif
 
+
 const GParamSpec *
 gst_property_probe_get_property (GstPropertyProbe * probe, const gchar * name)
 {
-  const GList *pspecs;
+  const GList *pspecs = gst_property_probe_get_properties (probe);
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
   g_return_val_if_fail (name != NULL, NULL);
 
-  pspecs = gst_property_probe_get_properties (probe);
-
   while (pspecs) {
     const GParamSpec *pspec = pspecs->data;
 
-    if (pspec) {
-      if (!strcmp (pspec->name, name))
-        return pspec;
-    } else {
-      GST_WARNING_OBJECT (probe, "NULL paramspec in property probe list");
-    }
+    if (!strcmp (pspec->name, name))
+      return pspec;
 
     pspecs = pspecs->next;
   }
 
   return NULL;
 }
-
-/**
- * gst_property_probe_probe_property:
- * @probe: the #GstPropertyProbe to check.
- * @pspec: #GParamSpec of the property.
- *
- * Runs a probe on the property specified by %pspec
- */
 #ifdef __SYMBIAN32__
 EXPORT_C
 #endif
 
+
 void
 gst_property_probe_probe_property (GstPropertyProbe * probe,
     const GParamSpec * pspec)
@@ -190,7 +150,6 @@
   GstPropertyProbeInterface *iface;
 
   g_return_if_fail (probe != NULL);
-  g_return_if_fail (GST_IS_PROPERTY_PROBE (probe));
   g_return_if_fail (pspec != NULL);
 
   iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -202,14 +161,15 @@
 /**
  * gst_property_probe_probe_property_name:
  * @probe: the #GstPropertyProbe to check.
- * @name: name of the property.
+ * @name: name of the property to return.
  *
- * Runs a probe on the property specified by %name.
+ * Runs a probe on the given property.
  */
 #ifdef __SYMBIAN32__
 EXPORT_C
 #endif
 
+
 void
 gst_property_probe_probe_property_name (GstPropertyProbe * probe,
     const gchar * name)
@@ -217,7 +177,6 @@
   const GParamSpec *pspec;
 
   g_return_if_fail (probe != NULL);
-  g_return_if_fail (GST_IS_PROPERTY_PROBE (probe));
   g_return_if_fail (name != NULL);
 
   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -246,6 +205,7 @@
 EXPORT_C
 #endif
 
+
 gboolean
 gst_property_probe_needs_probe (GstPropertyProbe * probe,
     const GParamSpec * pspec)
@@ -253,7 +213,6 @@
   GstPropertyProbeInterface *iface;
 
   g_return_val_if_fail (probe != NULL, FALSE);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), FALSE);
   g_return_val_if_fail (pspec != NULL, FALSE);
 
   iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -277,6 +236,7 @@
 EXPORT_C
 #endif
 
+
 gboolean
 gst_property_probe_needs_probe_name (GstPropertyProbe * probe,
     const gchar * name)
@@ -284,7 +244,6 @@
   const GParamSpec *pspec;
 
   g_return_val_if_fail (probe != NULL, FALSE);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), FALSE);
   g_return_val_if_fail (name != NULL, FALSE);
 
   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -310,6 +269,7 @@
 EXPORT_C
 #endif
 
+
 GValueArray *
 gst_property_probe_get_values (GstPropertyProbe * probe,
     const GParamSpec * pspec)
@@ -317,7 +277,6 @@
   GstPropertyProbeInterface *iface;
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
   g_return_val_if_fail (pspec != NULL, NULL);
 
   iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -341,6 +300,7 @@
 EXPORT_C
 #endif
 
+
 GValueArray *
 gst_property_probe_get_values_name (GstPropertyProbe * probe,
     const gchar * name)
@@ -348,7 +308,6 @@
   const GParamSpec *pspec;
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
   g_return_val_if_fail (name != NULL, NULL);
 
   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -375,6 +334,7 @@
 EXPORT_C
 #endif
 
+
 GValueArray *
 gst_property_probe_probe_and_get_values (GstPropertyProbe * probe,
     const GParamSpec * pspec)
@@ -382,7 +342,6 @@
   GstPropertyProbeInterface *iface;
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
   g_return_val_if_fail (pspec != NULL, NULL);
 
   iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -406,6 +365,7 @@
 EXPORT_C
 #endif
 
+
 GValueArray *
 gst_property_probe_probe_and_get_values_name (GstPropertyProbe * probe,
     const gchar * name)
@@ -413,7 +373,6 @@
   const GParamSpec *pspec;
 
   g_return_val_if_fail (probe != NULL, NULL);
-  g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
   g_return_val_if_fail (name != NULL, NULL);
 
   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);