iOS 5 - AVCaptureDevice setting focus point and focus mode freezes the live camera picture

前端 未结 2 1940
长情又很酷
长情又很酷 2021-02-04 21:18

I\'m using the following method to set point of focus since iOS 4:

- (void) focusAtPoint:(CGPoint)point
{
    AVCaptureDevice *device = [[self captureInput] devi         


        
2条回答
  •  Happy的楠姐
    2021-02-04 21:47

    I want to give some additional info to @Louis 's answer.

    According to Apple's documents (Please pay attention to the bold part):

    In addition, a device may support a focus point of interest. You test for support using focusPointOfInterestSupported. If it’s supported, you set the focal point using focusPointOfInterest. You pass a CGPoint where {0,0} represents the top left of the picture area, and {1,1} represents the bottom right in landscape mode with the home button on the right—this applies even if the device is in portrait mode.

    We should involve the orientation when calculate FocusPointOfInterest.

提交回复
热议问题