[aravis] gv_stream: store region position and pixel format in buffers.



commit 3f7234905012e3bfdc853eef522f4b1fdfffb4e3
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Mon May 10 10:57:10 2010 +0200

    gv_stream: store region position and pixel format in buffers.

 src/arvbuffer.h   |    3 +++
 src/arvgvsp.h     |   34 +++++++++++++++++++++++++++++++---
 src/arvgvstream.c |    4 ++++
 3 files changed, 38 insertions(+), 3 deletions(-)
---
diff --git a/src/arvbuffer.h b/src/arvbuffer.h
index 5ece040..a1b982e 100644
--- a/src/arvbuffer.h
+++ b/src/arvbuffer.h
@@ -57,8 +57,11 @@ struct _ArvBuffer {
 	ArvBufferStatus status;
 
 	guint32 frame_id;
+	guint32 x;
+	guint32 y;
 	guint32 width;
 	guint32 height;
+	ArvPixelFormat pixel_format;
 };
 
 struct _ArvBufferClass {
diff --git a/src/arvgvsp.h b/src/arvgvsp.h
index d4ed45a..4698db2 100644
--- a/src/arvgvsp.h
+++ b/src/arvgvsp.h
@@ -41,11 +41,12 @@ typedef struct {
 
 typedef struct {
 	guint32 data0;
-	guint32 data1;
-	guint32 data2;
-	guint32 data3;
+	guint64 timestamp;
+	guint32 pixel_format;
 	guint32 width;
 	guint32 height;
+	guint32	x;
+	guint32	y;
 } __attribute__((__packed__)) ArvGvspDataLeader;
 
 typedef struct {
@@ -79,6 +80,24 @@ arv_gvsp_packet_get_frame_id (const ArvGvspPacket *packet)
 }
 
 static inline guint32
+arv_gvsp_packet_get_x (const ArvGvspPacket *packet)
+{
+	ArvGvspDataLeader *leader;
+
+	leader = (ArvGvspDataLeader *) &packet->data;
+	return g_ntohl (leader->x);
+}
+
+static inline guint32
+arv_gvsp_packet_get_y (const ArvGvspPacket *packet)
+{
+	ArvGvspDataLeader *leader;
+
+	leader = (ArvGvspDataLeader *) &packet->data;
+	return g_ntohl (leader->y);
+}
+
+static inline guint32
 arv_gvsp_packet_get_width (const ArvGvspPacket *packet)
 {
 	ArvGvspDataLeader *leader;
@@ -96,6 +115,15 @@ arv_gvsp_packet_get_height (const ArvGvspPacket *packet)
 	return g_ntohl (leader->height);
 }
 
+static inline ArvPixelFormat
+arv_gvsp_packet_get_pixel_format (const ArvGvspPacket *packet)
+{
+	ArvGvspDataLeader *leader;
+
+	leader = (ArvGvspDataLeader *) &packet->data;
+	return g_ntohl (leader->pixel_format);
+}
+
 static inline size_t
 arv_gvsp_packet_get_data_size (size_t packet_size)
 {
diff --git a/src/arvgvstream.c b/src/arvgvstream.c
index c39c7e0..d301920 100644
--- a/src/arvgvstream.c
+++ b/src/arvgvstream.c
@@ -166,9 +166,13 @@ arv_gv_stream_thread (void *data)
 
 					arv_gv_stream_update_socket (thread_data, buffer);
 
+					buffer->x = arv_gvsp_packet_get_x (packet);
+					buffer->y = arv_gvsp_packet_get_y (packet);
 					buffer->width = arv_gvsp_packet_get_width (packet);
 					buffer->height = arv_gvsp_packet_get_height (packet);
+					buffer->pixel_format = arv_gvsp_packet_get_pixel_format (packet);
 					buffer->frame_id = arv_gvsp_packet_get_frame_id (packet);
+
 					buffer->status = ARV_BUFFER_STATUS_FILLING;
 					block_id = 0;
 					offset = 0;



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