summaryrefslogtreecommitdiffstats
path: root/ipecamera
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera')
-rw-r--r--ipecamera/image.c4
-rw-r--r--ipecamera/ipecamera.h4
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,