JavaEar 专注于收集分享传播有价值的技术资料

1个回答

    最佳答案
  1. the QTKit is phased out and you are encouraged to use AVFoundation. It offers similiar functionality and much more

    in this case use a AVCaptureDevice to make a AVCaptureSession

    e.g. set up a camera view

    AVCaptureDevice * captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
    AVCaptureDeviceInput * captureDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:captureDevice error:error];
    
    AVCaptureSession * captureSession = [[AVCaptureSession alloc] init];    
    [captureSession beginConfiguration];
    captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
    [captureSession addInput:captureDeviceInput];
    AVCaptureStillImageOutput * output = [[AVCaptureStillImageOutput alloc] init];
    [captureSession addOutput:output];
    
    [captureSession commitConfiguration];    
    [captureSession startRunning];