/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/data.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-03-29 16:05:58 UTC
  • Revision ID: csa@suren.me-20150329160558-326s1v2vlh850s6t
Fix frame size computation in ipecamera and few debuging options

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    res = ufo_decoder_decode_frame(ctx->ipedec, ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, pixels, &ctx->frame[buf_ptr].event.meta);
62
62
//    puts("done\n");
63
63
    if (!res) {
 
64
#ifdef IPECAMERA_DEBUG_BROKEN_FRAMES
 
65
        char name[128];
 
66
        sprintf(name, "%s/broken.%4lu", IPECAMERA_DEBUG_BROKEN_FRAMES, ctx->event_id);
 
67
        FILE *f = fopen("/mnt/frames/broken", "w");
 
68
        fwrite(ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, 1, f);
 
69
        fclose(f);
 
70
#endif /* IPECAMERA_DEBUG_BROKEN_FRAMES */
64
71
        err = PCILIB_ERROR_FAILED;
65
72
        ctx->frame[buf_ptr].event.image_broken = err;
66
73
        goto ready;