| 
														
															@@ -387,6 +387,7 @@ class PQMovieFilter: PQBaseFilter { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         // 二, 已经播放完一次 
														 | 
														
														 | 
														
															         // 二, 已经播放完一次 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if assetReader?.status == .completed { 
														 | 
														
														 | 
														
															         if assetReader?.status == .completed { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            BFLog(message: "已经播放完一次") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             // 1 自动循环模式 重头开始循环 
														 | 
														
														 | 
														
															             // 1 自动循环模式 重头开始循环 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if moveSticker?.materialDurationFit?.fitType == adapterMode.loopAuto.rawValue { 
														 | 
														
														 | 
														
															             if moveSticker?.materialDurationFit?.fitType == adapterMode.loopAuto.rawValue { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 FilterLog(message: "自动循环模式 重头开始循环 \(CMTimeGetSeconds(currentTime))") 
														 | 
														
														 | 
														
															                 FilterLog(message: "自动循环模式 重头开始循环 \(CMTimeGetSeconds(currentTime))") 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -522,3 +523,29 @@ class PQMovieFilter: PQBaseFilter { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return nanos * UInt64(timebaseInfo.denom) / UInt64(timebaseInfo.numer) 
														 | 
														
														 | 
														
															         return nanos * UInt64(timebaseInfo.denom) / UInt64(timebaseInfo.numer) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+// 测试使用 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import VideoToolbox 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+extension UIImage { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public convenience init?(pixelBuffer: CVPixelBuffer) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        var cgImage: CGImage? 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        VTCreateCGImageFromCVPixelBuffer(pixelBuffer, options: nil, imageOut: &cgImage) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        guard let cgImage = cgImage else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return nil 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        self.init(cgImage: cgImage) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    func saveImage(currentImage: UIImage, persent: CGFloat, imageName: String){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if let imageData =  currentImage.jpegData(compressionQuality: persent) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+               let fullPath = NSHomeDirectory().appending("/Documents/").appending(imageName) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                try? imageData.write(to: URL(fileURLWithPath: fullPath)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+               print("fullPath=\(fullPath)") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+           } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+       } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+} 
														 |