summaryrefslogtreecommitdiffstats
path: root/ipecamera/data.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-03-29 18:05:58 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-03-29 18:05:58 +0200
commitadb36212be886985dbaf397d7d2dd875b3d4aab8 (patch)
tree292b252b22f823eb4eb8753c7d437b723e23a85b /ipecamera/data.c
parentb222af943c405df509eb9df084d203da4fbd324e (diff)
downloadipecamera-adb36212be886985dbaf397d7d2dd875b3d4aab8.tar.gz
ipecamera-adb36212be886985dbaf397d7d2dd875b3d4aab8.tar.bz2
ipecamera-adb36212be886985dbaf397d7d2dd875b3d4aab8.tar.xz
ipecamera-adb36212be886985dbaf397d7d2dd875b3d4aab8.zip
Fix frame size computation in ipecamera and few debuging options
Diffstat (limited to 'ipecamera/data.c')
-rw-r--r--ipecamera/data.c7
1 files changed, 7 insertions, 0 deletions
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;