Re: MIT-SHM example



thanks for your replies anyways. I'm studying some rationales related to what you said.

I have some working code that has a refresh rate of over 24fps on a relatively small window (using gdk drawing primitives). I also played with gtkglextmm

since you suggested,
"using XImage has a number of costs *regardless* of whether MIT-SHM is
present or not. it is *not* the fastest way to draw an image all the
time",

say for example, to render on a nearly full-screen window (say the screen has a resolution of 1280x1024pixels) in a timely fashion, like a video player. with raw RGB input data.

What will be your suggestion for a fast way? say targeting at a 20-24fps?
you know how MPlayer or Xine does graphics rendering?


From: Paul Davis <paul linuxaudiosystems com>
Reply-To: paul linuxaudiosystems com
To: Rose Cumming <rose_alice_cumming hotmail com>
CC: gtkmm-list gnome org
Subject: Re: MIT-SHM example
Date: Mon, 19 Sep 2005 23:07:16 -0400

On Mon, 2005-09-19 at 16:44 +0000, Rose Cumming wrote:
> I'm not confused.
> My application (client) and the X server are running on the same machine.
>
> I want to have very high frame rates to playback my raw data images.
> I have tried drawing primitives like draw_rgb_image and draw_gray_image.
>
> What you said was consistent with previous email archieves I read. Using
> MIT-SHM will avoid network flow because the image (Xmage) use shared memory
> when the client and server are on the same machine.
> I have this link
> http://ftp.xfree86.org/pub/XFree86/4.5.0/doc/mit-shm.txt
> that talks about shared memory XImage.
>
> but if anyone has working example of how to set up a simple application, it
> would be greatly appreciated.

i am afraid that you *are* confused. controlling the use of MIT-SHM is
not intended to be an option for an application. the version of Xlib
that you are linked against will check whether the server supports it.
if the server does support it, then any realworld Xlib implementation
will use it.

using XImage has a number of costs *regardless* of whether MIT-SHM is
present or not. it is *not* the fastest way to draw an image all the
time - that depends a great deal on what the image is, on the type of
the server, the host system you are running on, and more.

if you want to draw images quickly, please forget about MIT-SHM. it is
not an important part of the code you will write. there are reasons to
prefer using a client side image on occasion; there are reasons to
prefer a server side image on other occasions. these reasons exist and
are true with *and* without MIT-SHM.

>I want to use low level Xlib drawing API with a Gtk::DrawingArea.
>My application is targeted on a single host machine. So I want to use
>the fastest way to draw images possible.

Why on earth do you imagine that using gdk routines, which normally map
1:1 onto Xlib routines, will be measurably slower than Xlib routines? if
your frame rate is slow, you should look to your algorithms for drawing
and for the overall structure of your code.

People use GDK/GTK to get frame rates that are essentially identical to
what they would get if they had raw access to the h/w. *Without* using
Xlib, and without even stopping to think about whether or not MIT-SHM is
present or not.

--p



_________________________________________________________________
Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.




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