[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Displaying live video -- how to notify main loop from another thread
From: |
Marek Peca |
Subject: |
Re: Displaying live video -- how to notify main loop from another thread? |
Date: |
Sat, 17 Jul 2010 00:20:05 +0200 (CEST) |
Dear GNUsteppers,
On Fri, 9 Jul 2010, David Chisnall wrote:
(..)
-setNeedsDisplay: also ought to work. I think this is a bug in GNUstep
- this ought to wake up the main thread if it is sleeping and trigger a
redraw. If it doesn't, you can poke the main thread with
-performSelectorInMainThread:
I checked SVN and it seemed to me it should really work. Replaced my old
bad Debian version with current stable compiled from sources and voila, it
works, as I expected.
So, sorry for my previous message. But anyway, now I know, how to
connect multiple non-GNUstep threads to NSApplication loop.
On 9 Jul 2010, at 12:44, Marek Peca wrote:
(..)
And the second question is, whether I have chosen the right method of
image display: I am calling NSBitmapImageRep->draw from within
ImgView->drawRect:, where ImgView is descendant of NSView. Camera is
grabbing at few fps, 640x480x8bit, calling [imgView setNeedsDisplay:
YES]; if the event queue is being refreshed by continuous mouse motion,
I can easily get CPU load 60% on my 3GHz Pentium. (Similar program
under Gtk takes 2% CPU.) So I am asking, whether, and what am I doing
wrong.
Now, xlib backend, version 1.18.0 & XFree86 4.3.0 (yes, you have heard it
right, I will test it on a recent machine soon), it is better: CPU load
around 7% on 3GHz Pentium, split evenly between my app and X.
Great, many thanks for your previous answers.
Best regards,
Marek
Re: Displaying live video -- how to notify main loop from another thread?, David Chisnall, 2010/07/09