summaryrefslogtreecommitdiff
path: root/src/cheese-stage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cheese-stage.c')
-rw-r--r--src/cheese-stage.c86
1 files changed, 17 insertions, 69 deletions
diff --git a/src/cheese-stage.c b/src/cheese-stage.c
index 59c93c8..089290d 100644
--- a/src/cheese-stage.c
+++ b/src/cheese-stage.c
@@ -35,48 +35,6 @@
#define W 160
#define H 120
-
-/*static ClutterX11FilterReturn event_filter (XEvent * ev, ClutterEvent * cev,
- gpointer unused);
-
-static ClutterX11FilterReturn
-event_filter (XEvent * ev, ClutterEvent * cev, gpointer data)
-{
- Window *windows = (Window *) data;
- gint i;
- switch (ev->type) {
- case MapRequest:
- g_message ("map request");
- return CLUTTER_X11_FILTER_CONTINUE;
- case MapNotify:
- if (ev->xmap.window == windows[N_ACTORS]) {
- g_message ("stage map");
-// XMapSubwindows (ev->xmap.display, ev->xmap.window);
- for (i = 0; i < N_ACTORS; i++) {
- XMapWindow (ev->xmap.display, windows[i]);
- }
- XSync (ev->xmap.display, FALSE);
- } else
- g_message ("map");
- XMapSubwindows (ev->xmap.display, ev->xmap.window);
- return CLUTTER_X11_FILTER_CONTINUE;
- case UnmapNotify:
- if (ev->xmap.window == windows[N_ACTORS]) {
- g_message ("stage unmap");
-// XUnmapSubwindows (ev->xmap.display, ev->xmap.window);
- for (i = 0; i < N_ACTORS; i++) {
- XUnmapWindow (ev->xmap.display, windows[i]);
- }
- XSync (ev->xmap.display, FALSE);
- } else
- g_message ("unmap");
- return CLUTTER_X11_FILTER_CONTINUE;
- default:
- return CLUTTER_X11_FILTER_CONTINUE;
- }
-}
-*/
-
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, gpointer data)
{
@@ -100,7 +58,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
g_object_get (G_OBJECT (actor[count]), "window", &win, NULL);
g_message ("adding actor: %d win: %d", count, win);
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
- win);
+ win);
count++;
}
@@ -110,26 +68,6 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
return GST_BUS_DROP;
}
-#if 0
-void
-apply_fx (GstElement * element, const gchar * fx)
-{
- GEnumClass *p_class;
-
- /* from fxtest ;) */
- /* heeeellppppp!! */
- p_class =
- G_PARAM_SPEC_ENUM (g_object_class_find_property (G_OBJECT_GET_CLASS
- (G_OBJECT (data)), "effect")
- )->enum_class;
-
- g_print ("setting: %s - %s\n", fx, g_enum_get_value_by_nick (p_class,
- fx)->value_name);
- g_object_set (G_OBJECT (element), "effect", g_enum_get_value_by_nick (p_class,
- fx)->value, NULL);
-}
-#endif
-
int
main (int argc, char *argv[])
{
@@ -165,17 +103,20 @@ main (int argc, char *argv[])
}
stage = clutter_stage_get_default ();
+
clutter_actor_set_size (CLUTTER_ACTOR (stage),
W * COLS + (COLS - 1), H * ROWS + (ROWS - 1));
-
+
clutter_color_from_string (&color, "DarkSlateGrey");
clutter_stage_set_color (CLUTTER_STAGE (stage), &color);
+
// clutter_stage_set_user_resizable (stage, TRUE);
for (i = 0; i < N_ACTORS; i++) {
actor[i] = cheese_texture_new ();
- clutter_container_add_actor (CLUTTER_CONTAINER (stage),
- actor[i]);
+ clutter_actor_set_scale_with_gravity (actor[i], 0.95, 0.95,
+ CLUTTER_GRAVITY_CENTER);
+ clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor[i]);
clutter_actor_set_position (actor[i], xpos, ypos);
if (xpos > (COLS - 1) * W) {
xpos = 0;
@@ -184,10 +125,17 @@ main (int argc, char *argv[])
xpos += W + 1;
clutter_actor_show (actor[i]);
}
-// clutter_x11_add_filter (event_filter, actor);
+
+/* desc = g_strdup_printf ("v4l2src ! "
+ "video/x-raw-yuv, width=640, height=480, framerate=30/1 ! "
+ "videoscale ! videorate ! "
+ "video/x-raw-yuv, width=%d, height=%d, framerate=15/1 ! "
+ "identity", W, H);
+*/
desc = g_strdup_printf ("videotestsrc ! "
- "video/x-raw-rgb, width=%d, height=%d !" "identity", W, H);
+ "video/x-raw-rgb, width=%d, height=%d, framerate=10/1 ! ffmpegcolorspace ! identity",
+ W, H);
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
srcbin = gst_parse_bin_from_description (desc, TRUE, NULL);
@@ -200,7 +148,7 @@ main (int argc, char *argv[])
for (i = 0; i < N_ACTORS; i++) {
queue[i] = gst_element_factory_make ("queue", NULL);
- sink[i] = gst_element_factory_make ("glimagesink", NULL);
+ sink[i] = gst_element_factory_make ("ximagesink", NULL);
gst_bin_add_many (GST_BIN (pipeline), queue[i], sink[i], NULL);
}