|
@@ -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()
|
|
|
}
|
|
|
|
|
|
// 开始录制
|