summaryrefslogtreecommitdiffstats
path: root/ipecamera/reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera/reader.c')
-rw-r--r--ipecamera/reader.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ipecamera/reader.c b/ipecamera/reader.c
index c11bb9d..b9b7193 100644
--- a/ipecamera/reader.c
+++ b/ipecamera/reader.c
@@ -129,7 +129,7 @@ static int ipecamera_data_callback(void *user, pcilib_dma_flags_t flags, size_t
#endif /* IPECAMERA_DEBUG_RAW_PACKETS */
if (invalid_frame_id != ctx->event_id) {
- pcilib_warning("Invalid DMA packets received, first is %u bytes long, current event %lu", bufsize, ctx->event_id);
+ pcilib_warning("No frame magic in DMA packet of %u bytes, current event %lu", bufsize, ctx->event_id);
invalid_frame_id = ctx->event_id;
}
@@ -155,12 +155,11 @@ static int ipecamera_data_callback(void *user, pcilib_dma_flags_t flags, size_t
if ((bufsize >= 8)&&(!memcmp(buf, frame_magic, sizeof(frame_magic)))) {
size_t n_lines = ((uint32_t*)buf)[5] & 0x7FF;
ipecamera_compute_buffer_size(ctx, n_lines);
-/*
- // Not implemented in hardware yet
- ctx->frame[ctx->buffer_pos].event.info.seqnum = ((uint32_t*)buf)[6] & 0xF0000000;
- ctx->frame[ctx->buffer_pos].event.info.offset = ((uint32_t*)buf)[7] & 0xF0000000;
-*/
- ctx->frame[ctx->buffer_pos].event.info.seqnum = ctx->event_id + 1;
+
+ ctx->frame[ctx->buffer_pos].event.info.seqnum = ((uint32_t*)buf)[6] & 0x1FFFFFF;
+ ctx->frame[ctx->buffer_pos].event.info.offset = (((uint32_t*)buf)[7] & 0xFFFFFF) * 80;
+
+// ctx->frame[ctx->buffer_pos].event.info.seqnum = ctx->event_id + 1;
gettimeofday(&ctx->frame[ctx->buffer_pos].event.info.timestamp, NULL);
} else {