mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
rtsp: cleanup headers
Add padding, fix indentation, remove deprecated stuff
This commit is contained in:
parent
107d5a3d05
commit
bdf3845498
7 changed files with 49 additions and 159 deletions
|
@ -3569,109 +3569,3 @@ gst_rtsp_watch_send_message (GstRTSPWatch * watch, GstRTSPMessage * message,
|
|||
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 */
|
||||
|
|
|
@ -60,75 +60,75 @@ G_BEGIN_DECLS
|
|||
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 */
|
||||
|
||||
|
@ -176,13 +176,13 @@ typedef struct {
|
|||
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);
|
||||
|
||||
|
@ -196,14 +196,6 @@ GstRTSPResult gst_rtsp_watch_send_message (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__ */
|
||||
|
|
|
@ -68,14 +68,14 @@ struct _GstRTSPExtensionInterface {
|
|||
GstRTSPResult (*receive_request) (GstRTSPExtension *ext, GstRTSPMessage *req);
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING - 1];
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_rtsp_extension_get_type (void);
|
||||
|
||||
/* invoke vfunction on interface */
|
||||
gboolean gst_rtsp_extension_detect_server (GstRTSPExtension *ext, GstRTSPMessage *resp);
|
||||
|
||||
|
||||
GstRTSPResult gst_rtsp_extension_before_send (GstRTSPExtension *ext, GstRTSPMessage *req);
|
||||
GstRTSPResult gst_rtsp_extension_after_send (GstRTSPExtension *ext, GstRTSPMessage *req,
|
||||
GstRTSPMessage *resp);
|
||||
|
|
|
@ -104,6 +104,8 @@ struct _GstRTSPMessage
|
|||
|
||||
guint8 *body;
|
||||
guint body_size;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* memory management */
|
||||
|
|
|
@ -54,7 +54,7 @@ G_BEGIN_DECLS
|
|||
* @GST_RTSP_RANGE_SMPTE: SMPTE timecode
|
||||
* @GST_RTSP_RANGE_SMPTE_30_DROP: 29.97 frames per second
|
||||
* @GST_RTSP_RANGE_SMPTE_25: 25 frames per second
|
||||
* @GST_RTSP_RANGE_NPT: Normal play time
|
||||
* @GST_RTSP_RANGE_NPT: Normal play time
|
||||
* @GST_RTSP_RANGE_CLOCK: Absolute time expressed as ISO 8601 timestamps
|
||||
*
|
||||
* Different possible time range units.
|
||||
|
@ -88,7 +88,7 @@ typedef enum {
|
|||
/**
|
||||
* GstRTSPTime:
|
||||
* @type: the time of the time
|
||||
* @seconds: seconds when @type is GST_RTSP_TIME_SECONDS
|
||||
* @seconds: seconds when @type is GST_RTSP_TIME_SECONDS
|
||||
*
|
||||
* A time indication.
|
||||
*/
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#ifndef __GST_RTSP_TRANSPORT_H__
|
||||
#define __GST_RTSP_TRANSPORT_H__
|
||||
|
||||
#include <gst/gstconfig.h>
|
||||
#include <gst/rtsp/gstrtspdefs.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -156,6 +157,7 @@ struct _GstRTSPTransport {
|
|||
/* RTP specific */
|
||||
guint ssrc;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GstRTSPResult gst_rtsp_transport_new (GstRTSPTransport **transport);
|
||||
|
|
|
@ -84,7 +84,7 @@ struct _GstRTSPUrl {
|
|||
guint16 port;
|
||||
gchar *abspath;
|
||||
gchar *query;
|
||||
};
|
||||
};
|
||||
|
||||
GType gst_rtsp_url_get_type (void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue