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

  • Committer: Suren A. Chilingaryan
  • Date: 2015-05-01 17:21:14 UTC
  • Revision ID: csa@suren.me-20150501172114-zhfeilae8k10kvnx
Use pcitool debugging API

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    printf("%lu\n", ctx->raw_size);*/
62
62
    res = ufo_decoder_decode_frame(ctx->ipedec, ctx->buffer + buf_ptr * ctx->padded_size, ctx->frame[buf_ptr].event.raw_size, pixels, &ctx->frame[buf_ptr].event.meta);
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(name, "w");
68
 
        if (f) {
69
 
            fwrite(ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, 1, f);
70
 
            fclose(f);
71
 
        }
72
 
#endif /* IPECAMERA_DEBUG_BROKEN_FRAMES */
 
64
        ipecamera_debug_buffer(BROKEN_FRAMES, ctx->frame[buf_ptr].event.raw_size, ctx->buffer + buf_ptr * ctx->padded_size, PCILIB_DEBUG_BUFFER_MKDIR, "broken_frame.%4lu", ctx->event_id);
73
65
        err = PCILIB_ERROR_FAILED;
74
66
        ctx->frame[buf_ptr].event.image_broken = err;
75
67
        goto ready;