[aravis] gv_stream: don't invalidate frame with more data than expected.



commit 74f62b58f7e4871986350f83f3035b20222a1f66
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Thu Apr 14 09:31:32 2011 +0200

    gv_stream: don't invalidate frame with more data than expected.
    
    Sometime Prosilica GC1380 camera send more data than expected in the last
    data packet. It is may be some data used internally by Prosilica software.

 src/arvgvstream.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/arvgvstream.c b/src/arvgvstream.c
index ca68c09..89ca29e 100644
--- a/src/arvgvstream.c
+++ b/src/arvgvstream.c
@@ -228,9 +228,14 @@ _process_data_block (ArvGvStreamThreadData *thread_data,
 	block_end = block_size + block_offset;
 
 	if (block_end > frame->buffer->size) {
-		arv_gvsp_packet_debug (packet, read_count);
-		frame->buffer->status = ARV_BUFFER_STATUS_SIZE_MISMATCH;
-		return;
+		arv_debug ("stream-thread", "[GvStream::_process_data_block] %d unexpected bytes in packet %u"
+			   " for frame %u",
+			   block_end, frame->buffer->size,
+			   packet_id, frame->frame_id);
+		thread_data->n_size_mismatch_errors++;
+
+		block_end = frame->buffer->size;
+		block_size = block_end - block_offset;
 	}
 
 	memcpy (frame->buffer->data + block_offset, &packet->data, block_size);
@@ -429,9 +434,6 @@ _close_frame (ArvGvStreamThreadData *thread_data, ArvGvStreamFrameData *frame)
 		}
 	}
 
-	if (frame->buffer->status == ARV_BUFFER_STATUS_SIZE_MISMATCH)
-		thread_data->n_size_mismatch_errors++;
-
 	if (thread_data->callback != NULL)
 		thread_data->callback (thread_data->user_data,
 				       ARV_STREAM_CALLBACK_TYPE_BUFFER_DONE,



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