emotion: FPS tracking.

SVN revision: 63830
This commit is contained in:
Cedric BAIL 2011-10-05 09:39:32 +00:00
parent fb371c8aa6
commit 69a70ef632
3 changed files with 36 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "Emotion.h"
int _emotion_gstreamer_log_domain = -1;
Eina_Bool debug_fps = EINA_FALSE;
/* Callbacks to get the eos */
static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data);
@ -1279,6 +1280,8 @@ module_open(Evas_Object *obj,
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL);
if (getenv("EMOTION_FPS_DEBUG")) debug_fps = EINA_TRUE;
eina_threads_init();
*module = &em_module;

View File

@ -125,6 +125,11 @@ struct _Emotion_Gstreamer_Video
int in;
int out;
int frames;
int flapse;
double rtime;
double rlapse;
struct
{
int width;
@ -201,6 +206,7 @@ struct _Emotion_Gstreamer_Message
GstMessage *msg;
};
extern Eina_Bool debug_fps;
extern int _emotion_gstreamer_log_domain;
#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__)

View File

@ -648,6 +648,31 @@ evas_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer)
return GST_FLOW_OK;
}
static void
_update_emotion_fps(Emotion_Gstreamer_Video *ev)
{
double tim;
if (!debug_fps) return ;
tim = ecore_time_get();
ev->frames++;
if (ev->rlapse == 0.0)
{
ev->rlapse = tim;
ev->flapse = ev->frames;
}
else if ((tim - ev->rlapse) >= 0.5)
{
printf("FRAME: %i, FPS: %3.1f\n",
ev->frames,
(ev->frames - ev->flapse) / (tim - ev->rlapse));
ev->rlapse = tim;
ev->flapse = ev->frames;
}
}
static void
evas_video_sink_samsung_main_render(void *data)
{
@ -719,6 +744,8 @@ evas_video_sink_samsung_main_render(void *data)
evas_object_image_size_set(priv->o, stride, elevation);
evas_object_image_fill_set(priv->o, 0, 0, send->ev->fill.width, send->ev->fill.height);
_update_emotion_fps(send->ev);
evas_data = evas_object_image_data_get(priv->o, 1);
if (priv->func)