Re: Display Raster Data?
- Date: Wed, 1 Aug 2018 10:44:05 -0500
- From: R0b0t1 via gtk-list <gtk-list@xxxxxxxxx>
- Subject: Re: Display Raster Data?
On Wed, Aug 1, 2018 at 8:52 AM, Luca Bacci via gtk-list
> I should point out that the draw_func may be called by Gtk whenever it
> The best is to have the timer callback change the "current" bitmap and call
> Then on the drawing callback of the drawing area you just paint the
> "current" bitmap.
This is what I first tried to do but could not find good information
on it. It seems I need to quickly create and destroy objects no matter
what I do which is why I sent this message.
I can set an image control's GdkPixbuf but there seems to be no way to
change the data that a GdkPixbuf points to. It may also be necessary
to create another GtkImage to perform double buffering inside the
On Wed, Aug 1, 2018 at 10:06 AM, Paul Davis <paul@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Aug 1, 2018 at 9:44 AM, Luca Bacci via gtk-list <gtk-list@xxxxxxxxx>
>> I suggest you use GStreamer, you can build a video by pushing bitmap
>> frames and it does everything else for you.
>> Otherwise, you can animate a DrawingArea. Set up a 60hz timer on your own.
>> The timer callback simply calls
>> gtk_widget_queue_draw_area(). Then, on the draw_func of your drawingarea
>> you display the bitmaps, one after another.
>> That's the simplest solution but can have lower timing quality
> in GTK3, this is almost certainly not the best way to do this. You want to
> use a frame timer based on the refresh/vblank cycle of the monitor.
I suspect he realized and that is why he recommended just changing the
The only reason I can find to not use GStreamer is that decoding is
already done for me. Putting the frames into a video and having that
displayed may lead to pointless copying of the video data. Pointless
copying is usually the biggest time sink. However this would mean the
video would be double/triple buffered properly upon display and would
use video acceleration.
But doing properly double or triple buffered video isn't that hard.
The hard part is integrating the display and event loop with GTK+.
Considering my issues here and in the other post I made about command
line arguments my solution for now is to just not use GTK+ in
preference of SDL2. This has the benefit of getting me very easy video
acceleration and better cross platform support. (The application links
in about 1/5th the time.)
Any pointers are still appreciated, of course.
P.S. "GtkApplication is a class that handles many important aspects of
a GTK+ application in a convenient fashion, without enforcing a
one-size-fits-all application model."
gtk-list mailing list