summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-08-13 17:25:54 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-08-13 17:25:54 +0200
commite298baba17f9d4b9b4631eb93724a44b822ff92c (patch)
tree9a5bb26fd71c000e841884228eb72061aa8d53a9
parentdc54794546c90f56a7399406c6a7baf9603ae07c (diff)
downloadipecamera-e298baba17f9d4b9b4631eb93724a44b822ff92c.tar.gz
ipecamera-e298baba17f9d4b9b4631eb93724a44b822ff92c.tar.bz2
ipecamera-e298baba17f9d4b9b4631eb93724a44b822ff92c.tar.xz
ipecamera-e298baba17f9d4b9b4631eb93724a44b822ff92c.zip
Add few warning about problems with frames
-rw-r--r--data.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/data.c b/data.c
index d636097..7e219da 100644
--- a/data.c
+++ b/data.c
@@ -58,6 +58,7 @@ 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->frame[buf_ptr].event.raw_size, pixels, &ctx->frame[buf_ptr].event.meta);
if (!res) {
+ pcilib_warning("Decoding of frame %u has failed, ufodecode returns error %i", ctx->event_id, res);
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);
err = PCILIB_ERROR_FAILED;
ctx->frame[buf_ptr].event.image_broken = err;
@@ -192,8 +193,11 @@ int ipecamera_get(pcilib_context_t *vctx, pcilib_event_id_t event_id, pcilib_eve
ipecamera_debug(API, "ipecamera: get (data)");
buf_ptr = ipecamera_resolve_event_id(ctx, event_id);
- if (buf_ptr < 0) return PCILIB_ERROR_OVERWRITTEN;
-
+ if (buf_ptr < 0) {
+ pcilib_warning("The data of requested frame %zu was overwritten", event_id);
+ return PCILIB_ERROR_OVERWRITTEN;
+ }
+
switch ((ipecamera_data_type_t)data_type) {
case IPECAMERA_RAW_DATA:
raw_size = ctx->frame[buf_ptr].event.raw_size;