/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to ipecamera/image.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-12-09 08:30:21 UTC
  • Revision ID: csa@dside.dyndns.org-20111209083021-b031rh6pr033to38
Parse required event & data_type

Show diffs side-by-side

added added

removed removed

Lines of Context:
418
418
 
419
419
        if ((bufsize >= 8)&&(!memcmp(buf, frame_magic, sizeof(frame_magic)))) {
420
420
            //if (ctx->cur_size) ipecamera_new_frame(ctx);
 
421
//          printf("%lx\n", ((uint32_t*)buf)[7] & 0xF0000000);
421
422
            ctx->frame_info[ctx->buffer_pos].info.seqnum = ((uint32_t*)buf)[6] & 0xF0000000;
422
423
            ctx->frame_info[ctx->buffer_pos].info.offset = ((uint32_t*)buf)[7] & 0xF0000000;
423
424
            gettimeofday(&ctx->frame_info[ctx->buffer_pos].info.timestamp, NULL);
865
866
    if (buf_ptr < 0) return NULL;
866
867
    
867
868
    switch ((ipecamera_data_type_t)data_type) {
 
869
        case IPECAMERA_RAW_DATA:
 
870
            if (size) *size = ctx->frame_info[buf_ptr].raw_size;
 
871
            return ctx->buffer + buf_ptr * ctx->padded_size;
868
872
        case IPECAMERA_IMAGE_DATA:
869
873
            if (size) *size = ctx->dim.width * ctx->dim.height * sizeof(ipecamera_pixel_t);
870
874
            return ctx->buffer + buf_ptr * ctx->dim.width * ctx->dim.height;