[273/906] add some debug outputs about Visual and XVisualInfo

This commit is contained in:
Julien Isorce 2008-11-19 00:07:22 +01:00 committed by Matthew Waters
parent 4ffac649e9
commit 94f74d4b50
2 changed files with 43 additions and 5 deletions

View file

@ -92,6 +92,8 @@ gst_gl_window_finalize (GObject * object)
glXDestroyContext (priv->device, priv->gl_context);
XFree (priv->visual_info);
XDestroyWindow (priv->device, priv->internal_win_id);
XSync (priv->device, FALSE);
@ -219,13 +221,25 @@ gst_gl_window_new (gint width, gint height)
gint attrib[] = {
GLX_RGBA,
GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1,
GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
GLX_DEPTH_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_STENCIL_SIZE, 8,
GLX_ACCUM_RED_SIZE, 8,
GLX_ACCUM_GREEN_SIZE, 8,
GLX_ACCUM_BLUE_SIZE, 8,
GLX_ACCUM_ALPHA_SIZE, 8,
GLX_LEVEL, 0,
None
};
Bool ret = FALSE;
gint error_base;
gint event_base;
//XVisualInfo templ;
//gint unused;
XSetWindowAttributes win_attr;
XTextProperty text_property;
@ -263,8 +277,30 @@ gst_gl_window_new (gint width, gint height)
priv->connection = ConnectionNumber (priv->device);
ret = glXQueryExtension (priv->device, &error_base, &event_base);
if (!ret)
g_debug ("No GLX extension");
priv->visual_info = glXChooseVisual (priv->device, priv->screen_num, attrib);
//priv->visual_info = XGetVisualInfo(priv->device, VisualNoMask, &templ, &unused);
if (priv->visual_info->visual != priv->visual)
g_debug ("selected visual is different from the default\n");
if (priv->visual_info->class == TrueColor)
g_debug ("visual is using TrueColor\n");
g_debug ("visual ID: %d\n", (gint)XVisualIDFromVisual(priv->visual_info->visual));
g_debug ("visual info screen: %d\n", priv->visual_info->screen);
g_debug ("visual info visualid: %d\n", (gint) priv->visual_info->visualid);
g_debug ("visual info depth: %d\n", priv->visual_info->depth);
g_debug ("visual info class: %d\n", priv->visual_info->class);
g_debug ("visual info red_mask: %ld\n", priv->visual_info->red_mask);
g_debug ("visual info green_mask: %ld\n", priv->visual_info->green_mask);
g_debug ("visual info blue_mask: %ld\n", priv->visual_info->blue_mask);
g_debug ("visual info bits_per_rgb: %d\n", priv->visual_info->bits_per_rgb);
win_attr.event_mask = StructureNotifyMask | ExposureMask | VisibilityChangeMask;
win_attr.background_pixmap = None;

View file

@ -477,6 +477,8 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
glimage_sink = GST_GLIMAGE_SINK (bsink);
GST_INFO ("buffer size: %d", GST_BUFFER_SIZE (buf));
//is gl
if (glimage_sink->is_gl)
{
@ -534,9 +536,9 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
gl_buffer = gst_gl_buffer_new (glimage_sink->display,
glimage_sink->width, glimage_sink->height);
//blocking call
gst_gl_display_do_upload(glimage_sink->display, gl_buffer->texture,
glimage_sink->width, glimage_sink->height, GST_BUFFER_DATA (buf));
//blocking call
gst_gl_display_do_upload(glimage_sink->display, gl_buffer->texture,
glimage_sink->width, glimage_sink->height, GST_BUFFER_DATA (buf));
//gl_buffer is created in this block, so the gl buffer is already referenced
}