[285/906] fix gl framerate in gst caps. Consider position in xoverlay. Fix inversion bettween COLS and ROWS, and move windows.
This commit is contained in:
parent
0d2c7b20fd
commit
4b53383385
@ -362,6 +362,8 @@ gst_gl_window_new (gint width, gint height)
|
|||||||
|
|
||||||
g_debug ("gl window id: %lld\n", (guint64) priv->internal_win_id);
|
g_debug ("gl window id: %lld\n", (guint64) priv->internal_win_id);
|
||||||
|
|
||||||
|
g_debug ("gl window props: x:%d y:%d w:%d h:%d\n", x, y, width, height);
|
||||||
|
|
||||||
wm_atoms[0] = XInternAtom (priv->device, "WM_DELETE_WINDOW", True);
|
wm_atoms[0] = XInternAtom (priv->device, "WM_DELETE_WINDOW", True);
|
||||||
if (wm_atoms[0] == None)
|
if (wm_atoms[0] == None)
|
||||||
g_debug ("Cannot create WM_DELETE_WINDOW\n");
|
g_debug ("Cannot create WM_DELETE_WINDOW\n");
|
||||||
@ -428,6 +430,8 @@ gst_gl_window_set_external_window_id (GstGLWindow *window, guint64 id)
|
|||||||
|
|
||||||
priv->parent = (Window) id;
|
priv->parent = (Window) id;
|
||||||
|
|
||||||
|
g_debug ("set parent window id: %lld\n", id);
|
||||||
|
|
||||||
XGetWindowAttributes (priv->disp_send, priv->parent, &attr);
|
XGetWindowAttributes (priv->disp_send, priv->parent, &attr);
|
||||||
|
|
||||||
XResizeWindow (priv->disp_send, priv->internal_win_id, attr.width, attr.height);
|
XResizeWindow (priv->disp_send, priv->internal_win_id, attr.width, attr.height);
|
||||||
@ -541,13 +545,21 @@ gst_gl_window_draw (GstGLWindow *window)
|
|||||||
XWindowAttributes attr_parent;
|
XWindowAttributes attr_parent;
|
||||||
XGetWindowAttributes (priv->disp_send, priv->parent, &attr_parent);
|
XGetWindowAttributes (priv->disp_send, priv->parent, &attr_parent);
|
||||||
|
|
||||||
if (attr.width != attr_parent.width || attr.height != attr_parent.height)
|
if (attr.x != attr_parent.x || attr.y != attr_parent.y ||
|
||||||
|
attr.width != attr_parent.width || attr.height != attr_parent.height)
|
||||||
{
|
{
|
||||||
XResizeWindow (priv->disp_send, priv->internal_win_id, attr_parent.width, attr_parent.height);
|
XMoveResizeWindow (priv->disp_send, priv->internal_win_id, attr_parent.x, attr_parent.y,
|
||||||
|
attr_parent.width, attr_parent.height);
|
||||||
XSync (priv->disp_send, FALSE);
|
XSync (priv->disp_send, FALSE);
|
||||||
|
|
||||||
|
attr.x = attr_parent.x;
|
||||||
|
attr.y = attr_parent.y;
|
||||||
|
|
||||||
attr.width = attr_parent.width;
|
attr.width = attr_parent.width;
|
||||||
attr.height = attr_parent.height;
|
attr.height = attr_parent.height;
|
||||||
|
|
||||||
|
g_debug ("parent resize: %d, %d, %d, %d\n", attr_parent.x, attr_parent.y,
|
||||||
|
attr_parent.width, attr_parent.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,8 +636,6 @@ gst_gl_window_run_loop (GstGLWindow *window)
|
|||||||
custom_cb (custom_data);
|
custom_cb (custom_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_debug("signal\n");
|
|
||||||
|
|
||||||
g_cond_signal (priv->cond_send_message);
|
g_cond_signal (priv->cond_send_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,12 +252,11 @@ gst_gl_upload_transform_caps (GstBaseTransform* bt,
|
|||||||
GstCaps* newothercaps = gst_caps_new_simple ("video/x-raw-rgb", NULL);
|
GstCaps* newothercaps = gst_caps_new_simple ("video/x-raw-rgb", NULL);
|
||||||
newcaps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
|
newcaps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
|
||||||
gst_caps_append(newcaps, newothercaps);
|
gst_caps_append(newcaps, newothercaps);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
newcaps = gst_caps_new_simple ("video/x-raw-gl", NULL);
|
newcaps = gst_caps_new_simple ("video/x-raw-gl", NULL);
|
||||||
|
|
||||||
structure = gst_structure_copy (gst_caps_get_structure (newcaps, 0));
|
structure = gst_caps_get_structure (newcaps, 0);
|
||||||
|
|
||||||
gst_structure_set (structure,
|
gst_structure_set (structure,
|
||||||
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
||||||
|
@ -45,12 +45,17 @@ static gboolean
|
|||||||
create_actor (GstGLClutterActor *actor) {
|
create_actor (GstGLClutterActor *actor) {
|
||||||
static gint xpos = 0;
|
static gint xpos = 0;
|
||||||
static gint ypos = 0;
|
static gint ypos = 0;
|
||||||
|
Display *disp;
|
||||||
actor->texture = g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
|
actor->texture = g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
|
||||||
"window", actor->win,
|
"window", actor->win,
|
||||||
"automatic-updates", TRUE, NULL);
|
"automatic-updates", TRUE, NULL);
|
||||||
clutter_container_add_actor (CLUTTER_CONTAINER (actor->stage), actor->texture);
|
clutter_container_add_actor (CLUTTER_CONTAINER (actor->stage), actor->texture);
|
||||||
clutter_actor_set_position (actor->texture, xpos, ypos);
|
clutter_actor_set_position (actor->texture, xpos, ypos);
|
||||||
if (xpos > (ROWS-1)*W) {
|
|
||||||
|
disp = clutter_x11_get_default_display ();
|
||||||
|
XMoveResizeWindow (disp, actor->win, xpos, ypos, W, H);
|
||||||
|
|
||||||
|
if (xpos > (COLS-1)*W) {
|
||||||
xpos = 0;
|
xpos = 0;
|
||||||
ypos += H+1;
|
ypos += H+1;
|
||||||
} else
|
} else
|
||||||
@ -140,8 +145,8 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
stage = clutter_stage_get_default ();
|
stage = clutter_stage_get_default ();
|
||||||
clutter_actor_set_size (CLUTTER_ACTOR (stage),
|
clutter_actor_set_size (CLUTTER_ACTOR (stage),
|
||||||
W*ROWS + (ROWS-1),
|
W*COLS + (COLS-1),
|
||||||
H*COLS + (COLS-1));
|
H*ROWS + (ROWS-1));
|
||||||
|
|
||||||
stage_win = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
stage_win = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||||
|
|
||||||
@ -172,7 +177,6 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), srcbin, tee, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), srcbin, tee, NULL);
|
||||||
|
|
||||||
|
|
||||||
for (i=0; i<N_ACTORS; i++) {
|
for (i=0; i<N_ACTORS; i++) {
|
||||||
queue[i] = gst_element_factory_make ("queue", NULL);
|
queue[i] = gst_element_factory_make ("queue", NULL);
|
||||||
upload[i] = gst_element_factory_make ("glupload", NULL);
|
upload[i] = gst_element_factory_make ("glupload", NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user