summaryrefslogtreecommitdiffstats
path: root/ipecamera/reader.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2014-02-22 06:21:27 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2014-02-22 06:21:27 +0100
commitb53c207619ccbb090b170b1eda5c19bf3ea94eb0 (patch)
treef5e4c7c5142193235d7b0345b5af23a8272f52c6 /ipecamera/reader.c
parent5f4b3a8bb26c54e7dac29ffc580ffd4e4386471a (diff)
downloadpcitool-b53c207619ccbb090b170b1eda5c19bf3ea94eb0.tar.gz
pcitool-b53c207619ccbb090b170b1eda5c19bf3ea94eb0.tar.bz2
pcitool-b53c207619ccbb090b170b1eda5c19bf3ea94eb0.tar.xz
pcitool-b53c207619ccbb090b170b1eda5c19bf3ea94eb0.zip
Provide offset header in the camera
Diffstat (limited to 'ipecamera/reader.c')
-rw-r--r--ipecamera/reader.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipecamera/reader.c b/ipecamera/reader.c
index af99fb5..5fadaca 100644
--- a/ipecamera/reader.c
+++ b/ipecamera/reader.c
@@ -155,11 +155,14 @@ 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 = ((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);