? typefind_gsm.patch
Index: gsttypefindfunctions.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/typefind/gsttypefindfunctions.c,v
retrieving revision 1.178
diff -u -B -b -p -r1.178 gsttypefindfunctions.c
--- gsttypefindfunctions.c	11 Dec 2008 12:32:03 -0000	1.178
+++ gsttypefindfunctions.c	9 Jan 2009 17:58:02 -0000
@@ -1116,6 +1116,14 @@ ac3_type_find (GstTypeFind * tf, gpointe
   }
 }
 
+/*** gsm ***/
+
+/* can only be detected by using the extension, in which case we use the default
+ * GSM properties */
+static GstStaticCaps gsm_caps = GST_STATIC_CAPS ("audio/x-gsm, rate=8000, channels=1");
+
+#define GSM_CAPS (gst_static_caps_get(&gsm_caps))
+
 /*** wavpack ***/
 
 static GstStaticCaps wavpack_caps =
@@ -2995,7 +3003,7 @@ G_BEGIN_DECLS{                          
   sw_data->probability = _probability;                                  \
   sw_data->caps = gst_caps_new_simple (name, NULL);                     \
   if (!gst_type_find_register (plugin, name, rank, start_with_type_find,\
-                      ext, sw_data->caps, sw_data,                      \
+                      (gchar **)ext, sw_data->caps, sw_data,            \
                      (GDestroyNotify) (sw_data_destroy))) {             \
     gst_caps_unref (sw_data->caps);                                     \
     g_free (sw_data);                                                   \
@@ -3025,7 +3033,7 @@ G_BEGIN_DECLS{                          
   sw_data->probability = GST_TYPE_FIND_MAXIMUM;                         \
   sw_data->caps = gst_caps_new_simple (name, NULL);                     \
   if (!gst_type_find_register (plugin, name, rank, riff_type_find,      \
-                      ext, sw_data->caps, sw_data,                      \
+                      (gchar **)ext, sw_data->caps, sw_data,            \
                       (GDestroyNotify) (sw_data_destroy))) {            \
     gst_caps_unref (sw_data->caps);                                     \
     g_free (sw_data);                                                   \
@@ -3037,7 +3045,7 @@ G_BEGIN_DECLS{                          
 
 #define TYPE_FIND_REGISTER(plugin,name,rank,func,ext,caps,priv,notify) \
 G_BEGIN_DECLS{\
-  if (!gst_type_find_register (plugin, name, rank, func, ext, caps, priv, notify))\
+  if (!gst_type_find_register (plugin, name, rank, func, (gchar **)ext, caps, priv, notify))\
     return FALSE; \
 }G_END_DECLS
 
@@ -3052,7 +3060,7 @@ plugin_init (GstPlugin * plugin)
      this requires gstreamer/gst/gsttypefind::gst_type_find_register()
      to have define the parameter as const
    */
-  static gchar *asf_exts[] = { "asf", "wm", "wma", "wmv", NULL };
+  static const gchar *asf_exts[] = { "asf", "wm", "wma", "wmv", NULL };
   static gchar *au_exts[] = { "au", "snd", NULL };
   static gchar *avi_exts[] = { "avi", NULL };
   static gchar *qcp_exts[] = { "qcp", NULL };
@@ -3069,6 +3077,7 @@ plugin_init (GstPlugin * plugin)
   };
   static gchar *mp3_exts[] = { "mp3", "mp2", "mp1", "mpga", NULL };
   static gchar *ac3_exts[] = { "ac3", NULL };
+  static gchar *gsm_exts[] = { "gsm", NULL };
   static gchar *musepack_exts[] = { "mpc", "mpp", "mp+", NULL };
   static gchar *mpeg_sys_exts[] = { "mpe", "mpeg", "mpg", NULL };
   static gchar *mpeg_video_exts[] = { "mpv", "mpeg", "mpg", NULL };
@@ -3187,6 +3196,8 @@ plugin_init (GstPlugin * plugin)
       mp3_exts, MP3_CAPS, NULL, NULL);
   TYPE_FIND_REGISTER (plugin, "audio/x-ac3", GST_RANK_PRIMARY, ac3_type_find,
       ac3_exts, AC3_CAPS, NULL, NULL);
+  TYPE_FIND_REGISTER (plugin, "audio/x-gsm", GST_RANK_PRIMARY, NULL,
+      gsm_exts, GSM_CAPS, NULL, NULL);
   TYPE_FIND_REGISTER (plugin, "video/mpeg-sys", GST_RANK_PRIMARY,
       mpeg_sys_type_find, mpeg_sys_exts, MPEG_SYS_CAPS, NULL, NULL);
   TYPE_FIND_REGISTER (plugin, "video/mpegts", GST_RANK_PRIMARY,
