From 253e5f1ad3526de662e66c12f3e083025436c8e3 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 9 Dec 2011 09:30:21 +0100 Subject: Parse required event & data_type --- ipecamera/image.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ipecamera/image.c') 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; -- cgit v1.2.3