#include ClutterActor *rect; /* um... */ void input_cb (ClutterStage *stage, ClutterEvent *event, gpointer user_data) { ClutterVideoTexture *vtex = CLUTTER_VIDEO_TEXTURE(user_data); static gint paused = 0; if (event->type == CLUTTER_KEY_RELEASE) { if (paused) { clutter_media_set_playing (CLUTTER_MEDIA(vtex), TRUE); paused = 0; } else { clutter_media_set_playing (CLUTTER_MEDIA(vtex), FALSE); paused = 1; } } } void size_change (ClutterTexture *texture, gint width, gint height, gpointer user_data) { ClutterActor *stage; ClutterGeometry stage_geom; gint vid_width, vid_height, new_y, new_height; stage = clutter_stage_get_default (); clutter_actor_get_geometry (stage, &stage_geom); clutter_texture_get_base_size (texture, &vid_width, &vid_height); printf("*** vid : %ix%i stage %ix%i ***\n", vid_width, vid_height, stage_geom.width, stage_geom.height); new_height = ( vid_height * stage_geom.width ) / vid_width; new_y = (stage_geom.height - new_height) / 2; clutter_actor_set_position (CLUTTER_ACTOR (texture), 0, new_y); clutter_actor_set_size (CLUTTER_ACTOR (texture), stage_geom.width, new_height); // clutter_actor_set_opacity (CLUTTER_ACTOR (texture), 50); printf("*** Pos set to +%i+%i , %ix%i ***\n", 0, new_y, stage_geom.width, new_height); } void tick (GObject *object, GParamSpec *pspec, ClutterLabel *label) { ClutterVideoTexture *vtex; gint w, h, position, duration; gchar buf[256]; vtex = CLUTTER_VIDEO_TEXTURE(object); position = clutter_media_get_position (CLUTTER_MEDIA(vtex)); duration = clutter_media_get_duration (CLUTTER_MEDIA(vtex)); g_snprintf(buf, 256, "%i / %i", position, duration); clutter_label_set_text (label, buf); clutter_texture_get_base_size (CLUTTER_TEXTURE(label), &w, &h); clutter_actor_set_size(rect, w+10, h+10); } int main (int argc, char *argv[]) { ClutterActor *label, *vtexture, *ctexture; ClutterActor *stage; ClutterColor rect_color = { 0xde, 0xde, 0xdf, 0xaa }; ClutterColor stage_color = { 0x00, 0x00, 0x00, 0x00 }; GError *err = NULL; if (argc < 2) g_error("%s