XCreateWindow request fails for imxeglvivsink plugin

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XCreateWindow request fails for imxeglvivsink plugin

780 Views
naseebpanghal
Contributor I

Hardware and Software details:
Board: wb quad Rev C1
Image: wandboard-all-ubuntu-16.04-sdcard-20160520.img downloaded from wandboard site:(http://download.wandboard.org/wandboard-imx6/ubuntu-16.04/)

Drivers and gstreamer(1.8.0) plugins are already installed with the image.

I debug imxeglvivsink plugin using source code gstreamer-imx  from github and found that XCreateWindow request fails to create window.

Let me explain what i am trying to do.

1. I create a GTK+ window using gtk_window_new (GTK_WINDOW_TOPLEVEL);

2. Then add drawing area using gtk api gtk_drawing_area_new

3.Once video area is "realized", get window handle using GDK_WINDOW_XID (window) and store in variable video_window_handle( i will use it later).

4. Inside gstreamer bus sync handler i use video_window_handle to set it as overlay using gstreamer api gst_video_overlay_set_window_handle().

5. In imxeglvivsink, XCreateWindow api uses video_window_handle as parent window. AND here everything goes wrong.

I debugged further using xtrace utility, CreateWindow request fails with BADMATCH. I check the visuals for video_window_handle(window created using GTK+GDK) its value is 0xC7 and default X value it is 0x21.

I don't understand where to configure GDK to use system defalut X visual so that parameter match for parent and child window and XCreateWindow gets successful.

I have searched it all the place but not found any such setting. Please help.

For ubuntu-14.04 i did not do any such setting, there by default visual match for both GTK window and XCreateWindow.

Let me know in case any further information is required.

0 Kudos
3 Replies

585 Views
naseebpanghal
Contributor I

I strongly feel there must be some configuration file to change GDK default visual. Time being I have changed GDK Visual using the code 

static int change_visual(GtkWidget *widget) {   int nitems_return;   Display *x_display = XOpenDisplay(NULL);   Visual *x_visual = XDefaultVisual(x_display, DefaultScreen(x_display));    GdkScreen *gdk_screen = gdk_screen_get_default();   GList *gdk_visual_list = gdk_screen_list_visuals(gdk_screen);   GList *l;   for (l = gdk_visual_list; l != NULL; l = l->next)   {     Visual *temp = gdk_x11_visual_get_xvisual((GdkVisual *)l->data);     if(temp->visualid == x_visual->visualid) break;   }   //l is pointing the visual which is similar to system x visual. Lets change it.   gtk_widget_set_visual (widget, (GdkVisual *)l->data);   return 0; }
0 Kudos

585 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Naseeb,

You need to compile gstreamer vs imxeglvivsink. In you 14.04 is should be compiled

0 Kudos

585 Views
naseebpanghal
Contributor I

Hi Bio_TICFSL,

Thanks for your reply.

I am sorry. i don't get your answer. Do you want me to compile gstreamer-imx on my 14.04 machine?

Also,

In file: egl_platform_x11.c and function: gst_imx_egl_viv_sink_egl_platform_init_window, i modified

XCreateWindow parameters visual_info->depth to CopyFromParent and visual_info->visual to CopyFromParent and compile gstramer-imx on 16.04 itself. By these changes imxeglvivsink is able to render on the child window.

But i don't want to change the gstreamer-imx code. I want, if GDK settings are configured such a way that x-window gets created with visual_info->depth  and visual_info->visual  itself.

I hope i am able to clarify what i want.

0 Kudos