diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-09 09:30:21 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-09 09:30:21 +0100 |
commit | 253e5f1ad3526de662e66c12f3e083025436c8e3 (patch) | |
tree | f5d64494342ef19fc27a088ee24f5daa3856e06b /ipecamera | |
parent | 097edb90b7826ad7557777cc102de2630f235141 (diff) | |
download | pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.gz pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.bz2 pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.tar.xz pcitool-253e5f1ad3526de662e66c12f3e083025436c8e3.zip |
Parse required event & data_type
Diffstat (limited to 'ipecamera')
-rw-r--r-- | ipecamera/image.c | 4 | ||||
-rw-r--r-- | ipecamera/ipecamera.h | 4 |
2 files changed, 6 insertions, 2 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; diff --git a/ipecamera/ipecamera.h b/ipecamera/ipecamera.h index c89c6c9..b923b1f 100644 --- a/ipecamera/ipecamera.h +++ b/ipecamera/ipecamera.h @@ -10,8 +10,8 @@ typedef struct { } ipecamera_image_dimensions_t; typedef enum { - IPECAMERA_RAW_DATA = 0, - IPECAMERA_IMAGE_DATA = 1, + IPECAMERA_IMAGE_DATA = 0, + IPECAMERA_RAW_DATA = 1, IPECAMERA_DIMENSIONS = 0x8000, IPECAMERA_IMAGE_REGION = 0x8010, IPECAMERA_PACKED_IMAGE = 0x8020, |