return gst_rtsp_watch_write_data (watch,
(guint8 *) g_string_free (str, FALSE), size, id);
}
-
-/**
- * gst_rtsp_watch_queue_data:
- * @watch: a #GstRTSPWatch
- * @data: the data to queue
- * @size: the size of @data
- *
- * Queue @data for transmission in @watch. It will be transmitted when the
- * connection of the @watch becomes writable.
- *
- * This function will take ownership of @data and g_free() it after use.
- *
- * The return value of this function will be used as the id argument in the
- * message_sent callback.
- *
- * Deprecated: Use gst_rtsp_watch_write_data()
- *
- * Returns: an id.
- *
- * Since: 0.10.24
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-guint
-gst_rtsp_watch_queue_data (GstRTSPWatch * watch, const guint8 * data,
- guint size);
-#endif
-guint
-gst_rtsp_watch_queue_data (GstRTSPWatch * watch, const guint8 * data,
- guint size)
-{
- GstRTSPRec *rec;
- GMainContext *context = NULL;
-
- g_return_val_if_fail (watch != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (data != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (size != 0, GST_RTSP_EINVAL);
-
- g_mutex_lock (watch->mutex);
-
- /* make a record with the data and id */
- rec = g_slice_new (GstRTSPRec);
- rec->data = (guint8 *) data;
- rec->size = size;
- do {
- /* make sure rec->id is never 0 */
- rec->id = ++watch->id;
- } while (G_UNLIKELY (rec->id == 0));
-
- /* add the record to a queue. FIXME we would like to have an upper limit here */
- g_queue_push_head (watch->messages, rec);
-
- /* make sure the main context will now also check for writability on the
- * socket */
- if (watch->writefd.events != WRITE_COND) {
- watch->writefd.events = WRITE_COND;
- context = ((GSource *) watch)->context;
- }
- g_mutex_unlock (watch->mutex);
-
- if (context)
- g_main_context_wakeup (context);
-
- return rec->id;
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
-/**
- * gst_rtsp_watch_queue_message:
- * @watch: a #GstRTSPWatch
- * @message: a #GstRTSPMessage
- *
- * Queue a @message for transmission in @watch. The contents of this
- * message will be serialized and transmitted when the connection of the
- * @watch becomes writable.
- *
- * The return value of this function will be used as the id argument in the
- * message_sent callback.
- *
- * Deprecated: Use gst_rtsp_watch_send_message()
- *
- * Returns: an id.
- *
- * Since: 0.10.23
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-guint
-gst_rtsp_watch_queue_message (GstRTSPWatch * watch, GstRTSPMessage * message);
-#endif
-guint
-gst_rtsp_watch_queue_message (GstRTSPWatch * watch, GstRTSPMessage * message)
-{
- GString *str;
- guint size;
-
- g_return_val_if_fail (watch != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL);
-
- /* make a record with the message as a string and id */
- str = message_to_string (watch->conn, message);
- size = str->len;
- return gst_rtsp_watch_queue_data (watch,
- (guint8 *) g_string_free (str, FALSE), size);
-}
-#endif /* GST_REMOVE_DEPRECATED */
typedef struct _GstRTSPConnection GstRTSPConnection;
/* opening/closing a connection */
-GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
GstRTSPResult gst_rtsp_connection_create_from_fd (gint fd,
const gchar * ip,
guint16 port,
const gchar * initial_buffer,
GstRTSPConnection ** conn);
-GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
-GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
-GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);
-GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
+GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
+GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);
+GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
/* sending/receiving raw bytes */
-GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data,
- guint size, GTimeVal * timeout);
-GstRTSPResult gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data,
- guint size, GTimeVal * timeout);
+GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data,
+ guint size, GTimeVal * timeout);
+GstRTSPResult gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data,
+ guint size, GTimeVal * timeout);
/* sending/receiving messages */
-GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection *conn, GstRTSPMessage *message,
- GTimeVal *timeout);
-GstRTSPResult gst_rtsp_connection_receive (GstRTSPConnection *conn, GstRTSPMessage *message,
- GTimeVal *timeout);
+GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection *conn, GstRTSPMessage *message,
+ GTimeVal *timeout);
+GstRTSPResult gst_rtsp_connection_receive (GstRTSPConnection *conn, GstRTSPMessage *message,
+ GTimeVal *timeout);
/* status management */
-GstRTSPResult gst_rtsp_connection_poll (GstRTSPConnection *conn, GstRTSPEvent events,
- GstRTSPEvent *revents, GTimeVal *timeout);
+GstRTSPResult gst_rtsp_connection_poll (GstRTSPConnection *conn, GstRTSPEvent events,
+ GstRTSPEvent *revents, GTimeVal *timeout);
/* reset the timeout */
-GstRTSPResult gst_rtsp_connection_next_timeout (GstRTSPConnection *conn, GTimeVal *timeout);
-GstRTSPResult gst_rtsp_connection_reset_timeout (GstRTSPConnection *conn);
+GstRTSPResult gst_rtsp_connection_next_timeout (GstRTSPConnection *conn, GTimeVal *timeout);
+GstRTSPResult gst_rtsp_connection_reset_timeout (GstRTSPConnection *conn);
/* flushing state */
-GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection *conn, gboolean flush);
+GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection *conn, gboolean flush);
/* HTTP proxy support */
-GstRTSPResult gst_rtsp_connection_set_proxy (GstRTSPConnection *conn,
- const gchar *host, guint port);
+GstRTSPResult gst_rtsp_connection_set_proxy (GstRTSPConnection *conn,
+ const gchar *host, guint port);
/* configure authentication data */
-GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection *conn, GstRTSPAuthMethod method,
- const gchar *user, const gchar *pass);
+GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection *conn, GstRTSPAuthMethod method,
+ const gchar *user, const gchar *pass);
void gst_rtsp_connection_set_auth_param (GstRTSPConnection *conn,
- const gchar * param,
- const gchar *value);
+ const gchar * param,
+ const gchar *value);
void gst_rtsp_connection_clear_auth_params (GstRTSPConnection *conn);
/* configure DSCP */
-GstRTSPResult gst_rtsp_connection_set_qos_dscp (GstRTSPConnection *conn,
- guint qos_dscp);
+GstRTSPResult gst_rtsp_connection_set_qos_dscp (GstRTSPConnection *conn,
+ guint qos_dscp);
/* accessors */
-GstRTSPUrl * gst_rtsp_connection_get_url (const GstRTSPConnection *conn);
-const gchar * gst_rtsp_connection_get_ip (const GstRTSPConnection *conn);
-void gst_rtsp_connection_set_ip (GstRTSPConnection *conn, const gchar *ip);
+GstRTSPUrl * gst_rtsp_connection_get_url (const GstRTSPConnection *conn);
+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);
+gint gst_rtsp_connection_get_readfd (const GstRTSPConnection *conn);
+gint gst_rtsp_connection_get_writefd (const GstRTSPConnection *conn);
-void gst_rtsp_connection_set_http_mode (GstRTSPConnection *conn,
- gboolean enable);
+void gst_rtsp_connection_set_http_mode (GstRTSPConnection *conn,
+ gboolean enable);
/* tunneling */
-void gst_rtsp_connection_set_tunneled (GstRTSPConnection *conn, gboolean tunneled);
-gboolean gst_rtsp_connection_is_tunneled (const GstRTSPConnection *conn);
+void gst_rtsp_connection_set_tunneled (GstRTSPConnection *conn, gboolean tunneled);
+gboolean gst_rtsp_connection_is_tunneled (const GstRTSPConnection *conn);
-const gchar * gst_rtsp_connection_get_tunnelid (const GstRTSPConnection *conn);
-GstRTSPResult gst_rtsp_connection_do_tunnel (GstRTSPConnection *conn, GstRTSPConnection *conn2);
+const gchar * gst_rtsp_connection_get_tunnelid (const GstRTSPConnection *conn);
+GstRTSPResult gst_rtsp_connection_do_tunnel (GstRTSPConnection *conn, GstRTSPConnection *conn2);
/* async IO */
GstRTSPResult (*tunnel_lost) (GstRTSPWatch *watch, gpointer user_data);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING - 2];
+ gpointer _gst_reserved[GST_PADDING];
} GstRTSPWatchFuncs;
GstRTSPWatch * gst_rtsp_watch_new (GstRTSPConnection *conn,
GstRTSPWatchFuncs *funcs,
- gpointer user_data,
- GDestroyNotify notify);
+ gpointer user_data,
+ GDestroyNotify notify);
void gst_rtsp_watch_reset (GstRTSPWatch *watch);
void gst_rtsp_watch_unref (GstRTSPWatch *watch);
GstRTSPMessage *message,
guint *id);
-#ifndef GST_DISABLE_DEPRECATED
-guint gst_rtsp_watch_queue_data (GstRTSPWatch * watch,
- const guint8 * data,
- guint size);
-guint gst_rtsp_watch_queue_message (GstRTSPWatch *watch,
- GstRTSPMessage *message);
-#endif
-
G_END_DECLS
#endif /* __GST_RTSP_CONNECTION_H__ */