From adb36212be886985dbaf397d7d2dd875b3d4aab8 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 29 Mar 2015 18:05:58 +0200 Subject: Fix frame size computation in ipecamera and few debuging options --- ipecamera/data.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ipecamera/data.c') diff --git a/ipecamera/data.c b/ipecamera/data.c index fb29018..bdc067e 100644 --- a/ipecamera/data.c +++ b/ipecamera/data.c @@ -61,6 +61,13 @@ inline static int ipecamera_decode_frame(ipecamera_t *ctx, pcilib_event_id_t eve res = ufo_decoder_decode_frame(ctx->ipedec, ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, pixels, &ctx->frame[buf_ptr].event.meta); // puts("done\n"); if (!res) { +#ifdef IPECAMERA_DEBUG_BROKEN_FRAMES + char name[128]; + sprintf(name, "%s/broken.%4lu", IPECAMERA_DEBUG_BROKEN_FRAMES, ctx->event_id); + FILE *f = fopen("/mnt/frames/broken", "w"); + fwrite(ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, 1, f); + fclose(f); +#endif /* IPECAMERA_DEBUG_BROKEN_FRAMES */ err = PCILIB_ERROR_FAILED; ctx->frame[buf_ptr].event.image_broken = err; goto ready; -- cgit v1.2.3