*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/*
* Unless otherwise indicated, Source Code is licensed under MIT license.
#include <gst/rtsp/gstrtspdefs.h>
#include <gst/rtsp/gstrtspurl.h>
#include <gst/rtsp/gstrtspmessage.h>
+#include <gio/gio.h>
G_BEGIN_DECLS
/* opening/closing a connection */
GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
-GstRTSPResult gst_rtsp_connection_create_from_fd (gint fd,
+GstRTSPResult gst_rtsp_connection_create_from_socket (GSocket * socket,
const gchar * ip,
guint16 port,
const gchar * initial_buffer,
GstRTSPConnection ** conn);
-GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_accept (GSocket *socket, GstRTSPConnection **conn, GCancellable *cancellable);
GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);
GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
+/* TLS connections */
+GTlsConnection * gst_rtsp_connection_get_tls (GstRTSPConnection * conn, GError ** error);
+gboolean gst_rtsp_connection_set_tls_validation_flags (GstRTSPConnection * conn, GTlsCertificateFlags flags);
+GTlsCertificateFlags gst_rtsp_connection_get_tls_validation_flags (GstRTSPConnection * conn);
+void gst_rtsp_connection_set_tls_database (GstRTSPConnection * conn, GTlsDatabase * database);
+GTlsDatabase * gst_rtsp_connection_get_tls_database (GstRTSPConnection * conn);
/* sending/receiving raw bytes */
GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data,
const gchar * gst_rtsp_connection_get_ip (const GstRTSPConnection *conn);
void gst_rtsp_connection_set_ip (GstRTSPConnection *conn, const gchar *ip);
-gint gst_rtsp_connection_get_readfd (const GstRTSPConnection *conn);
-gint gst_rtsp_connection_get_writefd (const GstRTSPConnection *conn);
+GSocket * gst_rtsp_connection_get_read_socket (const GstRTSPConnection *conn);
+GSocket * gst_rtsp_connection_get_write_socket (const GstRTSPConnection *conn);
void gst_rtsp_connection_set_http_mode (GstRTSPConnection *conn,
gboolean enable);
const gchar * gst_rtsp_connection_get_tunnelid (const GstRTSPConnection *conn);
GstRTSPResult gst_rtsp_connection_do_tunnel (GstRTSPConnection *conn, GstRTSPConnection *conn2);
+void gst_rtsp_connection_set_remember_session_id (GstRTSPConnection *conn, gboolean remember);
+gboolean gst_rtsp_connection_get_remember_session_id (GstRTSPConnection *conn);
+
/* async IO */
/**
* you usually pair the tunnelid of this connection with the saved one using
* gst_rtsp_connection_do_tunnel().
* @error_full: callback when an error occured with more information than
- * the @error callback. Since 0.10.25
+ * the @error callback.
* @tunnel_lost: callback when the post connection of a tunnel is closed.
- * Since 0.10.29
+ * @tunnel_http_response: callback when an HTTP response to the GET request
+ * is about to be sent for a tunneled connection. The response can be
+ * modified in the callback. Since 1.4.
*
* Callback functions from a #GstRTSPWatch.
- *
- * Since: 0.10.23
*/
typedef struct {
GstRTSPResult (*message_received) (GstRTSPWatch *watch, GstRTSPMessage *message,
GstRTSPMessage *message, guint id,
gpointer user_data);
GstRTSPResult (*tunnel_lost) (GstRTSPWatch *watch, gpointer user_data);
+ GstRTSPResult (*tunnel_http_response) (GstRTSPWatch *watch,
+ GstRTSPMessage *request,
+ GstRTSPMessage *response,
+ gpointer user_data);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING-1];
} GstRTSPWatchFuncs;
GstRTSPWatch * gst_rtsp_watch_new (GstRTSPConnection *conn,
guint gst_rtsp_watch_attach (GstRTSPWatch *watch,
GMainContext *context);
+void gst_rtsp_watch_set_send_backlog (GstRTSPWatch *watch,
+ gsize bytes, guint messages);
+void gst_rtsp_watch_get_send_backlog (GstRTSPWatch *watch,
+ gsize *bytes, guint *messages);
+
GstRTSPResult gst_rtsp_watch_write_data (GstRTSPWatch *watch,
const guint8 *data,
guint size, guint *id);