client: expose connection
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-client.h
index f421116..5e0f3f3 100644 (file)
@@ -28,8 +28,8 @@ G_BEGIN_DECLS
 typedef struct _GstRTSPClient GstRTSPClient;
 typedef struct _GstRTSPClientClass GstRTSPClientClass;
 typedef struct _GstRTSPClientState GstRTSPClientState;
+typedef struct _GstRTSPClientPrivate GstRTSPClientPrivate;
 
-#include "rtsp-server.h"
 #include "rtsp-media.h"
 #include "rtsp-mount-points.h"
 #include "rtsp-session-pool.h"
@@ -73,42 +73,31 @@ struct _GstRTSPClientState {
 };
 
 /**
- * GstRTSPClient:
+ * GstRTSPClientSendFunc:
+ * @client: a #GstRTSPClient
+ * @message: a #GstRTSPMessage
+ * @close: close the connection
+ * @user_data: user data when registering the callback
+ *
+ * This callback is called when @client wants to send @message. When @close is
+ * %TRUE, the connection should be closed when the message has been sent.
  *
- * @connection: the connection object handling the client request.
- * @watch: watch for the connection
- * @ip: ip address used by the client to connect to us
- * @use_client_settings: whether to allow client transport settings for multicast
- * @session_pool: handle to the session pool used by the client.
- * @mount_points: handle to the mount points used by the client.
- * @uri: cached uri
- * @media: cached media
- * @transports: a list of #GstRTSPStreamTransport using @connection.
- * @sessions: a list of sessions managed by @connection.
+ * Returns: %TRUE on success.
+ */
+typedef gboolean (*GstRTSPClientSendFunc)      (GstRTSPClient *client,
+                                                GstRTSPMessage *message,
+                                                gboolean close,
+                                                gpointer user_data);
+
+/**
+ * GstRTSPClient:
  *
  * The client structure.
  */
 struct _GstRTSPClient {
   GObject       parent;
 
-  GstRTSPConnection *connection;
-  GstRTSPWatch      *watch;
-  gchar             *server_ip;
-  gboolean           is_ipv6;
-  gboolean           use_client_settings;
-
-  GstRTSPServer        *server;
-  GstRTSPSessionPool   *session_pool;
-  GstRTSPMountPoints   *mount_points;
-  GstRTSPAuth          *auth;
-
-  GstRTSPUrl     *uri;
-  GstRTSPMedia   *media;
-
-  GList *transports;
-  GList *sessions;
-
-  guint close_response_seq;
+  GstRTSPClientPrivate *priv;
 };
 
 struct _GstRTSPClientClass {
@@ -133,9 +122,6 @@ GType                 gst_rtsp_client_get_type          (void);
 
 GstRTSPClient *       gst_rtsp_client_new               (void);
 
-void                  gst_rtsp_client_set_server        (GstRTSPClient * client, GstRTSPServer * server);
-GstRTSPServer *       gst_rtsp_client_get_server        (GstRTSPClient * client);
-
 void                  gst_rtsp_client_set_session_pool  (GstRTSPClient *client,
                                                          GstRTSPSessionPool *pool);
 GstRTSPSessionPool *  gst_rtsp_client_get_session_pool  (GstRTSPClient *client);
@@ -151,6 +137,15 @@ gboolean              gst_rtsp_client_get_use_client_settings (GstRTSPClient * c
 void                  gst_rtsp_client_set_auth          (GstRTSPClient *client, GstRTSPAuth *auth);
 GstRTSPAuth *         gst_rtsp_client_get_auth          (GstRTSPClient *client);
 
+GstRTSPUrl *          gst_rtsp_client_get_uri           (GstRTSPClient *client);
+GstRTSPConnection *   gst_rtsp_client_get_connection    (GstRTSPClient *client);
+
+void                  gst_rtsp_client_set_send_func     (GstRTSPClient *client,
+                                                         GstRTSPClientSendFunc func,
+                                                         gpointer user_data,
+                                                         GDestroyNotify notify);
+GstRTSPResult         gst_rtsp_client_handle_message    (GstRTSPClient *client,
+                                                         GstRTSPMessage *message);
 
 gboolean              gst_rtsp_client_accept            (GstRTSPClient *client,
                                                          GSocket *socket,