Applying Effect to iPhone Camera Preview “Video”

前端 未结 2 1862
太阳男子
太阳男子 2020-12-29 00:22

My goal is to write a custom camera view controller that:

  1. Can take photos in all four interface orientations with both the back and, when available, front came
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 01:00

    A fundamentally better approach would be to use OpenGL to handle as much of the image-related heavy lifting for you (as I see you're trying in your latest attempt). However, even then you might have issues with building up frames to be processed.

    While it seems strange that you'd be running into memory accumulation when processing frames (in my experience, you just stop getting them if you can't process them fast enough), Grand Central Dispatch queues can get jammed up if they are waiting on I/O.

    Perhaps a dispatch semaphore would let you throttle the addition of new items to the processing queues. For more on this, I highly recommend Mike Ash's "GCD Practicum" article, where he looks at optimizing an I/O bound thumbnail processing operation using dispatch semaphores.

提交回复
热议问题