gst/rtsp/: Make channel guint8 where possible.

Original commit message from CVS:
Patch by: Peter Kjellerstedt  <pkj at axis com>
* gst/rtsp/gstrtspsrc.h:
* gst/rtsp/rtspconnection.c: (rtsp_connection_receive):
* gst/rtsp/rtspmessage.c: (rtsp_message_init_data),
(rtsp_message_get_header):
* gst/rtsp/rtspmessage.h:
Make channel guint8 where possible.
Make rtsp_message_init_data() take the channel as a guint8.
* gst/rtsp/rtspdefs.c:
Fixed a typo: Timout -> Timeout
* gst/rtsp/rtspdefs.h:
Make RTSP_CHECK() behave as a statement.
* gst/rtsp/sdpmessage.c:
Avoid a compiler warning in INIT_ARRAY().
Fixes #437692.
This commit is contained in:
Peter Kjellerstedt 2007-05-12 16:37:50 +00:00 committed by Wim Taymans
parent 02a64fe5ad
commit 7ef62aac45
8 changed files with 34 additions and 9 deletions

View file

@ -1,3 +1,25 @@
2007-05-12 Wim Taymans <wim@fluendo.com>
Patch by: Peter Kjellerstedt <pkj at axis com>
* gst/rtsp/gstrtspsrc.h:
* gst/rtsp/rtspconnection.c: (rtsp_connection_receive):
* gst/rtsp/rtspmessage.c: (rtsp_message_init_data),
(rtsp_message_get_header):
* gst/rtsp/rtspmessage.h:
Make channel guint8 where possible.
Make rtsp_message_init_data() take the channel as a guint8.
* gst/rtsp/rtspdefs.c:
Fixed a typo: Timout -> Timeout
* gst/rtsp/rtspdefs.h:
Make RTSP_CHECK() behave as a statement.
* gst/rtsp/sdpmessage.c:
Avoid a compiler warning in INIT_ARRAY().
Fixes #437692.
2007-05-12 Wim Taymans <wim@fluendo.com>
Patch by: Peter Kjellerstedt <pkj at axis com>

View file

@ -90,7 +90,7 @@ struct _GstRTSPStream {
gboolean added;
/* for interleaved mode */
gint channel[2];
guint8 channel[2];
GstCaps *caps;
GstPad *channelpad[2];

View file

@ -767,7 +767,7 @@ rtsp_connection_receive (RTSPConnection * conn, RTSPMessage * msg,
RTSP_CHECK (rtsp_connection_read (conn, &c, 1, timeout), read_error);
/* now we create a data message */
rtsp_message_init_data (msg, (gint) c);
rtsp_message_init_data (msg, c);
/* next two bytes are the length of the data */
RTSP_CHECK (rtsp_connection_read (conn, (guint8 *) & size, 2, timeout),

View file

@ -66,7 +66,7 @@ static const gchar *rtsp_results[] = {
"Received end-of-file",
"Network error: %s",
"Host is not a valid IP address",
"Timout while waiting for server response",
"Timeout while waiting for server response",
"Unknown error (%d)",
NULL
};

View file

@ -48,7 +48,10 @@
G_BEGIN_DECLS
#define RTSP_CHECK(stmt, label) \
if (G_UNLIKELY ((res = (stmt)) != RTSP_OK)) goto label
G_STMT_START { \
if (G_UNLIKELY ((res = (stmt)) != RTSP_OK)) \
goto label; \
} G_STMT_END
typedef enum {
RTSP_OK = 0,

View file

@ -167,7 +167,7 @@ rtsp_message_init_response (RTSPMessage * msg, RTSPStatusCode code,
}
RTSPResult
rtsp_message_init_data (RTSPMessage * msg, gint channel)
rtsp_message_init_data (RTSPMessage * msg, guint8 channel)
{
g_return_val_if_fail (msg != NULL, RTSP_EINVAL);
@ -255,7 +255,7 @@ rtsp_message_get_header (const RTSPMessage * msg, RTSPHeaderField field,
g_return_val_if_fail (msg != NULL, RTSP_EINVAL);
if (msg->type != RTSP_MESSAGE_RESPONSE && msg->type != RTSP_MESSAGE_REQUEST)
if (msg->type == RTSP_MESSAGE_INVALID || msg->type == RTSP_MESSAGE_DATA)
return RTSP_ENOTIMPL;
val = g_hash_table_lookup (msg->hdr_fields, GINT_TO_POINTER (field));

View file

@ -71,7 +71,7 @@ typedef struct _RTSPMessage
gchar *reason;
} response;
struct {
gint channel;
guint8 channel;
} data;
} type_data;
@ -102,7 +102,7 @@ RTSPResult rtsp_message_init_response (RTSPMessage *msg,
const RTSPMessage *request);
RTSPResult rtsp_message_init_data (RTSPMessage *msg,
gint channel);
guint8 channel);
RTSPResult rtsp_message_unset (RTSPMessage *msg);
RTSPResult rtsp_message_free (RTSPMessage *msg);

View file

@ -60,7 +60,7 @@ G_STMT_START { \
#define INIT_ARRAY(field,type,init_func) \
G_STMT_START { \
if (field) { \
gint i; \
guint i; \
for(i=0; i<field->len; i++) \
init_func (&g_array_index(field, type, i)); \
g_array_set_size (field,0); \