Definitely not using CGWindowListCreateImage.
In the past, inspired by some code, i wrote a screen capture test program using 
opengl, the trick was to declare a fullscreen context without a curtain window 
or setting it to transparent and then reading the pixels, and that was quite 
fast, on a G4 i could achieve hundreds (or thousands?) of FPS (which is 
completely useless i agree on a 60Hz display).
The problem is, since 10.7 (?) this stopped working, all the pixels you read 
are black.
In the meantime, quicktime was added screen capture support and something was 
added to AVFoundation, and you can directly capture the screen using it, I 
personally never used it.

https://developer.apple.com/library/mac/qa/qa1740/_index.html

Regards.

On Oct 16, 2013, at 7:26 AM, cocoa-dev-requ...@lists.apple.com wrote:

> Date: Wed, 09 Oct 2013 23:16:49 -0400
> From: Mauritz Jameson <mjames2...@gmail.com>
> To: cocoa-dev@lists.apple.com
> Subject: Fastest way to do screen captures on OSX ?
> Message-ID:
>       <cahff3y-euqrfnb0rsxujxs6rshz99o+ielqgcyndr1wgnjn...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> I have created a function to do screen captures on OSX.
> 
> Since I'm new to OSX, Xcode and the SDKs on OSX, I've asked for a code
> review of the screen capture function here:
> 
> http://codereview.stackexchange.com/questions/32466/reviewing-c-function-which-captures-the-screen
> 
> The function is a bit messy since it's a prototype. I would be very happy
> if you could tell me how I can optimize the code I've posted in the link
> above.
> 
> The screen capture function is being called every 100ms approximately and
> these frequent function calls seems to slow everything else down. After my
> program has run for a little while, the desktop and mouse pointer becomes
> very laggy/non-responsive. The mouse pointer icon periodically changes to
> that spinning circle (equivalent to the hour glass on Windows). Opening
> other apps while my program is running is also a problem. After my program
> has run for 30 seconds or so, opening up a browser takes more than a
> minute. Eventually everything just hangs and I have to reboot.
> 
> I'm wondering if it's the screen capture method itself (i.e. using the Core
> Graphics API) which isn't ideal for this type of application or if there's
> something in the screen capture code which is causing the above mentioned
> problems.
> 
> If I comment out the code in the screen capture function and run my
> program, I don't get the same laggy behavior. So the bottleneck/problem
> definitely seems to have something to do with the way I capture the screen.
> 
> Any suggestions, comments, questions etc. are highly appreciated.
> 
> Thank you!!


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to