[aravis/timeout-resend] gvsp: use proper define for protocol overhead.



commit d54d90475b0bf97fe9b189ac36da3c9d61cea717
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Mar 1 11:46:16 2011 +0100

    gvsp: use proper define for protocol overhead.

 src/arvgvsp.h     |    2 ++
 src/arvgvstream.c |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/arvgvsp.h b/src/arvgvsp.h
index 24ea3e1..dc00304 100644
--- a/src/arvgvsp.h
+++ b/src/arvgvsp.h
@@ -31,6 +31,8 @@ G_BEGIN_DECLS
 #define ARV_GVSP_PACKET_INFOS_TYPE_MASK		0xff000000
 #define ARV_GVSP_PACKET_INFOS_TYPE_POS		24
 
+#define ARV_GVSP_PACKET_PROTOCOL_OVERHEAD	(20 + 8 + 8)		/* IP + UDP + GVSP headers */
+
 typedef enum {
 	ARV_GVSP_PACKET_TYPE_DATA_LEADER = 	0x01,
 	ARV_GVSP_PACKET_TYPE_DATA_TRAILER = 	0x02,
diff --git a/src/arvgvstream.c b/src/arvgvstream.c
index 5738faf..cf33694 100644
--- a/src/arvgvstream.c
+++ b/src/arvgvstream.c
@@ -510,7 +510,7 @@ arv_gv_stream_new (GInetAddress *device_address, guint16 port,
 	ArvGvStreamThreadData *thread_data;
 
 	g_return_val_if_fail (G_IS_INET_ADDRESS (device_address), NULL);
-	g_return_val_if_fail (packet_size > (20 + 8 + 8) /* FIXME IP + UDP + GVSP headers */, NULL);
+	g_return_val_if_fail (packet_size > ARV_GVSP_PACKET_PROTOCOL_OVERHEAD, NULL);
 
 	gv_stream = g_object_new (ARV_TYPE_GV_STREAM, NULL);
 
@@ -534,7 +534,7 @@ arv_gv_stream_new (GInetAddress *device_address, guint16 port,
 	thread_data->device_address = g_inet_socket_address_new (device_address, ARV_GVCP_PORT);
 	thread_data->packet_resend = ARV_GV_STREAM_PACKET_RESEND_ALWAYS;
 	thread_data->timestamp_tick_frequency = timestamp_tick_frequency;
-	thread_data->data_size = packet_size - (20 + 8 + 8) /* FIXME IP + UDP + GVSP headers */;
+	thread_data->data_size = packet_size - ARV_GVSP_PACKET_PROTOCOL_OVERHEAD;
 	thread_data->cancel = FALSE;
 
 	thread_data->packet_count = 1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]