summaryrefslogtreecommitdiffstats
path: root/ipecamera/image.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-09 09:30:21 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-09 09:30:21 +0100
commit253e5f1ad3526de662e66c12f3e083025436c8e3 (patch)
treef5d64494342ef19fc27a088ee24f5daa3856e06b /ipecamera/image.c
parent097edb90b7826ad7557777cc102de2630f235141 (diff)
downloadpcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.gz
pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.bz2
pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.xz
pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.zip
Parse required event & data_type
Diffstat (limited to 'ipecamera/image.c')
-rw-r--r--ipecamera/image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipecamera/image.c b/ipecamera/image.c
index 89e02a7..4653dc4 100644
--- a/ipecamera/image.c
+++ b/ipecamera/image.c
@@ -418,6 +418,7 @@ static int ipecamera_data_callback(void *user, pcilib_dma_flags_t flags, size_t
if ((bufsize >= 8)&&(!memcmp(buf, frame_magic, sizeof(frame_magic)))) {
//if (ctx->cur_size) ipecamera_new_frame(ctx);
+// printf("%lx\n", ((uint32_t*)buf)[7] & 0xF0000000);
ctx->frame_info[ctx->buffer_pos].info.seqnum = ((uint32_t*)buf)[6] & 0xF0000000;
ctx->frame_info[ctx->buffer_pos].info.offset = ((uint32_t*)buf)[7] & 0xF0000000;
gettimeofday(&ctx->frame_info[ctx->buffer_pos].info.timestamp, NULL);
@@ -865,6 +866,9 @@ void* ipecamera_get(pcilib_context_t *vctx, pcilib_event_id_t event_id, pcilib_e
if (buf_ptr < 0) return NULL;
switch ((ipecamera_data_type_t)data_type) {
+ case IPECAMERA_RAW_DATA:
+ if (size) *size = ctx->frame_info[buf_ptr].raw_size;
+ return ctx->buffer + buf_ptr * ctx->padded_size;
case IPECAMERA_IMAGE_DATA:
if (size) *size = ctx->dim.width * ctx->dim.height * sizeof(ipecamera_pixel_t);
return ctx->buffer + buf_ptr * ctx->dim.width * ctx->dim.height;