Questions tagged [iosurface]

29 questions
13
votes
1 answer

IOSurface gradually increases memory in iOS 12 and above

I am facing memory issue in my app for iOS 12 and above versions. IOSurface gradually increases simultaneously in iOS 12.1.1 where as it works fine in iOS 11 versions. I have attached the issue screenshot below, Why this issue happens in iOS 12…
Madhavan
  • 647
  • 4
  • 16
10
votes
0 answers

Trying to do screen capture with private framework IOSurface no longer seems to work in iOS 9

I'm working on an existing (non app-store) app for a client that uses the IOSurface private framework to do screen captures while in the background. There are a few threads here on SO that outline the technique, as well as several open source…
Duncan C
  • 128,072
  • 22
  • 173
  • 272
6
votes
1 answer

How do you synchronize an MTLTexture and IOSurface across processes?

What APIs do I need to use, and what precautions do I need to take, when writing to an IOSurface in an XPC process that is also being used as the backing store for an MTLTexture in the main application? In my XPC service I have the…
kennyc
  • 5,490
  • 5
  • 34
  • 57
6
votes
2 answers

Is there a way to read data from CGImage without internal caching?

I am fighting with an internal caching (about 90 MB for 15 mp image ) in CGContextDrawImage/CGDataProviderCopyData functions. Here is the stack-trace in profiler: In all cases, IOSurface is created as a "cache", and isn't cleaned after…
olha
  • 2,132
  • 1
  • 18
  • 39
6
votes
1 answer

Encoding H.264 Compression Session with CGDisplayStream

I'm trying to create an H.264 Compression Session with the data from my screen. I've created a CGDisplayStreamRef instance like so: displayStream = CGDisplayStreamCreateWithDispatchQueue(0, 100, 100, k32BGRAPixelFormat, nil, self.screenCaptureQueue,…
narner
  • 2,908
  • 3
  • 26
  • 63
5
votes
0 answers

'IOSurface' memory keeps increasing in SceneKit project

This question is roughly related to this one. I have a SceneKit project in which memory management has been a challenge (yes, even with ARC). By loading images in a very specific way, by using weak variables in closures, and by setting SCNMaterials…
West1
  • 1,430
  • 16
  • 27
5
votes
0 answers

Why is CoreImage doing a memcpy when all my surfaces are on the GPU

When trying to debug why certain CoreImage renders increased our CPU usage significantly, I can see in the sample trace that when I crop and composite images in certain ways, CoreImage is doing memcpys. When I take out the crop filter, it goes…
Ken Aspeslagh
  • 11,484
  • 2
  • 36
  • 42
4
votes
1 answer

Convert IOSurface-backed texture to GL_TEXTURE_2D

I want to render an IOSurface texture with mipmapping. I am generating an OpenGL texture from an IOSurface like so: let error = CGLTexImageIOSurface2D(context.cglContextObj!, GLenum(GL_TEXTURE_RECTANGLE_ARB),GLenum(GL_RGBA), GLsizei(width),…
Oskar
  • 3,625
  • 2
  • 29
  • 37
3
votes
1 answer

How to create an IOSurface in Swift

I'm trying to create an IOSurface in Swift and then create a CIImage from it. The IOSurfaceRef looks alright, but CIImage returns nil: textureImageWidth = 1024 textureImageHeight = 1024 let macPixelFormatString = "ARGB" var…
Nestor
  • 2,753
  • 2
  • 29
  • 34
3
votes
1 answer

How to include IOSurfaceRef

I'm attempting to create an app using private APIs to take screenshots from the background. I found this example: Taking Screenshots in the background (iOS) - Improving Performance In the author's code, the first line makes use of the IOSurfaceRef…
2
votes
1 answer

How to properly send IOSurface to another process using XPC?

I'm developing a MacOS application in which I'm trying to send a IOSurface from an XPC Service to a client application (in the same project as the XPC service), but there is something I'm clearly missing. I get the following error: Exception:…
Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48
2
votes
1 answer

Can you reuse an IOSurface that has been purged?

TL;DR: Is an IOSurfaceRef a valid surface to write to after it has been purged and its state changed to kIOSurfacePurgeableEmpty? I'm trying to get a better understanding of what it means for an IOSurface to be purged. The only documentation I have…
kennyc
  • 5,490
  • 5
  • 34
  • 57
2
votes
0 answers

Error: IOSurface.h not found

xcode still give me error when i try to import IOSurface. I've tried all possibilities, import framework, link framework on project but xcode still give me error. Anyone know why? Thanks to all for any answer
MeisterC
  • 25
  • 6
2
votes
1 answer

Copy OpenGL texture from one target to another

I have a IOSurface backed texture which is limited to GL_TEXTURE_RECTANGLE_ARB and doesn't support mipmapping. I'm trying to copy this texture to another texture bound to GL_TEXTURE_2D and then perform mipmapping on that one instead. But I'm having…
Oskar
  • 3,625
  • 2
  • 29
  • 37
1
vote
0 answers

CVPixelBufferCreateWithIOSurface: Get pixels from IOSurfaceRef

I'm trying to create a CVPixelBufferRef from an IOSurfaceRef in order to be able to read its pixels values. The IOSurfaceRef is read from the Syphon (website and repo) framework's SyphonOpenGLClient. My code is inspired from the Simple Client…
Benoît Lahoz
  • 1,270
  • 1
  • 18
  • 43
1
2