+2007-07-27 Wim Taymans <wim.taymans@gmail.com>
+
+ * gst/rtsp/gstrtspext.c: (gst_rtsp_ext_list_free),
+ (gst_rtsp_ext_list_connect):
+ * gst/rtsp/gstrtspext.h:
+ * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init),
+ (gst_rtspsrc_finalize), (gst_rtspsrc_send_cb):
+ Clean up the interface list.
+ Allow connecting to interface signals for the extensions.
+ Remove old extension code.
+ Free list on cleanup.
+ Allow extensions to send additional RTSP messages.
+
2007-07-27 Jan Schmidt <thaytan@mad.scientist.com>
* ext/gconf/gconf.c: (gst_gconf_render_bin_with_default):
return result;
}
+void
+gst_rtsp_ext_list_free (GstRTSPExtensionList * ext)
+{
+ GList *walk;
+
+ for (walk = ext->extensions; walk; walk = g_list_next (walk)) {
+ GstRTSPExtension *elem = (GstRTSPExtension *) walk->data;
+
+ gst_object_unref (GST_OBJECT_CAST (elem));
+ }
+ g_list_free (ext->extensions);
+ g_free (ext);
+}
+
gboolean
gst_rtsp_ext_list_detect_server (GstRTSPExtensionList * ext,
GstRTSPMessage * resp)
}
return res;
}
+
+void
+gst_rtsp_ext_list_connect (GstRTSPExtensionList * ext,
+ const gchar * detailed_signal, GCallback c_handler, gpointer data)
+{
+ GList *walk;
+
+ for (walk = ext->extensions; walk; walk = g_list_next (walk)) {
+ GstRTSPExtension *elem = (GstRTSPExtension *) walk->data;
+
+ g_signal_connect (elem, detailed_signal, c_handler, data);
+ }
+}
void gst_rtsp_ext_list_init (void);
GstRTSPExtensionList * gst_rtsp_ext_list_get (void);
+void gst_rtsp_ext_list_free (GstRTSPExtensionList *ext);
gboolean gst_rtsp_ext_list_detect_server (GstRTSPExtensionList *ext, GstRTSPMessage *resp);
gchar **transport);
GstRTSPResult gst_rtsp_ext_list_stream_select (GstRTSPExtensionList *ext, GstRTSPUrl *url);
+void gst_rtsp_ext_list_connect (GstRTSPExtensionList *ext,
+ const gchar *detailed_signal, GCallback c_handler,
+ gpointer data);
+
G_END_DECLS
#endif /* __GST_RTSP_EXT_H__ */
#include "gstrtspsrc.h"
-/* define for experimental real support */
-#undef WITH_EXT_REAL
-
-#if 0
-#include "rtspextwms.h"
-#ifdef WITH_EXT_REAL
-#include "rtspextreal.h"
-#endif
-#endif
-
GST_DEBUG_CATEGORY_STATIC (rtspsrc_debug);
#define GST_CAT_DEFAULT (rtspsrc_debug)
GstStateChange transition);
static void gst_rtspsrc_handle_message (GstBin * bin, GstMessage * message);
+static GstRTSPResult gst_rtspsrc_send_cb (GstRTSPExtension * ext,
+ GstRTSPMessage * request, GstRTSPMessage * response, GstRTSPSrc * src);
+
static gboolean gst_rtspsrc_open (GstRTSPSrc * src);
static gboolean gst_rtspsrc_play (GstRTSPSrc * src);
static gboolean gst_rtspsrc_pause (GstRTSPSrc * src);
/* get a list of all extensions */
src->extensions = gst_rtsp_ext_list_get ();
-#if 0
-#ifdef WITH_EXT_REAL
- src->extension = rtsp_ext_real_get_context ();
-#else
- /* install WMS extension by default */
- src->extension = rtsp_ext_wms_get_context ();
-#endif
- src->extension->src = (gpointer) src;
-#endif
+ /* connect to send signal */
+ gst_rtsp_ext_list_connect (src->extensions, "send",
+ (GCallback) gst_rtspsrc_send_cb, src);
src->state_rec_lock = g_new (GStaticRecMutex, 1);
g_static_rec_mutex_init (src->state_rec_lock);
rtspsrc = GST_RTSPSRC (object);
+ gst_rtsp_ext_list_free (rtspsrc->extensions);
g_static_rec_mutex_free (rtspsrc->stream_rec_lock);
g_free (rtspsrc->stream_rec_lock);
g_free (rtspsrc->location);
g_static_rec_mutex_free (rtspsrc->state_rec_lock);
g_free (rtspsrc->state_rec_lock);
-#if 0
- if (rtspsrc->extension) {
-#ifdef WITH_EXT_REAL
- rtsp_ext_real_free_context (rtspsrc->extension);
-#else
- rtsp_ext_wms_free_context (rtspsrc->extension);
-#endif
- }
-#endif
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
}
}
+static GstRTSPResult
+gst_rtspsrc_send_cb (GstRTSPExtension * ext, GstRTSPMessage * request,
+ GstRTSPMessage * response, GstRTSPSrc * src)
+{
+ return gst_rtspsrc_send (src, request, response, NULL);
+}
+
+
/* parse the response and collect all the supported methods. We need this
* information so that we don't try to send an unsupported request to the
* server.