summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-10-05 09:39:32 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-10-05 09:39:32 +0000
commit69a70ef632d136e735ea1acc2a4dc23998e892f9 (patch)
treef1474ccf7664a50e010591b3a4fcdb15407ea09e /legacy
parentfb371c8aa636070598afd52cd0d8f74117bab744 (diff)
emotion: FPS tracking.
SVN revision: 63830
Diffstat (limited to 'legacy')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c3
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h6
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c27
3 files changed, 36 insertions, 0 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index 48a6e6a727..1e9a40fd58 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -8,6 +8,7 @@
8#include "Emotion.h" 8#include "Emotion.h"
9 9
10int _emotion_gstreamer_log_domain = -1; 10int _emotion_gstreamer_log_domain = -1;
11Eina_Bool debug_fps = EINA_FALSE;
11 12
12/* Callbacks to get the eos */ 13/* Callbacks to get the eos */
13static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data); 14static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data);
@@ -1279,6 +1280,8 @@ module_open(Evas_Object *obj,
1279 1280
1280 ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL); 1281 ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL);
1281 1282
1283 if (getenv("EMOTION_FPS_DEBUG")) debug_fps = EINA_TRUE;
1284
1282 eina_threads_init(); 1285 eina_threads_init();
1283 1286
1284 *module = &em_module; 1287 *module = &em_module;
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
index c4afd13750..2ed284fc9b 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
@@ -125,6 +125,11 @@ struct _Emotion_Gstreamer_Video
125 int in; 125 int in;
126 int out; 126 int out;
127 127
128 int frames;
129 int flapse;
130 double rtime;
131 double rlapse;
132
128 struct 133 struct
129 { 134 {
130 int width; 135 int width;
@@ -201,6 +206,7 @@ struct _Emotion_Gstreamer_Message
201 GstMessage *msg; 206 GstMessage *msg;
202}; 207};
203 208
209extern Eina_Bool debug_fps;
204extern int _emotion_gstreamer_log_domain; 210extern int _emotion_gstreamer_log_domain;
205#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__) 211#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__)
206#define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__) 212#define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__)
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index f2273b7980..cc0fe49fbe 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -649,6 +649,31 @@ evas_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer)
649} 649}
650 650
651static void 651static void
652_update_emotion_fps(Emotion_Gstreamer_Video *ev)
653{
654 double tim;
655
656 if (!debug_fps) return ;
657
658 tim = ecore_time_get();
659 ev->frames++;
660
661 if (ev->rlapse == 0.0)
662 {
663 ev->rlapse = tim;
664 ev->flapse = ev->frames;
665 }
666 else if ((tim - ev->rlapse) >= 0.5)
667 {
668 printf("FRAME: %i, FPS: %3.1f\n",
669 ev->frames,
670 (ev->frames - ev->flapse) / (tim - ev->rlapse));
671 ev->rlapse = tim;
672 ev->flapse = ev->frames;
673 }
674}
675
676static void
652evas_video_sink_samsung_main_render(void *data) 677evas_video_sink_samsung_main_render(void *data)
653{ 678{
654 Emotion_Gstreamer_Buffer *send; 679 Emotion_Gstreamer_Buffer *send;
@@ -719,6 +744,8 @@ evas_video_sink_samsung_main_render(void *data)
719 evas_object_image_size_set(priv->o, stride, elevation); 744 evas_object_image_size_set(priv->o, stride, elevation);
720 evas_object_image_fill_set(priv->o, 0, 0, send->ev->fill.width, send->ev->fill.height); 745 evas_object_image_fill_set(priv->o, 0, 0, send->ev->fill.width, send->ev->fill.height);
721 746
747 _update_emotion_fps(send->ev);
748
722 evas_data = evas_object_image_data_get(priv->o, 1); 749 evas_data = evas_object_image_data_get(priv->o, 1);
723 750
724 if (priv->func) 751 if (priv->func)