diff options
author | David Schleef <ds@schleef.org> | 2014-09-07 20:08:40 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2014-09-07 20:08:40 -0700 |
commit | dfe6e72d3c157b4eb4e75246b94fa9094e11cd8d (patch) | |
tree | 16c1c14aed1dfd1263fcc2b477d2c5898e796166 | |
parent | 7eb409e577b67423079b96cf98a2c87d325796b7 (diff) |
fix warnings
-rw-r--r-- | rtmp/amf.c | 12 | ||||
-rw-r--r-- | rtmp/rtmpchunk.c | 8 | ||||
-rw-r--r-- | rtmp/rtmpchunk.h | 2 | ||||
-rw-r--r-- | rtmp/rtmpclient.h | 1 | ||||
-rw-r--r-- | rtmp/rtmpconnection.c | 18 | ||||
-rw-r--r-- | rtmp/rtmputils.c | 10 |
6 files changed, 24 insertions, 27 deletions
@@ -151,7 +151,7 @@ _parse_number (AmfParser * parser) static char * _parse_utf8_string (AmfParser * parser) { - int size; + gsize size; char *s; size = _parse_u16 (parser); @@ -376,7 +376,7 @@ _gst_amf_node_dump (GstAmfNode * node, int indent) case GST_AMF_TYPE_OBJECT: case GST_AMF_TYPE_ECMA_ARRAY: g_print ("{\n"); - for (i = 0; i < node->array_val->len; i++) { + for (i = 0; i < (int)node->array_val->len; i++) { AmfObjectField *field = g_ptr_array_index (node->array_val, i); g_print ("%*.*s \"%s\": ", indent, indent, "", field->name); _gst_amf_node_dump (field->value, indent + 2); @@ -406,7 +406,7 @@ gst_amf_node_dump (GstAmfNode * node) } static gboolean -_serialize_check (AmfSerializer * serializer, int value) +_serialize_check (AmfSerializer * serializer, gsize value) { if (serializer->offset + value > serializer->size) { serializer->error = TRUE; @@ -484,7 +484,7 @@ _serialize_object (AmfSerializer * serializer, GstAmfNode * node) { int i; - for (i = 0; i < node->array_val->len; i++) { + for (i = 0; i < (int)node->array_val->len; i++) { AmfObjectField *field = g_ptr_array_index (node->array_val, i); _serialize_utf8_string (serializer, field->name); _serialize_value (serializer, field->value); @@ -499,7 +499,7 @@ _serialize_ecma_array (AmfSerializer * serializer, GstAmfNode * node) int i; _serialize_u32 (serializer, 0); - for (i = 0; i < node->array_val->len; i++) { + for (i = 0; i < (int)node->array_val->len; i++) { AmfObjectField *field = g_ptr_array_index (node->array_val, i); _serialize_utf8_string (serializer, field->name); _serialize_value (serializer, field->value); @@ -620,7 +620,7 @@ const GstAmfNode * gst_amf_node_get_object (const GstAmfNode * node, const char *field_name) { int i; - for (i = 0; i < node->array_val->len; i++) { + for (i = 0; i < (int)node->array_val->len; i++) { AmfObjectField *field = g_ptr_array_index (node->array_val, i); if (strcmp (field->name, field_name) == 0) { return field->value; diff --git a/rtmp/rtmpchunk.c b/rtmp/rtmpchunk.c index 4dfbceb..bc4f36f 100644 --- a/rtmp/rtmpchunk.c +++ b/rtmp/rtmpchunk.c @@ -257,7 +257,7 @@ gst_rtmp_chunk_serialize (GstRtmpChunk * chunk, data[7] = chunk->message_type_id; offset = 8; } - for (i = 0; i < chunksize; i += max_chunk_size) { + for (i = 0; i < (int)chunksize; i += max_chunk_size) { if (i != 0) { data[offset] = 0xc0 | chunk->chunk_stream_id; offset++; @@ -327,11 +327,11 @@ gst_rtmp_chunk_cache_free (GstRtmpChunkCache * cache) } GstRtmpChunkCacheEntry * -gst_rtmp_chunk_cache_get (GstRtmpChunkCache * cache, int chunk_stream_id) +gst_rtmp_chunk_cache_get (GstRtmpChunkCache * cache, guint32 chunk_stream_id) { int i; GstRtmpChunkCacheEntry *entry; - for (i = 0; i < cache->len; i++) { + for (i = 0; i < (int)cache->len; i++) { entry = &g_array_index (cache, GstRtmpChunkCacheEntry, i); if (entry->previous_header.chunk_stream_id == chunk_stream_id) return entry; @@ -371,7 +371,7 @@ gst_rtmp_chunk_parse_message (GstRtmpChunk * chunk, char **command_name, offset += n_parsed; n3 = gst_amf_node_new_parse (data + offset, size - offset, &n_parsed); offset += n_parsed; - if (offset < size) { + if (offset < (int)size) { n4 = gst_amf_node_new_parse (data + offset, size - offset, &n_parsed); } else { n4 = NULL; diff --git a/rtmp/rtmpchunk.h b/rtmp/rtmpchunk.h index cb0400a..d8507ec 100644 --- a/rtmp/rtmpchunk.h +++ b/rtmp/rtmpchunk.h @@ -145,7 +145,7 @@ gboolean gst_rtmp_chunk_parse_message (GstRtmpChunk *chunk, GstRtmpChunkCache *gst_rtmp_chunk_cache_new (void); void gst_rtmp_chunk_cache_free (GstRtmpChunkCache *cache); GstRtmpChunkCacheEntry * gst_rtmp_chunk_cache_get ( - GstRtmpChunkCache *cache, int chunk_stream_id); + GstRtmpChunkCache *cache, guint32 chunk_stream_id); void gst_rtmp_chunk_cache_update (GstRtmpChunkCacheEntry * entry, GstRtmpChunk * chunk); diff --git a/rtmp/rtmpclient.h b/rtmp/rtmpclient.h index 1204f2b..09c8ee0 100644 --- a/rtmp/rtmpclient.h +++ b/rtmp/rtmpclient.h @@ -92,6 +92,7 @@ GstRtmpClient *gst_rtmp_client_new (void); void gst_rtmp_client_set_url (GstRtmpClient *client, const char *url); void gst_rtmp_client_set_server_address (GstRtmpClient * client, const char *host); void gst_rtmp_client_set_server_port (GstRtmpClient * client, int port); +void gst_rtmp_client_set_stream (GstRtmpClient * client, const char *stream); void gst_rtmp_client_connect_async (GstRtmpClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, diff --git a/rtmp/rtmpconnection.c b/rtmp/rtmpconnection.c index 3b4a3f9..25b4b29 100644 --- a/rtmp/rtmpconnection.c +++ b/rtmp/rtmpconnection.c @@ -45,23 +45,18 @@ static gboolean gst_rtmp_connection_input_ready (GInputStream * is, gpointer user_data); static gboolean gst_rtmp_connection_output_ready (GOutputStream * os, gpointer user_data); -static void gst_rtmp_connection_client_handshake1_done (GObject * obj, - GAsyncResult * res, gpointer user_data); -static void gst_rtmp_connection_client_handshake2 (GstRtmpConnection * sc); -static void gst_rtmp_connection_client_handshake2_done (GObject * obj, - GAsyncResult * res, gpointer user_data); static void gst_rtmp_connection_client_handshake1 (GstRtmpConnection * sc); static void gst_rtmp_connection_client_handshake1_done (GObject * obj, GAsyncResult * res, gpointer user_data); static void gst_rtmp_connection_client_handshake2 (GstRtmpConnection * sc); static void gst_rtmp_connection_client_handshake2_done (GObject * obj, GAsyncResult * res, gpointer user_data); -static void gst_rtmp_connection_write_chunk_done (GObject * obj, - GAsyncResult * res, gpointer user_data); static void gst_rtmp_connection_server_handshake1 (GstRtmpConnection * sc); static void gst_rtmp_connection_server_handshake1_done (GObject * obj, GAsyncResult * res, gpointer user_data); static void gst_rtmp_connection_server_handshake2 (GstRtmpConnection * sc); +static void gst_rtmp_connection_write_chunk_done (GObject * obj, + GAsyncResult * res, gpointer user_data); static void gst_rtmp_connection_set_input_callback (GstRtmpConnection * connection, void (*input_callback) (GstRtmpConnection * connection), @@ -77,7 +72,6 @@ gst_rtmp_connection_handle_user_control (GstRtmpConnection * connectin, static void gst_rtmp_connection_handle_chunk (GstRtmpConnection * sc, GstRtmpChunk * chunk); -static void gst_rtmp_connection_server_handshake1 (GstRtmpConnection * sc); static void gst_rtmp_connection_send_ack (GstRtmpConnection * connection); static void gst_rtmp_connection_send_ping_response (GstRtmpConnection * connection, @@ -88,7 +82,7 @@ static void gst_rtmp_connection_send_window_size_request (GstRtmpConnection * typedef struct _CommandCallback CommandCallback; struct _CommandCallback { - int chunk_stream_id; + guint32 chunk_stream_id; int transaction_id; GstRtmpCommandCallback func; gpointer user_data; @@ -411,7 +405,7 @@ gst_rtmp_connection_write_chunk_done (GObject * obj, g_error_free (error); return; } - if (ret < g_bytes_get_size (connection->output_bytes)) { + if (ret < (gssize)g_bytes_get_size (connection->output_bytes)) { GST_DEBUG ("short write %" G_GSIZE_FORMAT " < %" G_GSIZE_FORMAT, ret, g_bytes_get_size (connection->output_bytes)); @@ -809,7 +803,8 @@ gst_rtmp_connection_start_handshake (GstRtmpConnection * connection, } } -void +#if 0 +static void gst_rtmp_connection_handshake_async (GstRtmpConnection * connection, gboolean is_server, GCancellable * cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -829,6 +824,7 @@ gst_rtmp_connection_handshake_async (GstRtmpConnection * connection, gst_rtmp_connection_client_handshake1 (connection); } } +#endif static void gst_rtmp_connection_client_handshake1 (GstRtmpConnection * sc) diff --git a/rtmp/rtmputils.c b/rtmp/rtmputils.c index 6f8fabd..dc40d6a 100644 --- a/rtmp/rtmputils.c +++ b/rtmp/rtmputils.c @@ -36,17 +36,17 @@ gst_rtmp_dump_data (GBytes * bytes) int i, j; data = g_bytes_get_data (bytes, &size); - for (i = 0; i < size; i += 16) { + for (i = 0; i < (int)size; i += 16) { g_print ("%04x: ", i); for (j = 0; j < 16; j++) { - if (i + j < size) { + if (i + j < (int)size) { g_print ("%02x ", data[i + j]); } else { g_print (" "); } } for (j = 0; j < 16; j++) { - if (i + j < size) { + if (i + j < (int)size) { g_print ("%c", g_ascii_isprint (data[i + j]) ? data[i + j] : '.'); } } @@ -92,7 +92,7 @@ gst_rtmp_hexify (const guint8 * src, gsize size) int i; gchar *dest; dest = g_malloc (2 * size + 1); - for (i = 0; i < size; i++) { + for (i = 0; i < (int)size; i++) { dest[2 * i] = xdigit[src[i] >> 4]; dest[2 * i + 1] = xdigit[src[i] & 0xf]; } @@ -192,7 +192,7 @@ dump_command (GstRtmpChunk * chunk) offset = 0; data = g_bytes_get_data (chunk->payload, &size); - while (offset < size) { + while (offset < (int)size) { amf = gst_amf_node_new_parse (data + offset, size - offset, &n_parsed); gst_amf_node_dump (amf); gst_amf_node_free (amf); |