Bläddra i källkod

关闭录制头像功能,

jsonwang 3 år sedan
förälder
incheckning
506a746b7c
1 ändrade filer med 20 tillägg och 20 borttagningar
  1. 20 20
      BFRecordScreenKit/Classes/RecordScreen/View/BFRecordAvatarView.swift

+ 20 - 20
BFRecordScreenKit/Classes/RecordScreen/View/BFRecordAvatarView.swift

@@ -48,22 +48,22 @@ class BFRecordAvatarView: UIView {
         addSubview(renderView)
 
         addSubview(closedBtn)
-        closedBtn.frame = CGRect(x: frame.maxX - 68, y: frame.maxY - 68, width: 68, height: 68)
-        do {
-            camera = try Camera(sessionPreset: .high, location: .frontFacing, captureAsYUV: true)
-            //            camera.runBenchmark = true
-
-            let conertFilter = PQCornerFilter()
-            let cropFilter = Crop()
-            cropFilter.cropSizeInPixels = videoPixelsSize
-            cropFilter.cropSizeInPixels = Size(width: 1080, height: 1080)
-            cropFilter.locationOfCropInPixels = Position(0, (1920 - 1080) / 2)
-
-//            camera  --> cropFilter --> conertFilter --> renderView
-//            camera  --> cropFilter --> conertFilter --> renderView
-        } catch {
-            fatalError("Could not initialize rendering pipeline: \(error)")
-        }
+//        closedBtn.frame = CGRect(x: frame.maxX - 68, y: frame.maxY - 68, width: 68, height: 68)
+//        do {
+//            camera = try Camera(sessionPreset: .high, location: .frontFacing, captureAsYUV: true)
+//            //            camera.runBenchmark = true
+//
+//            let conertFilter = PQCornerFilter()
+//            let cropFilter = Crop()
+//            cropFilter.cropSizeInPixels = videoPixelsSize
+//            cropFilter.cropSizeInPixels = Size(width: 1080, height: 1080)
+//            cropFilter.locationOfCropInPixels = Position(0, (1920 - 1080) / 2)
+//
+////            camera  --> cropFilter --> conertFilter --> renderView
+////            camera  --> cropFilter --> conertFilter --> renderView
+//        } catch {
+//            fatalError("Could not initialize rendering pipeline: \(error)")
+//        }
 
         let Drag = UIPanGestureRecognizer(target: self, action: #selector(onDrag(gesture:)))
         addGestureRecognizer(Drag)
@@ -75,22 +75,22 @@ class BFRecordAvatarView: UIView {
 
     deinit {
         BFLog(message: "BFRecordAvatarView deinit")
-        closeCamera()
+//        closeCamera()
     }
 
     @objc func cameraClosed() {
         isHidden = true
-        closeCamera()
+//        closeCamera()
     }
 
     // 打开摄像头
     func openCamera() {
-        camera.startCapture()
+//        camera.startCapture()
     }
 
     // 关闭摄像头
     func closeCamera() {
-        camera.stopCapture()
+//        camera.stopCapture()
     }
 
     // 开始录制