{
evas_object_del(em);
}
+ else if (!strcmp(ev->keyname, "l"))
+ {
+ // force frame dropping
+ sleep(5);
+ }
else
{
fprintf(stderr, "unhandled key: %s\n", ev->keyname);
static void
_unlock(void *data, void *id, void *const *pixels)
{
- struct _App *app = data;
-
- if (!app->playing)
- return;
-
- sem_wait(&app->vs->lock);
- app->vs->frame.last = app->vs->frame.player;
- app->vs->frame.player = app->vs->frame.next;
- app->vs->frame.next = app->vs->frame.last;
-
- sem_post(&app->vs->lock);
}
static void
if (!app->playing)
return;
- _send_cmd(app, EM_RESULT_FRAME_NEW);
+ sem_wait(&app->vs->lock);
+ app->vs->frame.last = app->vs->frame.player;
+ app->vs->frame.player = app->vs->frame.next;
+ app->vs->frame.next = app->vs->frame.last;
+ if (!app->vs->frame_drop++)
+ _send_cmd(app, EM_RESULT_FRAME_NEW);
+ sem_post(&app->vs->lock);
}
static void *
vs->frame.player = 1;
vs->frame.last = 2;
vs->frame.next = 2;
+ vs->frame_drop = 0;
sem_init(&vs->lock, 1, 1);
ev->frame.frames[0] = (unsigned char *)vs + sizeof(*vs);
ev->frame.frames[1] = (unsigned char *)vs + sizeof(*vs) + vs->height * vs->width * vs->pitch;
{
if (ev->opening || ev->closing)
return;
- if (!ev->drop++)
- _emotion_frame_new(ev->obj);
+ _emotion_frame_new(ev->obj);
}
static void
}
*bgra_data = ev->frame.frames[ev->shared->frame.emotion];
+ if (ev->shared->frame_drop > 1)
+ WRN("dropped frames: %d", ev->shared->frame_drop - 1);
+ ev->shared->frame_drop = 0;
+
// unlock frame here
sem_post(&ev->shared->lock);
ev->drop = 0;