{
Smart_Data *sd;
int iw, ih;
+ double tmp;
int changed = 0;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
evas_object_image_size_get(sd->obj, &iw, &ih);
if ((w != iw) || (h != ih))
{
- if (h > 0) sd->ratio = (double)w / (double)h;
- else sd->ratio = 1.0;
evas_object_image_size_set(sd->obj, w, h);
_emotion_image_data_zero(sd->obj);
changed = 1;
}
- if (ratio != sd->ratio)
+ if (h > 0) tmp = (double)w / (double)h;
+ else tmp = 1.0;
+ if (ratio != tmp) tmp = ratio;
+ if (tmp != sd->ratio)
{
- sd->ratio = ratio;
+ sd->ratio = tmp;
changed = 1;
}
- if (changed) evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL);
- evas_object_size_hint_request_set(obj, w, h);
+ if (changed)
+ {
+ evas_object_size_hint_request_set(obj, w, h);
+ evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL);
+ }
}
EAPI void
int width;
int height;
- gboolean update_size;
GstVideoFormat format;
GMutex* buffer_mutex;
// Protected by the buffer mutex
Eina_Bool unlocked : 1;
Eina_Bool preroll : 1;
+ Eina_Bool update_size : 1;
};
#define _do_init(bla) \
priv->p = ecore_pipe_add(evas_video_sink_render_handler, sink);
priv->width = 0;
priv->height = 0;
- priv->update_size = TRUE;
priv->format = GST_VIDEO_FORMAT_UNKNOWN;
priv->data_cond = g_cond_new();
priv->buffer_mutex = g_mutex_new();
priv->preroll = EINA_FALSE;
priv->unlocked = EINA_FALSE;
+ priv->update_size = EINA_TRUE;
}
{
priv->width = width;
priv->height = height;
- priv->update_size = TRUE;
+ priv->update_size = EINA_TRUE;
}
printf("format :");
if (priv->update_size)
{
evas_object_image_size_set(priv->o, priv->width, priv->height);
- evas_object_image_fill_set(priv->o, 0, 0, priv->width, priv->height);
- priv->update_size = FALSE;
+ if (!priv->preroll) priv->update_size = FALSE;
}
evas_data = (unsigned char *)evas_object_image_data_get(priv->o, 1);