여 전체 카메라 에서 폭 Mac 카메라 실행할 경우를 통해 응용 프로그램 Mac 촉매

0

질문

나는 내 맥북의 웹캠에는 넓은 시야. 을 열 때 Quicktime 응용 프로그램을 선택 나의 맥북 카메라 입력으로 나는 좋은 넓은 비디오를 먹은 이렇습니다.

enter image description here

지금,나는 iOS 앱는 내가 사용하여 실행되는 맥 촉매이다. 여기에 빌드 조합을 사용하고.

enter image description here

을 실행할 때 사용은 크게 자른 버전의 비디오 공급 웹에서 캠입니다.

enter image description here

여기에는 내가 설정 AVCaptureSession

import Foundation
import AVFoundation


class BasicCamera: ObservableObject {
    
    @Published var authorizationState: AVAuthorizationStatus = .notDetermined
    
    let session = AVCaptureSession()
    
    init() {
        guard let device = AVCaptureDevice.default(for: .video) else {
            fatalError("Could not make capture device.")
        }
        
        guard let input = try? AVCaptureDeviceInput(device: device) else {
            fatalError("Could not make input")
        }
        
        session.beginConfiguration()
        
        session.addInput(input)
        
        session.commitConfiguration()
        
        session.startRunning()
    }
    
    public func requestCameraPermission() async -> AVAuthorizationStatus {
        return await withCheckedContinuation({ continuation in
            AVCaptureDevice.requestAccess(for: .video) { [unowned self] didComplete in
                self.authorizationState = AVCaptureDevice.authorizationStatus(for: .video)
                continuation.resume(with: .success(self.authorizationState))
            }
        })
    }
    
}

추가 ViewController 다음과 같다:

let preview = AVCaptureVideoPreviewLayer(session: session)
preview.removeFromSuperlayer()  
preview.frame = self.view.bounds      
self.view.layer.insertSublayer(preview, at: 0)

Note UIViewController 내가 사용하는을 통해 SwiftUI UIViewControllerRepresentable 프로토콜 적합성.

내가 노력의 번호를 사전 설정 및 탐색 세션 매개 변수를 포함하여 .buildInWidtAngleCamera 하지만 얻을 수 없는 것 그것을 보여 전체 카메라 해상도? 나는 행운의 여지 않는 한 나는 그것을 구축으로 실제 기본 Mac 응용 프로그램?

apple-m1 avfoundation swift video
2021-11-22 21:53:49
1

최고의 응답

2

스위치 Optimize interface for MacTarget>General>Deployment Info>Next To the Mac checkmark button.

가능성을 식별하는 카메라로 초상화를 위한 iPad

2021-11-23 00:12:21

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................