I have created a simple gstreamer+gtk based application to play video file. "filesrc", "decodebin", "autovideosink", "autoaudiosink" gstreamer elements are used for that.
Main window is created using gtk_window_new(GTK_WINDOW_TOPLEVEL) and drawing area is created using gtk_drawing_area_new(). Drawing window is embedded in main window.
To render on gtk drawing window, its handle is passed to gstreamer video plugin as overlay using gstreamer api gst_video_overlay_set_window_handle()
By doing so video is not rendered only audio gets played.
Instead of GTK window if i pass XCreateWindow() handle to gstreamer video plugin as overlay then everything works fine. But i have to create GTK based player.
Now, when i start debugging the issue i have found below details.
- "autovideosink" plugin gets blocked on XNextEvent inside mainloop thread(Luckily i have source code and verified using logs)
- Then using xtrace utility it was found that most of X Request gets failed(See below) whereas in case of XCreateWindow all such Request gets successful Response.
002:<:000f: 52: Request(1): CreateWindow depth=0x18 window=0x01600001 parent=0x01400007 x=0 y=0 width=640 height=368 border-width=0 class=InputOutput(0x0001) visual=0x00000021 value-list={background-pixel=0x00000000 border-pixel=0x00000000 backing-store=NotUseful(0x00) override-redirect=false(0x00) colormap=CopyFromParent(0x00000000)}
002:<:0010: 24: Request(16): InternAtom only-if-exists=true(0x01) name='_NET_WM_STATE'
002:>:000f:Error 8=Match: major=1, minor=0, bad=20971527
002:<:001d: 8: Request(3): GetWindowAttributes window=0x01600001
002:<:001e: 8: Request(14): GetGeometry drawable=0x01600001
002:>:001d:Error 3=Window: major=3, minor=0, bad=23068673
002:>:001e:Error 9=Drawable: major=14, minor=0, bad=23068673
I have no idea why these requests gets failed for GTK window. Whereas in my old system(ubuntu 14.04) i can run the same player very well. Current system is ubuntu 16.04
Any X Server related configuration setting doing that? Please suggest some solution or any idea how to debug it further to catch the real cause.