Re: write a media player using gtk+



On Nov 30, 2007 2:45 AM, Bin Chen <binary chen gmail com> wrote:
image, but I am not familiar with XLib, so I want to know if it is
possible to use pure GTK+ API to achieve this? What about the
performance comparing to use XLib directly?

You can use gdk_draw_rgb_image() to paint an RGB array to the screen:

http://library.gnome.org/devel/gdk/unstable/gdk-GdkRGB.html#gdk-draw-rgb-image

This is a wrapper over the XImage functions, including XShm when
available, plus some nice dithering code. It's about as quick as you
can get with vanilla X11 calls. There's a tiny program in
gtk+-2.x.x/tests/testrgb.c which benchmarks your computer for drawing
speed with his operation. You could try that and see if it's going to
be quick enough for you.

If you want to go faster, you need to use another (non-X11) rendering
path. One possibility is the Xv extension, another is to go via
OpenGL. Both are somewhat hairy :-( and much less portable. As Ken
says, unless you really want to do this all yourself, GStreamer might
be the way to go.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]