Strange 'regression' in gtk+/gstreamer app
Hello, So many years ago we wrote a custom app for a client. It does video recording from either network cameras or optionally built in webcams. Its worked well for a long time. Originally built against gstreamer 0.10. Recently we've replaced some of the hardware and have noticed an issue that I can't for the life of me track down. It was first observed on playback. When updating the position of the scrollbar, the video would flash, as if drawn over in white if you will. It happens each time the scrollbar position moved. For example the callback to update it is called every 200ms, but only when it moves does the flash occur. In digging into it some more, I also realized I could cause it to occur while recording. We have a number of Notebooks in the UI. Mousing over an inactive one where it then gets a little 'highlight' if you will prior to clicking also causes the video to then flicker. Originally to debug this I went into the code that was updating the scrollbar. if (ret && position != GST_CLOCK_TIME_NONE) { g_signal_handler_block (GTK_RANGE(playbackScale), updateId); gtk_range_set_value (GTK_RANGE(playbackScale), positionInSeconds); g_signal_handler_unblock (GTK_RANGE(playbackScale), updateId); } Simply commenting out the gtk_range_set_value stops playback on flicker. Obviously that's less desirable. I wondered if part of the issue was gstreamer 0.10 as its quite old. So started porting it to gstreamer-1.x. Made it far enough that I could test and confirm that I still have flickering when the mouse moves over notebook panels etc. I'm at a complete loss. I looked at Cheese and Totem to see if I could figure out what was going on. It seems they use clutter for quite a bit. I don't know if I want to port it over to that as well if I don't have to. However I would really like some pointers as to what could be causing the issue. I can even take a screencast if anyone wants to see the actual behaviour. Hoping someone has some good ideas, -- Nathanael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Strange 'regression' in gtk+/gstreamer app
It could be a problem with the double buffering. gtk_widget_set_double_buffered() Try to set that to false and see if that makes any difference. This is on Linux? Usually you don't need this function any more and it is deprecated but it can sometimes still be useful. I know to get gnuplot pictures to redraw without flickering or a white background, it needs to be false. I did a little gstreamer experimentation a little while back with the webcam video. It works without gtk_widget_set_double_buffered() using Ubuntu 16.04, GTK3.18 and gstreamer1.0. No flickering that I can see. I don't have a scrollbar in there though. It might be helpful. https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Sound/webcam3.c Eric ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Strange 'regression' in gtk+/gstreamer app
Hello Eric, Thanks for the reply. Yeah I forgot to mention that in the Glade file I had set double buffered to false for both GtkDrawingAreas. I also tried setting them to false directly in code once I finish loading/configuring it from the glade file. gtk_builder_connect_signals (builder, DO); g_signal_connect (recordingArea, "realize", rec_realize_cb, DO); g_signal_connect (viewerArea,"realize", view_realize_cb, DO ); gtk_widget_set_double_buffered (GTK_WIDGET(recordingArea), FALSE); gtk_widget_set_double_buffered (GTK_WIDGET(viewerArea), FALSE); One thing this did make me realized is that in my source dir I have a copy of a tutorial/example. "basic-tutorial-5.c" (http://pastebin.com/4 gaWhCJs). It compiles and runs fine - updating the scrollbars without a flicker. It also sets the double buffer to false. So I'm wondering if it has to do with the notebook. That or the fact that I have two drawing areas. One in each notebool panel that is causing the issue. It is just so bizarre that its suddenly occurring years after it was written. Any other ideas? -- Nathanael On Fri, 2016-12-09 at 18:59 -0500, cecas...@aol.com wrote: > > It could be a problem with the double buffering. > > gtk_widget_set_double_buffered() > > Try to set that to false and see if that makes any difference. This > is on Linux? Usually you don't need this function any more and it is > deprecated but it can sometimes still be useful. I know to get > gnuplot pictures to redraw without flickering or a white background, > it needs to be false. > > I did a little gstreamer experimentation a little while back with the > webcam video. It works without gtk_widget_set_double_buffered() using > Ubuntu 16.04, GTK3.18 and gstreamer1.0. No flickering that I can see. > I don't have a scrollbar in there though. It might be helpful. > > https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/S > ound/webcam3.c > > Eric > > > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Strange 'regression' in gtk+/gstreamer app
Hello Eric, Thanks for the reply. Yeah I forgot to mention that in the Glade file I had set double buffered to false for both GtkDrawingAreas. I also tried setting them to false directly in code once I finish loading/configuring it from the glade file. gtk_builder_connect_signals (builder, DO); g_signal_connect (recordingArea, "realize", rec_realize_cb, DO); g_signal_connect (viewerArea,"realize", view_realize_cb, DO ); gtk_widget_set_double_buffered (GTK_WIDGET(recordingArea), FALSE); gtk_widget_set_double_buffered (GTK_WIDGET(viewerArea), FALSE); One thing this did make me realized is that in my source dir I have a copy of a tutorial/example. "basic-tutorial-5.c" (http://pastebin.com/4 gaWhCJs). It compiles and runs fine - updating the scrollbars without a flicker. It also sets the double buffer to false. So I'm wondering if it has to do with the notebook. That or the fact that I have two drawing areas. One in each notebool panel that is causing the issue. It is just so bizarre that its suddenly occurring years after it was written. Any other ideas? -- Nathanael On Fri, 2016-12-09 at 18:59 -0500, cecas...@aol.com wrote: > > It could be a problem with the double buffering. > > gtk_widget_set_double_buffered() > > Try to set that to false and see if that makes any difference. This > is on Linux? Usually you don't need this function any more and it is > deprecated but it can sometimes still be useful. I know to get > gnuplot pictures to redraw without flickering or a white background, > it needs to be false. > > I did a little gstreamer experimentation a little while back with the > webcam video. It works without gtk_widget_set_double_buffered() using > Ubuntu 16.04, GTK3.18 and gstreamer1.0. No flickering that I can see. > I don't have a scrollbar in there though. It might be helpful. > > https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/S > ound/webcam3.c > > Eric > > > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Strange 'regression' in gtk+/gstreamer app
My guess is that it has something to do with how GTK is drawing. Look at the double buffered reference. https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-double-buffered For drawing transparent backgrounds GTK changed something in the drawing code in 3.10. When I was using 3.10 and trying to draw transparent windows they would work sometimes and then they wouldn't. I think that got fixed sometime in 3.10 but then that caused the double buffering set to false not to work anymore. I used to be able to send an X window id to gnuplot and it would draw directly on the window. That doesn't work in 3.18 but did in 3.10. With gstreamer it still needs a X window id but it works with the updates with GTK but not with double buffering set to false anymore or it just ignores it. Some of the older gstreamer code has the double buffering always set to false. It isn't needed anymore. You probably don't want to set it to false if you are using GTK after version 3.10 on any of the drawing areas. I don't know the internals of why this is. Just from testing some code out but this is my understanding of it. I will have to test a few more things out. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list