mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-08 00:18:54 +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 */
|
||||
|
|
|
@ -176,7 +176,7 @@ 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,
|
||||
|
@ -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,7 +68,7 @@ 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);
|
||||
|
|
|
@ -104,6 +104,8 @@ struct _GstRTSPMessage
|
|||
|
||||
guint8 *body;
|
||||
guint body_size;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
/* memory management */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue