diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2011-06-24 14:11:24 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2011-06-24 14:11:24 +0000 |
commit | 1724785989b3075613e6253e512780d5db0c7aa4 (patch) | |
tree | 2390c43cb7ae8d424e1c569ed742641904fb72e8 | |
parent | 923bff4e1cd8afcf9e6157affa989384befd262a (diff) |
emotion: advertise only on frame size change.
SVN revision: 60665
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 17 | ||||
-rw-r--r-- | legacy/emotion/src/modules/gstreamer/emotion_sink.c | 9 |
2 files changed, 15 insertions, 11 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index f67ec10701..7cfe946d49 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -1162,25 +1162,30 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio) | |||
1162 | { | 1162 | { |
1163 | Smart_Data *sd; | 1163 | Smart_Data *sd; |
1164 | int iw, ih; | 1164 | int iw, ih; |
1165 | double tmp; | ||
1165 | int changed = 0; | 1166 | int changed = 0; |
1166 | 1167 | ||
1167 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1168 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1168 | evas_object_image_size_get(sd->obj, &iw, &ih); | 1169 | evas_object_image_size_get(sd->obj, &iw, &ih); |
1169 | if ((w != iw) || (h != ih)) | 1170 | if ((w != iw) || (h != ih)) |
1170 | { | 1171 | { |
1171 | if (h > 0) sd->ratio = (double)w / (double)h; | ||
1172 | else sd->ratio = 1.0; | ||
1173 | evas_object_image_size_set(sd->obj, w, h); | 1172 | evas_object_image_size_set(sd->obj, w, h); |
1174 | _emotion_image_data_zero(sd->obj); | 1173 | _emotion_image_data_zero(sd->obj); |
1175 | changed = 1; | 1174 | changed = 1; |
1176 | } | 1175 | } |
1177 | if (ratio != sd->ratio) | 1176 | if (h > 0) tmp = (double)w / (double)h; |
1177 | else tmp = 1.0; | ||
1178 | if (ratio != tmp) tmp = ratio; | ||
1179 | if (tmp != sd->ratio) | ||
1178 | { | 1180 | { |
1179 | sd->ratio = ratio; | 1181 | sd->ratio = tmp; |
1180 | changed = 1; | 1182 | changed = 1; |
1181 | } | 1183 | } |
1182 | if (changed) evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL); | 1184 | if (changed) |
1183 | evas_object_size_hint_request_set(obj, w, h); | 1185 | { |
1186 | evas_object_size_hint_request_set(obj, w, h); | ||
1187 | evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL); | ||
1188 | } | ||
1184 | } | 1189 | } |
1185 | 1190 | ||
1186 | EAPI void | 1191 | EAPI void |
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c index 54c3a66c3c..65b81387b4 100644 --- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c +++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c | |||
@@ -36,7 +36,6 @@ struct _EvasVideoSinkPrivate { | |||
36 | 36 | ||
37 | int width; | 37 | int width; |
38 | int height; | 38 | int height; |
39 | gboolean update_size; | ||
40 | GstVideoFormat format; | 39 | GstVideoFormat format; |
41 | 40 | ||
42 | GMutex* buffer_mutex; | 41 | GMutex* buffer_mutex; |
@@ -52,6 +51,7 @@ struct _EvasVideoSinkPrivate { | |||
52 | // Protected by the buffer mutex | 51 | // Protected by the buffer mutex |
53 | Eina_Bool unlocked : 1; | 52 | Eina_Bool unlocked : 1; |
54 | Eina_Bool preroll : 1; | 53 | Eina_Bool preroll : 1; |
54 | Eina_Bool update_size : 1; | ||
55 | }; | 55 | }; |
56 | 56 | ||
57 | #define _do_init(bla) \ | 57 | #define _do_init(bla) \ |
@@ -93,12 +93,12 @@ evas_video_sink_init(EvasVideoSink* sink, EvasVideoSinkClass* klass __UNUSED__) | |||
93 | priv->p = ecore_pipe_add(evas_video_sink_render_handler, sink); | 93 | priv->p = ecore_pipe_add(evas_video_sink_render_handler, sink); |
94 | priv->width = 0; | 94 | priv->width = 0; |
95 | priv->height = 0; | 95 | priv->height = 0; |
96 | priv->update_size = TRUE; | ||
97 | priv->format = GST_VIDEO_FORMAT_UNKNOWN; | 96 | priv->format = GST_VIDEO_FORMAT_UNKNOWN; |
98 | priv->data_cond = g_cond_new(); | 97 | priv->data_cond = g_cond_new(); |
99 | priv->buffer_mutex = g_mutex_new(); | 98 | priv->buffer_mutex = g_mutex_new(); |
100 | priv->preroll = EINA_FALSE; | 99 | priv->preroll = EINA_FALSE; |
101 | priv->unlocked = EINA_FALSE; | 100 | priv->unlocked = EINA_FALSE; |
101 | priv->update_size = EINA_TRUE; | ||
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
@@ -206,7 +206,7 @@ gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps) | |||
206 | { | 206 | { |
207 | priv->width = width; | 207 | priv->width = width; |
208 | priv->height = height; | 208 | priv->height = height; |
209 | priv->update_size = TRUE; | 209 | priv->update_size = EINA_TRUE; |
210 | } | 210 | } |
211 | 211 | ||
212 | printf("format :"); | 212 | printf("format :"); |
@@ -382,8 +382,7 @@ static void evas_video_sink_render_handler(void *data, | |||
382 | if (priv->update_size) | 382 | if (priv->update_size) |
383 | { | 383 | { |
384 | evas_object_image_size_set(priv->o, priv->width, priv->height); | 384 | evas_object_image_size_set(priv->o, priv->width, priv->height); |
385 | evas_object_image_fill_set(priv->o, 0, 0, priv->width, priv->height); | 385 | if (!priv->preroll) priv->update_size = FALSE; |
386 | priv->update_size = FALSE; | ||
387 | } | 386 | } |
388 | 387 | ||
389 | evas_data = (unsigned char *)evas_object_image_data_get(priv->o, 1); | 388 | evas_data = (unsigned char *)evas_object_image_data_get(priv->o, 1); |