return result;
}
+/**
+ * gst_rtsp_client_set_media_factory:
+ * @client: a #GstRTSPClient
+ * @factory: a #GstRTSPMediaFactory
+ *
+ * Set @factory as the media factory for @client which it will use to map urls
+ * to media streams.
+ */
+void
+gst_rtsp_client_set_media_factory (GstRTSPClient *client, GstRTSPMediaFactory *factory)
+{
+ GstRTSPMediaFactory *old;
+
+ old = client->factory;
+
+ if (old != factory) {
+ if (factory)
+ g_object_ref (factory);
+ client->factory = factory;
+ if (old)
+ g_object_unref (old);
+ }
+}
+
+/**
+ * gst_rtsp_client_get_media_factory:
+ * @client: a #GstRTSPClient
+ *
+ * Get the #GstRTSPMediaFactory object that @client uses to manage its sessions.
+ *
+ * Returns: a #GstRTSPMediaFactory, unref after usage.
+ */
+GstRTSPMediaFactory *
+gst_rtsp_client_get_media_factory (GstRTSPClient *client)
+{
+ GstRTSPMediaFactory *result;
+
+ if ((result = client->factory))
+ g_object_ref (result);
+
+ return result;
+}
+
/**
* gst_rtsp_client_attach:
#define __GST_RTSP_CLIENT_H__
#include "rtsp-media.h"
+#include "rtsp-media-factory.h"
#include "rtsp-session-pool.h"
G_BEGIN_DECLS
GstRTSPConnection *connection;
struct sockaddr_in address;
-
- GstRTSPMedia *media;
+ GThread *thread;
GstRTSPSessionPool *pool;
- GThread *thread;
+ GstRTSPMedia *media;
+ GstRTSPMediaFactory *factory;
+
};
struct _GstRTSPClientClass {
GObjectClass parent_class;
};
-GType gst_rtsp_client_get_type (void);
+GType gst_rtsp_client_get_type (void);
+
+GstRTSPClient * gst_rtsp_client_new (void);
-GstRTSPClient * gst_rtsp_client_new (void);
+void gst_rtsp_client_set_session_pool (GstRTSPClient *client,
+ GstRTSPSessionPool *pool);
+GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client);
-void gst_rtsp_client_set_session_pool (GstRTSPClient *client,
- GstRTSPSessionPool *pool);
-GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client);
+void gst_rtsp_client_set_media_factory (GstRTSPClient *client,
+ GstRTSPMediaFactory *factory);
+GstRTSPMediaFactory * gst_rtsp_client_get_media_factory (GstRTSPClient *client);
-gboolean gst_rtsp_client_accept (GstRTSPClient *client,
- GIOChannel *channel);
+gboolean gst_rtsp_client_accept (GstRTSPClient *client,
+ GIOChannel *channel);
G_END_DECLS