Browse Source

使用 BFLog

jsonwang 3 years ago
parent
commit
ac5d59293e
66 changed files with 503 additions and 495 deletions
  1. 1 1
      BFFramework/Classes/Base/Controller/PQBaseViewController.swift
  2. 6 6
      BFFramework/Classes/Base/Controller/PQBaseWebViewController.swift
  3. 2 2
      BFFramework/Classes/Base/Controller/PQPhotoAlbumController.swift
  4. 3 3
      BFFramework/Classes/Base/Controller/PQPhotoMaterialController.swift
  5. 1 1
      BFFramework/Classes/Base/View/PQChoseMaterialCell.swift
  6. 1 1
      BFFramework/Classes/Base/View/PQHeartAnimation.swift
  7. 13 13
      BFFramework/Classes/Base/ViewModel/PQBaseViewModel.swift
  8. 5 5
      BFFramework/Classes/Base/ViewModel/PQDownloadFileManager.swift
  9. 13 13
      BFFramework/Classes/Base/ViewModel/PQDownloadManager.swift
  10. 6 6
      BFFramework/Classes/Base/ViewModel/PQSessionManager.swift
  11. 3 3
      BFFramework/Classes/Base/ViewModel/PQUploadViewModel.swift
  12. 1 1
      BFFramework/Classes/Categorys/Int+Ext.swift
  13. 2 2
      BFFramework/Classes/Categorys/String+Ext.swift
  14. 2 2
      BFFramework/Classes/Categorys/UIView+Ext.swift
  15. 1 1
      BFFramework/Classes/EventTrack/Model/PQVideoMakeEventTrackModel.swift
  16. 10 10
      BFFramework/Classes/EventTrack/ViewModel/PQEventTrackViewModel.swift
  17. 3 3
      BFFramework/Classes/PModels/PQLoginUserInfo.swift
  18. 6 6
      BFFramework/Classes/PModels/PQVideoListModel.swift
  19. 2 2
      BFFramework/Classes/PModels/editDarftModels/PQEditAudioTrackMaterialModel.swift
  20. 2 2
      BFFramework/Classes/PModels/editDarftModels/PQEditAudioTrackModel.swift
  21. 1 1
      BFFramework/Classes/PModels/editDarftModels/PQEditBaseModel.swift
  22. 5 5
      BFFramework/Classes/PModels/editDarftModels/PQEditSdataModel.swift
  23. 6 6
      BFFramework/Classes/PModels/editDarftModels/PQEditSectionModel.swift
  24. 2 2
      BFFramework/Classes/PModels/editDarftModels/PQEditSectionTimelineModel.swift
  25. 1 1
      BFFramework/Classes/PModels/editDarftModels/PQEditSubtitleInfoModel.swift
  26. 11 11
      BFFramework/Classes/PModels/editDarftModels/PQEditVisionTrackMaterialsModel.swift
  27. 5 5
      BFFramework/Classes/PModels/editDarftModels/PQEditVisionTrackModel.swift
  28. 2 2
      BFFramework/Classes/PQGPUImage/Source/BasicOperation.swift
  29. 2 2
      BFFramework/Classes/PQGPUImage/Source/Pipeline.swift
  30. 1 1
      BFFramework/Classes/PQGPUImage/Source/iOS/MovieOutput.swift
  31. 3 3
      BFFramework/Classes/PQGPUImage/Source/iOS/SpeakerOutput.swift
  32. 1 1
      BFFramework/Classes/PQGPUImage/akfilters/PQBaseFilter.swift
  33. 1 1
      BFFramework/Classes/PQGPUImage/akfilters/PQGPUImageFilterGroup.swift
  34. 2 2
      BFFramework/Classes/PQGPUImage/akfilters/PQGifFilter.swift
  35. 3 3
      BFFramework/Classes/PQGPUImage/akfilters/PQImageFilter.swift
  36. 2 2
      BFFramework/Classes/PQGPUImage/akfilters/PQMoveFilter.swift
  37. 5 5
      BFFramework/Classes/PQGPUImage/akfilters/PQMoveInput.swift
  38. 6 6
      BFFramework/Classes/PQGPUImage/akfilters/PQSubTitleFilter.swift
  39. 2 2
      BFFramework/Classes/PQGPUImage/akfilters/Tools/NXAVAssetExportSession.swift
  40. 6 6
      BFFramework/Classes/PQGPUImage/akfilters/Tools/PQCompositionExporter.swift
  41. 29 29
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift
  42. 1 1
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialController.swift
  43. 8 8
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialDetailController.swift
  44. 8 8
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMusicController.swift
  45. 3 3
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMusicSearchController.swift
  46. 36 36
      BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift
  47. 1 1
      BFFramework/Classes/Stuckpoint/Model/PQVoiceModel.swift
  48. 1 1
      BFFramework/Classes/Stuckpoint/View/PQCuttingPointView.swift
  49. 2 2
      BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift
  50. 1 1
      BFFramework/Classes/Stuckpoint/View/PQStuckPointLoadingView.swift
  51. 6 6
      BFFramework/Classes/Stuckpoint/View/PQVideoCutingOprateView.swift
  52. 10 10
      BFFramework/Classes/Stuckpoint/ViewModel/PQGPUImagePlayerView.swift
  53. 48 48
      BFFramework/Classes/Stuckpoint/ViewModel/PQPlayerViewModel.swift
  54. 7 7
      BFFramework/Classes/Utils/NXAudioRecorder.swift
  55. 33 33
      BFFramework/Classes/Utils/PQAliOssUtil.swift
  56. 30 23
      BFFramework/Classes/Utils/PQCommonMethodUtil.swift
  57. 12 12
      BFFramework/Classes/Utils/PQCreateEmptyWAV.swift
  58. 61 61
      BFFramework/Classes/Utils/PQPHAssetVideoParaseUtil.swift
  59. 7 7
      BFFramework/Classes/Utils/PQSingletoMemoryUtil.swift
  60. 25 25
      BFFramework/Classes/Utils/PQSingletoRealmUtil.swift
  61. 4 4
      BFFramework/Classes/Utils/PQSingletoSourcesFileUtil.swift
  62. 2 2
      BFFramework/Classes/Utils/PQSingletonEnvUtil.swift
  63. 9 9
      BFFramework/Classes/Utils/PQThirdPlatformUtil.swift
  64. 1 1
      BFFramework/Classes/Utils/PQVideoSnapshotUtil.swift
  65. 6 6
      BFFramework/Classes/Utils/SWNetRequest.swift
  66. 2 1
      Example/BFFramework/ViewController.swift

+ 1 - 1
BFFramework/Classes/Base/Controller/PQBaseViewController.swift

@@ -142,7 +142,7 @@ public class PQBaseViewController: UIViewController, UIGestureRecognizerDelegate
 
     deinit {
         PQNotification.removeObserver(self)
-        PQLog(message: "\(String(describing: type(of: self)))被销毁")
+        BFLog(message: "\(String(describing: type(of: self)))被销毁")
     }
 
     public override var preferredStatusBarStyle: UIStatusBarStyle {

+ 6 - 6
BFFramework/Classes/Base/Controller/PQBaseWebViewController.swift

@@ -136,7 +136,7 @@ extension PQBaseWebViewController: WKNavigationDelegate {
     }
 
     func webView(_ webView: WKWebView, didFail _: WKNavigation!, withError error: Error) {
-        PQLog(message: error)
+        BFLog(message: error)
         if baseTitle == nil || baseTitle?.count ?? 0 <= 0 {
             webView.evaluateJavaScript("document.title") { [weak self] (any, _) -> Void in
                 self?.setTitle(title: any as? String)
@@ -151,20 +151,20 @@ extension PQBaseWebViewController: WKNavigationDelegate {
     }
 
     func webView(_: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) {
-        PQLog(message: "navigationResponse:\(String(describing: navigationResponse))")
+        BFLog(message: "navigationResponse:\(String(describing: navigationResponse))")
         decisionHandler(.allow)
     }
 
     func webView(_: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
-        PQLog(message: "didStartProvisionalNavigation:\(String(describing: navigation))")
+        BFLog(message: "didStartProvisionalNavigation:\(String(describing: navigation))")
     }
 
     func webView(_: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {
-        PQLog(message: "didReceiveServerRedirectForProvisionalNavigation:\(String(describing: navigation))")
+        BFLog(message: "didReceiveServerRedirectForProvisionalNavigation:\(String(describing: navigation))")
     }
 
     func webView(_: WKWebView, didCommit navigation: WKNavigation!) {
-        PQLog(message: "\(String(describing: navigation))")
+        BFLog(message: "\(String(describing: navigation))")
     }
 
 //    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
@@ -176,7 +176,7 @@ extension PQBaseWebViewController: WKNavigationDelegate {
 //        let vc = PQBaseWebViewController.init()
 //        vc.baseUrl = url
 //        navigationController?.pushViewController(vc, animated: true)
-//        PQLog(message: "decidePolicyFor \(String(describing: navigationAction))")
+//        BFLog(message: "decidePolicyFor \(String(describing: navigationAction))")
 //        decisionHandler(.allow)
 //    }
     override var preferredStatusBarStyle: UIStatusBarStyle {

+ 2 - 2
BFFramework/Classes/Base/Controller/PQPhotoAlbumController.swift

@@ -124,7 +124,7 @@ extension PQPhotoAlbumController {
             }
             let userCollections = PHCollectionList.fetchTopLevelUserCollections(with: nil)
             userCollections.enumerateObjects { [weak self] assCollection, index, point in
-                PQLog(message: "userCollections == \(assCollection),index = \(index),point = \(point)")
+                BFLog(message: "userCollections == \(assCollection),index = \(index),point = \(point)")
                 if assCollection is PHAssetCollection {
                     if assCollection.localizedTitle != "最近删除" {
                         self?.convertCollection(collection: assCollection as? PHAssetCollection)
@@ -159,7 +159,7 @@ extension PQPhotoAlbumController {
                         self?.updateItems(indexPath: IndexPath(item: (self?.albaumsData.count ?? 1) - 1, section: 0))
                     }
                 }
-                PQLog(message: "assetsFetchResult = \(assetsFetchResult)")
+                BFLog(message: "assetsFetchResult = \(assetsFetchResult)")
             }
         }
     }

+ 3 - 3
BFFramework/Classes/Base/Controller/PQPhotoMaterialController.swift

@@ -134,7 +134,7 @@ class PQPhotoMaterialController: PQBaseViewController {
                 }
             }
         } else if authStatus == .authorized {
-            PQLog(message: "授权成功,开始请求相册数据-\(allPhotos)")
+            BFLog(message: "授权成功,开始请求相册数据-\(allPhotos)")
 //            if allPhotos.count <= 0 {
             loadPhotoData()
 //            }
@@ -329,7 +329,7 @@ extension PQPhotoMaterialController: UICollectionViewDelegate, UICollectionViewD
                 if materialData?.asset != nil && materialData?.asset?.mediaType != .video && (materialData?.coverImageUI == nil || (materialData?.locationPath.count ?? 0) <= 0) {
                     PQPHAssetVideoParaseUtil.requestAssetOringinImage(asset: (materialData?.asset)!) { [weak self] _, data, image, _ in
                         if image == nil {
-                            PQLog(message: "图片数据为空!!!!!")
+                            BFLog(message: "图片数据为空!!!!!")
                         }
                         // 1,图片,gif的原文件数据,和视频的封面
                         var newImage: UIImage?
@@ -342,7 +342,7 @@ extension PQPhotoMaterialController: UICollectionViewDelegate, UICollectionViewD
                         let imageCacheName = "images_\(timeInterval)"
                         let imageCachePath = downloadImagesDirectory + imageCacheName
                         if !directoryIsExists(dicPath: downloadImagesDirectory) {
-                            PQLog(message: "文件夹不存在 \(downloadImagesDirectory)")
+                            BFLog(message: "文件夹不存在 \(downloadImagesDirectory)")
                             createDirectory(path: downloadImagesDirectory)
                         }
                         // 创建目录

+ 1 - 1
BFFramework/Classes/Base/View/PQChoseMaterialCell.swift

@@ -180,7 +180,7 @@ class PQChoseMaterialCell: UICollectionViewCell {
         } else {
             videoLoadingView.startAnimating()
         }
-        PQLog(message: "导出视频 = \(videoLoadingView.isHidden),asset = \(String(describing: materialData?.asset)),downloadState = \(String(describing: materialData?.downloadState))")
+        BFLog(message: "导出视频 = \(videoLoadingView.isHidden),asset = \(String(describing: materialData?.asset)),downloadState = \(String(describing: materialData?.downloadState))")
 //        if videoLoadingView.isHidden {
 //            videoLoadingView.stopAnimating()
 //            videoLoadingView.layer.removeAllAnimations()

+ 1 - 1
BFFramework/Classes/Base/View/PQHeartAnimation.swift

@@ -27,7 +27,7 @@ class PQHeartAnimation: NSObject {
         if !isRepeat {
             num = Int(arc4random_uniform(3))
         }
-//      PQLog(message: "num = \(num)")
+//      BFLog(message: "num = \(num)")
         imgV.transform = CGAffineTransform(rotationAngle: angleArr[num])
         // 放大动画
         let animation = CAKeyframeAnimation(keyPath: "transform.scale")

+ 13 - 13
BFFramework/Classes/Base/ViewModel/PQBaseViewModel.swift

@@ -141,9 +141,9 @@ class PQBaseViewModel: NSObject {
             params["pageNo"] = pageNo
         }
         SWNetRequest.postRequestData(url: url, parames: params) { response, _, error, _ in
-            PQLog(message: "当前线程:\(Thread.isMainThread) ")
+            BFLog(message: "当前线程:\(Thread.isMainThread) ")
             DispatchQueue.global().async {
-                PQLog(message: "当前线程 global:\(Thread.isMainThread) ")
+                BFLog(message: "当前线程 global:\(Thread.isMainThread) ")
                 var listData = Array<PQVideoListModel>.init()
                 var videoList = Array<[PQVideoListModel]>.init()
 
@@ -151,7 +151,7 @@ class PQBaseViewModel: NSObject {
                     let tempArr = response as! [[String: Any]]
                     for item in tempArr {
                         let tempModel = PQVideoListModel(jsonDict: item)
-                        if targetUid == Int(PQLoginUserInfo.shared.uid) {
+                        if targetUid == Int(BFLoginUserInfo.shared.uid) {
                             tempModel.pageSource = .sp_videoDetail_upload
                         } else {
                             tempModel.pageSource = .sp_videoDetail_userHomePage
@@ -162,12 +162,12 @@ class PQBaseViewModel: NSObject {
                         }
                     }
                     DispatchQueue.main.async {
-                        PQLog(message: "当前线程 main:\(Thread.isMainThread) ")
+                        BFLog(message: "当前线程 main:\(Thread.isMainThread) ")
                         completeHander(listData, videoList, nil)
                     }
                 } else {
                     DispatchQueue.main.async {
-                        PQLog(message: "当前线程main:\(Thread.isMainThread) ")
+                        BFLog(message: "当前线程main:\(Thread.isMainThread) ")
                         completeHander(listData, videoList, error?.msg)
                     }
                 }
@@ -420,7 +420,7 @@ extension PQBaseViewModel {
         if coverUrl != nil {
             parames["coverUrl"] = coverUrl
         }
-        PQLog(message: "保存草稿参数为:\(parames) \n\n sdata is:\n \(sdata) \n")
+        BFLog(message: "保存草稿参数为:\(parames) \n\n sdata is:\n \(sdata) \n")
         /* 返回数据格式
          "coverUrl": "string",
          "dataVersionCode": 0,
@@ -435,7 +435,7 @@ extension PQBaseViewModel {
                 completeHander(nil, error?.msg)
                 return
             }
-            PQLog(message: "保存草稿返回数据 :\(String(describing: response)))")
+            BFLog(message: "保存草稿返回数据 :\(String(describing: response)))")
             completeHander(response as? [String: Any], nil)
         }
     }
@@ -460,7 +460,7 @@ extension PQBaseViewModel {
                 completeHander(nil, error?.msg)
                 return
             }
-            PQLog(message: "生成的项目id :\(String(describing: response))")
+            BFLog(message: "生成的项目id :\(String(describing: response))")
             completeHander(response as? String, nil)
         }
     }
@@ -480,7 +480,7 @@ extension PQBaseViewModel {
                 completeHander(nil, error?.msg)
                 return
             }
-            PQLog(message: "生成的项目id :\(String(describing: response))")
+            BFLog(message: "生成的项目id :\(String(describing: response))")
             completeHander(response as? String, nil)
         }
     }
@@ -495,7 +495,7 @@ extension PQBaseViewModel {
     class func reportSendVideo(_ projectId: String, _ videoId: String, videoFromScene: videoFromScene, completeHander: @escaping (_ isSeccess: Bool, _ msg: String?) -> Void) {
         SWNetRequest.postRequestData(url: PQENVUtil.shared.clipapiapi + reportSendVideoUrl, parames: ["projectId": projectId, "videoId": videoId, "fromScene": videoFromScene.rawValue]) { _, _, error, _ in
 
-            PQLog(message: "发布视频后上报:projectId = \(projectId),videoId = \(videoId)")
+            BFLog(message: "发布视频后上报:projectId = \(projectId),videoId = \(videoId)")
             if error != nil {
                 completeHander(false, error?.msg)
                 return
@@ -523,7 +523,7 @@ extension PQBaseViewModel {
             var projectList = Array<PQEditProjectModel>.init()
             let tempList = (response as? [[String: Any]])
             if tempList != nil, (tempList?.count ?? 0) > 0 {
-                let draftDB: Realm = PQSingletoRealmUtil.shared.getDraftDB(uid: PQLoginUserInfo.shared.uid)
+                let draftDB: Realm = PQSingletoRealmUtil.shared.getDraftDB(uid: BFLoginUserInfo.shared.uid)
                 for item in tempList! {
                     let tempModel: PQEditProjectModel? = Mapper<PQEditProjectModel>().map(JSON: item)
                     tempModel?.isSelected = isSelected
@@ -616,7 +616,7 @@ extension PQBaseViewModel {
                 completeHander(nil, error?.msg)
                 return
             }
-            PQLog(message: "draftboxGetSdata response is \(String(describing: response))")
+            BFLog(message: "draftboxGetSdata response is \(String(describing: response))")
 
             let oneProjectModel = Mapper<PQEditSdataModel>().map(JSONString: response as! String)
 
@@ -641,7 +641,7 @@ extension PQBaseViewModel {
         if materialData?.locationPath != nil, materialData?.locationPath.count ?? 0 > 0 {
             params["materialMD5"] = (contentMD5(path: documensDirectory + (materialData?.locationPath ?? ""), data: nil) ?? "")
         }
-        PQLog(message: "素材上报扩展字段 = \(params),isDownload = \(isDownload)")
+        BFLog(message: "素材上报扩展字段 = \(params),isDownload = \(isDownload)")
         return params
     }
 }

+ 5 - 5
BFFramework/Classes/Base/ViewModel/PQDownloadFileManager.swift

@@ -17,9 +17,9 @@ class PQDownloadFileManager: NSObject {
         let filePath = downloadFileLocalPath(url: url, fileExtensionType: fileExtensionType)
         if !fileManager.fileExists(atPath: filePath) {
             let isFinished = fileManager.createFile(atPath: filePath, contents: nil, attributes: nil)
-            PQLog(message: "生成本地地址:\(url),localPath = \(filePath),isFinished:\(isFinished)")
+            BFLog(message: "生成本地地址:\(url),localPath = \(filePath),isFinished:\(isFinished)")
         } else {
-            PQLog(message: "已存在本地地址:\(url),localPath = \(filePath)")
+            BFLog(message: "已存在本地地址:\(url),localPath = \(filePath)")
         }
         return filePath
     }
@@ -32,7 +32,7 @@ class PQDownloadFileManager: NSObject {
             return url
         }
         let type: String = fileExtensionType?.rawValue ?? url.pathExtension
-        PQLog(message: "localPath : \(downloadDirectory + url.kf.md5 + (type.count > 0 ? ".\(type)" : ""))")
+        BFLog(message: "localPath : \(downloadDirectory + url.kf.md5 + (type.count > 0 ? ".\(type)" : ""))")
         return downloadDirectory + url.kf.md5 + (type.count > 0 ? ".\(type)" : "")
     }
 
@@ -59,7 +59,7 @@ class PQDownloadFileManager: NSObject {
             path = downloadFileLocalPath(url: url, fileExtensionType: fileExtensionType)
         }
         if fileManager.fileExists(atPath: path) {
-            PQLog(message: "删除本地文件 == \(path)")
+            BFLog(message: "删除本地文件 == \(path)")
             try? fileManager.removeItem(atPath: path)
         }
     }
@@ -69,7 +69,7 @@ class PQDownloadFileManager: NSObject {
     class func downloadTotalFile() -> [String]? {
         let fileManager = FileManager.default
         let subpaths = fileManager.subpaths(atPath: downloadDirectory)
-        PQLog(message: "已下载的总文件 == \(subpaths ?? [])")
+        BFLog(message: "已下载的总文件 == \(subpaths ?? [])")
         return subpaths
     }
 }

+ 13 - 13
BFFramework/Classes/Base/ViewModel/PQDownloadManager.swift

@@ -32,14 +32,14 @@ class PQDownloadManager: NSObject {
     ///   - stateHandle: <#stateHandle description#>
     /// - Returns: <#description#>
     func download(url: String, name: String? = nil, fileExtensionType: FileExtensionType?, imageURL: String? = nil, progressHandle: @escaping ProgressHandle, stateHandle: @escaping StateHandle) {
-        PQLog(message: "开始下载文件:\(url)")
+        BFLog(message: "开始下载文件:\(url)")
         let subfile = PQDownloadFileManager.downloadTotalFile()
         let newFileExtensionType: FileExtensionType = fileExtensionType ?? (FileExtensionType(rawValue: url.pathExtension) ?? FileExtensionType.normal)
         if (subfile?.count ?? 0) > 0 && (subfile?.count ?? 0) > maxDownloadCount {
             PQDownloadFileManager.removeDownloadFile(url: downloadDirectory + (subfile?.first)!, fileExtensionType: newFileExtensionType)
         }
         if !isValidURL(url: url) {
-            PQLog(message: "文件地址为空:\(url)")
+            BFLog(message: "文件地址为空:\(url)")
             return
         }
         let taskId = url.kf.md5
@@ -53,7 +53,7 @@ class PQDownloadManager: NSObject {
         }
         if downloadLenght > 0, (downloadingTask != nil && downloadingTask?.state == .compelte) || (totalLength > 0 && totalLength > downloadLenght) {
             progressHandle(1, downloadLenght, totalLength)
-            PQLog(message: "文件已下载完成:\(url),downloadLenght = \(downloadLenght),totalLength = \(totalLength)")
+            BFLog(message: "文件已下载完成:\(url),downloadLenght = \(downloadLenght),totalLength = \(totalLength)")
             downloadingTask?.state = .compelte
             downloadingTask?.progress = 1
             postNotification(name: cDownloadMatrialSuccessKey, userInfo: ["code": "1", "url": url, "localPath": localPath, "fileExtensionType": newFileExtensionType])
@@ -69,11 +69,11 @@ class PQDownloadManager: NSObject {
             task?.taskId = taskId
             downloadingTask?.task = task
             downloadingTask?.task?.resume()
-            PQLog(message: "下载任务已存在继续下载:\(url),localPath = \(localPath)")
+            BFLog(message: "下载任务已存在继续下载:\(url),localPath = \(localPath)")
         } else {
             createDirectory(path: downloadDirectory)
             PQDownloadFileManager.removeDownloadFile(url: absolutePath, fileExtensionType: newFileExtensionType)
-            PQLog(message: "URL(string: url)! ==\(URL(string: url)!)")
+            BFLog(message: "URL(string: url)! ==\(URL(string: url)!)")
             var request = URLRequest(url: URL(string: url)!)
 //            request.setValue("bytes=%lld-\(downloadLenght)", forHTTPHeaderField: "Range")
             request.setValue("Accept-Encoding", forHTTPHeaderField: "identity")
@@ -92,7 +92,7 @@ class PQDownloadManager: NSObject {
             tempModel.progressHandle = progressHandle
             tempModel.stateHandle = stateHandle
             tempModel.task = task
-            PQLog(message: "新建下载任务:\(url),localPath = \(PQDownloadFileManager.downloadFileLocalPath(url: url, fileExtensionType: newFileExtensionType)),taskID:\(taskId)  tempModel\(String(describing: tempModel.sourceURL))")
+            BFLog(message: "新建下载任务:\(url),localPath = \(PQDownloadFileManager.downloadFileLocalPath(url: url, fileExtensionType: newFileExtensionType)),taskID:\(taskId)  tempModel\(String(describing: tempModel.sourceURL))")
             if !sessionManager.downloadTaskDatas.keys.contains(taskId) {
                 sessionManager.downloadTaskDatas[taskId] = tempModel
             }
@@ -106,12 +106,12 @@ class PQDownloadManager: NSObject {
     ///   - downloadHandle: <#downloadHandle description#>
     /// - Returns: <#description#>
     func batchDownload(uniqueId: String, urls: [PQDownloadModel], downloadHandle: @escaping (_ isSuccess: downloadState, _ msg: String?, _ data: [String: Any]?) -> Void) {
-        PQLog(message: "urls count is \(urls.count)")
+        BFLog(message: "urls count is \(urls.count)")
         if urls.count <= 0 {
             return
         }
         if batchDownloadData.keys.contains(uniqueId) {
-            PQLog(message: "这组任务已经在下载中\(uniqueId)")
+            BFLog(message: "这组任务已经在下载中\(uniqueId)")
             downloadHandle(.downloading, nil, nil)
             return
         }
@@ -132,7 +132,7 @@ class PQDownloadManager: NSObject {
         downloadInfo["count"] = urls.count
         PQDownloadManager.shared.batchDownloadData[uniqueId] = downloadInfo
         dispatchGroup.notify(queue: DispatchQueue.main) {
-            PQLog(message: "所有的已请求完成,tempArr = \(PQDownloadManager.shared.batchDownloadData[uniqueId] ?? [])")
+            BFLog(message: "所有的已请求完成,tempArr = \(PQDownloadManager.shared.batchDownloadData[uniqueId] ?? [])")
             postNotification(name: cBatchDownloadMatrialSuccessKey, userInfo: ["uniqueId": uniqueId, "urls": PQDownloadManager.shared.batchDownloadData[uniqueId] ?? []])
 
             PQDownloadManager.shared.batchDownloadData.removeValue(forKey: uniqueId)
@@ -147,7 +147,7 @@ class PQDownloadManager: NSObject {
         let url = userInfo?["url"] as? String
         let localPath = userInfo?["localPath"] as? String
         let code = userInfo?["code"] as? String
-        PQLog(message: "目前下载的任务组数 \(PQDownloadManager.shared.batchDownloadData.keys)")
+        BFLog(message: "目前下载的任务组数 \(PQDownloadManager.shared.batchDownloadData.keys)")
         PQDownloadManager.shared.batchDownloadData.forEach { _, value in
             var downloadInfo: [String: Any]? = value as? [String: Any]
             let urlsArr: [PQDownloadModel]? = downloadInfo?["urls"] as? [PQDownloadModel]
@@ -159,13 +159,13 @@ class PQDownloadManager: NSObject {
                         if code == "1" {
                             downloadModel.filePath = localPath
                         }
-                        PQLog(message: "count = \(count)")
+                        BFLog(message: "count = \(count)")
                         if count > 0 {
-                            PQLog(message: "leave = \(count)")
+                            BFLog(message: "leave = \(count)")
                             count = count - 1
                             downloadInfo?["count"] = count
                             let dispatchGroupCount = dispatchGroup.debugDescription.components(separatedBy: ",").filter { $0.contains("count") }.first?.components(separatedBy: CharacterSet.decimalDigits.inverted).compactMap { Int($0) }.first
-                            PQLog(message: "dispatchGroup count is \(String(describing: dispatchGroupCount))")
+                            BFLog(message: "dispatchGroup count is \(String(describing: dispatchGroupCount))")
                             dispatchGroup?.leave()
                         }
                     }

+ 6 - 6
BFFramework/Classes/Base/ViewModel/PQSessionManager.swift

@@ -72,7 +72,7 @@ extension PQSessionManager: URLSessionDataDelegate {
             if downloadData?.stateHandle != nil {
                 downloadData?.stateHandle!(.error, taskUrl, PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: fileExtensionType), PQError(msg: "下载文件为空", code: 0))
             }
-            PQLog(message: "收到下载请求-下载文件为空:\(taskUrl),localPath = \(PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: fileExtensionType))")
+            BFLog(message: "收到下载请求-下载文件为空:\(taskUrl),localPath = \(PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: fileExtensionType))")
             return
         }
         // 创建文件地址
@@ -86,7 +86,7 @@ extension PQSessionManager: URLSessionDataDelegate {
         if downloadData?.name == nil {
             downloadData?.name = response.suggestedFilename
         }
-        PQLog(message: "收到下载请求-下载文件:downloadedLength = \(downloadedLength),localPath = \(filePath),totalLength = \(totalLength),expectedLength = \(expectedLength)")
+        BFLog(message: "收到下载请求-下载文件:downloadedLength = \(downloadedLength),localPath = \(filePath),totalLength = \(totalLength),expectedLength = \(expectedLength)")
         completionHandler(.allow)
     }
 
@@ -101,7 +101,7 @@ extension PQSessionManager: URLSessionDataDelegate {
         let downloadData = downloadTaskDatas[taskId]
         let fileExtensionType: FileExtensionType = downloadData?.fileExtensionType ?? (FileExtensionType(rawValue: taskUrl.pathExtension) ?? FileExtensionType.normal)
         let absolutePath = taskUrl + ".\(fileExtensionType.rawValue)"
-        PQLog(message: "收到下载请求-收到data taskId = \(taskId),data = \(data),totalBytes = \(downloadData?.totalLength ?? 0),download = \(PQDownloadFileManager.downloadFileLength(url: absolutePath, fileExtensionType: fileExtensionType))")
+        BFLog(message: "收到下载请求-收到data taskId = \(taskId),data = \(data),totalBytes = \(downloadData?.totalLength ?? 0),download = \(PQDownloadFileManager.downloadFileLength(url: absolutePath, fileExtensionType: fileExtensionType))")
 
         if downloadData != nil {
             downloadData?.fileHandle?.seekToEndOfFile()
@@ -131,7 +131,7 @@ extension PQSessionManager: URLSessionDataDelegate {
         var fileExtensionType: FileExtensionType = downloadData?.fileExtensionType ?? (FileExtensionType(rawValue: taskUrl.pathExtension) ?? FileExtensionType.normal)
         let absolutePath = taskUrl + ".\(fileExtensionType.rawValue)"
         downloadData?.fileHandle?.closeFile()
-        PQLog(message: "收到下载请求-下载完成 taskId = \(taskId),error = \(error ?? PQError(msg: ""))")
+        BFLog(message: "收到下载请求-下载完成 taskId = \(taskId),error = \(error ?? PQError(msg: ""))")
         downloadData?.fileHandle = nil
         if downloadData?.realFileExtensionType != nil, downloadData?.fileExtensionType != nil, downloadData?.realFileExtensionType != downloadData?.fileExtensionType {
             try? FileManager.default.moveItem(atPath: PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: fileExtensionType), toPath: PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: downloadData?.realFileExtensionType))
@@ -144,7 +144,7 @@ extension PQSessionManager: URLSessionDataDelegate {
 
             let outVideoPath = downloadDirectory + "export_temp" + oldVideoPath.replacingOccurrences(of: downloadDirectory, with: "")
 
-            PQLog(message: "下载视频 FPS 不是30帧 要处理 oldVideoPath is \(oldVideoPath) \n outVideoPath is\(outVideoPath)")
+            BFLog(message: "下载视频 FPS 不是30帧 要处理 oldVideoPath is \(oldVideoPath) \n outVideoPath is\(outVideoPath)")
 
             NXAVAssetExportSession().exportAsynchronouslyWithCompletionHandler(inFilePath: oldVideoPath, outFilePath: outVideoPath, frameDuration: CMTime(value: 1, timescale: 30)) { _ in
 
@@ -158,7 +158,7 @@ extension PQSessionManager: URLSessionDataDelegate {
                     // No-op
                 }
 
-                PQLog(message: "clear data movie outFilePath is \(String(describing: oldVideoPath))")
+                BFLog(message: "clear data movie outFilePath is \(String(describing: oldVideoPath))")
 
                 postNotification(name: cDownloadMatrialSuccessKey, userInfo: ["code": error != nil ? "0" : "1", "url": task.taskUrl, "localPath": error != nil ? "" : PQDownloadFileManager.downloadFileLocalPath(url: absolutePath, fileExtensionType: fileExtensionType), "fileExtensionType": fileExtensionType])
                 if downloadData?.stateHandle != nil {

+ 3 - 3
BFFramework/Classes/Base/ViewModel/PQUploadViewModel.swift

@@ -20,7 +20,7 @@ class PQUploadViewModel: NSObject {
     ///   - videoFromScene 视频来源场景 1:普通上传 2:创作工具,3:普通上传转创作工具,4:后台转换加工,5:卡点视频制作
     /// - Returns: <#description#>
     class func publishVideo(projectId: String?, fileExtensions: String?, title: String, videoPath: String, coverImgPath: String, descr: String, videoFromScene: videoFromScene, reCreateData: PQReCreateModel?, eventTrackData: PQVideoMakeEventTrackModel?, completeHander: @escaping (_ videoData: PQVideoListModel?, _ jsonDict: [String: Any]?, _ msg: String?) -> Void) {
-        PQLog(message: "AKAKAAKprojectId is\(String(describing: projectId)) videoFromScene is \(videoFromScene)")
+        BFLog(message: "AKAKAAKprojectId is\(String(describing: projectId)) videoFromScene is \(videoFromScene)")
         SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + videoSendUrl, parames: ["title": title, "fileExtensions": fileExtensions ?? "application/octet-stream", "videoPath": videoPath, "coverImgPath": coverImgPath, "descr": descr, "viewStatus": 1, "produceProjectId": (projectId ?? "") as String, "videoFromScene": videoFromScene.rawValue]) { response, _, error, _ in
             if error != nil {
                 completeHander(nil, nil, error?.msg)
@@ -29,9 +29,9 @@ class PQUploadViewModel: NSObject {
             var jsonDict = (response as! [String: Any])
             jsonDict["title"] = title
             jsonDict["auditStatus"] = 1
-            jsonDict["uid"] = PQLoginUserInfo.shared.uid
+            jsonDict["uid"] = BFLoginUserInfo.shared.uid
             let tempModel = PQVideoListModel(jsonDict: jsonDict)
-            tempModel.uid = Int(PQLoginUserInfo.shared.uid) ?? 0
+            tempModel.uid = Int(BFLoginUserInfo.shared.uid) ?? 0
             tempModel.auditStatus = 1
             completeHander(tempModel, jsonDict, nil)
             // 发布成功

+ 1 - 1
BFFramework/Classes/Categorys/Int+Ext.swift

@@ -42,7 +42,7 @@ extension Int {
         } else {
             unitStr = "\(self / 10000)万"
         }
-        PQLog(message: "转化单位:\(self) = \(unitStr)")
+        BFLog(message: "转化单位:\(self) = \(unitStr)")
         return unitStr
     }
 }

+ 2 - 2
BFFramework/Classes/Categorys/String+Ext.swift

@@ -39,7 +39,7 @@ extension String {
             return attbText
         }
         for tempStr in searchText! {
-            PQLog(message: "self = \(self),searchText = \(searchText ?? ""),tempStr = \(tempStr)")
+            BFLog(message: "self = \(self),searchText = \(searchText ?? ""),tempStr = \(tempStr)")
             enumerateSearchText(searchText: "\(tempStr)") { _, range in
                 attbText.setAttributes([NSAttributedString.Key.font: searchTextFont, NSAttributedString.Key.foregroundColor: searchTextColor], range: range)
             }
@@ -92,7 +92,7 @@ extension String {
                     if (scalar.properties.isEmoji && scalar.properties.isEmojiPresentation) || tempEmoji.contains(scalar) {
                         return true
                     } else {
-                        PQLog(message: "是表情==\(element),\(scalar)")
+                        BFLog(message: "是表情==\(element),\(scalar)")
                     }
                 }
             }

+ 2 - 2
BFFramework/Classes/Categorys/UIView+Ext.swift

@@ -411,7 +411,7 @@ extension UIImageView {
     ///   - url: 网络url
     func setNetImage(url: String?, placeholder: UIImage = UIImage(named: "placehold_image")!) {
         if url == nil || (url?.count ?? 0) <= 0 {
-            PQLog(message: "设置按钮网络图片地址为空")
+            BFLog(message: "设置按钮网络图片地址为空")
             return
         }
 //        kf.setImage(with: URL(string: url!), placeholder: placeholder, options: url?.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in
@@ -463,7 +463,7 @@ extension UIButton {
     ///   - url: 网络url
     func setNetImage(url: String?, placeholder: UIImage = UIImage(named: "placehold_image")!) {
         if url == nil || (url?.count ?? 0) <= 0 {
-            PQLog(message: "设置按钮网络图片地址为空")
+            BFLog(message: "设置按钮网络图片地址为空")
             return
         }
 //        kf.setImage(with: URL(string: url!), for: .normal, placeholder: placeholder, options: url?.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in

+ 1 - 1
BFFramework/Classes/EventTrack/Model/PQVideoMakeEventTrackModel.swift

@@ -313,7 +313,7 @@ class PQVideoMakeEventTrackModel: NSObject {
         eventTrackDic["syncedUpOriginalMaterialDuration"] = syncedUpOriginalMaterialDuration
         // 卡点视频 视频选用节奏名称(快节奏 1、适中 2、慢节奏 3))
         eventTrackDic["syncedUpRhythmNumber"] = syncedUpRhythmNumber
-        PQLog(message: "创作工具埋点信息数据-\(eventTrackDic)")
+        BFLog(message: "创作工具埋点信息数据-\(eventTrackDic)")
         return eventTrackDic
     }
 }

+ 10 - 10
BFFramework/Classes/EventTrack/ViewModel/PQEventTrackViewModel.swift

@@ -47,7 +47,7 @@ class PQEventTrackViewModel: NSObject {
                 tempParams["extParams"] = dictionaryToJsonString(extParams!)
             }
             SWNetRequest.postRequestData(url: PQENVUtil.shared.commonapi + staticsFrontendReportUrl, parames: tempParams) { _, _, _, _ in
-                PQLog(message: "\(remindmsg ?? "基础")埋点数据上报:\(tempParams)")
+                BFLog(message: "\(remindmsg ?? "基础")埋点数据上报:\(tempParams)")
             }
         }
     }
@@ -175,7 +175,7 @@ class PQEventTrackViewModel: NSObject {
                 params["extParams"] = dictionaryToJsonString(tempExtParams)
             }
             SWNetRequest.postRequestData(url: url, parames: params) { response, _, error, _ in
-                PQLog(message: "播放相关数据上报:\(String(describing: error)),\(response ?? [:])")
+                BFLog(message: "播放相关数据上报:\(String(describing: error)),\(response ?? [:])")
             }
         }
     }
@@ -218,8 +218,8 @@ class PQEventTrackViewModel: NSObject {
 //            params["rootLaunchShareId"] = shareId
 //            params["parentShareId"] = shareId
 //            params["rootShareId"] = shareId
-//            if !PQLoginUserInfo.shared.openId.isEmpty {
-//                params["shareUi"] = PQLoginUserInfo.shared.openId
+//            if !BFLoginUserInfo.shared.openId.isEmpty {
+//                params["shareUi"] = BFLoginUserInfo.shared.openId
 //            }
 //            if pageSource.rawValue.contains("speedApp-category") {
 //                params["pageCategoryId"] = 55
@@ -242,7 +242,7 @@ class PQEventTrackViewModel: NSObject {
 //                params["abInfoData"] = abInfoData
 //            }
 //            SWNetRequest.postRequestData(url: url, parames: params) { response, _, error, _ in
-//                PQLog(message: "用户点击分享数据上报:\(String(describing: error)),\(response ?? [:])")
+//                BFLog(message: "用户点击分享数据上报:\(String(describing: error)),\(response ?? [:])")
 //            }
 //        }
 //    }
@@ -320,7 +320,7 @@ class PQEventTrackViewModel: NSObject {
                 saveUserDefaults(key: cFirstParams, value: dictionaryToJsonString(params) ?? "")
             }
             SWNetRequest.postRequestData(url: PQENVUtil.shared.commonapi + staticsFrontendReportUrl, parames: params) { response, _, error, _ in
-                PQLog(message: "冷热启动上报:\(String(describing: error)),\(response ?? [:]),params = \(params)")
+                BFLog(message: "冷热启动上报:\(String(describing: error)),\(response ?? [:]),params = \(params)")
                 if PQSingletoMemoryUtil.shared.isColdLaunch {
                     PQSingletoMemoryUtil.shared.coldLaunchStatus = error == nil ? 2 : 3
                 }
@@ -358,7 +358,7 @@ class PQEventTrackViewModel: NSObject {
                 params.removeValue(forKey: "aps")
             }
             SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + pushActionReportUrl, parames: params) { response, _, error, _ in
-                PQLog(message: "推送点击数据上报:\(String(describing: error)),\(response ?? [:])")
+                BFLog(message: "推送点击数据上报:\(String(describing: error)),\(response ?? [:])")
             }
         }
     }
@@ -371,7 +371,7 @@ class PQEventTrackViewModel: NSObject {
         DispatchQueue.global().async {
             SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + pushDeviceTokenReportUrl, parames: ["registerId": registerId, "deviceToken": deviceToken, "brand": cPushChannel]) { response, _, error, _ in
                 completeHander(error == nil ? true : false)
-                PQLog(message: "deviceToken数据上报:\(String(describing: error)),\(response ?? [:])")
+                BFLog(message: "deviceToken数据上报:\(String(describing: error)),\(response ?? [:])")
             }
         }
     }
@@ -387,7 +387,7 @@ class PQEventTrackViewModel: NSObject {
         DispatchQueue.global().async {
             let params: [String: Any] = ["keyWord": keyWord, "searchType": searchType, "searchNumber": searchNumber, "reportType": reportType]
             SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + searchReportUrl, parames: params) { response, _, error, _ in
-                PQLog(message: "搜索数据上报:\(String(describing: error)),\(response ?? [:])")
+                BFLog(message: "搜索数据上报:\(String(describing: error)),\(response ?? [:])")
             }
         }
     }
@@ -517,7 +517,7 @@ class PQEventTrackViewModel: NSObject {
                 tempParams["extParams"] = dictionaryToJsonString(tempExtParams)
             }
             SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + messagePeportUrl, parames: tempParams) { _, _, _, _ in
-                PQLog(message: "\(remindmsg ?? "基础")埋点数据上报:\(tempParams)")
+                BFLog(message: "\(remindmsg ?? "基础")埋点数据上报:\(tempParams)")
             }
         }
     }

+ 3 - 3
BFFramework/Classes/PModels/PQLoginUserInfo.swift

@@ -1,5 +1,5 @@
 //
-//  PQLoginUserInfo.swift
+//  BFLoginUserInfo.swift
 //  PQSpeed
 //
 //  Created by SanW on 2020/5/27.
@@ -11,8 +11,8 @@ import UIKit
 // MARK: - 登录用户信息
 
 /// 登录用户信息
-class PQLoginUserInfo: NSObject {
-    static let shared = PQLoginUserInfo()
+class BFLoginUserInfo: NSObject {
+    static let shared = BFLoginUserInfo()
     var uid: String = "" // 账号
     var userCode: String = "" // 账号
     var accessToken: String = "" // token

+ 6 - 6
BFFramework/Classes/PModels/PQVideoListModel.swift

@@ -275,7 +275,7 @@ class PQVideoListModel: PQBaseModel {
             titleFontSize = 25
         }
 
-        PQLog(message: "title \(String(describing: title))   titleH :\(titleH)  titleFontSize :\(titleFontSize)")
+        BFLog(message: "title \(String(describing: title))   titleH :\(titleH)  titleFontSize :\(titleFontSize)")
 
         var isFollowed: Bool = false
 
@@ -288,13 +288,13 @@ class PQVideoListModel: PQBaseModel {
         let attM: CGFloat = cDefaultMargin * 4.5
         usnameW = sizeWithText(text: userInfo?.nickName ?? "", font: UIFont.systemFont(ofSize: 16, weight: .medium), size: CGSize(width: !isFollowed ? (cScreenWidth - cDefaultMargin * 8) : (cScreenWidth - cDefaultMargin * 9 - attM), height: cDefaultMargin * 2)).width + cDefaultMargin * 2
 
-        PQLog(message: "nickname is \(userInfo?.nickName ?? "") '    'usnameW is \(usnameW) isFollowed is \(isFollowed)")
+        BFLog(message: "nickname is \(userInfo?.nickName ?? "") '    'usnameW is \(usnameW) isFollowed is \(isFollowed)")
 
         updateReommendAgent()
 
         watchInfoY = -cDefaultMargin
 
-        PQLog(message: "watchInfoY11111 is \(watchInfoY)")
+        BFLog(message: "watchInfoY11111 is \(watchInfoY)")
     }
 
     func updateReommendAgent() {
@@ -308,7 +308,7 @@ class PQVideoListModel: PQBaseModel {
                     verticality = true
                     break
                 }
-                PQLog(message: "item.title  \(String(describing: item.title))")
+                BFLog(message: "item.title  \(String(describing: item.title))")
                 if item.title != nil, (item.title?.count ?? 0) > 0 {
                     haveTitle = true
                     break
@@ -318,7 +318,7 @@ class PQVideoListModel: PQBaseModel {
         itemH = verticality ? 130 : (haveTitle ? 90 : 55)
         itemH = (relationData?.count ?? 0) > 0 ? itemH : 0
 
-        PQLog(message: "itemH is: \(itemH) sss \(String(describing: relationData?.count))")
+        BFLog(message: "itemH is: \(itemH) sss \(String(describing: relationData?.count))")
 
         rotationH = itemH
         // 描述部分
@@ -328,7 +328,7 @@ class PQVideoListModel: PQBaseModel {
             watchInfoY = -cDefaultMargin
         }
 
-        PQLog(message: "watchInfoY2222 is \(watchInfoY)")
+        BFLog(message: "watchInfoY2222 is \(watchInfoY)")
 
         let nomalH: CGFloat = cDefaultMargin * 1.5
 //        let likeH: CGFloat = favoriteds <= 0 ? 0 : nomalH

+ 2 - 2
BFFramework/Classes/PModels/editDarftModels/PQEditAudioTrackMaterialModel.swift

@@ -24,7 +24,7 @@ class PQEditAudioTrackMaterialModel: PQEditBaseModel {
      @objc dynamic var materialDurationFit: PQEditmaterialDurationFitModel?
      @objc dynamic var locationPath: String = "" {
          didSet {
-             PQLog(message: "音频的:locationPath\(locationPath)")
+             BFLog(message: "音频的:locationPath\(locationPath)")
          }
      }
      **/
@@ -48,7 +48,7 @@ class PQEditAudioTrackMaterialModel: PQEditBaseModel {
     // 音频文件本地地址 URI
     @objc dynamic var locationPath: String = "" {
         didSet {
-            PQLog(message: "音频的:locationPath\(locationPath)")
+            BFLog(message: "音频的:locationPath\(locationPath)")
         }
     }
 

+ 2 - 2
BFFramework/Classes/PModels/editDarftModels/PQEditAudioTrackModel.swift

@@ -38,7 +38,7 @@ class PQEditAudioTrackModel: PQEditBaseModel {
     /// - Parameter voiceType: voiceType  音频类型(bgm:背景音乐,produce:合成语音,speech:录音,local : 本地文件)
     /// - Returns: PQEditAudioTrackMaterialModel
     func getAudioTrackModel(voiceType: String) -> PQEditAudioTrackMaterialModel? {
-        PQLog(message: "查询 voiceType is \(voiceType)")
+        BFLog(message: "查询 voiceType is \(voiceType)")
         var audioTrackMaterialModel: PQEditAudioTrackMaterialModel?
         for materialModel in audioTrackMaterials {
             if materialModel.voiceType == voiceType {
@@ -55,7 +55,7 @@ class PQEditAudioTrackModel: PQEditBaseModel {
             audioTrack.voiceType == VOICETYPT.SPEECH.rawValue
         })
         if audioTrackMaterials.count > sesscionIdex ?? 0 {
-            PQLog(message: "原来有录音 \(String(describing: sesscionIdex))")
+            BFLog(message: "原来有录音 \(String(describing: sesscionIdex))")
             audioTrackMaterials.remove(at: sesscionIdex ?? 0)
         }
         audioTrackMaterials.append(audioTrackMaterialModel)

+ 1 - 1
BFFramework/Classes/PModels/editDarftModels/PQEditBaseModel.swift

@@ -23,7 +23,7 @@ let timeTransform = TransformOf<Float64, Float64>(fromJSON: { (value: Float64?)
 
 // 自定义音量转换协议,服务器单位0.0-1.0,我们使用 0-100
 let volumeGainTransform = TransformOf<Float64, Float64>(fromJSON: { (value: Float64?) -> Float64? in
-    PQLog(message: "value is \(value)")
+    BFLog(message: "value is \(value)")
     return (value ?? 0.0) * 100.0
 }, toJSON: { (value: Float64?) -> Float64? in
     if let value = value {

+ 5 - 5
BFFramework/Classes/PModels/editDarftModels/PQEditSdataModel.swift

@@ -38,7 +38,7 @@ class PQEditSdataModel: PQEditBaseModel {
             }
         }
         if selectBGMIndex != -1 {
-            PQLog(message: "DELETE BGM INDEX\(selectBGMIndex)")
+            BFLog(message: "DELETE BGM INDEX\(selectBGMIndex)")
             sections.remove(at: selectBGMIndex)
         }
     }
@@ -118,9 +118,9 @@ class PQEditSdataModel: PQEditBaseModel {
         for section in sections {
             if section.sectionType == "normal" {
                 voisonArray.append(section)
-            } else { PQLog(message: "有音频bgm session") }
+            } else { BFLog(message: "有音频bgm session") }
         }
-        PQLog(message: "有效视觉段落数 \(voisonArray.count)")
+        BFLog(message: "有效视觉段落数 \(voisonArray.count)")
         return voisonArray
     }
 
@@ -140,7 +140,7 @@ class PQEditSdataModel: PQEditBaseModel {
                 } else if (isSaveDraft && visionTrackMaterialsModel.materialUrl.count > 0) || (!isSaveDraft && (visionTrackMaterialsModel.locationPath.count > 0 || visionTrackMaterialsModel.materialUrl.count > 0)) {
                     visionTrackMaterialsTemp.append(visionTrackMaterialsModel)
 
-                } else { PQLog(message: "visionTrackMaterialsModel 这个无效") }
+                } else { BFLog(message: "visionTrackMaterialsModel 这个无效") }
             }
             section.sectionTimeline?.visionTrack?.visionTrackMaterials = visionTrackMaterialsTemp
 
@@ -150,7 +150,7 @@ class PQEditSdataModel: PQEditBaseModel {
                 if audioTrackMaterialModel.voiceType == VOICETYPT.PRODUCE.rawValue || audioTrackMaterialModel.voiceType == VOICETYPT.BGM.rawValue || (isSaveDraft && audioTrackMaterialModel.materialUrl.count > 0) || (!isSaveDraft && (audioTrackMaterialModel.locationPath.count > 0 || audioTrackMaterialModel.materialUrl.count > 0)) {
                     audioTrackMaterialModelTemp.append(audioTrackMaterialModel)
 
-                } else { PQLog(message: "audioTrackMaterialModel 这个无效") }
+                } else { BFLog(message: "audioTrackMaterialModel 这个无效") }
             }
             section.sectionTimeline?.audioTrack?.audioTrackMaterials = audioTrackMaterialModelTemp
         }

+ 6 - 6
BFFramework/Classes/PModels/editDarftModels/PQEditSectionModel.swift

@@ -19,7 +19,7 @@ class PQEditSectionModel: PQEditBaseModel {
     @objc dynamic var addAutoEffect: Int = 0
     @objc dynamic var sectionDuration: Float64 = 0 {
         didSet {
-            PQLog(message: "sectionDuration == \(sectionDuration)")
+            BFLog(message: "sectionDuration == \(sectionDuration)")
         }
     }
 
@@ -28,13 +28,13 @@ class PQEditSectionModel: PQEditBaseModel {
     // 段落序号globle 全是0  nomoal 从1开始++ XXXXXX(已经通过TransformOf处理过,代码中使用时都是从0开始就 OK )
     @objc dynamic var sectionIndex: Int = 0 {
         didSet {
-            PQLog(message: "sectionIndex is \(sectionIndex)")
+            BFLog(message: "sectionIndex is \(sectionIndex)")
         }
     }
 
     @objc dynamic var sectionText: String = "" {
         didSet {
-          PQLog(message: "文字发生了改变")
+          BFLog(message: "文字发生了改变")
   
         }
     }
@@ -160,7 +160,7 @@ class PQEditSectionModel: PQEditBaseModel {
 
     /// 是否已经设置过一个发音人,voice 会在选择时给值,取消选择时清空 init
     func haveSelectVoice() -> Bool {
-        PQLog(message: "voice?.avatarUrl \(String(describing: selectVoice?.avatarUrl))")
+        BFLog(message: "voice?.avatarUrl \(String(describing: selectVoice?.avatarUrl))")
         return selectVoice?.avatarUrl.count ?? 0 > 0
     }
 
@@ -213,7 +213,7 @@ class PQEditSectionModel: PQEditBaseModel {
         var stickerTotalDuration: Float64 = 0
         // 没有选择发声音人,只有纯视觉的情况
         if sectionText.count == 0, audioFilePath.count == 0, mixEmptyAuidoFilePath.count == 0 {
-            PQLog(message: "section index is \(sectionIndex)")
+            BFLog(message: "section index is \(sectionIndex)")
             if !isEmptyObject(object: sectionTimeline?.visionTrack?.getEnableVisionTrackMaterials()) {
                 for sticker in sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
                     if sticker.timelineOut == 0, sticker.timelineIn == 0 {
@@ -236,7 +236,7 @@ class PQEditSectionModel: PQEditBaseModel {
            
              audioFilePath = documentPath
              sectionDuration = CMTimeGetSeconds(AVURLAsset(url: URL(fileURLWithPath: documentPath), options: avAssertOptions).duration)
-            PQLog(message: " 生成的空声音 \(String(describing: documentPath))  时长 \(String(describing: sectionDuration))")
+            BFLog(message: " 生成的空声音 \(String(describing: documentPath))  时长 \(String(describing: sectionDuration))")
             
         }
     }

+ 2 - 2
BFFramework/Classes/PModels/editDarftModels/PQEditSectionTimelineModel.swift

@@ -37,7 +37,7 @@ class PQEditSectionTimelineModel: PQEditBaseModel {
     // 添加发声音人数据
     func addVoice(audioMix: PQVoiceModel) {
         deleteVoice()
-        PQLog(message: "添加发声音人数据 \(audioMix.voice)")
+        BFLog(message: "添加发声音人数据 \(audioMix.voice)")
         let audioTrackMaterial = PQEditAudioTrackMaterialModel()
 
         audioTrackMaterial.voiceType = VOICETYPT.PRODUCE.rawValue
@@ -65,7 +65,7 @@ class PQEditSectionTimelineModel: PQEditBaseModel {
 
     // 删除发声音人,目前只有一个,配音
     func deleteVoice() {
-        PQLog(message: "删除一个发声音人")
+        BFLog(message: "删除一个发声音人")
         audioTrack?.audioTrackMaterials.removeAll()
     }
 }

+ 1 - 1
BFFramework/Classes/PModels/editDarftModels/PQEditSubtitleInfoModel.swift

@@ -17,7 +17,7 @@ class PQEditSubtitleInfoModel: PQEditBaseModel {
             if itemHeigth < cDefaultMargin * 2 {
                 itemHeigth = cDefaultMargin * 2
             }
-            PQLog(message: "text== \(text),itemHeigth = \(itemHeigth)")
+            BFLog(message: "text== \(text),itemHeigth = \(itemHeigth)")
         }
     }
 

+ 11 - 11
BFFramework/Classes/PModels/editDarftModels/PQEditVisionTrackMaterialsModel.swift

@@ -64,7 +64,7 @@ class PQEditVisionTrackMaterialsModel: PQEditBaseModel {
     // 文件本地地址 URI
     @objc dynamic var locationPath: String = "" {
         didSet {
-            PQLog(message: "如果是全路径就有问题XXXX 设置了新值为:locationPath\(locationPath)")
+            BFLog(message: "如果是全路径就有问题XXXX 设置了新值为:locationPath\(locationPath)")
         }
     }
 
@@ -208,35 +208,35 @@ class PQEditVisionTrackMaterialsModel: PQEditBaseModel {
     /// - Returns: <#description#>
     func isEqualMaterial(newMaterial: PQEditVisionTrackMaterialsModel?) -> Bool {
         if newMaterial == nil {
-            PQLog(message: "素材对比为空:material = \(String(describing: newMaterial))")
+            BFLog(message: "素材对比为空:material = \(String(describing: newMaterial))")
             return false
         }
         if asset != nil && newMaterial?.asset != nil && asset == newMaterial?.asset {
-            PQLog(message: "素材对比相等:asset = \(asset!)--\(String(describing: newMaterial?.asset))")
+            BFLog(message: "素材对比相等:asset = \(asset!)--\(String(describing: newMaterial?.asset))")
             return true
         }
         if (netResCoverImageURL != nil && (netResCoverImageURL?.count ?? 0) > 0) && (newMaterial?.netResCoverImageURL != nil && (newMaterial?.netResCoverImageURL?.count ?? 0) > 0) && netResCoverImageURL == newMaterial?.netResCoverImageURL {
-            PQLog(message: "素材对比相等:netResCoverImageURL = \(netResCoverImageURL!)--\(String(describing: newMaterial?.netResCoverImageURL))")
+            BFLog(message: "素材对比相等:netResCoverImageURL = \(netResCoverImageURL!)--\(String(describing: newMaterial?.netResCoverImageURL))")
             return true
         }
         if (materialUrl.count > 0) && ((newMaterial?.materialUrl.count ?? 0) > 0) && materialUrl == newMaterial?.materialUrl {
-            PQLog(message: "素材对比相等:materialUrl = \(materialUrl)--\(String(describing: newMaterial?.materialUrl))")
+            BFLog(message: "素材对比相等:materialUrl = \(materialUrl)--\(String(describing: newMaterial?.materialUrl))")
             return true
         }
-        PQLog(message: "素材对比不相等:asset = \(String(describing: asset))--\(String(describing: newMaterial?.asset)),netResCoverImageURL = \(String(describing: netResCoverImageURL))--\(String(describing: newMaterial?.netResCoverImageURL)),materialUrl = \(materialUrl)--\(String(describing: newMaterial?.materialUrl))")
+        BFLog(message: "素材对比不相等:asset = \(String(describing: asset))--\(String(describing: newMaterial?.asset)),netResCoverImageURL = \(String(describing: netResCoverImageURL))--\(String(describing: newMaterial?.netResCoverImageURL)),materialUrl = \(materialUrl)--\(String(describing: newMaterial?.materialUrl))")
         return false
     }
 
     func getCoverImage() -> UIImage? {
         if coverImageUI != nil {
-            PQLog(message: "已经有封面了")
+            BFLog(message: "已经有封面了")
             return coverImageUI
         }
         if locationPath.count == 0 {
-            PQLog(message: "本地地址为空可能没有下载完成!!")
+            BFLog(message: "本地地址为空可能没有下载完成!!")
             return nil
         }
-        PQLog(message: " locationPath is\(documensDirectory + locationPath)")
+        BFLog(message: " locationPath is\(documensDirectory + locationPath)")
         if type != StickerType.VIDEO.rawValue {
             var coverImage = UIImage(contentsOfFile: documensDirectory + locationPath)
 
@@ -247,7 +247,7 @@ class PQEditVisionTrackMaterialsModel: PQEditBaseModel {
                     fileData = try! Data(contentsOf: URL(fileURLWithPath: documensDirectory + locationPath))
                 }
 //                if fileData != nil && (fileData?.count ?? 0) > 0 && fileData?.isWebPFormat ?? false {
-//                    PQLog(message: "这个资源为web!")
+//                    BFLog(message: "这个资源为web!")
 //                    coverImage = WebPProcessor.default.process(item: ImageProcessItem.data(fileData!), options: [.onlyLoadFirstFrame, .scaleFactor(1)])
 //                }
             }
@@ -255,7 +255,7 @@ class PQEditVisionTrackMaterialsModel: PQEditBaseModel {
             return coverImage
         } else {
             if coverImageUI != nil {
-                PQLog(message: "已经有封面了")
+                BFLog(message: "已经有封面了")
                 return coverImageUI
             } else {
                 return PQVideoSnapshotUtil.videoSnapshot(videoURL: URL(fileURLWithPath: documensDirectory + locationPath), time: 0)

+ 5 - 5
BFFramework/Classes/PModels/editDarftModels/PQEditVisionTrackModel.swift

@@ -46,13 +46,13 @@ class PQEditVisionTrackModel: PQEditBaseModel {
     func getEnableVisionTrackMaterials() -> List<PQEditVisionTrackMaterialsModel> {
         let visionTrackMaterialsTemp = List<PQEditVisionTrackMaterialsModel>.init()
 
-//        PQLog(message: "visionTrackMaterials 总数\(visionTrackMaterials.count)")
+//        BFLog(message: "visionTrackMaterials 总数\(visionTrackMaterials.count)")
         for visionTrackMaterialsModel in visionTrackMaterials {
             if visionTrackMaterialsModel.type == "image" || visionTrackMaterialsModel.type == "video" || visionTrackMaterialsModel.type == "gif" {
                 visionTrackMaterialsTemp.append(visionTrackMaterialsModel)
             }
         }
-//        PQLog(message: "visionTrackMaterials 有效素材总数\(visionTrackMaterialsTemp.count)")
+//        BFLog(message: "visionTrackMaterials 有效素材总数\(visionTrackMaterialsTemp.count)")
         return visionTrackMaterialsTemp
     }
 
@@ -87,13 +87,13 @@ class PQEditVisionTrackModel: PQEditBaseModel {
     func getSubtitleMatraislInfo() -> List<PQEditVisionTrackMaterialsModel> {
         let visionTrackMaterialsTemp = List<PQEditVisionTrackMaterialsModel>.init()
 
-        PQLog(message: "visionTrackMaterials 总数\(visionTrackMaterials.count)")
+        BFLog(message: "visionTrackMaterials 总数\(visionTrackMaterials.count)")
         for visionTrackMaterialsModel in visionTrackMaterials {
             if visionTrackMaterialsModel.type == "subtitle" {
                 visionTrackMaterialsTemp.append(visionTrackMaterialsModel)
             }
         }
-        PQLog(message: "visionTrackMaterials 本段有效字幕总数\(visionTrackMaterialsTemp.count)")
+        BFLog(message: "visionTrackMaterials 本段有效字幕总数\(visionTrackMaterialsTemp.count)")
         return visionTrackMaterialsTemp
     }
 
@@ -101,7 +101,7 @@ class PQEditVisionTrackModel: PQEditBaseModel {
     /// - Parameter materialsModel: GIF . IMAGE, video 类型的
     func deleteMatraislInfo(materialsModel: PQEditVisionTrackMaterialsModel?) {
         if materialsModel == nil {
-            PQLog(message: "要删除的素材为空 操作不成功!")
+            BFLog(message: "要删除的素材为空 操作不成功!")
             return
         }
         let index = visionTrackMaterials.firstIndex(where: { (item) -> Bool in

+ 2 - 2
BFFramework/Classes/PQGPUImage/Source/BasicOperation.swift

@@ -109,10 +109,10 @@ open class BasicOperation: ImageProcessingOperation {
             outputFramebuffer.timingStyle = framebuffer.timingStyle
 
             let currTime1 = CMTimeGetSeconds(CMTime(value: framebuffer.timingStyle.timestamp!.value, timescale: framebuffer.timingStyle.timestamp!.timescale))
-//            PQLog(message: "baseicOperation  framebuffer 当前时间: \(currTime1)")
+//            BFLog(message: "baseicOperation  framebuffer 当前时间: \(currTime1)")
 
             let currTime = CMTimeGetSeconds(CMTime(value: outputFramebuffer.timingStyle.timestamp!.value, timescale: outputFramebuffer.timingStyle.timestamp!.timescale))
-//            PQLog(message: "baseicOperation 当前时间: \(currTime)")
+//            BFLog(message: "baseicOperation 当前时间: \(currTime)")
 
             updateTargetsWithFramebuffer(outputFramebuffer)
         }

+ 2 - 2
BFFramework/Classes/PQGPUImage/Source/Pipeline.swift

@@ -73,7 +73,7 @@ public extension ImageSource {
 
     func updateTargetsWithFramebuffer(_ framebuffer: Framebuffer) {
         let currTime1 = CMTimeGetSeconds(CMTime(value: framebuffer.timingStyle.timestamp!.value, timescale: framebuffer.timingStyle.timestamp!.timescale))
-//        PQLog(message: "pipeline   framebuffer 当前时间: \(currTime1)")
+//        BFLog(message: "pipeline   framebuffer 当前时间: \(currTime1)")
 
         if DispatchQueue.getSpecific(key: sharedImageProcessingContext.dispatchQueueKey) != sharedImageProcessingContext.dispatchQueueKeyValue {
             debugPrint("WARNING: updateTargetsWithFramebuffer() must be called from the sharedImageProcessingContext")
@@ -92,7 +92,7 @@ public extension ImageSource {
         }
         for (target, index) in targets {
             let currTime1 = CMTimeGetSeconds(CMTime(value: framebuffer.timingStyle.timestamp!.value, timescale: framebuffer.timingStyle.timestamp!.timescale))
-//            PQLog(message: "baseicOperation  framebuffer 当前时间: \(currTime1)")
+//            BFLog(message: "baseicOperation  framebuffer 当前时间: \(currTime1)")
 
             target.newFramebufferAvailable(framebuffer, fromSourceIndex: index)
         }

+ 1 - 1
BFFramework/Classes/PQGPUImage/Source/iOS/MovieOutput.swift

@@ -335,7 +335,7 @@ public class MovieOutput: ImageConsumer, AudioEncodingTarget {
 
             while !assetWriterAudioInput.isReadyForMoreMediaData, !self.encodingLiveVideo, !self.audioEncodingIsFinished {
                 self.synchronizedEncodingDebugPrint("Audio waiting...")
-                PQLog(message: "Audio waiting...Audio waiting...")
+                BFLog(message: "Audio waiting...Audio waiting...")
                 // add by ak 单位是微秒(百万分之一秒
                 usleep(100_000)
             }

+ 3 - 3
BFFramework/Classes/PQGPUImage/Source/iOS/SpeakerOutput.swift

@@ -102,7 +102,7 @@ public class SpeakerOutput: AudioEncodingTarget {
         if !isPlaying || processingGraph == nil { return }
         AUGraphStop(processingGraph!)
         isPlaying = false
-        PQLog(message: "音乐停止!!!!")
+        BFLog(message: "音乐停止!!!!")
     }
 
     // MARK: -
@@ -197,7 +197,7 @@ public class SpeakerOutput: AudioEncodingTarget {
 
     public func processAudioBuffer(_ sampleBuffer: CMSampleBuffer) {
         if !isReadyForMoreMediaData || !isPlaying {
-            PQLog(message: "不处理这一帧声音")
+            BFLog(message: "不处理这一帧声音")
             return
             
         }
@@ -320,7 +320,7 @@ func playbackCallback(
         let bytesToRead = min(availableBytes, requestedBytesSize)
         if !p.isMuted {
             // Copy the bytes from the circular buffer into the outSample
-//            PQLog(message: "playe audio data is \(p.circularBuffer.length)")
+//            BFLog(message: "playe audio data is \(p.circularBuffer.length)")
             memcpy(outSamples, bufferTail, Int(bytesToRead))
         }
         // Clear what we just read out of the circular buffer

+ 1 - 1
BFFramework/Classes/PQGPUImage/akfilters/PQBaseFilter.swift

@@ -13,7 +13,7 @@ let BASE_FILTER_ENABLE_LOG: Int = 0
 /** 打印 */
 func FilterLog<T>(message: T) {
     if BASE_FILTER_ENABLE_LOG == 1 {
-        PQLog(message: message)
+        BFLog(message: message)
     }
 }
 

+ 1 - 1
BFFramework/Classes/PQGPUImage/akfilters/PQGPUImageFilterGroup.swift

@@ -27,7 +27,7 @@ open class PQGPUImageFilterGroup: PQBaseFilter{
         }
         //创建不同的filter
         if(currentSticker == nil){
-            PQLog(message: "sticker data is error")
+            BFLog(message: "sticker data is error")
             return  PQBaseFilter.init(fragmentShader: PassthroughFragmentShader, numberOfInputs: 1)
         }
         

+ 2 - 2
BFFramework/Classes/PQGPUImage/akfilters/PQGifFilter.swift

@@ -44,7 +44,7 @@ open class PQGifFilter: PQBaseFilter {
         }
 
         if gifData == nil {
-            PQLog(message: "gif数据有问题!")
+            BFLog(message: "gif数据有问题!")
             return
         }
         PQPHAssetVideoParaseUtil.parasGIFImage(data: gifData) { [unowned self] _, images, duration in
@@ -63,7 +63,7 @@ open class PQGifFilter: PQBaseFilter {
 
             if self.mSticker?.materialDurationFit?.fitType == adapterMode.loopAuto.rawValue || self.mSticker?.materialDurationFit?.fitType == adapterMode.staticFrame.rawValue {
                 self.delayTime = self.mDuration / Double(self.mGifImages.count)
-                PQLog(message: "正常速度每一帧的时间:\(String(describing: self.delayTime))")
+                BFLog(message: "正常速度每一帧的时间:\(String(describing: self.delayTime))")
             }
             sharedImageProcessingContext.runOperationSynchronously {
                 // ( 提前渲染一帧

+ 3 - 3
BFFramework/Classes/PQGPUImage/akfilters/PQImageFilter.swift

@@ -23,7 +23,7 @@ open class PQImageFilter: PQBaseFilter {
     var newImage: UIImage?
 
     deinit {
-        PQLog(message: "image filter deinit 析构掉~")
+        BFLog(message: "image filter deinit 析构掉~")
         newImage = nil
         
         if(imageTexture != 0){
@@ -71,7 +71,7 @@ open class PQImageFilter: PQBaseFilter {
         }
 
         if newImage != nil {
-            PQLog(message: "提前加载图片。。。。timelineIn : \(String(describing: mSticker?.timelineIn)) timelineOut :\(mSticker?.timelineOut) \(mSticker?.locationPath)")
+            BFLog(message: "提前加载图片。。。。timelineIn : \(String(describing: mSticker?.timelineIn)) timelineOut :\(mSticker?.timelineOut) \(mSticker?.locationPath)")
             imageTexture = PQGPUImageTools.setupTexture(image: newImage!.cgImage!)
 
         } else { FilterLog(message: "image filter init error image data is nil!") }
@@ -84,7 +84,7 @@ open class PQImageFilter: PQBaseFilter {
         if mSticker!.timelineIn != 0, currTime >= mSticker!.timelineIn, currTime <= mSticker!.timelineOut, imageTexture == 0 {
             if newImage != nil {
 //                imageTexture = PQGPUImageTools.setupTexture(image: newImage!.cgImage!)
-            } else { PQLog(message: "image filter init error image data is nil!") }
+            } else { BFLog(message: "image filter init error image data is nil!") }
         }
     }
 

+ 2 - 2
BFFramework/Classes/PQGPUImage/akfilters/PQMoveFilter.swift

@@ -165,7 +165,7 @@ class PQMoveFilter: PQBaseFilter {
 //        let currTime = CMTimeGetSeconds(CMTime(value: inputFramebuffer.timingStyle.timestamp!.value, timescale: inputFramebuffer.timingStyle.timestamp!.timescale))
 
 //        enableSeek = inputFramebuffer.userInfo?["enableSeek"] as? Bool ?? false
-        PQLog(message: "enableSeek is \(enableSeek)")
+        BFLog(message: "enableSeek is \(enableSeek)")
         currentTime = CMTime(value: inputFramebuffer.timingStyle.timestamp!.value, timescale: inputFramebuffer.timingStyle.timestamp!.timescale)
         FilterLog(message: "11定帧!duration is currentSampleTime is \(CMTimeGetSeconds(currentTime))")
 
@@ -377,7 +377,7 @@ class PQMoveFilter: PQBaseFilter {
 
         if sampleBuffer != nil {
             if enableSeek {
-                PQLog(message: "cacheframeBuffers 添加后 个数\(cacheframeBuffers.count)")
+                BFLog(message: "cacheframeBuffers 添加后 个数\(cacheframeBuffers.count)")
                 cacheframeBuffers.append(sampleBuffer!)
             } else {
                 // 正常处理每一帧

+ 5 - 5
BFFramework/Classes/PQGPUImage/akfilters/PQMoveInput.swift

@@ -120,7 +120,7 @@ public class PQMoveInput: ImageSource {
      // 画布的大小 注意要是偶数 要不在 IOS 13上会有绿边 自动放大到偶数
     var mShowVidoSize: CGSize = cVideoCannvasSizeOneToOne {
         didSet {
-            PQLog(message: "mShowVidoSize is move input  \(mShowVidoSize)")
+            BFLog(message: "mShowVidoSize is move input  \(mShowVidoSize)")
             do {
                 displayLink?.isPaused = true
                 imageFramebuffer = try Framebuffer(context: sharedImageProcessingContext, orientation: .portrait, size: GLSize(width: GLint(mShowVidoSize.width), height: GLint(mShowVidoSize.height)), textureOnly: true)
@@ -191,7 +191,7 @@ public class PQMoveInput: ImageSource {
         isPlay = false
         beginTime = 0
         currentTime = .zero
-        PQLog(message: "播放开始时间、\(CMTimeGetSeconds(timeRange.start)) 结束时间\(CMTimeGetSeconds(timeRange.end))")
+        BFLog(message: "播放开始时间、\(CMTimeGetSeconds(timeRange.start)) 结束时间\(CMTimeGetSeconds(timeRange.end))")
       
         playeTimeRange = timeRange
         startTime = playeTimeRange.start
@@ -286,7 +286,7 @@ public class PQMoveInput: ImageSource {
 
         isPlay = true
         if assetReader == nil {
-            PQLog(message: "assetReader is null!!!!!")
+            BFLog(message: "assetReader is null!!!!!")
             return
         }
 
@@ -411,7 +411,7 @@ public class PQMoveInput: ImageSource {
             }
 
             assetReader.timeRange = playeTimeRange
-            PQLog(message: "播放器开始时间\(CMTimeGetSeconds(assetReader.timeRange.start)) 结束时间\(CMTimeGetSeconds(assetReader.timeRange.end))")
+            BFLog(message: "播放器开始时间\(CMTimeGetSeconds(assetReader.timeRange.start)) 结束时间\(CMTimeGetSeconds(assetReader.timeRange.end))")
        
 
             actualStartTime = nil
@@ -446,7 +446,7 @@ public class PQMoveInput: ImageSource {
 
     func readNextAudioSample(with assetReader: AVAssetReader, from audioTrackOutput: AVAssetReaderOutput) {
         if !isPlay {
-            PQLog(message: "自动停到首帧的不处理音频")
+            BFLog(message: "自动停到首帧的不处理音频")
             return
         }
         /*

+ 6 - 6
BFFramework/Classes/PQGPUImage/akfilters/PQSubTitleFilter.swift

@@ -45,18 +45,18 @@ open class PQSubTitleFilter: BasicOperation {
         super.init(fragmentShader: AlphaPassthroughFragmentShader, numberOfInputs: 1)
 
         isBigSubtile = isBig
-        PQLog(message: "isBigSubtile 强制设置 \(isBigSubtile)")
+        BFLog(message: "isBigSubtile 强制设置 \(isBigSubtile)")
         mSubtitles = st
 
         subTitleTexture = 0
 
         for subtitle in mSubtitles! {
-            PQLog(message: "初始化数据 start: \(subtitle.timelineIn)  end: \(subtitle.timelineOut) 显示的文字:\(subtitle.text)")
+            BFLog(message: "初始化数据 start: \(subtitle.timelineIn)  end: \(subtitle.timelineOut) 显示的文字:\(subtitle.text)")
         }
 
         if !inputSize.equalTo(.zero), mSubtitles?.first?.timelineIn == 0 {
             inputCGSize = inputSize
-            PQLog(message: "输入字幕画布的大小\(inputCGSize)")
+            BFLog(message: "输入字幕画布的大小\(inputCGSize)")
 
             createTexture(currtime: .zero)
         }
@@ -118,7 +118,7 @@ open class PQSubTitleFilter: BasicOperation {
 
     // 清空数据
     func clearData() {
-        PQLog(message: "清空字幕数据!")
+        BFLog(message: "清空字幕数据!")
         subtitleImage = nil
         glDeleteTextures(1, &subTitleTexture)
         subTitleTexture = 0
@@ -152,14 +152,14 @@ open class PQSubTitleFilter: BasicOperation {
                         subTitleTexture = 0
                     }
                 } else {
-                    PQLog(message: "已经绘制过!")
+                    BFLog(message: "已经绘制过!")
                 }
                 break
             }
         }
 
         if (currtime < lastSubtitle?.timelineIn ?? 0 || currtime > Float64(lastSubtitle?.timelineOut ?? 0)) && subtitleImage != nil {
-            PQLog(message: "字幕 已经全部显示完成 \(currtime) -\(String(describing: lastSubtitle?.timelineOut))")
+            BFLog(message: "字幕 已经全部显示完成 \(currtime) -\(String(describing: lastSubtitle?.timelineOut))")
             clearData()
         }
     }

+ 2 - 2
BFFramework/Classes/PQGPUImage/akfilters/Tools/NXAVAssetExportSession.swift

@@ -20,7 +20,7 @@ class NXAVAssetExportSession: NSObject {
     ///   - isAdjustRotationAngle: 是否旋转  默认为 true
     ///   - completeHander: 回调
     func exportAsynchronouslyWithCompletionHandler(inFilePath: String, outFilePath: String, frameDuration: CMTime, isAdjustRotationAngle: Bool = true, completeHander: @escaping (_ outFilePath: String?) -> Void) {
-        PQLog(message: "原视频文件地址 \(inFilePath)")
+        BFLog(message: "原视频文件地址 \(inFilePath)")
 
         let avAsset = AVURLAsset(url: URL(fileURLWithPath: inFilePath), options: avAssertOptions)
 
@@ -80,7 +80,7 @@ class NXAVAssetExportSession: NSObject {
 //            guard let strongSelf = self else { return }
 
             if exporter!.status == .completed {
-                PQLog(message: "导出完成 \(outFilePath)")
+                BFLog(message: "导出完成 \(outFilePath)")
                 completeHander(outFilePath)
             } else {
                 print("导出出错 \(String(describing: exporter?.error))")

+ 6 - 6
BFFramework/Classes/PQGPUImage/akfilters/Tools/PQCompositionExporter.swift

@@ -91,7 +91,7 @@ public class PQCompositionExporter {
         } catch {
             print("Couldn't process movie with error: \(error)")
         }
-        PQLog(message: "export mShowVidoSize is \(String(describing: input?.mShowVidoSize))")
+        BFLog(message: "export mShowVidoSize is \(String(describing: input?.mShowVidoSize))")
 
         let videoEncodingSettings: [String: Any] = [
             AVVideoCompressionPropertiesKey: [
@@ -135,12 +135,12 @@ public class PQCompositionExporter {
     func findShowStikcer(currTime:Float64)  {
          
         if(mStickers?.count ?? 0 == 0){
-            PQLog(message: "mStickers data is error")
+            BFLog(message: "mStickers data is error")
             return
         }
         var currentSticker:PQEditVisionTrackMaterialsModel?
         for sticker in mStickers! {
-            PQLog(message: "sticker in \(sticker.timelineIn) out \(sticker.timelineOut)  currTime is \(currTime)")
+            BFLog(message: "sticker in \(sticker.timelineIn) out \(sticker.timelineOut)  currTime is \(currTime)")
             if(sticker.timelineIn <= currTime && sticker.timelineOut >= currTime){
                 currentSticker = sticker
                 break
@@ -148,7 +148,7 @@ public class PQCompositionExporter {
         }
         //创建不同的filter
         if(currentSticker == nil){
-            PQLog(message: "sticker data is error")
+            BFLog(message: "sticker data is error")
             return
         }
         if(input != nil && lastshowSticker != currentSticker){
@@ -173,7 +173,7 @@ public class PQCompositionExporter {
     public func start(playeTimeRange:CMTimeRange = CMTimeRange.init()) {
         input?.completion = { [unowned self] in
             self.output?.finishRecording { [unowned self] in
-                PQLog(message: "导出视频完成发通知")
+                BFLog(message: "导出视频完成发通知")
                 DispatchQueue.main.async {
                     if let url = self.tmpExportURL {
                         self.handleCaption(for: AVURLAsset(url: url, options: avAssertOptions))
@@ -247,7 +247,7 @@ public class PQCompositionExporter {
         exporter?.videoComposition = videoComposition
         exporter?.exportAsynchronously { [weak self] in
             guard let strongSelf = self else { return }
-            PQLog(message: "导出完成 \(strongSelf.exportURL)")
+            BFLog(message: "导出完成 \(strongSelf.exportURL)")
             DispatchQueue.main.async {
                 strongSelf.progressClosure?(1, 1, 1)
                 strongSelf.completion?(strongSelf.exportURL)

+ 29 - 29
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -82,15 +82,15 @@ class PQStuckPointEditerController: PQBaseViewController {
         let stuckPointCuttingView = PQStuckPointCuttingView(frame: CGRect(x: 0, y: sustomSwitchView.frame.minY - cDefaultMargin * 14 - cDefaultMargin * 2, width: view.frame.width, height: cDefaultMargin * 14), duration: CGFloat(Float(stuckPointMusicData?.duration ?? "0") ?? 0), startTime: CGFloat(stuckPointMusicData?.startTime ?? 0), endTime: CGFloat(stuckPointMusicData?.endTime ?? 0))
         /// 裁剪进度回调
         stuckPointCuttingView.videoRangeDidChanged = { [weak self] startTime, endTime in
-            PQLog(message: "裁剪返回--startTime = \(startTime),endTime = \(endTime)")
+            BFLog(message: "裁剪返回--startTime = \(startTime),endTime = \(endTime)")
         }
         /// 播放进度回调
         stuckPointCuttingView.videoProgressDidChanged = { [weak self] progress in
-            PQLog(message: "进度更新返回--progress = \(progress) \(String(describing: self?.playerView.mPlayeTimeRange))")
+            BFLog(message: "进度更新返回--progress = \(progress) \(String(describing: self?.playerView.mPlayeTimeRange))")
         }
         /// 拖缀结束的回调 type - 1-拖动左边裁剪结束 2--拖动右边裁剪结束 3-进度条拖动结束 4-滑动结束
         stuckPointCuttingView.videoDidEndDragging = { [weak self] type, startTime, endTime, progress in
-            PQLog(message: "拖拽结束返回--type = \(type),startTime = \(startTime),endTime = \(endTime),progress = \(progress)")
+            BFLog(message: "拖拽结束返回--type = \(type),startTime = \(startTime),endTime = \(endTime),progress = \(progress)")
             self?.playerView.pause()
             // 修改最新值
             self?.stuckPointMusicData?.startTime = Float64(startTime)
@@ -98,14 +98,14 @@ class PQStuckPointEditerController: PQBaseViewController {
             // 红的指针完成
             if type == 3 {
                 if CMTimeGetSeconds(self?.playerView.mPlayeTimeRange?.end ?? .zero) == 0 {
-                    PQLog(message: "mPlayeTimeRange is error")
+                    BFLog(message: "mPlayeTimeRange is error")
                     return
                 }
                 let newBeginSconds = (Double(startTime) + (Double(endTime) - Double(startTime)) * Double(progress)) * 600
-                PQLog(message: " newBeginSconds is \(newBeginSconds)")
+                BFLog(message: " newBeginSconds is \(newBeginSconds)")
                 let seekTimeRange:CMTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Int64(newBeginSconds)), timescale: 600), end:
                     CMTime(value: CMTimeValue(Int64(endTime * 600)), timescale: 600))
-                PQLog(message: "修改的开始 \(CMTimeGetSeconds(seekTimeRange.start)) 结束  \(CMTimeGetSeconds(seekTimeRange.end))")
+                BFLog(message: "修改的开始 \(CMTimeGetSeconds(seekTimeRange.start)) 结束  \(CMTimeGetSeconds(seekTimeRange.end))")
                 self?.playerView.play(pauseFirstFrame: false, playeTimeRange: seekTimeRange)
 
             } else {
@@ -200,7 +200,7 @@ class PQStuckPointEditerController: PQBaseViewController {
     }
 
     @objc func enterBackground() {
-        PQLog(message: "进入到后台")
+        BFLog(message: "进入到后台")
         // 取消导出
         playerView.pause()
     }
@@ -263,7 +263,7 @@ class PQStuckPointEditerController: PQBaseViewController {
     }
 
     @objc func nextBtnClick(sender _: UIButton) {
-        PQLog(message: "去发布")
+        BFLog(message: "去发布")
         playerView.pause()
         let videoExporter = PQStuckPointPublicController()
         videoExporter.selectedTotalDuration = selectedTotalDuration
@@ -272,7 +272,7 @@ class PQStuckPointEditerController: PQBaseViewController {
         // 使用深 copy
         let json = projectModel.toJSONString(prettyPrint: false)
         if json == nil {
-            PQLog(message: "数据转换有问题 跳转")
+            BFLog(message: "数据转换有问题 跳转")
             return
         }
         let tempModel: PQEditProjectModel? = Mapper<PQEditProjectModel>().map(JSONString: json!)
@@ -301,7 +301,7 @@ class PQStuckPointEditerController: PQBaseViewController {
 
             let json = model.toJSONString(prettyPrint: false)
             if json == nil {
-                PQLog(message: "数据转换有问题 跳转")
+                BFLog(message: "数据转换有问题 跳转")
                 return
             }
             let tempModel: PQEditVisionTrackMaterialsModel = Mapper<PQEditVisionTrackMaterialsModel>().map(JSONString: json!)!
@@ -363,7 +363,7 @@ class PQStuckPointEditerController: PQBaseViewController {
 
             videoSize = CGSize(width: videoSize.width * CGFloat(maxRation), height: videoSize.height * CGFloat(maxRation))
 
-            PQLog(message: "最长边已经超过 1920 要等比缩小 缩放后\(videoSize)")
+            BFLog(message: "最长边已经超过 1920 要等比缩小 缩放后\(videoSize)")
         }
 
         if (Int(videoSize.width) % 2) != 0 {
@@ -382,7 +382,7 @@ class PQStuckPointEditerController: PQBaseViewController {
 
         // 3,设置音频
         let audioPath = stuckPointMusicData?.localPath ?? ""
-        PQLog(message: "初始化音频播放器的音频地址为:\(audioPath)")
+        BFLog(message: "初始化音频播放器的音频地址为:\(audioPath)")
         playerView.updateAsset(URL(fileURLWithPath: documensDirectory + audioPath), videoComposition: nil, audioMixModel: nil)
 
         // 4, 设置播放器的输出画布大小
@@ -393,7 +393,7 @@ class PQStuckPointEditerController: PQBaseViewController {
         playerView.showProgressLab = false
 
         // 初始化音频的开始和结束时间
-        PQLog(message: "播放的器 开始\(String(describing: CMTimeGetSeconds(playeTimeRange.start))) 结束 \(String(describing: CMTimeGetSeconds(playeTimeRange.end)))")
+        BFLog(message: "播放的器 开始\(String(describing: CMTimeGetSeconds(playeTimeRange.start))) 结束 \(String(describing: CMTimeGetSeconds(playeTimeRange.end)))")
         playerView.play(pauseFirstFrame: false, playeTimeRange: CMTimeRange(start: playeTimeRange.start, end: playeTimeRange.end))
 
         // 6,进度回调
@@ -403,14 +403,14 @@ class PQStuckPointEditerController: PQBaseViewController {
             let progress = (currentTime -  CMTimeGetSeconds(self?.playeTimeRange.start ?? .zero
             )) / CMTimeGetSeconds(self?.playeTimeRange.duration ?? .zero
             )
-            PQLog(message: "\(currentTime) \(tatolTime) 显示播放器进度为: \(progress)")
+            BFLog(message: "\(currentTime) \(tatolTime) 显示播放器进度为: \(progress)")
             
             self?.stuckPointCuttingView.videoCropView.updateProgress(progress: CGFloat(progress))
         }
     }
 
     deinit {
-        PQLog(message: "卡点视频预览界面销毁")
+        BFLog(message: "卡点视频预览界面销毁")
         musicNameLab.stop()
         playerView.pause()
         // 取消所有的导出
@@ -445,7 +445,7 @@ extension PQStuckPointEditerController {
             videoTotalDuration = videoTotalDuration + Float64(CMTimeGetSeconds(asset.duration))
         }
         if videoTotalDuration == 0 {
-            PQLog(message: "视频总时长出现错误!!!!这里应该有视频素材的")
+            BFLog(message: "视频总时长出现错误!!!!这里应该有视频素材的")
             return stickers
         }
         for sticker in section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
@@ -454,7 +454,7 @@ extension PQStuckPointEditerController {
                 // 要分割的段落
                 let clipNum = Int(max(round(Double(kongduan) * CMTimeGetSeconds(asset.duration) / videoTotalDuration), 1))
                 sticker.duration = CMTimeGetSeconds(asset.duration)
-                PQLog(message: "单个视频\(sticker.locationPath)时长::\(CMTimeGetSeconds(asset.duration)) ,clipNum is:\(clipNum)")
+                BFLog(message: "单个视频\(sticker.locationPath)时长::\(CMTimeGetSeconds(asset.duration)) ,clipNum is:\(clipNum)")
 
                 for clipindex in 0 ... clipNum {
                     // deep copy sticker model 防止只有一个对象
@@ -473,7 +473,7 @@ extension PQStuckPointEditerController {
                         deepCopySticker?.out = CMTimeGetSeconds(asset.duration)
                     }
 
-                    PQLog(message: " crilp is in \(deepCopySticker?.model_in ?? 0) out \(deepCopySticker?.out ?? 0) 总时长\(CMTimeGetSeconds(asset.duration))")
+                    BFLog(message: " crilp is in \(deepCopySticker?.model_in ?? 0) out \(deepCopySticker?.out ?? 0) 总时长\(CMTimeGetSeconds(asset.duration))")
 
                     if deepCopySticker != nil {
                         stickers.append(deepCopySticker!)
@@ -503,7 +503,7 @@ extension PQStuckPointEditerController {
 
                 var stuckPointsTemp = Array<Float>.init()
                 for (index, dunshu) in stuckPointMusicData!.rhythmSdata[0].pointTimes.enumerated() {
-                    PQLog(message: "所有卡点数:\(Float64(dunshu) / 1_000_000.0)")
+                    BFLog(message: "所有卡点数:\(Float64(dunshu) / 1_000_000.0)")
                     if Float64(dunshu) / 1_000_000.0 > CMTimeGetSeconds(playeTimeRange.start), Float64(dunshu) / 1_000_000.0 < CMTimeGetSeconds(playeTimeRange.end) {
                         stuckPointsTemp.append(Float(dunshu) / 1_000_000.0)
                     }
@@ -515,7 +515,7 @@ extension PQStuckPointEditerController {
                  - 适中为每两个点位取一个,即0,2,4,6……
                  - 慢节奏为每三个点位取一个,即0,3,6,9……
                  */
-                PQLog(message: "stuckPointMusicData?.speed is \(String(describing: stuckPointMusicData?.speed))")
+                BFLog(message: "stuckPointMusicData?.speed is \(String(describing: stuckPointMusicData?.speed))")
                 for (index, point) in stuckPointsTemp.enumerated() {
                     if stuckPointMusicData?.speed == 1 {
                         stuckPoints.append(point)
@@ -532,7 +532,7 @@ extension PQStuckPointEditerController {
                 }
 
                 for point in stuckPoints {
-                    PQLog(message: "有 start end 计算后的卡点数\(point)")
+                    BFLog(message: "有 start end 计算后的卡点数\(point)")
                 }
                 if stuckPoints.first != nil {
                     stuckPoints.removeFirst()
@@ -543,19 +543,19 @@ extension PQStuckPointEditerController {
                 stuckPoints.insert(Float(CMTimeGetSeconds(playeTimeRange.start)), at: 0)
                 stuckPoints.insert(Float(CMTimeGetSeconds(playeTimeRange.end)), at: stuckPoints.count)
 
-                PQLog(message: "stuckPoints count is \(stuckPoints.count)")
+                BFLog(message: "stuckPoints count is \(stuckPoints.count)")
                 // 当用户上传视觉素材个数大于等于音乐选择区域节拍分割个数时,无需进行视频分割,只显示卡点数-1 个素材
                 if section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials().count >= stuckPointMusicData!.rhythmSdata[0].pointTimes.count {
                     for (index, sticker) in section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials().enumerated() {
                         if index == stuckPointMusicData!.rhythmSdata[0].pointTimes.count {
-                            PQLog(message: "到达卡点数量")
+                            BFLog(message: "到达卡点数量")
                             break
                         }
-                        PQLog(message: "创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type) \(sticker.locationPath)")
+                        BFLog(message: "创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type) \(sticker.locationPath)")
 
                         sticker.timelineIn = Float64(stuckPoints[index])
                         sticker.timelineOut = Float64(stuckPoints[index + 1])
-                        PQLog(message: "卡点 间隔 \(sticker.timelineIn - sticker.timelineOut)")
+                        BFLog(message: "卡点 间隔 \(sticker.timelineIn - sticker.timelineOut)")
                         sticker.generateDefaultValues()
                         stickers.append(sticker)
                     }
@@ -567,7 +567,7 @@ extension PQStuckPointEditerController {
                     if section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials(type: "video").count == 0, section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials(type: "image").count > 0 {
                         for (index, point) in stuckPoints.enumerated() {
                             let sticker: PQEditVisionTrackMaterialsModel = section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials()[index % section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials().count]
-                            PQLog(message: "stickerlocationPath sticker : \(sticker.locationPath)")
+                            BFLog(message: "stickerlocationPath sticker : \(sticker.locationPath)")
                             let stickerjson = sticker.toJSONString(prettyPrint: false)
 
                             let deepCopySticker = Mapper<PQEditVisionTrackMaterialsModel>().map(JSONString: stickerjson!)
@@ -604,7 +604,7 @@ extension PQStuckPointEditerController {
                                     sticker.out = sticker.out - offsetAssetDuration
                                 }
 
-                                PQLog(message: "分割后 创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type)")
+                                BFLog(message: "分割后 创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type)")
                                 stickers.append(sticker)
                             }
                         }
@@ -725,7 +725,7 @@ extension PQStuckPointEditerController {
                         if tempPhoto != nil {
                             if filePath != nil, (filePath?.count ?? 0) > 0 {
                                 tempPhoto?.locationPath = filePath?.replacingOccurrences(of: documensDirectory, with: "") ?? ""
-                                PQLog(message: "导出视频相册地址为")
+                                BFLog(message: "导出视频相册地址为")
                             }
                             dispatchGroup.leave()
                         }
@@ -734,7 +734,7 @@ extension PQStuckPointEditerController {
             }
             dispatchGroup.notify(queue: DispatchQueue.main) { [weak self] in
                 self?.isExportVideosSuccess = true
-                PQLog(message: "所有相册视频导出成功")
+                BFLog(message: "所有相册视频导出成功")
                 // 处理所有数据完成
                 if isHaveVideo {
                     self?.dealWithDataSuccess()

+ 1 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialController.swift

@@ -345,7 +345,7 @@ public class PQStuckPointMaterialController: PQBaseViewController {
     /// 更新frame
     /// - Parameter contentOffset: <#contentOffset description#>
     func updateMaterialHeadFrame(contentOffset _: CGPoint) {
-//        PQLog(message: "===\((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + topImageH),\(contentOffset.y)")
+//        BFLog(message: "===\((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + topImageH),\(contentOffset.y)")
 //        if !materialHeadView.isHidden, contentOffset.y <= ((navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) + topImageH), contentOffset.y >= 0 {
 //            materialHeadView.frame.origin.y = (navHeadImageView?.frame.maxY ?? cDevice_iPhoneNavBarAndStatusBarHei) - contentOffset.y
 //            photoMaterialVc.updateFrame(newFrame: CGRect(x: 0, y: materialHeadView.frame.maxY + margin / 2, width: view.frame.width, height: view.frame.height - (materialHeadView.frame.maxY + margin + bottomRemindView.frame.height) - (selectedDataCount > 0 ? materialListView.frame.height : 0)))

+ 8 - 8
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialDetailController.swift

@@ -90,18 +90,18 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
     lazy var avPlayer: AVPlayer = {
         let avPlayer = AVPlayer()
         NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: avPlayer.currentItem, queue: .main) { [weak self] notify in
-            PQLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
             avPlayer.seek(to: CMTime(value: CMTimeValue((self?.materialData?.model_in ?? 0) * playerTimescale), timescale: CMTimeScale(playerTimescale)))
             self?.playBtn.isHidden = false
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemNewErrorLogEntry, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
+            BFLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemFailedToPlayToEndTime, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemPlaybackStalled, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
+            BFLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
         }
         avPlayer.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: CMTimeScale(playerTimescale)), queue: .main) { [weak self] cmTime in
             // let progress = CMTimeGetSeconds(avPlayer.currentItem?.currentTime() ?? CMTime.zero) / CMTimeGetSeconds(avPlayer.currentItem?.duration ?? CMTime.zero)
@@ -116,7 +116,7 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
             if progress >= 1 {
                 self?.playBtn.isHidden = false
             }
-            PQLog(message: "progress = \(progress)")
+            BFLog(message: "progress = \(progress)")
         }
         return avPlayer
     }()
@@ -175,7 +175,7 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
             if materialData?.originalData == nil {
                 PQPHAssetVideoParaseUtil.requestAssetOringinImage(asset: (materialData?.asset)!) { [weak self] _, data, image, _ in
                     if image == nil {
-                        PQLog(message: "图片数据为空!!!!!")
+                        BFLog(message: "图片数据为空!!!!!")
                     }
                     // 1,图片,gif的原文件数据,和视频的封面
                     var newImage: UIImage?
@@ -243,7 +243,7 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
             }
             ImageDownloader.default.downloadImage(with: URL(string: url ?? "")!, retrieveImageTask: nil, options: nil, progressBlock: nil) { [weak self] image, _, _, data in
                 if image == nil && data == nil {
-                    PQLog(message: "add by ak 素材有问题!!!!")
+                    BFLog(message: "add by ak 素材有问题!!!!")
                     return
                 }
                 self?.materialData?.originalData = data
@@ -259,7 +259,7 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
                 let imageCacheName = url!.kf.md5
                 let imageCachePath = downloadImagesDirectory + imageCacheName
                 if !directoryIsExists(dicPath: downloadImagesDirectory) {
-                    PQLog(message: "文件夹不存在 \(downloadImagesDirectory)")
+                    BFLog(message: "文件夹不存在 \(downloadImagesDirectory)")
                     createDirectory(path: downloadImagesDirectory)
                 }
                 if self?.materialData?.type != StickerType.GIF.rawValue {

+ 8 - 8
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMusicController.swift

@@ -46,22 +46,22 @@ class PQStuckPointMusicController: PQBaseViewController {
     lazy var avPlayer: AVPlayer = {
         let avPlayer = AVPlayer()
         PQNotification.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: avPlayer.currentItem, queue: .main) { [weak self] notify in
-            PQLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
             avPlayer.seek(to: CMTime(value: CMTimeValue((self?.currentPlayData?.startTime ?? 0) * 1000), timescale: CMTimeScale(playerTimescale)))
 //            avPlayer.play()
             self?.playStuckPointMusic(itemData: nil)
         }
         PQNotification.addObserver(forName: .AVPlayerItemNewErrorLogEntry, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
+            BFLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
         }
         PQNotification.addObserver(forName: .AVPlayerItemFailedToPlayToEndTime, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
         }
         PQNotification.addObserver(forName: .AVPlayerItemPlaybackStalled, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
+            BFLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
         }
         avPlayer.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: CMTimeScale(playerTimescale)), queue: .main) { [weak self] cmTime in
-            PQLog(message: "addPeriodicTimeObserver = \(cmTime)")
+            BFLog(message: "addPeriodicTimeObserver = \(cmTime)")
         }
         return avPlayer
     }()
@@ -464,7 +464,7 @@ extension PQStuckPointMusicController: UITextFieldDelegate {
             return
         }
         if searchTF.text != nil, (searchTF.text?.count ?? 0) > 0 {
-            PQLog(message: "背景音乐--开始搜索背景音乐-1")
+            BFLog(message: "背景音乐--开始搜索背景音乐-1")
             searchController.loadSearchData(keyword: searchTF.text)
         }
     }
@@ -601,7 +601,7 @@ extension PQStuckPointMusicController {
 extension PQStuckPointMusicController {
     override func observeValue(forKeyPath keyPath: String?, of object: Any?, change _: [NSKeyValueChangeKey: Any]?, context _: UnsafeMutableRawPointer?) {
         if object is AVPlayerItem, keyPath == "status" {
-            PQLog(message: "AVPlayerItem - status = \((object as! AVPlayerItem).status.rawValue)")
+            BFLog(message: "AVPlayerItem - status = \((object as! AVPlayerItem).status.rawValue)")
             switch (object as! AVPlayerItem).status {
             case .unknown:
                 break
@@ -613,7 +613,7 @@ extension PQStuckPointMusicController {
                 break
             }
         } else if object is AVPlayerItem, keyPath == "error" {
-            PQLog(message: "AVPlayerItem - error = \(String(describing: (object as! AVPlayerItem).error))")
+            BFLog(message: "AVPlayerItem - error = \(String(describing: (object as! AVPlayerItem).error))")
         }
     }
 }

+ 3 - 3
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMusicSearchController.swift

@@ -47,7 +47,7 @@ class PQStuckPointMusicSearchController: PQStuckPointMusicContentController {
             cShowHUB(superView: nil, msg: "请先输入搜索内容")
             return
         }
-        PQLog(message: "背景音乐--开始搜索背景音乐")
+        BFLog(message: "背景音乐--开始搜索背景音乐")
         if keyword != searchWord || (keyword == searchWord && itemList.count <= 0) {
             showEmptyView()
             itemList.removeAll()
@@ -65,7 +65,7 @@ class PQStuckPointMusicSearchController: PQStuckPointMusicContentController {
         PQLoadingHUB.shared.showHUB(superView: view)
         PQBaseViewModel.searchBGMListData(searchWord, pageNum, 20,videoCount: selectedDataCount - selectedImageDataCount,imageCount: selectedImageDataCount,totalDuration: selectedTotalDuration) { [weak self] bgmList, msg in
             // 处理请求数据
-            PQLog(message: "背景音乐--搜索背景音乐成功")
+            BFLog(message: "背景音乐--搜索背景音乐成功")
             if bgmList.count <= 0 {
                 self?.pageNum = (self?.pageNum ?? 0) - 1
             }
@@ -86,7 +86,7 @@ class PQStuckPointMusicSearchController: PQStuckPointMusicContentController {
     /// 清空搜索数据
     /// - Returns: <#description#>
     func clearData() {
-        PQLog(message: "背景音乐--清空背景音乐搜索数据")
+        BFLog(message: "背景音乐--清空背景音乐搜索数据")
         hotList.forEach { item in
             if item is PQVoiceModel {
                 (item as? PQVoiceModel)?.isSelected = false

+ 36 - 36
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift

@@ -137,18 +137,18 @@ class PQStuckPointPublicController: PQBaseViewController {
     lazy var avPlayer: AVPlayer = {
         let avPlayer = AVPlayer()
         NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: avPlayer.currentItem, queue: .main) { [weak self] notify in
-            PQLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
             avPlayer.seek(to: CMTime.zero)
             self?.playBtn.isHidden = false
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemNewErrorLogEntry, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
+            BFLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemFailedToPlayToEndTime, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
+            BFLog(message: "AVPlayerItemFailedToPlayToEndTime = \(notify)")
         }
         NotificationCenter.default.addObserver(forName: .AVPlayerItemPlaybackStalled, object: avPlayer.currentItem, queue: .main) { notify in
-            PQLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
+            BFLog(message: "AVPlayerItemPlaybackStalled = \(notify)")
         }
         avPlayer.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: 1000), queue: .main) { [weak self] _ in
             let progress = CMTimeGetSeconds(avPlayer.currentItem?.currentTime() ?? CMTime.zero) / CMTimeGetSeconds(avPlayer.currentItem?.duration ?? CMTime.zero)
@@ -350,7 +350,7 @@ class PQStuckPointPublicController: PQBaseViewController {
     }
 
     @objc public func clearMemoryCache() {
-        PQLog(message: "收到内存警告")
+        BFLog(message: "收到内存警告")
     }
 
     override func viewWillDisappear(_ animated: Bool) {
@@ -381,29 +381,29 @@ extension PQStuckPointPublicController {
     /// 开始导出视频
     func beginExport() {
         if !(editProjectModel?.sData?.sections != nil && (editProjectModel?.sData?.sections.count ?? 0) > 0) {
-            PQLog(message: "项目段落错误❌")
+            BFLog(message: "项目段落错误❌")
             return
         }
         // 输出视频地址
         var outPutMP4Path = exportVideosDirectory
         if !directoryIsExists(dicPath: outPutMP4Path) {
-            PQLog(message: "文件夹不存在")
+            BFLog(message: "文件夹不存在")
             createDirectory(path: outPutMP4Path)
         }
         outPutMP4Path.append("video_\(String.qe.timestamp()).mp4")
         let outPutMP4URL = URL(fileURLWithPath: outPutMP4Path)
-        PQLog(message: "导出视频地址 \(outPutMP4URL)")
+        BFLog(message: "导出视频地址 \(outPutMP4URL)")
         let inputAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + (audioMixModel?.localPath ?? "")), options: avAssertOptions)
         // 每次初始化的时候设置初始值 为 nIl
         exporter = PQCompositionExporter(asset: inputAsset, videoComposition: nil, audioMix: nil, filters: nil, stickers: mStickers, animationTool: nil, exportURL: outPutMP4URL)
         if exporter.prepare(videoSize: CGSize(width: editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0, height: editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0)) {
             let playeTimeRange: CMTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Int((audioMixModel?.startTime ?? 0) * 600)), timescale: 600), end: CMTime(value: CMTimeValue(Int((audioMixModel?.endTime ?? 0) * 600)), timescale: 600))
-            PQLog(message: "开始导出 \(String(describing: audioMixModel?.startTime)) 结束 \(String(describing: audioMixModel?.endTime))")
+            BFLog(message: "开始导出 \(String(describing: audioMixModel?.startTime)) 结束 \(String(describing: audioMixModel?.endTime))")
             exporter.start(playeTimeRange: playeTimeRange)
-            PQLog(message: "开始导出")
+            BFLog(message: "开始导出")
         }
         exporter.progressClosure = { [weak self] _, _, progress in
-            PQLog(message: "合成进度 \(progress)")
+            BFLog(message: "合成进度 \(progress)")
             let useProgress = progress > 1 ? 1 : progress
             if progress > 0, Int(useProgress * 100) > (self?.exportProgrss ?? 0) {
                 self?.exportProgrss = Int(useProgress * 100)
@@ -417,7 +417,7 @@ extension PQStuckPointPublicController {
             }
         }
         exporter.completion = { [weak self] url in
-            PQLog(message: "导了完成: \(url)")
+            BFLog(message: "导了完成: \(url)")
             // 导出完成后取消导出
             if self?.exporter != nil {
                 self?.exporter.cancel()
@@ -425,7 +425,7 @@ extension PQStuckPointPublicController {
             if !(self?.isExportSuccess ?? false) {
                 self?.isExportSuccess = true
                 self?.exportEndDate = Date().timeIntervalSince1970
-                PQLog(message: "视频导出完成-开始去发布视频")
+                BFLog(message: "视频导出完成-开始去发布视频")
                 self?.exportLocalURL = url
                 /// fp2-1-1 - 请求权限
 //                self?.authorizationStatus()
@@ -493,7 +493,7 @@ extension PQStuckPointPublicController {
                         self?.editProjectModel?.sData?.videoMetaData?.title = draftboxInfo?["title"] as? String ?? ""
                         self?.editProjectModel?.sData?.videoMetaData?.coverUrl = draftboxInfo?["coverUrl"] as? String ?? ""
                         self?.editProjectModel?.dataVersionCode = draftboxInfo?["dataVersionCode"] as? Int ?? 0
-                        PQLog(message: "保存远程的草稿成功")
+                        BFLog(message: "保存远程的草稿成功")
                         self?.isSaveDraftSuccess = true
                         /// fp3 - 保存项目
                         self?.saveProject()
@@ -517,13 +517,13 @@ extension PQStuckPointPublicController {
             let sdata = editProjectModel?.sData?.toJSONString(prettyPrint: false) ?? ""
             let draftboxId: String? = editProjectModel?.draftboxId
             PQBaseViewModel.saveProject(draftboxId: draftboxId, sdata: sdata, videoFromScene: .stuckPoint) { [weak self] projectId, msg in
-                PQLog(message: "生成的项目id1111 :\(projectId ?? ""),msg = \(msg ?? "")")
+                BFLog(message: "生成的项目id1111 :\(projectId ?? ""),msg = \(msg ?? "")")
                 if projectId == nil || (projectId?.count ?? 0) <= 0 {
                     PQBaseViewModel.saveProject(draftboxId: draftboxId, sdata: sdata, videoFromScene: .stuckPoint) { [weak self] projectId, msg in
-                        PQLog(message: "生成的项目id222 :\(projectId ?? ""),msg = \(msg ?? "")")
+                        BFLog(message: "生成的项目id222 :\(projectId ?? ""),msg = \(msg ?? "")")
                         if projectId == nil || (projectId?.count ?? 0) <= 0 {
                             PQBaseViewModel.saveProject(draftboxId: draftboxId, sdata: sdata, videoFromScene: .stuckPoint) { [weak self] projectId, msg in
-                                PQLog(message: "生成的项目id 3333:\(projectId ?? ""),msg = \(msg ?? "")")
+                                BFLog(message: "生成的项目id 3333:\(projectId ?? ""),msg = \(msg ?? "")")
                                 if projectId != nil, (projectId?.count ?? 0) > 0 {
                                     self?.editProjectModel?.projectId = projectId ?? ""
                                 }
@@ -548,13 +548,13 @@ extension PQStuckPointPublicController {
     /// fp4 - 处理视频数据
     /// - Returns: description
     @objc func dealWithVideoData() {
-        PQLog(message: "开始去发布视频12")
+        BFLog(message: "开始去发布视频12")
         isSaveProjectSuccess = true
         if isExportSuccess && exportLocalURL != nil {
-            PQLog(message: "素材上传完成同时视频导出完成开始发布视频")
+            BFLog(message: "素材上传完成同时视频导出完成开始发布视频")
             // 更新项目
             PQBaseViewModel.updateProject(projectId: editProjectModel?.projectId ?? "", produceStatus: "5") { repseon, _ in
-                PQLog(message: "updateProject 结果 is \(String(describing: repseon))")
+                BFLog(message: "updateProject 结果 is \(String(describing: repseon))")
             }
             let asset = AVURLAsset(url: exportLocalURL!, options: avAssertOptions)
             let tempUploadData = PQUploadModel()
@@ -578,7 +578,7 @@ extension PQStuckPointPublicController {
             }
             if isExportSuccess, exportLocalURL != nil {
                 let size = try! exportLocalURL?.resourceValues(forKeys: [.fileSizeKey])
-                PQLog(message: "size = \(String(describing: size))")
+                BFLog(message: "size = \(String(describing: size))")
                 if Float64(size?.fileSize ?? 0) <= maxUploadSize {
                     /// fp5 - 上传视频
                     reUploadVideo()
@@ -610,7 +610,7 @@ extension PQStuckPointPublicController {
                     self?.showUploadRemindView(isNetCollected: false, msg: "获取数据失败了哦~")
                     return
                 }
-                PQLog(message: "取我方服务器STS 返回数据 \(String(describing: response))")
+                BFLog(message: "取我方服务器STS 返回数据 \(String(describing: response))")
                 self?.multipartUpload(response: response)
             }
         }
@@ -655,7 +655,7 @@ extension PQStuckPointPublicController {
     /// - Parameter notify: <#notify description#>
     @objc func uploadSuccess(notify: NSNotification) {
         let objectKey: String = "\(notify.userInfo?["objectKey"] ?? "")"
-        PQLog(message: "收到上传成功请求==\(notify.userInfo ?? [:])")
+        BFLog(message: "收到上传成功请求==\(notify.userInfo ?? [:])")
         if uploadData?.videoBucketKey == objectKey {
             // 上传成功
             isUploadSuccess = true
@@ -669,7 +669,7 @@ extension PQStuckPointPublicController {
     func dealWithPublicData() {
         if uploadData?.localPath != nil {
             let size = try! URL(string: uploadData?.localPath ?? "")?.resourceValues(forKeys: [.fileSizeKey])
-            PQLog(message: "size = \(String(describing: size))")
+            BFLog(message: "size = \(String(describing: size))")
             if Float64(size?.fileSize ?? 0) > maxUploadSize {
                 cShowHUB(superView: nil, msg: "无法发布大于10G的视频,请重新选择/合成发布")
                 // 上传失败-播放视频
@@ -694,7 +694,7 @@ extension PQStuckPointPublicController {
         tempModel.eventTrackData = eventTrackData
         tempModel.uplpadStatus = 1
         tempModel.videoFromScene = .stuckPoint
-        tempModel.uid = Int(PQLoginUserInfo.shared.uid) ?? 0
+        tempModel.uid = Int(BFLoginUserInfo.shared.uid) ?? 0
         tempModel.uplpadRequest = PQAliOssUtil.shared.allTasks[uploadData?.videoBucketKey ?? ""]
         tempModel.stsToken = uploadData?.stsToken
         tempModel.projectId = projectId
@@ -707,7 +707,7 @@ extension PQStuckPointPublicController {
 //            item.uplpadBucketKey == tempModel.uplpadBucketKey
 //        }
 //        if !isContains {
-//            PQLog(message: "添加正在上传数据===\(tempModel)")
+//            BFLog(message: "添加正在上传数据===\(tempModel)")
 //            PQSingletoMemoryUtil.shared.uploadDatas.insert(tempModel, at: 0)
 //        }
 //        currentController().dismiss(animated: false) {
@@ -727,12 +727,12 @@ extension PQStuckPointPublicController {
     /// - Parameter videoData: <#videoData description#>
     func publicVideo(videoData: PQVideoListModel) {
         if videoData.uplpadBucketKey == nil {
-            PQLog(message: "发布视频:视频uplpadBucketKey为空-\(String(describing: videoData.uplpadBucketKey))")
+            BFLog(message: "发布视频:视频uplpadBucketKey为空-\(String(describing: videoData.uplpadBucketKey))")
             // 上传失败-播放视频
             publicEnd(isError: true)
             return
         }
-        PQLog(message: "开始发布")
+        BFLog(message: "开始发布")
         if (videoData.eventTrackData?.endUploadDate ?? 0) <= 0 {
             // 结束上传时间
             videoData.eventTrackData?.endUploadDate = Date().timeIntervalSince1970
@@ -747,7 +747,7 @@ extension PQStuckPointPublicController {
                 let endpoint: String = "\(response?["endPoint"] ?? "")"
                 let bucketName: String = "\(response?["bucketName"] ?? "")"
                 let objectKey: String = "\(response?["objectKey"] ?? "")"
-                PQLog(message: "开始上传视频图片==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey)")
+                BFLog(message: "开始上传视频图片==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey)")
                 PQAliOssUtil.shared
                     .startClient(
                         accessKeyId: accessKeyId,
@@ -756,12 +756,12 @@ extension PQStuckPointPublicController {
                         endpoint: endpoint
                     )
                     .uploadObjectAsync(bucketName: bucketName, objectKey: objectKey, data: data!, fileExtensions: "png", imageUploadBlock: { _, code, ossObjectKey, _ in
-                        PQLog(message: "图片上传完成==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
+                        BFLog(message: "图片上传完成==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
                         if code == 1 && ossObjectKey == objectKey && objectKey.count > 0 {
-                            PQLog(message: "开始发布==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
+                            BFLog(message: "开始发布==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
                             PQUploadViewModel.publishVideo(projectId: videoData.projectId, fileExtensions: videoData.localPath?.pathExtension, title: videoData.title ?? "", videoPath: videoData.uplpadBucketKey ?? "", coverImgPath: objectKey, descr: videoData.summary ?? "", videoFromScene: .stuckPoint, reCreateData: videoData.reCreateVideoData, eventTrackData: videoData.eventTrackData) { [weak self] newVideoData, _, _ in
                                 postNotification(name: cPublishStuckPointSuccessKey, userInfo: ["newVideoData": newVideoData!])
-                                PQLog(message: "发布成功==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
+                                BFLog(message: "发布成功==\(videoData.title ?? ""),uplpadBucketKey = \(videoData.uplpadBucketKey ?? ""),objectKey =\(objectKey),ossObjectKey = \(ossObjectKey)")
 //                                cShowHUB(superView: nil, msg: "视频发布成功")
                                 self?.videoData = newVideoData
                                 // 发布成功后续操作
@@ -770,7 +770,7 @@ extension PQStuckPointPublicController {
                             }
                         } else {
                             // 图片上传失败
-                            PQLog(message: "图片上传失败重新发布视频==\(videoData.title ?? ""),\(videoData.uplpadBucketKey ?? "")")
+                            BFLog(message: "图片上传失败重新发布视频==\(videoData.title ?? ""),\(videoData.uplpadBucketKey ?? "")")
                             self?.publicVideo(videoData: videoData)
                         }
                     })
@@ -885,7 +885,7 @@ extension PQStuckPointPublicController {
                 cHiddenHUB(superView: nil)
                 if path != nil {
                     self?.isShared = true
-                    PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: PQLoginUserInfo.shared.isLogin() ? "\(PQLoginUserInfo.shared.nickName)made a music video for you" : "Music Video for U", description: "", imageUrl: self?.videoData?.shareImgPath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                    PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: BFLoginUserInfo.shared.isLogin() ? "\(BFLoginUserInfo.shared.nickName)made a music video for you" : "Music Video for U", description: "", imageUrl: self?.videoData?.shareImgPath, path: path, videoId: (self?.videoData?.uniqueId)!, pageSource: self?.videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
                     }
                 } else {
                     cShowHUB(superView: nil, msg: "网络不佳哦")
@@ -920,7 +920,7 @@ extension PQStuckPointPublicController {
     }
 
     @objc func enterBackground() {
-        PQLog(message: "进入到后台")
+        BFLog(message: "进入到后台")
         // 取消导出
         if exporter != nil {
             exporter.cancel()
@@ -930,7 +930,7 @@ extension PQStuckPointPublicController {
     }
 
     @objc func willEnterForeground() {
-        PQLog(message: "进入到前台")
+        BFLog(message: "进入到前台")
         if !isExportSuccess {
             beginExport()
         }

+ 1 - 1
BFFramework/Classes/Stuckpoint/Model/PQVoiceModel.swift

@@ -309,7 +309,7 @@ class PQVoiceModel: NSObject, NSCopying {
         }else if (M + startTime) > (Float64(duration ?? "0") ?? 0) {
             M = (Float64(duration ?? "0") ?? 0) - startTime
         }
-        PQLog(message: "计算当前裁剪时长:\(M),开始时间:\(startTime),结束时间:\(endTime),总时长:\(Float64(duration ?? "0") ?? 0)")
+        BFLog(message: "计算当前裁剪时长:\(M),开始时间:\(startTime),结束时间:\(endTime),总时长:\(Float64(duration ?? "0") ?? 0)")
         return M
     }
 }

+ 1 - 1
BFFramework/Classes/Stuckpoint/View/PQCuttingPointView.swift

@@ -35,6 +35,6 @@ class PQCuttingPointView: UIView {
     }
 
     deinit {
-        PQLog(message: "卡点裁剪-指示器销毁")
+        BFLog(message: "卡点裁剪-指示器销毁")
     }
 }

+ 2 - 2
BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

@@ -239,7 +239,7 @@ class PQStuckPointCuttingView: UIView {
     }
 
     deinit {
-        PQLog(message: "卡点裁剪-裁剪视图销毁")
+        BFLog(message: "卡点裁剪-裁剪视图销毁")
     }
 }
 
@@ -259,7 +259,7 @@ extension PQStuckPointCuttingView: UIScrollViewDelegate {
     }
 
     @objc func scrollViewDidEndScrollingAnimation(scrollView _: UIScrollView) {
-        PQLog(message: "拖拽结束 - 回调")
+        BFLog(message: "拖拽结束 - 回调")
 //        videoProgress = 0
 //        if videoDidEndDragging != nil {
 //            videoDidEndDragging!(3, cutFinishedStartTime, cutFinishedEndTime, videoProgress)

+ 1 - 1
BFFramework/Classes/Stuckpoint/View/PQStuckPointLoadingView.swift

@@ -71,6 +71,6 @@ class PQStuckPointLoadingView: UIView {
     }
     
     deinit {
-        PQLog(message: "销毁加载中视图")
+        BFLog(message: "销毁加载中视图")
     }
 }

+ 6 - 6
BFFramework/Classes/Stuckpoint/View/PQVideoCutingOprateView.swift

@@ -140,7 +140,7 @@ class PQVideoCutingOprateView: UIView {
         perSecondWidth = 7
         cutTotalTime = cutEndTime - cutStartTime
         configSubview()
-        PQLog(message: "======\(frame),perSecondWidth = \(perSecondWidth),cutMaxDuration = \(cutMaxDuration * perSecondWidth)")
+        BFLog(message: "======\(frame),perSecondWidth = \(perSecondWidth),cutMaxDuration = \(cutMaxDuration * perSecondWidth)")
     }
 
     /// 初始化视图
@@ -188,7 +188,7 @@ class PQVideoCutingOprateView: UIView {
         }
         let width = rightOprateView.frame.minX - leftOprateView.frame.maxX
         var newX = leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2) + progress * width
-        PQLog(message: "progress = \(progress),newX = \(newX)")
+        BFLog(message: "progress = \(progress),newX = \(newX)")
         if newX.isNaN || newX <= (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2)) {
             newX = (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2))
         }
@@ -199,7 +199,7 @@ class PQVideoCutingOprateView: UIView {
     }
 
     deinit {
-        PQLog(message: "卡点裁剪-裁剪时长视图销毁")
+        BFLog(message: "卡点裁剪-裁剪时长视图销毁")
     }
 }
 
@@ -258,7 +258,7 @@ extension PQVideoCutingOprateView {
                     rightOprateView.frame = oprateFrame
                 } else if currentPanView == progressView {
                     var progressFrame = progressView.frame
-                    PQLog(message: "progressFrame = \(progressFrame),offsetX = \(offsetX)")
+                    BFLog(message: "progressFrame = \(progressFrame),offsetX = \(offsetX)")
                     progressFrame.origin.x += offsetX
                     if progressFrame.origin.x <= (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2)) {
                         progressFrame.origin.x = (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2))
@@ -267,7 +267,7 @@ extension PQVideoCutingOprateView {
                         progressFrame.origin.x = (rightOprateView.frame.minX - (((progressView.frame.width - 3) / 2) + 3))
                     }
                     progressView.frame = progressFrame
-                    PQLog(message: "======\(progressView.frame.minX - (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2)))")
+                    BFLog(message: "======\(progressView.frame.minX - (leftOprateView.frame.maxX - ((progressView.frame.width - 3) / 2)))")
                     if progressDidChanged != nil {
                         progressDidChanged!(progress)
                     }
@@ -277,7 +277,7 @@ extension PQVideoCutingOprateView {
                     // 更新子视图布局
                     updateSubViewFrame()
                     if cutRangeDidChanged != nil {
-                        PQLog(message: "cutStartTime = \(cutStartTime),cutEndTime = \(cutEndTime)")
+                        BFLog(message: "cutStartTime = \(cutStartTime),cutEndTime = \(cutEndTime)")
                         cutRangeDidChanged!(cutStartTime, cutEndTime, cutTotalTime)
                     }
                 }

+ 10 - 10
BFFramework/Classes/Stuckpoint/ViewModel/PQGPUImagePlayerView.swift

@@ -269,7 +269,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
     // 设置画布比例
     func resetCanvasFrame(frame: CGRect) {
         if self.frame.equalTo(frame) {
-            PQLog(message: "新老值一样,不重置")
+            BFLog(message: "新老值一样,不重置")
             return
         }
 
@@ -279,7 +279,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
             showBorderLayer()
         }
 
-        PQLog(message: "new frame is \(frame)")
+        BFLog(message: "new frame is \(frame)")
         renderView.isHidden = true
         renderView.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height)
         renderView.resatSize()
@@ -330,10 +330,10 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
         var composition: AVMutableComposition?
 
         let asset = AVURLAsset(url: url, options: avAssertOptions)
-        PQLog(message: "播放器初始化的音频时长\(asset.duration.seconds)  url is \(url)")
+        BFLog(message: "播放器初始化的音频时长\(asset.duration.seconds)  url is \(url)")
         self.asset = asset
         if (audioMixModel != nil && audioMixModel?.localPath != nil) || (videoStickers != nil && (videoStickers?.count ?? 0) > 0) {
-            PQLog(message: "有参加混音的数据。")
+            BFLog(message: "有参加混音的数据。")
             (audioMix, composition) = PQPlayerViewModel.setupAudioMix(originAsset: asset, bgmData: audioMixModel, videoStickers: videoStickers)
         } else {
             audioMix = nil
@@ -355,7 +355,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
         }
         do {
             if composition != nil {
-                PQLog(message: "composition 方式初始化")
+                BFLog(message: "composition 方式初始化")
                 movie = try PQMoveInput(asset: composition!, videoComposition: videoComposition, audioMix: audioMix, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
             } else {
                 movie = try PQMoveInput(url: url, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
@@ -416,7 +416,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
     func findShowStikcer(currTime:Float64)  {
          
         if(mStickers?.count ?? 0 == 0){
-            PQLog(message: "mStickers data is error")
+            BFLog(message: "mStickers data is error")
             return
         }
         var currentSticker:PQEditVisionTrackMaterialsModel?
@@ -432,7 +432,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
         }
         //创建不同的filter
         if(currentSticker == nil){
-            PQLog(message: "sticker data is error")
+            BFLog(message: "sticker data is error")
             return
         }
         
@@ -441,7 +441,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
        //
         if(movie != nil && currentSticker != lastshowSticker){
             
-            PQLog(message: "sticker timelineIn is: \(currentSticker!.timelineIn) timelineOut \(currentSticker!.timelineOut)    in is :\(currentSticker!.model_in) in out is :\(currentSticker!.out)  sticker location::: \(String(describing: currentSticker?.locationPath))")
+            BFLog(message: "sticker timelineIn is: \(currentSticker!.timelineIn) timelineOut \(currentSticker!.timelineOut)    in is :\(currentSticker!.model_in) in out is :\(currentSticker!.out)  sticker location::: \(String(describing: currentSticker?.locationPath))")
             
             var showFitler:PQBaseFilter?
             if currentSticker!.type == StickerType.VIDEO.rawValue {
@@ -502,7 +502,7 @@ public extension PQGPUImagePlayerView {
             self.progressLab.isHidden = false
         }
 //        guard status != .playing else {
-//            PQLog(message: "已经是播放状态")
+//            BFLog(message: "已经是播放状态")
 //            return
 //        }
         
@@ -564,7 +564,7 @@ public extension PQGPUImagePlayerView {
 
     // 显示提示文字
     func showTip(show: Bool) {
-        PQLog(message: "showTip \(show)")
+        BFLog(message: "showTip \(show)")
         tipLab.isHidden = !show
         if show {
             playerEmptyView.isHidden = true

+ 48 - 48
BFFramework/Classes/Stuckpoint/ViewModel/PQPlayerViewModel.swift

@@ -44,11 +44,11 @@ class PQPlayerViewModel: NSObject {
                 // 优先使用 mix audio
                 if section.mixEmptyAuidoFilePath.count > 0 {
                     audioFiles.append(URL(fileURLWithPath: documensDirectory + section.mixEmptyAuidoFilePath.replacingOccurrences(of: documensDirectory, with: "")))
-                    PQLog(message: "add mixEmptyAuidoFilePath mixEmptyAuidoFilePath")
+                    BFLog(message: "add mixEmptyAuidoFilePath mixEmptyAuidoFilePath")
                 } else {
                     if section.audioFilePath.count > 0 {
                         audioFiles.append(URL(fileURLWithPath: documensDirectory + section.audioFilePath.replacingOccurrences(of: documensDirectory, with: "")))
-                        PQLog(message: "add audioFilePath audioFilePath")
+                        BFLog(message: "add audioFilePath audioFilePath")
                     }
                 }
 
@@ -59,7 +59,7 @@ class PQPlayerViewModel: NSObject {
                         sticker.timelineIn = totalDuration + partTotaDuration
                         totalDuration = totalDuration + sticker.aptDuration
                         sticker.timelineOut = totalDuration + partTotaDuration
-                        PQLog(message: "创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type)")
+                        BFLog(message: "创建 filter start :\(sticker.timelineIn) end :\(sticker.timelineOut) type is \(sticker.type)")
                         if sticker.type == StickerType.IMAGE.rawValue {
                             let imageFilter = PQImageFilter(sticker: sticker)
                             filters.append(imageFilter)
@@ -83,7 +83,7 @@ class PQPlayerViewModel: NSObject {
                 let recorderSubtitle = List<PQEditSubTitleModel>()
                 if section.sectionTimeline?.visionTrack?.getSubtitleMatraislInfo() != nil {
                     for subtitleMatraislInfo in section.sectionTimeline!.visionTrack!.getSubtitleMatraislInfo() {
-                        PQLog(message: "有录音字幕")
+                        BFLog(message: "有录音字幕")
                         let editSubTitleModel = PQEditSubTitleModel()
                         editSubTitleModel.text = subtitleMatraislInfo.subtitleInfo?.text ?? ""
                         editSubTitleModel.timelineIn = subtitleMatraislInfo.timelineIn
@@ -93,12 +93,12 @@ class PQPlayerViewModel: NSObject {
                 }
 
                 for (index, subTitle) in recorderSubtitle.count > 0 ? recorderSubtitle.enumerated() : section.subTitles.enumerated() {
-                    PQLog(message: "有配音字幕")
+                    BFLog(message: "有配音字幕")
                     let newSubtitle = PQEditSubTitleModel()
                     newSubtitle.timelineIn = subTitle.timelineIn
                     newSubtitle.timelineOut = subTitle.timelineOut
                     newSubtitle.text = subTitle.text.replacingOccurrences(of: "\n", with: "")
-                    PQLog(message: "第\(index)个字幕 subTitle old start : \(newSubtitle.timelineIn)  end: \(newSubtitle.timelineOut) text: \(newSubtitle.text)")
+                    BFLog(message: "第\(index)个字幕 subTitle old start : \(newSubtitle.timelineIn)  end: \(newSubtitle.timelineOut) text: \(newSubtitle.text)")
 
                     // subtitle duration
                     let duration: Float64 = (newSubtitle.timelineOut - newSubtitle.timelineIn)
@@ -106,7 +106,7 @@ class PQPlayerViewModel: NSObject {
                     newSubtitle.timelineIn = partTotaDuration + newSubtitle.timelineIn
                     newSubtitle.timelineOut = newSubtitle.timelineIn + duration
 
-                    PQLog(message: "第\(index)个字幕 subTitle new start : \(newSubtitle.timelineIn)  end: \(newSubtitle.timelineOut) text: \(newSubtitle.text)")
+                    BFLog(message: "第\(index)个字幕 subTitle new start : \(newSubtitle.timelineIn)  end: \(newSubtitle.timelineOut) text: \(newSubtitle.text)")
 
                     newSubtitleData.append(newSubtitle)
 
@@ -130,22 +130,22 @@ class PQPlayerViewModel: NSObject {
                 }
 
                 var tempDuration = section.allStickerAptDurationNoRound() == 0 ? section.sectionDuration : section.allStickerAptDurationNoRound()
-                PQLog(message: "tempDuration 1 is \(tempDuration)")
+                BFLog(message: "tempDuration 1 is \(tempDuration)")
                 // 如果音频时长是经过加空音频 加长后的 要使用长音频
                 if section.mixEmptyAuidoFilePath.count > 0 {
-                    PQLog(message: "有拼接的数据")
+                    BFLog(message: "有拼接的数据")
                     let audioAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + section.mixEmptyAuidoFilePath), options: avAssertOptions)
                     if tempDuration <= audioAsset.duration.seconds {
                         tempDuration = audioAsset.duration.seconds
                     } else {
-                        PQLog(message: "音频文件时长为0?")
+                        BFLog(message: "音频文件时长为0?")
                     }
                 }
-                PQLog(message: "tempDuration 2 is \(tempDuration)")
+                BFLog(message: "tempDuration 2 is \(tempDuration)")
 
                 partTotaDuration = partTotaDuration + tempDuration
             }
-            PQLog(message: "audioFiles 声音文件总数\(audioFiles.count)")
+            BFLog(message: "audioFiles 声音文件总数\(audioFiles.count)")
         }
         return (filters, audioFiles)
     }
@@ -159,7 +159,7 @@ class PQPlayerViewModel: NSObject {
         for sticker in currentPart.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
             var stikcerDuration: Float64 = sticker.duration
             if sticker.videoIsCrop() {
-                PQLog(message: "这个视频有裁剪 \(sticker.locationPath)")
+                BFLog(message: "这个视频有裁剪 \(sticker.locationPath)")
                 stikcerDuration = sticker.out - sticker.model_in
             }
 
@@ -168,13 +168,13 @@ class PQPlayerViewModel: NSObject {
 
         // 真人声音时长
         var realAudioDuration = 0.0
-        PQLog(message: "currentPart.audioFilePath is \(currentPart.audioFilePath)")
+        BFLog(message: "currentPart.audioFilePath is \(currentPart.audioFilePath)")
         if currentPart.audioFilePath.count > 0 {
             let audioAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + currentPart.audioFilePath), options: avAssertOptions)
             realAudioDuration = audioAsset.duration.seconds
         }
 
-        PQLog(message: "所有素材的总时 \(stickerTotalDuration)  文字转语音的时长:\(realAudioDuration)")
+        BFLog(message: "所有素材的总时 \(stickerTotalDuration)  文字转语音的时长:\(realAudioDuration)")
 
         if stickerTotalDuration == 0 && realAudioDuration == 0 {
             DispatchQueue.main.async {
@@ -194,7 +194,7 @@ class PQPlayerViewModel: NSObject {
 
             var audioFileTempPath = exportAudiosDirectory
             if !directoryIsExists(dicPath: audioFileTempPath) {
-                PQLog(message: "文件夹不存在 \(audioFileTempPath)")
+                BFLog(message: "文件夹不存在 \(audioFileTempPath)")
                 createDirectory(path: audioFileTempPath)
             }
 
@@ -205,7 +205,7 @@ class PQPlayerViewModel: NSObject {
                 var tempUrls: Array = NSArray() as! [URL]
 
                 if currentPart.audioFilePath.count > 0 {
-                    PQLog(message: "currentPart.audioFilePath is \(String(describing: currentPart.audioFilePath))")
+                    BFLog(message: "currentPart.audioFilePath is \(String(describing: currentPart.audioFilePath))")
                     tempUrls.append(URL(fileURLWithPath: documensDirectory + currentPart.audioFilePath))
                 }
                 tempUrls.append(URL(fileURLWithPath: audioFileTempPath))
@@ -213,25 +213,25 @@ class PQPlayerViewModel: NSObject {
                 PQPlayerViewModel.mergeAudios(urls: tempUrls) { completURL in
 
                     if completURL == nil {
-                        PQLog(message: "合并文件有问题!")
+                        BFLog(message: "合并文件有问题!")
                         return
                     }
                     //                file:///var/mobile/Containers/Data/Application/2A008644-31A6-4D7E-930B-F1099F36D577/Documents/Resource/ExportAudios/merge_1618817019.789495.m4a
                     let audioAsset = AVURLAsset(url: completURL!, options: avAssertOptions)
 
-                    PQLog(message: "completURL mix : \(String(describing: completURL)) audioFilePath durtion  \(audioAsset.duration.seconds)")
+                    BFLog(message: "completURL mix : \(String(describing: completURL)) audioFilePath durtion  \(audioAsset.duration.seconds)")
 
                     currentPart.mixEmptyAuidoFilePath = completURL!.absoluteString.replacingOccurrences(of: documensDirectory, with: "").replacingOccurrences(of: "file://", with: "")
                     currentPart.sectionDuration = audioAsset.duration.seconds
 
-                    PQLog(message: "stickerTotalDuration is \(stickerTotalDuration)  mixEmptyAuidoFilePath 设置后 是\(currentPart.mixEmptyAuidoFilePath) 时长是:\(currentPart.sectionDuration)")
+                    BFLog(message: "stickerTotalDuration is \(stickerTotalDuration)  mixEmptyAuidoFilePath 设置后 是\(currentPart.mixEmptyAuidoFilePath) 时长是:\(currentPart.sectionDuration)")
 
                     // 1.2)计算贴纸的逻辑显示时长
                     for sticker in currentPart.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
                         var tempDuration = sticker.duration
                         if sticker.videoIsCrop() {
                             tempDuration = sticker.out - sticker.model_in
-                            PQLog(message: "这个视频有裁剪后:\(tempDuration) \(String(describing: sticker.locationPath))")
+                            BFLog(message: "这个视频有裁剪后:\(tempDuration) \(String(describing: sticker.locationPath))")
                         }
                         sticker.aptDuration = tempDuration
                     }
@@ -250,7 +250,7 @@ class PQPlayerViewModel: NSObject {
             // 1.1)计算系数
             let coefficient: Float64 = realAudioDuration / stickerTotalDuration
 
-            PQLog(message: "系数 is: \(coefficient) stickerTotalDuration is \(stickerTotalDuration) audioTotalDuration is :\(realAudioDuration)")
+            BFLog(message: "系数 is: \(coefficient) stickerTotalDuration is \(stickerTotalDuration) audioTotalDuration is :\(realAudioDuration)")
 
             // 1.2)计算贴纸的逻辑显示时长
             for sticker in currentPart.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
@@ -259,7 +259,7 @@ class PQPlayerViewModel: NSObject {
 
                 if sticker.videoIsCrop() {
                     tempDuration = sticker.out - sticker.model_in
-                    PQLog(message: "这个视频有裁剪后:\(tempDuration) \(String(describing: sticker.locationPath))")
+                    BFLog(message: "这个视频有裁剪后:\(tempDuration) \(String(describing: sticker.locationPath))")
                 }
                 // 如果没有音频 系数为0时 使用素材的原始时长
                 sticker.aptDuration = (coefficient == 0) ? tempDuration : tempDuration * coefficient
@@ -274,7 +274,7 @@ class PQPlayerViewModel: NSObject {
     // 计算所有贴纸的逻辑时长
     class func calculationStickAptDuration(currentPart: PQEditSectionModel, createFirst: Bool = true, completeHander: @escaping (_ returnPart: PQEditSectionModel?) -> Void) {
         if currentPart.sectionType == "global" {
-            PQLog(message: "音频段落不处理计算")
+            BFLog(message: "音频段落不处理计算")
             return
         }
         // 从素材详细界面返回 有可能是删除素材操作 这时如果没有选择发音人同时没有录音和导入数据要重新计算空文件时长
@@ -296,7 +296,7 @@ class PQPlayerViewModel: NSObject {
                         timeCount = timeCount + sticker.aptDuration
                     }
                 }
-                PQLog(message: "计算视觉的总时长 \(timeCount)")
+                BFLog(message: "计算视觉的总时长 \(timeCount)")
                 if timeCount > 0 {
                     let tool = PQCreateEmptyWAV(sampleRate: 8000,
                                                 channel: 1,
@@ -306,7 +306,7 @@ class PQPlayerViewModel: NSObject {
 
                     var audioFileTempPath = exportAudiosDirectory
                     if !directoryIsExists(dicPath: audioFileTempPath) {
-                        PQLog(message: "文件夹不存在 \(audioFileTempPath)")
+                        BFLog(message: "文件夹不存在 \(audioFileTempPath)")
                         createDirectory(path: audioFileTempPath)
                     }
 
@@ -340,20 +340,20 @@ class PQPlayerViewModel: NSObject {
         let timeInterval: TimeInterval = Date().timeIntervalSince1970
         let composition = AVMutableComposition()
         var totalDuration: CMTime = .zero
-        PQLog(message: "合并文件总数 \(urls.count)")
+        BFLog(message: "合并文件总数 \(urls.count)")
         for urlStr in urls {
-            PQLog(message: "合并的文件地址: \(urlStr)")
+            BFLog(message: "合并的文件地址: \(urlStr)")
             let audioAsset = AVURLAsset(url: urlStr, options: avAssertOptions)
             let tracks1 = audioAsset.tracks(withMediaType: .audio)
             if tracks1.count == 0 {
-                PQLog(message: "音频数据无效不进行合并,所有任务结束要确保输入的数据都正常! \(urlStr)")
+                BFLog(message: "音频数据无效不进行合并,所有任务结束要确保输入的数据都正常! \(urlStr)")
                 break
             }
             let assetTrack1: AVAssetTrack = tracks1[0]
 
             let duration1: CMTime = assetTrack1.timeRange.duration
 
-            PQLog(message: "每一个文件的 duration \(CMTimeGetSeconds(duration1))")
+            BFLog(message: "每一个文件的 duration \(CMTimeGetSeconds(duration1))")
 
             let timeRange1 = CMTimeRangeMake(start: .zero, duration: duration1)
 
@@ -364,30 +364,30 @@ class PQPlayerViewModel: NSObject {
                 try compositionAudioTrack.insertTimeRange(timeRange1, of: assetTrack1, at: totalDuration)
 
             } catch {
-                PQLog(message: "error is \(error)")
+                BFLog(message: "error is \(error)")
             }
 
             totalDuration = CMTimeAdd(totalDuration, audioAsset.duration)
         }
 
         if CMTimeGetSeconds(totalDuration) == 0 {
-            PQLog(message: "所有数据无效")
+            BFLog(message: "所有数据无效")
             completeHander(nil)
             return
         } else {
 //            拼接声音文件 完成
-            PQLog(message: "totalDuration is \(CMTimeGetSeconds(totalDuration))")
+            BFLog(message: "totalDuration is \(CMTimeGetSeconds(totalDuration))")
         }
 
         let assetExport = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetAppleM4A)
-        PQLog(message: "assetExport.supportedFileTypes is \(String(describing: assetExport?.supportedFileTypes))")
+        BFLog(message: "assetExport.supportedFileTypes is \(String(describing: assetExport?.supportedFileTypes))")
 
         assetExport?.outputFileType = .m4a
         // XXXX 注意文件名的后缀要和outputFileType 一致 否则会导出失败
         var audioFilePath = exportAudiosDirectory
 
         if !directoryIsExists(dicPath: audioFilePath) {
-            PQLog(message: "文件夹不存在")
+            BFLog(message: "文件夹不存在")
             createDirectory(path: audioFilePath)
         }
         audioFilePath.append("merge_\(timeInterval).m4a")
@@ -400,7 +400,7 @@ class PQPlayerViewModel: NSObject {
                 // 85.819125
                 let audioAsset = AVURLAsset(url: fileUrl, options: avAssertOptions)
 
-                PQLog(message: "拼接声音文件 完成 \(fileUrl) 时长is \(CMTimeGetSeconds(audioAsset.duration))")
+                BFLog(message: "拼接声音文件 完成 \(fileUrl) 时长is \(CMTimeGetSeconds(audioAsset.duration))")
                 completeHander(fileUrl)
 
             } else {
@@ -417,7 +417,7 @@ class PQPlayerViewModel: NSObject {
     /// - Returns: 显示的坐标和位置
     class func getShowCanvasRect(editProjectModel: PQEditProjectModel?, showType: Int, playerViewHeight: CGFloat = 216 / 667 * cScreenHeigth) -> CGRect {
         if editProjectModel == nil {
-            PQLog(message: "editProjectModel is error")
+            BFLog(message: "editProjectModel is error")
             return CGRect()
         }
         // UI播放器的最大高度,同时最大宽度为设备宽度
@@ -439,9 +439,9 @@ class PQPlayerViewModel: NSObject {
                 }
                 if firstModel != nil {
                     if firstModel?.width == 0 || firstModel?.height == 0 {
-                        PQLog(message: "!!!!!!!!!!!素材宽高有问题!!!!!!!!!!!")
+                        BFLog(message: "!!!!!!!!!!!素材宽高有问题!!!!!!!!!!!")
                     }
-                    PQLog(message: "第一个有效素材的大小 \(String(describing: firstModel?.width)) \(String(describing: firstModel?.height))")
+                    BFLog(message: "第一个有效素材的大小 \(String(describing: firstModel?.width)) \(String(describing: firstModel?.height))")
                     let ratioMaterial: Float = (firstModel?.width ?? 0) / (firstModel?.height ?? 0)
                     if ratioMaterial > 1 {
                         // 横屏
@@ -475,7 +475,7 @@ class PQPlayerViewModel: NSObject {
             switch canvasType {
             case videoCanvasType.origin.rawValue:
 
-                PQLog(message: "总览时画布的大小 \(String(describing: editProjectModel!.sData!.videoMetaData?.videoWidth)) \(String(describing: editProjectModel!.sData!.videoMetaData?.videoHeight))")
+                BFLog(message: "总览时画布的大小 \(String(describing: editProjectModel!.sData!.videoMetaData?.videoWidth)) \(String(describing: editProjectModel!.sData!.videoMetaData?.videoHeight))")
                 // 画布的宽高 和宽高比值
                 let materialWidth = editProjectModel!.sData!.videoMetaData?.videoWidth ?? 0
                 let materialHeight = editProjectModel!.sData!.videoMetaData?.videoHeight ?? 1
@@ -487,7 +487,7 @@ class PQPlayerViewModel: NSObject {
                 } else if ratioMaterial < 1 {
                     // 竖屏
                     showRect = CGRect(x: (cScreenWidth - cScreenWidth * CGFloat(materialWidth) / CGFloat(materialHeight)) / 2, y: 0, width: cScreenWidth * (CGFloat(materialWidth) / CGFloat(materialHeight)), height: cScreenWidth)
-                    PQLog(message: "showRect is \(showRect)")
+                    BFLog(message: "showRect is \(showRect)")
                 } else {
                     showRect = CGRect(x: 0, y: 0, width: cScreenWidth - 2, height: cScreenWidth - 2)
                 }
@@ -601,7 +601,7 @@ extension PQPlayerViewModel {
             for sticker in videoStickers! {
                 if sticker.volumeGain == 0 {
                     // 如果添加了会有刺啦音
-                    PQLog(message: "音频音量 为0 不添加")
+                    BFLog(message: "音频音量 为0 不添加")
                     continue
                 }
                 let stickerParameters = dealWithMaterialTrack(stickerModel: sticker, composition: composition)
@@ -626,7 +626,7 @@ extension PQPlayerViewModel {
         let bgmAsset = AVURLAsset(url: URL(fileURLWithPath: bgmData.localPath ?? ""), options: avAssertOptions)
         let volume = Float(bgmData.volume) / 100.0
         let bgmDuration = (Float64(bgmData.duration ?? "0") ?? 0) - bgmData.startTime
-        PQLog(message: "处理背景音乐:startTime = \(bgmData.startTime),bgmDuration = \(bgmDuration),totalDuration = \(totalDuration)")
+        BFLog(message: "处理背景音乐:startTime = \(bgmData.startTime),bgmDuration = \(bgmDuration),totalDuration = \(totalDuration)")
 
         if bgmDuration < totalDuration {
             let count = Int(totalDuration) / Int(bgmDuration)
@@ -635,7 +635,7 @@ extension PQPlayerViewModel {
                 for index in 0 ..< count {
                     let startTime = CMTime(value: CMTimeValue(bgmDuration * Double(index) * Double(playerTimescaleInt)), timescale: playerTimescaleInt)
                     let trackTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(bgmData.startTime * Double(playerTimescaleInt)), timescale: playerTimescaleInt), end: CMTime(value: CMTimeValue((bgmData.startTime + bgmDuration) * Double(playerTimescaleInt)), timescale: playerTimescaleInt))
-                    PQLog(message: "背景音乐时长短:count = \(count),startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
+                    BFLog(message: "背景音乐时长短:count = \(count),startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
                     let parameters = mixAudioTrack(audioAsset: bgmAsset, startTime: startTime, trackTimeRange: trackTimeRange, volume: volume, composition: composition)
                     if parameters != nil {
                         tempParameters.append(parameters!)
@@ -645,7 +645,7 @@ extension PQPlayerViewModel {
             if row > 0 {
                 let startTime = CMTime(value: CMTimeValue(bgmDuration * Double(count) * Double(playerTimescaleInt)), timescale: playerTimescaleInt)
                 let trackTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(bgmData.startTime * Double(playerTimescaleInt)), timescale: playerTimescaleInt), end: CMTime(value: CMTimeValue((bgmData.startTime + row) * Double(playerTimescaleInt)), timescale: playerTimescaleInt))
-                PQLog(message: "背景音乐时长短:count = \(count),startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
+                BFLog(message: "背景音乐时长短:count = \(count),startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
                 let parameters = mixAudioTrack(audioAsset: bgmAsset, startTime: startTime, trackTimeRange: trackTimeRange, volume: volume, composition: composition)
                 if parameters != nil {
                     tempParameters.append(parameters!)
@@ -653,7 +653,7 @@ extension PQPlayerViewModel {
             }
         } else {
             let trackTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(bgmData.startTime * Double(playerTimescaleInt)), timescale: playerTimescaleInt), end: CMTime(value: CMTimeValue((bgmData.startTime + totalDuration) * Double(playerTimescaleInt)), timescale: playerTimescaleInt))
-            PQLog(message: "背景音乐时长长:trackTimeRange = \(trackTimeRange)")
+            BFLog(message: "背景音乐时长长:trackTimeRange = \(trackTimeRange)")
             let bgmParameters = mixAudioTrack(audioAsset: bgmAsset, trackTimeRange: trackTimeRange, volume: volume, composition: composition)
             if bgmParameters != nil {
                 tempParameters.append(bgmParameters!)
@@ -722,7 +722,7 @@ extension PQPlayerViewModel {
     ///   - composition: <#composition description#>
     /// - Returns: <#description#>
     class func mixAudioTrack(audioAsset: AVURLAsset, startTime: CMTime = CMTime.zero, trackTimeRange: CMTimeRange, volume: Float = 1, composition: AVMutableComposition) -> AVMutableAudioMixInputParameters? {
-        PQLog(message: "startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
+        BFLog(message: "startTime = \(startTime),trackTimeRange = \(trackTimeRange)")
         // 第一个音轨
         // let assetTrack : AVAssetTrack? = audioAsset.tracks(withMediaType: .audio).first
         // 所有音轨
@@ -738,7 +738,7 @@ extension PQPlayerViewModel {
                 let timeRanges = Array(repeating: NSValue(timeRange: trackTimeRange), count: assetTracks!.count)
                 try audioTrack?.insertTimeRanges(timeRanges, of: assetTracks!, at: startTime)
             } catch {
-                PQLog(message: "error is \(error)")
+                BFLog(message: "error is \(error)")
             }
             return mixInputParameters
         }

+ 7 - 7
BFFramework/Classes/Utils/NXAudioRecorder.swift

@@ -35,7 +35,7 @@ class NXAudioRecorder {
     public init(path: String) throws {
         // 1,判断目录文件夹是否存在
         recordFilePath = path
-        PQLog(message: "recorder file path is \(String(describing: recordFilePath))")
+        BFLog(message: "recorder file path is \(String(describing: recordFilePath))")
 
         // 2,参数
         let fileURL = URL(fileURLWithPath: recordFilePath)
@@ -57,7 +57,7 @@ class NXAudioRecorder {
     /// 开始录制
     public func startRecord() {
         if recorder.isRecording {
-            PQLog(message: "正在录制中。。")
+            BFLog(message: "正在录制中。。")
             return
         }
 
@@ -68,7 +68,7 @@ class NXAudioRecorder {
                 try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: .defaultToSpeaker)
                 try AVAudioSession.sharedInstance().setActive(true)
             } catch {
-                PQLog(message: error)
+                BFLog(message: error)
             }
         }
 
@@ -92,7 +92,7 @@ class NXAudioRecorder {
     // 停止录制
     public func stopRecord(_ closure: @escaping (_ isSuccess: Bool, _ url: String) -> Void) {
         if !recorder.isRecording {
-            PQLog(message: "不是录制状态")
+            BFLog(message: "不是录制状态")
         }
 
         stopTimer()
@@ -105,7 +105,7 @@ class NXAudioRecorder {
     @objc func displayLinkClick(_: CADisplayLink) {
         recorder.updateMeters()
 
-        PQLog(message: "当前录制时间长 \(String(describing: recorder.currentTime)) 波值:\(String(describing: recorder.averagePower(forChannel: 0)))")
+        BFLog(message: "当前录制时间长 \(String(describing: recorder.currentTime)) 波值:\(String(describing: recorder.averagePower(forChannel: 0)))")
         if recorderProgross != nil {
             recorderProgross!(recorder.currentTime)
         }
@@ -146,7 +146,7 @@ private class EditAudioRecorderDelegateHandler: NSObject {
 
 extension EditAudioRecorderDelegateHandler: AVAudioRecorderDelegate {
     func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool) {
-        PQLog(message: "完成录音结果 is \(flag) url is \(recorder.url)")
+        BFLog(message: "完成录音结果 is \(flag) url is \(recorder.url)")
         if flag {
             finishClosure?(true, recorder.url.relativePath)
         }
@@ -154,6 +154,6 @@ extension EditAudioRecorderDelegateHandler: AVAudioRecorderDelegate {
 
     func audioRecorderEncodeErrorDidOccur(_: AVAudioRecorder, error: Error?) {
         guard let error = error else { return }
-        PQLog(message: error)
+        BFLog(message: error)
     }
 }

+ 33 - 33
BFFramework/Classes/Utils/PQAliOssUtil.swift

@@ -25,7 +25,7 @@ class PQAliOssUtil: NSObject {
     var allTasks: [String: OSSMultipartUploadRequest] = [:] // add by ak 保存当前所有任务 用于取消某个任务使用
     func startClient(accessKeyId: String, secretKeyId: String, securityToken: String, endpoint: String) -> PQAliOssUtil {
         if endpoint.count == 0 {
-            PQLog(message: "endpoint is nil xxxxxx \(endpoint)")
+            BFLog(message: "endpoint is nil xxxxxx \(endpoint)")
         }
 
         let credential = OSSStsTokenCredentialProvider(accessKeyId: accessKeyId, secretKeyId: secretKeyId, securityToken: securityToken)
@@ -49,7 +49,7 @@ class PQAliOssUtil: NSObject {
         putRequest.objectKey = objectKey
         putRequest.uploadingData = data
         putRequest.uploadProgress = { [weak self] _, totalByteSent, totalBytesExpectedToSend in
-            PQLog(message: "文件上传进度:totalByteSent = \(totalByteSent),totalBytesExpectedToSend = \(totalBytesExpectedToSend)")
+            BFLog(message: "文件上传进度:totalByteSent = \(totalByteSent),totalBytesExpectedToSend = \(totalBytesExpectedToSend)")
             if totalBytesExpectedToSend > 0, totalByteSent == totalBytesExpectedToSend {
                 if isMatarialUpload, self?.aliOssHander != nil {
                     self?.aliOssHander!(isMatarialUpload, materialType, fileExtensions, 1, objectKey, contentMD5, width, height, 0, 0, nil, nil, data, "上传成功")
@@ -64,14 +64,14 @@ class PQAliOssUtil: NSObject {
         putTask.continue(successBlock: { [weak self] (osstask) -> Any? in
             if osstask.error == nil {
                 let task = self?.client?.presignPublicURL(withBucketName: putRequest.bucketName, withObjectKey: putRequest.objectKey)
-                PQLog(message: "图片原方法上传完成=\(objectKey)")
-                PQLog(message: "url == \(task?.result ?? "" as AnyObject)")
+                BFLog(message: "图片原方法上传完成=\(objectKey)")
+                BFLog(message: "url == \(task?.result ?? "" as AnyObject)")
                 imageUploadBlock(osstask, 1, objectKey, fileExtensions)
             } else {
                 if self?.aliOssHander != nil {
                     self?.aliOssHander!(isMatarialUpload, materialType, fileExtensions, 0, objectKey, contentMD5, width, height, 0, 0, nil, nil, data, "上传失败")
                 }
-                PQLog(message: "图片原方法上传失败=\(objectKey),osstask.error = \(osstask.error ?? PQError(msg: "失败"))")
+                BFLog(message: "图片原方法上传失败=\(objectKey),osstask.error = \(osstask.error ?? PQError(msg: "失败"))")
                 imageUploadBlock(osstask, 0, objectKey, fileExtensions)
             }
 
@@ -124,7 +124,7 @@ class PQAliOssUtil: NSObject {
             endpoints = response?["Hosts"] as! [String]
             endpoints.append(endpoint)
         }
-        PQLog(message: "取我方服务器STS 返回数据 \(String(describing: response))")
+        BFLog(message: "取我方服务器STS 返回数据 \(String(describing: response))")
         PQAliOssUtil.shared.PQOSSMultipartUpload(accessKeyId: accessKeyId, secretKeyId: secretKeyId, securityToken: securityToken, bucketName: bucketName, endpoints: endpoints, FileName: FileName, fileURL: URL(fileURLWithPath: (localPath ?? "").replacingOccurrences(of: "file:///", with: "")), ossUploadID: uploadID)
     }
 
@@ -146,9 +146,9 @@ class PQAliOssUtil: NSObject {
     ///   - height: 视频高 isMatarialUpload = true时传
     /// - Returns: <#description#>
     func PQOSSMultipartUpload(accessKeyId: String, secretKeyId: String, securityToken: String, bucketName: String, endpoints: [String], FileName: String, fileURL: URL, ossUploadID: String, materialType: StickerType = .VIDEO, isMatarialUpload: Bool = false, contentMD5: String = "", width: CGFloat = 0, height: CGFloat = 0) -> PQAliOssUtil {
-        PQLog(message: "上传数据 参数\n accessKeyId:\(accessKeyId)\n secretKeyId:\(secretKeyId)\n  securityToken:\(securityToken) \n bucketName:\(bucketName)\n endpoint:\(endpoints)\n FileName:\(FileName)")
+        BFLog(message: "上传数据 参数\n accessKeyId:\(accessKeyId)\n secretKeyId:\(secretKeyId)\n  securityToken:\(securityToken) \n bucketName:\(bucketName)\n endpoint:\(endpoints)\n FileName:\(FileName)")
         if endpoints.count <= 0 || (endpoints.first?.count ?? 0) <= 0 {
-            PQLog(message: "endpoints 为空")
+            BFLog(message: "endpoints 为空")
             return .shared
         }
         #if DEBUG
@@ -159,13 +159,13 @@ class PQAliOssUtil: NSObject {
         // 1,设置鉴权
         let url = PQENVUtil.shared.longvideoapi + (isMatarialUpload ? materialUploadStsTokenUrl : getStsTokenUrl)
         let authServerUrl = url + "?appType=13" + "&machineCode=" + getMachineCode()
-            + "&token=" + PQLoginUserInfo.shared.accessToken + "&loginUid" + PQLoginUserInfo.shared.uid + "&fileType=2" + "&uploadId=\(ossUploadID)"
+            + "&token=" + BFLoginUserInfo.shared.accessToken + "&loginUid" + BFLoginUserInfo.shared.uid + "&fileType=2" + "&uploadId=\(ossUploadID)"
 
-        PQLog(message: "authServerUrl is: \(authServerUrl)")
-        PQLog(message: "当前上传authServerUrl线程:\(Thread.isMainThread) ")
+        BFLog(message: "authServerUrl is: \(authServerUrl)")
+        BFLog(message: "当前上传authServerUrl线程:\(Thread.isMainThread) ")
 
         let provider = OSSAuthCredentialProvider(authServerUrl: authServerUrl) { (data) -> Data? in
-            PQLog(message: "当前上传provider线程:\(Thread.isMainThread) ")
+            BFLog(message: "当前上传provider线程:\(Thread.isMainThread) ")
             // 在 OSSModel 代码中解析有自己的格式 所以接收到我方服务器后的数据要进行二次处理 AccessKeyId 等信息
             let str = String(data: data, encoding: .utf8)
             let jsonDic = jsonStringToDictionary(str!)
@@ -180,7 +180,7 @@ class PQAliOssUtil: NSObject {
                 ]
             }
             let proStr = dictionaryToJsonString(respDic as [String: Any])
-            PQLog(message: "处理后准备给 OSS SDK数据 \(String(describing: proStr))")
+            BFLog(message: "处理后准备给 OSS SDK数据 \(String(describing: proStr))")
             let decodedData = proStr?.data(using: .utf8)
             if decodedData != nil {
                 return decodedData
@@ -202,14 +202,14 @@ class PQAliOssUtil: NSObject {
             fileSize = attr[FileAttributeKey.size] as! UInt64
 
         } catch {
-            PQLog(message: "取文件大小 Error: \(error)")
+            BFLog(message: "取文件大小 Error: \(error)")
             if aliOssHander != nil {
                 DispatchQueue.main.async { [weak self] in
                     self?.aliOssHander!(isMatarialUpload, materialType, fileURL.absoluteString.pathExtension, 260, FileName, contentMD5, width, height, 0, 0, nil, fileURL, nil, "文件已丢失")
                 }
             }
         }
-        PQLog(message: "文件已经存在  \(fileURL) 文件大小 \(fileSize)")
+        BFLog(message: "文件已经存在  \(fileURL) 文件大小 \(fileSize)")
         var partSize: Int = 0
         // sdk中规定kClientMaximumOfChunks = 5000;
         let defaultChunkSize: UInt64 = 1024 * 1024
@@ -220,12 +220,12 @@ class PQAliOssUtil: NSObject {
         } else {
             partSize = Int(ceil(Float(fileSize / 5000)))
         }
-        PQLog(message: "partSize \(partSize)")
+        BFLog(message: "partSize \(partSize)")
         // 除最后一片外 不能小于 102400(100kb)
         request.partSize = UInt(partSize)
         request.uploadId = ossUploadID
         request.uploadProgress = { [weak self] (bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) -> Void in
-            PQLog(message: "当前上传uploadProgress线程:\(Thread.isMainThread) ")
+            BFLog(message: "当前上传uploadProgress线程:\(Thread.isMainThread) ")
             self?.paraseSpeedAndRestTime(bytesSent: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend) { uploadSpeed, resttime in
                 if self?.aliOssProgressHander != nil {
                     DispatchQueue.main.async { [weak self] in
@@ -254,11 +254,11 @@ class PQAliOssUtil: NSObject {
         let task = client.multipartUpload(request)
 
         task.continue ({ [weak self] (osstask) -> Any? in
-            PQLog(message: "当前上传线程:\(Thread.isMainThread) ")
+            BFLog(message: "当前上传线程:\(Thread.isMainThread) ")
             if osstask.error == nil {
-                PQLog(message: "上传成功")
+                BFLog(message: "上传成功")
                 // 文件URL的格式为:BucketName.Endpoint/ObjectName。
-                PQLog(message: " 上传成功注意使用时拼接域名 url == \(FileName)")
+                BFLog(message: " 上传成功注意使用时拼接域名 url == \(FileName)")
                 request.callbackParam = ["code": 1, "objectKey": FileName, "msg": "上传成功"]
                 DispatchQueue.main.async { [weak self] in
                     if self?.aliOssHander != nil {
@@ -277,7 +277,7 @@ class PQAliOssUtil: NSObject {
                 // 上传完成
                 PQEventTrackViewModel.baseReportUpload(businessType: .bt_up_process, objectType: .ot_up_success, pageSource: nil, remindmsg: "上传相关")
             } else {
-                PQLog(message: "上传失败 \(osstask.error!)")
+                BFLog(message: "上传失败 \(osstask.error!)")
 
                 request.callbackParam = ["code": (osstask.error! as NSError).code, "objectKey": FileName, "msg": osstask.error?.localizedDescription ?? ""]
                 if self?.aliOssHander != nil {
@@ -328,9 +328,9 @@ class PQAliOssUtil: NSObject {
         #if DEBUG
             OSSLog.enable()
         #endif
-        PQLog(message: "普通上传数据 参数 accessKeyId:\(accessKeyId) secretKeyId:\(secretKeyId) securityToken:\(securityToken) bucketName:\(bucketName) endpoint:\(endpoint) objectKey:\(objectKey) enableBackground:\(enableBackground) fileURL : \(fileURL!)")
+        BFLog(message: "普通上传数据 参数 accessKeyId:\(accessKeyId) secretKeyId:\(secretKeyId) securityToken:\(securityToken) bucketName:\(bucketName) endpoint:\(endpoint) objectKey:\(objectKey) enableBackground:\(enableBackground) fileURL : \(fileURL!)")
         if endpoint.count <= 0 || (endpoint.first?.count ?? 0) <= 0 {
-            PQLog(message: "endpoints 为空")
+            BFLog(message: "endpoints 为空")
             return .shared
         }
         let provider = OSSStsTokenCredentialProvider(accessKeyId: accessKeyId, secretKeyId: secretKeyId, securityToken: securityToken)
@@ -375,7 +375,7 @@ class PQAliOssUtil: NSObject {
                         speed = speed / 1024
                         units = "M/s"
                     }
-                    PQLog(message: "上传速度: \(speed)\(units)   还剩时间 \(resttime)")
+                    BFLog(message: "上传速度: \(speed)\(units)   还剩时间 \(resttime)")
                 }
             }
             // 多个界面都要处理上传进度 所以使用通知 ? 通知有回到主线?
@@ -384,11 +384,11 @@ class PQAliOssUtil: NSObject {
         let task = client?.putObject(request)
         if fileURL?.absoluteString.contains("_noise_") ?? false {
             task?.continue ({ [weak self] (osstask) -> Any? in
-                PQLog(message: "当前上传线程:\(Thread.isMainThread) ")
+                BFLog(message: "当前上传线程:\(Thread.isMainThread) ")
                 if osstask.error == nil {
-                    PQLog(message: "上传成功")
+                    BFLog(message: "上传成功")
                     // 文件URL的格式为:BucketName.Endpoint/ObjectName。
-                    PQLog(message: " 上传成功注意使用时拼接域名 url == \(objectKey)")
+                    BFLog(message: " 上传成功注意使用时拼接域名 url == \(objectKey)")
                     request.callbackParam = ["code": 1, "objectKey": objectKey, "msg": "上传成功"]
                     DispatchQueue.main.async { [weak self] in
                         if self?.aliOssHander != nil {
@@ -407,7 +407,7 @@ class PQAliOssUtil: NSObject {
                     // 上传完成
                     PQEventTrackViewModel.baseReportUpload(businessType: .bt_up_process, objectType: .ot_up_success, pageSource: nil, remindmsg: "上传相关")
                 } else {
-                    PQLog(message: "上传失败 \(osstask.error!)")
+                    BFLog(message: "上传失败 \(osstask.error!)")
                     request.callbackParam = ["code": (osstask.error! as NSError).code, "objectKey": objectKey, "msg": osstask.error?.localizedDescription ?? ""]
                     if self?.aliOssHander != nil {
                         DispatchQueue.main.async { [weak self] in
@@ -429,11 +429,11 @@ class PQAliOssUtil: NSObject {
             }).waitUntilFinished()
         } else {
             task?.continue ({ [weak self] (osstask) -> Any? in
-                PQLog(message: "当前上传线程:\(Thread.isMainThread) ")
+                BFLog(message: "当前上传线程:\(Thread.isMainThread) ")
                 if osstask.error == nil {
-                    PQLog(message: "上传成功")
+                    BFLog(message: "上传成功")
                     // 文件URL的格式为:BucketName.Endpoint/ObjectName。
-                    PQLog(message: " 上传成功注意使用时拼接域名 url == \(objectKey)")
+                    BFLog(message: " 上传成功注意使用时拼接域名 url == \(objectKey)")
                     request.callbackParam = ["code": 1, "objectKey": objectKey, "msg": "上传成功"]
                     DispatchQueue.main.async { [weak self] in
                         if self?.aliOssHander != nil {
@@ -452,7 +452,7 @@ class PQAliOssUtil: NSObject {
                     // 上传完成
                     PQEventTrackViewModel.baseReportUpload(businessType: .bt_up_process, objectType: .ot_up_success, pageSource: nil, remindmsg: "上传相关")
                 } else {
-                    PQLog(message: "上传失败 \(osstask.error!)")
+                    BFLog(message: "上传失败 \(osstask.error!)")
                     request.callbackParam = ["code": (osstask.error! as NSError).code, "objectKey": objectKey, "msg": osstask.error?.localizedDescription ?? ""]
                     if self?.aliOssHander != nil {
                         DispatchQueue.main.async { [weak self] in
@@ -502,7 +502,7 @@ class PQAliOssUtil: NSObject {
         }
         lastInterfaceBytes = newInterfaceBytes
         let resttime = (totalBytesExpectedToSend - totalBytesSent) / interfaceBytes
-        PQLog(message: "interfaceBytes = \(interfaceBytes),totalBytesExpectedToSend = \(totalBytesExpectedToSend),totalBytesSent = \(totalBytesSent),")
+        BFLog(message: "interfaceBytes = \(interfaceBytes),totalBytesExpectedToSend = \(totalBytesExpectedToSend),totalBytesSent = \(totalBytesSent),")
         complateHandle("\(PQBridgeObject.formatNetWork(interfaceBytes))", resttime)
     }
 

+ 30 - 23
BFFramework/Classes/Utils/PQCommonMethodUtil.swift

@@ -16,6 +16,7 @@ import Kingfisher
 import Photos
 import RealmSwift
 import Toast_Swift
+import NXFramework_Swift
 /// Home文件地址
 let homeDirectory = NSHomeDirectory()
 /// docdocumens文件地址
@@ -57,7 +58,7 @@ func createDirectory(path: String) {
 /// 判断文件夹是否存在
 /// - Parameter dicPath:文件夹 目录
 func directoryIsExists(dicPath: String) -> Bool {
-    PQLog(message: " dir path is: \(dicPath)")
+    BFLog(message: " dir path is: \(dicPath)")
     var directoryExists = ObjCBool(false)
     let fileExists = FileManager.default.fileExists(atPath: dicPath, isDirectory: &directoryExists)
     return fileExists && directoryExists.boolValue
@@ -66,7 +67,7 @@ func directoryIsExists(dicPath: String) -> Bool {
 /// 判断文件是否存在
 /// - Parameter filepath: 文件目录
 func fileIsExists(filePath: String) -> Bool {
-    PQLog(message: "file path is: \(filePath)")
+    BFLog(message: "file path is: \(filePath)")
 
     let fileExists = FileManager.default.fileExists(atPath: filePath)
     return fileExists
@@ -124,8 +125,14 @@ func kf_imageCacheImage(originUrl: String) -> UIImage? {
 }
 
 /** 打印 */
-func PQLog<T>(message: T) {
-    print(message)
+public func BFLog<T>(message: T) {
+ 
+    let logger = NXLogger.shared
+
+    logger.level = .info
+    logger.ouput = .debuggerConsole
+
+    logger.d(message as? String ?? "")
 }
 
 // MARK: 获取公共参数
@@ -161,12 +168,12 @@ func commonParams() -> [String: Any] {
         "idfv": UIDevice.current.identifierForVendor?.uuidString ?? "",
         "deviceToken": PQSingletoMemoryUtil.shared.deviceToken,
     ]
-    if PQLoginUserInfo.shared.accessToken.count > 0 {
-        commParams["token"] = PQLoginUserInfo.shared.accessToken
+    if BFLoginUserInfo.shared.accessToken.count > 0 {
+        commParams["token"] = BFLoginUserInfo.shared.accessToken
     }
-    if PQLoginUserInfo.shared.uid.count > 0 {
-        commParams["loginUid"] = PQLoginUserInfo.shared.uid
-        commParams["uid"] = PQLoginUserInfo.shared.uid
+    if BFLoginUserInfo.shared.uid.count > 0 {
+        commParams["loginUid"] = BFLoginUserInfo.shared.uid
+        commParams["uid"] = BFLoginUserInfo.shared.uid
     }
 //    showAlertVc(title: "公参", message: dictionaryToJsonString(commParams))
     return commParams
@@ -234,23 +241,23 @@ func getUniqueId(desc: String) -> String {
     let uuid: String = getMachineCode()
     let code: String = "\(arc4random_uniform(1_000_000_000))"
     let uniqueId = (timeStr + desc + uuid + code).kf.md5.kf.md5
-    PQLog(message: "生成唯一码:desc = \(desc),timeStr = \(timeStr),uuid = \(uuid),code = \(code),uniqueId = \(uniqueId)")
+    BFLog(message: "生成唯一码:desc = \(desc),timeStr = \(timeStr),uuid = \(uuid),code = \(code),uniqueId = \(uniqueId)")
     return uniqueId
 }
 
 // MARK: 字典转字符串
 
 func dictionaryToJsonString(_ dic: [String: Any]) -> String? {
-    PQLog(message: "dictionaryToJsonString = \(dic)")
+    BFLog(message: "dictionaryToJsonString = \(dic)")
     if !JSONSerialization.isValidJSONObject(dic) {
         return ""
     }
     guard let data = try? JSONSerialization.data(withJSONObject: dic, options: []) else {
         return ""
     }
-    PQLog(message: "dictionaryToJsonString - data = \(data)")
+    BFLog(message: "dictionaryToJsonString - data = \(data)")
     let str = String(data: data, encoding: String.Encoding.utf8)
-    PQLog(message: "dictionaryToJsonString - str = \(String(describing: str))")
+    BFLog(message: "dictionaryToJsonString - str = \(String(describing: str))")
     return str
 }
 
@@ -282,7 +289,7 @@ func jsonStringToArray(_ str: String) -> [[String: String]]? {
 /// - Returns: <#description#>
 func arrayToJsonString(_ array: [Any]) -> String {
     if !JSONSerialization.isValidJSONObject(array) {
-        PQLog(message: "无法解析String")
+        BFLog(message: "无法解析String")
         return ""
     }
     let data: NSData! = try? JSONSerialization.data(withJSONObject: array, options: []) as NSData?
@@ -371,7 +378,7 @@ func gradientColor(size: CGSize, endPoint: CGPoint, startColor: UIColor, endColo
 func getMachineCode() -> String {
     let userInfo: [String: Any]? = jsonStringToDictionary(UserDefaults.standard.string(forKey: cUserInfoStorageKey) ?? "")
     if userInfo != nil && ((userInfo?.keys.contains("isVirtualUser") ?? false) && !(userInfo?["isVirtualUser"] is NSNull) && ((userInfo?["isVirtualUser"] as? Bool) ?? false)) && ((userInfo?.keys.contains("mid") ?? false) && !(userInfo?["mid"] is NSNull)) {
-        PQLog(message: "虚拟账号mid:\("\(userInfo?["mid"] ?? "")")")
+        BFLog(message: "虚拟账号mid:\("\(userInfo?["mid"] ?? "")")")
         return "\(userInfo?["mid"] ?? "")"
     }
     let keychain = Keychain(service: "com.piaoquan.pqspeed")
@@ -380,7 +387,7 @@ func getMachineCode() -> String {
         uuid = NSUUID().uuidString
         keychain["machineCode"] = uuid
     }
-    PQLog(message: "正式账号mid:\(uuid)")
+    BFLog(message: "正式账号mid:\(uuid)")
     return uuid
 }
 
@@ -486,7 +493,7 @@ func saveCustomObject(customObject object: NSCoding, key: String) {
     let encodedObject = NSKeyedArchiver.archivedData(withRootObject: object)
     UserDefaults.standard.set(encodedObject, forKey: key)
     UserDefaults.standard.synchronize()
-    PQLog(message: "保存自定义类成功 key is \(key) \(encodedObject.count)")
+    BFLog(message: "保存自定义类成功 key is \(key) \(encodedObject.count)")
 }
 
 /// 取自定义model
@@ -495,7 +502,7 @@ func getCustomObject(forKey key: String) -> AnyObject? {
     let decodedObject = UserDefaults.standard.object(forKey: key) as? Data
 
     if decodedObject == nil {
-        PQLog(message: "key is \(key)  decodedObject is nil")
+        BFLog(message: "key is \(key)  decodedObject is nil")
     }
     if let decoded = decodedObject {
         let object = NSKeyedUnarchiver.unarchiveObject(with: decoded as Data)
@@ -615,8 +622,8 @@ func parseDNS(hostUrl: String) -> [String: Any]? {
     }
     let end = CFAbsoluteTimeGetCurrent()
     let duration = end - start
-    PQLog(message: "duration = \(duration)")
-    PQLog(message: "addressList = \(addressList)")
+    BFLog(message: "duration = \(duration)")
+    BFLog(message: "addressList = \(addressList)")
     if addressList.count > 0 {
         return ["dnsResult": arrayToJsonString(addressList), "duration": duration * 1000, "hostName": hostUrl, "networkType": networkStatus()]
     } else {
@@ -693,17 +700,17 @@ func isIncludeChineseIn(string: String) -> Bool {
 /// - Returns: <#description#>
 func contentMD5(path: String? = nil, data _: Data? = nil) -> String? {
     if path == nil || (path?.count ?? 0) <= 0 || !FileManager.default.fileExists(atPath: path ?? "") {
-        PQLog(message: "生成内容md5值:地址错误或者不存在\(String(describing: path))")
+        BFLog(message: "生成内容md5值:地址错误或者不存在\(String(describing: path))")
         return ""
     }
     let att = try? FileManager.default.attributesOfItem(atPath: path ?? "")
     let size = Int64(att?[FileAttributeKey.size] as! UInt64)
     if size <= 0 {
-        PQLog(message: "生成内容md5值:文件大小为0\(size)")
+        BFLog(message: "生成内容md5值:文件大小为0\(size)")
         return ""
     }
     let hash: String = OSSUtil.base64Md5(forFilePath: path)
-    PQLog(message: "生成内容md5值:contentMD5 = \(hash)")
+    BFLog(message: "生成内容md5值:contentMD5 = \(hash)")
     return hash
 
     //    let ctxLen = MemoryLayout<CC_MD5_CTX>.size

+ 12 - 12
BFFramework/Classes/Utils/PQCreateEmptyWAV.swift

@@ -39,23 +39,23 @@ class PQCreateEmptyWAV {
         mduration = duration
         mbit = bit
         if mduration == 0 {
-            PQLog(message: "时长为0??")
+            BFLog(message: "时长为0??")
         }
-        PQLog(message: "mSampleRate is\(mSampleRate) mChannel is \(mChannel) mduration is:\(mduration) mbit is \(mbit)")
+        BFLog(message: "mSampleRate is\(mSampleRate) mChannel is \(mChannel) mduration is:\(mduration) mbit is \(mbit)")
     }
 
     func createEmptyWAVFile(url: URL, completeHander: @escaping (_ fileURL: URL?) -> Void) {
         DispatchQueue.global().async {
             // 数字音频文件大小(Byte) = 采样频率(Hz)× 采样时长(S)×(采样位数 / 8)× 声道数(单声道为1,立体声为2)
-//        PQLog(message: "createEmptyWAVFile 1")
+//        BFLog(message: "createEmptyWAVFile 1")
             let size = Int64(self.mSampleRate * self.mduration * (self.mbit / 8) * self.mChannel)
 
             let bufer = Array(repeating: 0, count: Int(size))
-//        PQLog(message: "createEmptyWAVFile 2 \(size)")
+//        BFLog(message: "createEmptyWAVFile 2 \(size)")
             let data = Data(bytes: bufer, count: Int(size))
             let totalAudioLen = size
             let totalDataLen = totalAudioLen + 44
-//        PQLog(message: "createEmptyWAVFile 3")
+//        BFLog(message: "createEmptyWAVFile 3")
             self.writewaveFileHeader(output: url,
                                      totalAudioLen: totalAudioLen,
                                      totalDataLen: totalDataLen,
@@ -73,15 +73,15 @@ class PQCreateEmptyWAV {
     func createEmptyWAVFile(url: URL) {
  
             // 数字音频文件大小(Byte) = 采样频率(Hz)× 采样时长(S)×(采样位数 / 8)× 声道数(单声道为1,立体声为2)
-//        PQLog(message: "createEmptyWAVFile 1")
+//        BFLog(message: "createEmptyWAVFile 1")
             let size = Int64(self.mSampleRate * self.mduration * (self.mbit / 8) * self.mChannel)
 
             let bufer = Array(repeating: 0, count: Int(size))
-//        PQLog(message: "createEmptyWAVFile 2 \(size)")
+//        BFLog(message: "createEmptyWAVFile 2 \(size)")
             let data = Data(bytes: bufer, count: Int(size))
             let totalAudioLen = size
             let totalDataLen = totalAudioLen + 44
-//        PQLog(message: "createEmptyWAVFile 3")
+//        BFLog(message: "createEmptyWAVFile 3")
             self.writewaveFileHeader(output: url,
                                      totalAudioLen: totalAudioLen,
                                      totalDataLen: totalDataLen,
@@ -101,7 +101,7 @@ class PQCreateEmptyWAV {
                              byteRate: Int64,
                              audioData: Data)
     {
-        PQLog(message: "createEmptyWAVFile 4")
+        BFLog(message: "createEmptyWAVFile 4")
         var header: [UInt8] = Array(repeating: 0, count: 44)
 
         // RIFF/WAVE header
@@ -169,12 +169,12 @@ class PQCreateEmptyWAV {
 //        guard let writeHandler = try? FileHandle(forWritingTo: output) else { return }
         var data = Data(header)
         data.append(audioData)
-        PQLog(message: "createEmptyWAVFile 5")
+        BFLog(message: "createEmptyWAVFile 5")
         do {
             try data.write(to: output, options: .atomicWrite)
-            PQLog(message: "createEmptyWAVFile 6 \(data.count)")
+            BFLog(message: "createEmptyWAVFile 6 \(data.count)")
         } catch {
-            PQLog(message: " write file error \(error)")
+            BFLog(message: " write file error \(error)")
         }
     }
 }

+ 61 - 61
BFFramework/Classes/Utils/PQPHAssetVideoParaseUtil.swift

@@ -56,16 +56,16 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 tempVideoOptions.isNetworkAccessAllowed = true
                 tempVideoOptions.deliveryMode = .highQualityFormat
                 tempVideoOptions.progressHandler = { progress, error, pointer, info in
-                    PQLog(message: "导出playerItem-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
+                    BFLog(message: "导出playerItem-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
                 }
                 PHImageManager().requestPlayerItem(forVideo: phAsset, options: tempVideoOptions) { (playerItem, info) in
                     let size = try! (playerItem?.asset as? AVURLAsset)?.url.resourceValues(forKeys: [.fileSizeKey])
-                    PQLog(message: "size = \(String(describing: size))")
+                    BFLog(message: "size = \(String(describing: size))")
                     resultHandler(playerItem, Float64(size?.fileSize ?? 0), info)
                 }
             }else{
                 let size = try! (playerItem?.asset as? AVURLAsset)?.url.resourceValues(forKeys: [.fileSizeKey])
-                PQLog(message: "size = \(String(describing: size))")
+                BFLog(message: "size = \(String(describing: size))")
                 resultHandler(playerItem, Float64(size?.fileSize ?? 0), info)
             }
         }
@@ -85,17 +85,17 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 tempVideoOptions.isNetworkAccessAllowed = true
                 tempVideoOptions.deliveryMode = .highQualityFormat
                 tempVideoOptions.progressHandler = { progress, error, pointer, info in
-                    PQLog(message: "导出playerItem-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
+                    BFLog(message: "导出playerItem-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
                 }
                 PHImageManager.default().requestAVAsset(forVideo: phAsset, options: tempVideoOptions) { tempAvAsset, tempAudioMix, tempInfo in
                     let size = try! (tempAvAsset as? AVURLAsset)?.url.resourceValues(forKeys: [.fileSizeKey])
-                    PQLog(message: "size = \(String(describing: size))")
+                    BFLog(message: "size = \(String(describing: size))")
                     resultHandler(tempAvAsset, size?.fileSize ?? 0, tempAudioMix, tempInfo)
                 }
             }else{
                 let size = try! (avAsset as? AVURLAsset)?.url.resourceValues(forKeys: [.fileSizeKey])
                 resultHandler(avAsset, size?.fileSize ?? 0, audioMix, info)
-                PQLog(message: "size = \(String(describing: size))")
+                BFLog(message: "size = \(String(describing: size))")
             }
         }
     }
@@ -107,7 +107,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
     ///   - resultHandler: <#resultHandler description#>
     /// - Returns: <#description#>
     class func exportPHAssetToMP4(phAsset: PHAsset, isAdjustRotationAngle: Bool = true, isCancelCurrentExport: Bool = false,deliveryMode: PHVideoRequestOptionsDeliveryMode? = .automatic, resultHandler: @escaping (_ phAsset: PHAsset, _ aVAsset: AVAsset?, _ filePath: String?, _ errorMsg: String?) -> Void) {
-        PQLog(message: "导出相册视频-开始导出:phAsset = \(phAsset)")
+        BFLog(message: "导出相册视频-开始导出:phAsset = \(phAsset)")
         if isCancelCurrentExport {
             currentExportSession?.cancelExport()
         }
@@ -119,23 +119,23 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 let filePath = photoLibraryDirectory + (fileName.kf.md5).kf.md5 + ".mp4"
                 let data = try? Data(contentsOf: NSURL.fileURL(withPath: filePath))
                 if FileManager.default.fileExists(atPath: filePath) && (data?.count ?? 0) > fileSize / 40 {
-                    PQLog(message: "导出相册视频-已经导出完成:\(filePath)")
+                    BFLog(message: "导出相册视频-已经导出完成:\(filePath)")
                     DispatchQueue.main.async {
                         resultHandler(phAsset, avAsset, filePath, nil)
                     }
                 } else {
                     let tempExportSession = PQSingletoMemoryUtil.shared.allExportSession[phAsset]
                     if tempExportSession != nil {
-                        PQLog(message: "导出相册视频-正在导出")
+                        BFLog(message: "导出相册视频-正在导出")
                         return
                     }
-                    PQLog(message: "导出相册视频-未导出视频过,开始导出:phAsset = \(phAsset)")
+                    BFLog(message: "导出相册视频-未导出视频过,开始导出:phAsset = \(phAsset)")
                     // 删除以创建地址
                     if FileManager.default.fileExists(atPath: filePath) {
                         do {
                             try FileManager.default.removeItem(at: NSURL.fileURL(withPath: filePath))
                         } catch {
-                            PQLog(message: "导出相册视频-error == \(error)")
+                            BFLog(message: "导出相册视频-error == \(error)")
                         }
                     }
                     let requestOptions = PHVideoRequestOptions()
@@ -145,11 +145,11 @@ class PQPHAssetVideoParaseUtil: NSObject {
                     // 下载iCloud视频
                     requestOptions.isNetworkAccessAllowed = false
                     requestOptions.progressHandler = { progress, error, pointer, info in
-                        PQLog(message: "导出相册视频-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
+                        BFLog(message: "导出相册视频-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
                     }
                     requestOptions.deliveryMode = deliveryMode ?? .automatic
                     PHImageManager.default().requestExportSession(forVideo: phAsset, options: requestOptions, exportPreset: (deliveryMode == .automatic || deliveryMode == .mediumQualityFormat) ? AVAssetExportPresetMediumQuality :(deliveryMode == .highQualityFormat ? AVAssetExportPresetHighestQuality : AVAssetExportPresetLowQuality) , resultHandler: { avAssetExportSession, _ in
-                        PQLog(message: "导出相册视频-请求到导出 avAssetExportSession = \(String(describing: avAssetExportSession))")
+                        BFLog(message: "导出相册视频-请求到导出 avAssetExportSession = \(String(describing: avAssetExportSession))")
                         currentExportSession = avAssetExportSession
                         if avAssetExportSession != nil {
                             PQSingletoMemoryUtil.shared.allExportSession[phAsset] = avAssetExportSession!
@@ -193,11 +193,11 @@ class PQPHAssetVideoParaseUtil: NSObject {
                                 videoComposition.instructions = [roateInstruction]
                                 avAssetExportSession?.videoComposition = videoComposition
                             } else {
-                                PQLog(message: "firstTrack is error !!!")
+                                BFLog(message: "firstTrack is error !!!")
                             }
                         }
                         avAssetExportSession?.exportAsynchronously(completionHandler: {
-                            PQLog(message: "导出相册视频-progress = \(avAssetExportSession?.progress ?? 0),status = \(String(describing: avAssetExportSession?.status))")
+                            BFLog(message: "导出相册视频-progress = \(avAssetExportSession?.progress ?? 0),status = \(String(describing: avAssetExportSession?.status))")
                             switch avAssetExportSession?.status {
                             case .unknown:
                                 DispatchQueue.main.async {
@@ -205,32 +205,32 @@ class PQPHAssetVideoParaseUtil: NSObject {
                                 }
                                 avAssetExportSession?.cancelExport()
                                 PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-                                PQLog(message: "导出相册视频-发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                                BFLog(message: "导出相册视频-发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                             case .waiting:
-                                PQLog(message: "导出相册视频-等待导出mp4:\(filePath)")
+                                BFLog(message: "导出相册视频-等待导出mp4:\(filePath)")
                             case .exporting:
-                                PQLog(message: "导出相册视频-导出相册视频中...:\(filePath)")
+                                BFLog(message: "导出相册视频-导出相册视频中...:\(filePath)")
                             case .completed:
                                 DispatchQueue.main.async {
                                     resultHandler(phAsset, avAsset, filePath, nil)
                                 }
                                 avAssetExportSession?.cancelExport()
                                 PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-                                PQLog(message: "导出相册视频-导出完成:\(filePath)")
+                                BFLog(message: "导出相册视频-导出完成:\(filePath)")
                             case .failed:
                                 DispatchQueue.main.async {
                                     resultHandler(phAsset, avAsset, nil, avAssetExportSession?.error?.localizedDescription)
                                 }
                                 avAssetExportSession?.cancelExport()
                                 PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-                                PQLog(message: "导出相册视频-导出失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                                BFLog(message: "导出相册视频-导出失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                             case .cancelled:
                                 DispatchQueue.main.async {
                                     resultHandler(phAsset, avAsset, nil, avAssetExportSession?.error?.localizedDescription)
                                 }
                                 avAssetExportSession?.cancelExport()
                                 PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-                                PQLog(message: "导出相册视频-取消导出:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                                BFLog(message: "导出相册视频-取消导出:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                             default:
                                 break
                             }
@@ -238,7 +238,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
                     })
                 }
             } else if avAsset is AVComposition {
-                PQLog(message: "导出相册视频-是AVComposition = \(String(describing: avAsset))")
+                BFLog(message: "导出相册视频-是AVComposition = \(String(describing: avAsset))")
                 let assetResources = PHAssetResource.assetResources(for: phAsset)
                 var resource: PHAssetResource?
                 for assetRes in assetResources {
@@ -280,7 +280,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
     ///   - resultHandler: <#resultHandler description#>
     /// - Returns: <#description#>
     class func writePHAssetDataToMP4(phAsset: PHAsset, isAdjustRotationAngle: Bool = true, isCancelCurrentExport: Bool = false,deliveryMode: PHVideoRequestOptionsDeliveryMode? = .automatic, resultHandler: @escaping (_ phAsset: PHAsset, _ aVAsset: AVAsset?, _ filePath: String?, _ errorMsg: String?) -> Void) {
-        PQLog(message: "导出相册视频-开始导出:phAsset = \(phAsset)")
+        BFLog(message: "导出相册视频-开始导出:phAsset = \(phAsset)")
         if isCancelCurrentExport {
             currentExportSession?.cancelExport()
         }
@@ -292,29 +292,29 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 let filePath = photoLibraryDirectory + fileName.kf.md5 + ".mp4"
                 let data = try? Data(contentsOf: NSURL.fileURL(withPath: filePath))
                 if FileManager.default.fileExists(atPath: filePath) && (data?.count ?? 0) > fileSize / 40 {
-                    PQLog(message: "导出相册视频-已经导出完成:\(filePath)")
+                    BFLog(message: "导出相册视频-已经导出完成:\(filePath)")
                     DispatchQueue.main.async {
                         resultHandler(phAsset, avAsset, filePath, nil)
                     }
                 } else {
                     let tempExportSession = PQSingletoMemoryUtil.shared.allExportSession[phAsset]
                     if tempExportSession != nil {
-                        PQLog(message: "导出相册视频-正在导出")
+                        BFLog(message: "导出相册视频-正在导出")
                         return
                     }
-                    PQLog(message: "导出相册视频-未导出视频过,开始导出:phAsset = \(phAsset)")
+                    BFLog(message: "导出相册视频-未导出视频过,开始导出:phAsset = \(phAsset)")
                     // 删除以创建地址
                     if FileManager.default.fileExists(atPath: filePath) {
                         do {
                             try FileManager.default.removeItem(at: NSURL.fileURL(withPath: filePath))
                         } catch {
-                            PQLog(message: "导出相册视频-error == \(error)")
+                            BFLog(message: "导出相册视频-error == \(error)")
                         }
                     }
                     do {
                         try FileManager.default.copyItem(at: (avAsset as! AVURLAsset).url, to: URL.init(fileURLWithPath: filePath))
                     } catch {
-                        PQLog(message: "导出相册视频-error == \(error)")
+                        BFLog(message: "导出相册视频-error == \(error)")
                     }
                     
 //                    NSError *error;
@@ -342,12 +342,12 @@ class PQPHAssetVideoParaseUtil: NSObject {
 //                    // 下载iCloud视频
 //                    requestOptions.isNetworkAccessAllowed = false
 //                    requestOptions.progressHandler = { progress, error, pointer, info in
-//                        PQLog(message: "导出相册视频-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
+//                        BFLog(message: "导出相册视频-progress = \(progress),error = \(String(describing: error)),pointer = \(pointer),info = \(String(describing: info))")
 //                    }
 //                    requestOptions.deliveryMode = deliveryMode ?? .automatic
                     
 //                    PHImageManager.default().requestExportSession(forVideo: phAsset, options: requestOptions, exportPreset: (deliveryMode == .automatic || deliveryMode == .mediumQualityFormat) ? AVAssetExportPreset1920x1080 :(deliveryMode == .highQualityFormat ? AVAssetExportPresetHighestQuality : AVAssetExportPresetLowQuality) , resultHandler: { avAssetExportSession, _ in
-//                        PQLog(message: "导出相册视频-请求到导出 avAssetExportSession = \(avAssetExportSession)")
+//                        BFLog(message: "导出相册视频-请求到导出 avAssetExportSession = \(avAssetExportSession)")
 //                        currentExportSession = avAssetExportSession
 //                        if avAssetExportSession != nil {
 //                            PQSingletoMemoryUtil.shared.allExportSession[phAsset] = avAssetExportSession!
@@ -391,12 +391,12 @@ class PQPHAssetVideoParaseUtil: NSObject {
 //                                videoComposition.instructions = [roateInstruction]
 //                                avAssetExportSession?.videoComposition = videoComposition
 //                            } else {
-//                                PQLog(message: "firstTrack is error !!!")
+//                                BFLog(message: "firstTrack is error !!!")
 //                            }
 //                        }
 //                        avAssetExportSession?.shouldOptimizeForNetworkUse = true
 //                        avAssetExportSession?.exportAsynchronously(completionHandler: {
-//                            PQLog(message: "导出相册视频-progress = \(avAssetExportSession?.progress ?? 0),status = \(String(describing: avAssetExportSession?.status))")
+//                            BFLog(message: "导出相册视频-progress = \(avAssetExportSession?.progress ?? 0),status = \(String(describing: avAssetExportSession?.status))")
 //                            switch avAssetExportSession?.status {
 //                            case .unknown:
 //                                DispatchQueue.main.async {
@@ -404,32 +404,32 @@ class PQPHAssetVideoParaseUtil: NSObject {
 //                                }
 //                                avAssetExportSession?.cancelExport()
 //                                PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-//                                PQLog(message: "导出相册视频-发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+//                                BFLog(message: "导出相册视频-发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
 //                            case .waiting:
-//                                PQLog(message: "导出相册视频-等待导出mp4:\(filePath)")
+//                                BFLog(message: "导出相册视频-等待导出mp4:\(filePath)")
 //                            case .exporting:
-//                                PQLog(message: "导出相册视频-导出相册视频中...:\(filePath)")
+//                                BFLog(message: "导出相册视频-导出相册视频中...:\(filePath)")
 //                            case .completed:
 //                                DispatchQueue.main.async {
 //                                    resultHandler(phAsset, avAsset, filePath, nil)
 //                                }
 //                                avAssetExportSession?.cancelExport()
 //                                PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-//                                PQLog(message: "导出相册视频-导出完成:\(filePath)")
+//                                BFLog(message: "导出相册视频-导出完成:\(filePath)")
 //                            case .failed:
 //                                DispatchQueue.main.async {
 //                                    resultHandler(phAsset, avAsset, nil, avAssetExportSession?.error?.localizedDescription)
 //                                }
 //                                avAssetExportSession?.cancelExport()
 //                                PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-//                                PQLog(message: "导出相册视频-导出失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+//                                BFLog(message: "导出相册视频-导出失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
 //                            case .cancelled:
 //                                DispatchQueue.main.async {
 //                                    resultHandler(phAsset, avAsset, nil, avAssetExportSession?.error?.localizedDescription)
 //                                }
 //                                avAssetExportSession?.cancelExport()
 //                                PQSingletoMemoryUtil.shared.allExportSession.removeValue(forKey: phAsset)
-//                                PQLog(message: "导出相册视频-取消导出:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+//                                BFLog(message: "导出相册视频-取消导出:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
 //                            default:
 //                                break
 //                            }
@@ -437,7 +437,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
 //                    })
                 }
             } else if avAsset is AVComposition {
-                PQLog(message: "导出相册视频-是AVComposition = \(String(describing: avAsset))")
+                BFLog(message: "导出相册视频-是AVComposition = \(String(describing: avAsset))")
                 let assetResources = PHAssetResource.assetResources(for: phAsset)
                 var resource: PHAssetResource?
                 for assetRes in assetResources {
@@ -479,7 +479,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
     ///   - resultHandler: <#resultHandler description#>
     class func exportAVAssetToMP4(aVAsset: AVURLAsset, isAdjustRotationAngle: Bool = true, resultHandler: @escaping (_ aVAsset: AVURLAsset?, _ filePath: String?, _ errorMsg: String?) -> Void) {
         currentExportSession?.cancelExport()
-        PQLog(message: "开始导出相册视频:url = \(aVAsset.url.absoluteString)")
+        BFLog(message: "开始导出相册视频:url = \(aVAsset.url.absoluteString)")
         // 创建目录
         createDirectory(path: photoLibraryDirectory)
         let fileName = aVAsset.url.absoluteString
@@ -491,7 +491,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 resultHandler(aVAsset, filePath, nil)
             }
         } else {
-            PQLog(message: "未导出视频过,开始导出:aVAsset = \(aVAsset)")
+            BFLog(message: "未导出视频过,开始导出:aVAsset = \(aVAsset)")
             // 删除以创建地址
             try? FileManager.default.removeItem(at: NSURL.fileURL(withPath: filePath))
             let avAssetExportSession = AVAssetExportSession(asset: aVAsset, presetName: AVAssetExportPreset1280x720)
@@ -536,32 +536,32 @@ class PQPHAssetVideoParaseUtil: NSObject {
 
             avAssetExportSession?.shouldOptimizeForNetworkUse = true
             avAssetExportSession?.exportAsynchronously(completionHandler: {
-                PQLog(message: "导出相册视频progress = \(avAssetExportSession?.progress ?? 0)")
+                BFLog(message: "导出相册视频progress = \(avAssetExportSession?.progress ?? 0)")
                 switch avAssetExportSession?.status {
                 case .unknown:
                     DispatchQueue.main.async {
                         resultHandler(aVAsset, nil, avAssetExportSession?.error?.localizedDescription)
                     }
-                    PQLog(message: "导出相册视频发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                    BFLog(message: "导出相册视频发生未知错误:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                 case .waiting:
-                    PQLog(message: "等待导出mp4:\(filePath)")
+                    BFLog(message: "等待导出mp4:\(filePath)")
                 case .exporting:
-                    PQLog(message: "导出相册视频中...:\(filePath)")
+                    BFLog(message: "导出相册视频中...:\(filePath)")
                 case .completed:
                     DispatchQueue.main.async {
                         resultHandler(aVAsset, filePath, nil)
                     }
-                    PQLog(message: "导出相册视频完成:\(filePath)")
+                    BFLog(message: "导出相册视频完成:\(filePath)")
                 case .failed:
                     DispatchQueue.main.async {
                         resultHandler(aVAsset, nil, avAssetExportSession?.error?.localizedDescription)
                     }
-                    PQLog(message: "导出相册视频失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                    BFLog(message: "导出相册视频失败:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                 case .cancelled:
                     DispatchQueue.main.async {
                         resultHandler(aVAsset, nil, avAssetExportSession?.error?.localizedDescription)
                     }
-                    PQLog(message: "取消导出相册视频:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
+                    BFLog(message: "取消导出相册视频:\(filePath),\(avAssetExportSession?.error?.localizedDescription ?? "")")
                 default:
                     break
                 }
@@ -624,26 +624,26 @@ class PQPHAssetVideoParaseUtil: NSObject {
                     exportSession?.exportAsynchronously(completionHandler: {
                         switch exportSession?.status {
                         case .waiting:
-                            PQLog(message: "等待导出mp3:\(filePath)")
+                            BFLog(message: "等待导出mp3:\(filePath)")
                         case .exporting:
-                            PQLog(message: "导出中...:\(filePath)")
+                            BFLog(message: "导出中...:\(filePath)")
                         case .completed:
                             DispatchQueue.main.async {
                                 resultHandler(url, filePath, startTime, endTime, nil)
                             }
-                            PQLog(message: "导出完成:\(filePath)")
+                            BFLog(message: "导出完成:\(filePath)")
 
                         case .cancelled, .failed, .unknown:
                             DispatchQueue.main.async {
                                 resultHandler(url, nil, startTime, endTime, exportSession?.error?.localizedDescription)
                             }
-                            PQLog(message: "导出失败:\(filePath),\(exportSession?.error?.localizedDescription ?? "")")
+                            BFLog(message: "导出失败:\(filePath),\(exportSession?.error?.localizedDescription ?? "")")
                         default:
                             break
                         }
                     })
                 case .loading:
-                    PQLog(message: "加载中...:\(url)")
+                    BFLog(message: "加载中...:\(url)")
                 case .failed, .cancelled, .unknown:
                     DispatchQueue.main.async {
                         resultHandler(url, nil, startTime, endTime, "导出失败")
@@ -663,11 +663,11 @@ class PQPHAssetVideoParaseUtil: NSObject {
     class func createLocalFile(sourceFilePath: String, completeHandle: (_ isFileExists: Bool, _ isCreateSuccess: Bool, _ filePath: String) -> Void) {
         let cLocalPath = NSString(string: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!).appendingPathComponent("\(sourceFilePath.kf.md5).mp4")
         if FileManager.default.fileExists(atPath: cLocalPath) {
-            PQLog(message: "文件已经存在:\(cLocalPath)")
+            BFLog(message: "文件已经存在:\(cLocalPath)")
             completeHandle(true, false, cLocalPath)
         } else {
             let result = FileManager.default.createFile(atPath: cLocalPath, contents: nil, attributes: nil)
-            PQLog(message: "文件创建:\(cLocalPath),\(result)")
+            BFLog(message: "文件创建:\(cLocalPath),\(result)")
             completeHandle(false, result, cLocalPath)
         }
     }
@@ -680,7 +680,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
     /// - Returns: <#description#>
     class func requestAssetImage(asset: PHAsset, itemSize: CGSize, resultHandler: @escaping (UIImage?, [AnyHashable: Any]?) -> Void) {
         PHCachingImageManager().requestImage(for: asset, targetSize: itemSize, contentMode: .aspectFill, options: imagesOptions, resultHandler: { image, info in
-            PQLog(message: "info = \(info ?? [:])")
+            BFLog(message: "info = \(info ?? [:])")
             if info?.keys.contains("PHImageResultIsDegradedKey") ?? false, "\(info?["PHImageResultIsDegradedKey"] ?? "0")" == "0" {
                 resultHandler(image, info)
             }
@@ -718,7 +718,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
         ]
         guard let imageSource = CGImageSourceCreateWithData(data as CFData, info as CFDictionary) else {
             resultHandler(data, nil, nil)
-            PQLog(message: "获取gifimageSource 失败")
+            BFLog(message: "获取gifimageSource 失败")
             return
         }
         // 获取帧数
@@ -728,7 +728,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
         for i in 0 ..< frameCount {
             // 取出索引对应的图片
             guard let imageRef = CGImageSourceCreateImageAtIndex(imageSource, i, info as CFDictionary) else {
-                PQLog(message: "取出对应的图片失败")
+                BFLog(message: "取出对应的图片失败")
                 return
             }
             if frameCount == 1 {
@@ -738,12 +738,12 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 // 1.获取gif没帧的时间间隔
                 // 获取到该帧图片的属性字典
                 guard let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, i, nil) as? [String: Any] else {
-                    PQLog(message: "取出对应的图片属性失败")
+                    BFLog(message: "取出对应的图片属性失败")
                     return
                 }
                 // 获取该帧图片中的GIF相关的属性字典
                 guard let gifInfo = properties[kCGImagePropertyGIFDictionary as String] as? [String: Any] else {
-                    PQLog(message: "取出对应的图片属性失败")
+                    BFLog(message: "取出对应的图片属性失败")
                     return
                 }
                 let defaultFrameDuration = 0.1
@@ -753,7 +753,7 @@ class PQPHAssetVideoParaseUtil: NSObject {
                 let delayTime = gifInfo[kCGImagePropertyGIFDelayTime as String] as? NSNumber
                 let duration = unclampedDelayTime ?? delayTime
                 guard let frameDuration = duration else {
-                    PQLog(message: "获取帧时间间隔失败")
+                    BFLog(message: "获取帧时间间隔失败")
                     return
                 }
                 // 对于播放时间低于0.011s的,重新指定时长为0.100s;

+ 7 - 7
BFFramework/Classes/Utils/PQSingletoMemoryUtil.swift

@@ -28,20 +28,20 @@ class PQSingletoMemoryUtil: NSObject {
     // 剪切板content是否为空,如果为空走承接逻辑,冷启动不再加载缓存
     var isEmptyPasteContent: Bool = false {
         didSet {
-            PQLog(message: "isEmptyPasteContent = \(isEmptyPasteContent)")
+            BFLog(message: "isEmptyPasteContent = \(isEmptyPasteContent)")
         }
     }
 
     // 展示无服务提示视图(剪切板 data.reportData.downloadButtonType为 weapp_share_noServiceDownloadApp/weapp_categoryTab_noServiceDownloadApp
     var isShowPasteNoServeView: Bool = false {
         didSet {
-            PQLog(message: "isShowPasteNoServeView = \(isShowPasteNoServeView)")
+            BFLog(message: "isShowPasteNoServeView = \(isShowPasteNoServeView)")
         }
     }
     /// 是否正在展示广告view
     var isLoadingSplashAdView: Bool = false {
         didSet {
-            PQLog(message: "isLoadingSplashAdView = \(isLoadingSplashAdView)")
+            BFLog(message: "isLoadingSplashAdView = \(isLoadingSplashAdView)")
         }
     }
     var cutBoardInfo: String? // 剪切板信息
@@ -90,21 +90,21 @@ class PQSingletoMemoryUtil: NSObject {
     func createSesstionId() {
         sessionId = getUniqueId(desc: "sessionId")
         subSessionid = sessionId
-        PQLog(message: "生成的sessionId = \(sessionId)")
+        BFLog(message: "生成的sessionId = \(sessionId)")
     }
 
     /// 创建subSessionid
     /// - Returns: <#description#>
     func createSubSesstionId() {
         subSessionid = getUniqueId(desc: "subSessionid")
-        PQLog(message: "生成的subSessionid = \(String(describing: subSessionid))")
+        BFLog(message: "生成的subSessionid = \(String(describing: subSessionid))")
     }
 
     /// 制作视频项目Id
     /// - Returns: <#description#>
     func createMakeVideoProjectId() {
         makeVideoProjectId = cProjectIdPrefix + getUniqueId(desc: "makeVideoProjectId")
-        PQLog(message: "生成的projectId = \(String(describing: makeVideoProjectId))")
+        BFLog(message: "生成的projectId = \(String(describing: makeVideoProjectId))")
     }
 
     /// 解析abInfoData
@@ -116,7 +116,7 @@ class PQSingletoMemoryUtil: NSObject {
             abInfoData.merge(infoDic, uniquingKeysWith: { (key, _) -> Any in
                 key
             })
-            PQLog(message: "=====abInfoData = \(abInfoData)")
+            BFLog(message: "=====abInfoData = \(abInfoData)")
         }
     }
 

+ 25 - 25
BFFramework/Classes/Utils/PQSingletoRealmUtil.swift

@@ -24,7 +24,7 @@ class PQSingletoRealmUtil: NSObject {
             return realmEntry
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-realm创建失败:\(error)")
+            BFLog(message: "Realm-realm创建失败:\(error)")
         }
         return nil
     }
@@ -35,7 +35,7 @@ class PQSingletoRealmUtil: NSObject {
     func getDraftDB(uid: String) -> Realm {
         let docPath = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0] as String
         let dbPath = docPath.appending("/\(uid)Draft.realm")
-        PQLog(message: "生成登录人数据库地址\(dbPath)")
+        BFLog(message: "生成登录人数据库地址\(dbPath)")
 
         var config = Realm.Configuration(
             schemaVersion: schemaVersion,
@@ -55,11 +55,11 @@ class PQSingletoRealmUtil: NSObject {
         do {
             try realmEntry?.write {
                 realmEntry?.add(object, update: .modified)
-                PQLog(message: "Realm-添加单个数据成功:\(object)")
+                BFLog(message: "Realm-添加单个数据成功:\(object)")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-添加单个数据失败:\(error)")
+            BFLog(message: "Realm-添加单个数据失败:\(error)")
         }
     }
 
@@ -70,11 +70,11 @@ class PQSingletoRealmUtil: NSObject {
         do {
             try realmEntry?.write {
                 realmEntry?.add(objects, update: .modified)
-                PQLog(message: "Realm-添加多个数据成功:\(objects)")
+                BFLog(message: "Realm-添加多个数据成功:\(objects)")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-添加多个数据失败:\(error)")
+            BFLog(message: "Realm-添加多个数据失败:\(error)")
         }
     }
 
@@ -88,18 +88,18 @@ class PQSingletoRealmUtil: NSObject {
                 try realmEntry?.write {
                     currentObject?.first?.isSelected = isSelected
                     (currentObject?.first as? PQLocalStoreModel)?.currentDate = systemCurrentDate()
-                    PQLog(message: "Realm-本地已存储数据更新成功:\(currentObject)")
+                    BFLog(message: "Realm-本地已存储数据更新成功:\(currentObject)")
                 }
             } catch let error as NSError {
                 // handle error
-                PQLog(message: "Realm-本地已存储数据更新失败:\(error)")
+                BFLog(message: "Realm-本地已存储数据更新失败:\(error)")
             }
         } else {
             let storeObject = PQLocalStoreModel()
             storeObject.uniqueId = uniqueId
             storeObject.isSelected = isSelected
             // 未存在则保存
-            PQLog(message: "Realm-本地数据未存储,开始存储")
+            BFLog(message: "Realm-本地数据未存储,开始存储")
             saveObject(object: storeObject)
         }
     }
@@ -121,17 +121,17 @@ class PQSingletoRealmUtil: NSObject {
     /// - Returns: <#description#>
     func deleteAllCacheObject() {
         guard let deleteObjecs = realmEntry?.objects(PQVideoListModel.self) else {
-            PQLog(message: "Realm-删除已缓存为空")
+            BFLog(message: "Realm-删除已缓存为空")
             return
         }
         do {
             try realmEntry?.write {
                 realmEntry?.delete(deleteObjecs)
-                PQLog(message: "Realm-删除已缓存视频成功")
+                BFLog(message: "Realm-删除已缓存视频成功")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-删除已缓存视频失败:\(error)")
+            BFLog(message: "Realm-删除已缓存视频失败:\(error)")
         }
     }
 
@@ -142,7 +142,7 @@ class PQSingletoRealmUtil: NSObject {
     /// - Returns: <#description#>
     func queryObjects(_ type: PQBaseModel.Type, filter: String) -> Results<PQBaseModel>? {
         let puppies = realmEntry?.objects(type).filter(filter)
-        PQLog(message: "查询已缓存数据:type = \(type) \(puppies ?? nil)")
+        BFLog(message: "查询已缓存数据:type = \(type) \(puppies ?? nil)")
         return puppies
     }
 
@@ -151,11 +151,11 @@ class PQSingletoRealmUtil: NSObject {
         do {
             try realmEntry?.write {
                 realmEntry?.delete(deleteObjecs)
-                PQLog(message: "Realm-删除已缓存视频成功")
+                BFLog(message: "Realm-删除已缓存视频成功")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-删除已缓存视频失败:\(error)")
+            BFLog(message: "Realm-删除已缓存视频失败:\(error)")
         }
     }
 
@@ -167,11 +167,11 @@ class PQSingletoRealmUtil: NSObject {
         do {
             try realmEntry?.write {
                 realmEntry?.delete(deleteObjecs)
-                PQLog(message: "Realm-删除已缓存视频成功")
+                BFLog(message: "Realm-删除已缓存视频成功")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-删除已缓存视频失败:\(error)")
+            BFLog(message: "Realm-删除已缓存视频失败:\(error)")
         }
     }
 
@@ -180,11 +180,11 @@ class PQSingletoRealmUtil: NSObject {
         do {
             try realmEntry?.write {
                 realmEntry?.delete(deleteObjecs)
-                PQLog(message: "Realm-删除已缓存视频成功")
+                BFLog(message: "Realm-删除已缓存视频成功")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-删除已缓存视频失败:\(error)")
+            BFLog(message: "Realm-删除已缓存视频失败:\(error)")
         }
     }
 
@@ -192,18 +192,18 @@ class PQSingletoRealmUtil: NSObject {
     /// - Parameter object: <#object description#>
     /// - Returns: <#description#>
     func updateObject(object: PQVideoListModel) {
-        guard let newObject = realmEntry?.objects(PQVideoListModel.self).filter("videoId == \(object.videoId)") else { PQLog(message: "更新 newObject 为空")
+        guard let newObject = realmEntry?.objects(PQVideoListModel.self).filter("videoId == \(object.videoId)") else { BFLog(message: "更新 newObject 为空")
             return
         }
-        PQLog(message: "更新 newObject = \(newObject)")
+        BFLog(message: "更新 newObject = \(newObject)")
         do {
             try realmEntry?.write {
                 newObject.first?.isSelected = true
-                PQLog(message: "Realm-更新缓存视频已播放成功:\(newObject)")
+                BFLog(message: "Realm-更新缓存视频已播放成功:\(newObject)")
             }
         } catch let error as NSError {
             // handle error
-            PQLog(message: "Realm-更新缓存视频已播放失败:\(error)")
+            BFLog(message: "Realm-更新缓存视频已播放失败:\(error)")
         }
     }
 
@@ -330,7 +330,7 @@ class PQSingletoRealmUtil: NSObject {
     /// - Parameter filter: 查询条件
     func reamlQueryObjects(realm: Realm, _ type: Object.Type, filter: String) -> Results<Object>? {
         let puppies = realm.objects(type).filter(filter)
-        PQLog(message: "查询已缓存数据:type = \(type) \(puppies)")
+        BFLog(message: "查询已缓存数据:type = \(type) \(puppies)")
         return puppies
     }
 
@@ -338,7 +338,7 @@ class PQSingletoRealmUtil: NSObject {
         var json: String?
         try! realm.write {
             let puppies: Results<Object> = realm.objects(type).filter(filter)
-            PQLog(message: "查询已缓存数据:type = \(type) \(puppies)")
+            BFLog(message: "查询已缓存数据:type = \(type) \(puppies)")
             if puppies.count > 0 {
                 json = (puppies.first as? PQEditProjectModel)!.toJSONString(prettyPrint: false)
             }

+ 4 - 4
BFFramework/Classes/Utils/PQSingletoSourcesFileUtil.swift

@@ -37,9 +37,9 @@ class PQSingletoSourcesFileUtil: NSObject {
             oldData.setValue(object, forKey: key.kf.md5)
             let success: Bool = oldData.write(toFile: cPlistPath, atomically: true)
             if success {
-                PQLog(message: "写入成功:\(oldData)")
+                BFLog(message: "写入成功:\(oldData)")
             } else {
-                PQLog(message: "写入失败:\(oldData)")
+                BFLog(message: "写入失败:\(oldData)")
             }
             return success
         }
@@ -48,10 +48,10 @@ class PQSingletoSourcesFileUtil: NSObject {
 
     func readFile(isString: Bool, key: String) -> Any {
         let oldData = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "sourcesFile.plist", ofType: nil) ?? "")
-        PQLog(message: "oldData = \(oldData),key = \(key.kf.md5)")
+        BFLog(message: "oldData = \(oldData),key = \(key.kf.md5)")
         let enStr = oldData?.object(forKey: key.kf.md5)
         let desStr = DES3Util.decryptUseDES(enStr as? String, key: key)
-        PQLog(message: "读取成功:\(desStr)")
+        BFLog(message: "读取成功:\(desStr)")
         if isString {
             return desStr ?? ""
         } else {

+ 2 - 2
BFFramework/Classes/Utils/PQSingletonEnvUtil.swift

@@ -22,10 +22,10 @@ enum ENVMode: String {
 class PQENVUtil {
     var envMode: ENVMode {
         let config = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "PQConfig.plist", ofType: nil) ?? "")
-        PQLog(message: "config  is  = \(String(describing: config))")
+        BFLog(message: "config  is  = \(String(describing: config))")
 
         let enStr: String = (config?.object(forKey: "ENVMode") ?? "ENVModeOnline") as! String
-        PQLog(message: "ENVMode is \(enStr)")
+        BFLog(message: "ENVMode is \(enStr)")
 
         return ENVMode(rawValue: enStr)!
     }

+ 9 - 9
BFFramework/Classes/Utils/PQThirdPlatformUtil.swift

@@ -46,9 +46,9 @@ class PQSingleBuglyUtil: NSObject {
         let buglyConfig = BuglyConfig()
         buglyConfig.reportLogLevel = .warn
         buglyConfig.version = versionName + "-\(PQENVUtil.shared.envMode)"
-        PQLog(message: "Bugly版本号:\(BuglyConfig.version())")
+        BFLog(message: "Bugly版本号:\(BuglyConfig.version())")
         buglyConfig.channel = channelID
-        buglyConfig.deviceIdentifier = PQLoginUserInfo.shared.isLogin() ? PQLoginUserInfo.shared.uid : getMachineCode()
+        buglyConfig.deviceIdentifier = BFLoginUserInfo.shared.isLogin() ? BFLoginUserInfo.shared.uid : getMachineCode()
         buglyConfig.unexpectedTerminatingDetectionEnable = true
         buglyConfig.blockMonitorEnable = true
         buglyConfig.blockMonitorTimeout = 2
@@ -99,13 +99,13 @@ class PQSingletoWXApiUtil: NSObject {
         mAppInfo = appInfo
         #if DEBUG
             WXApi.startLog(by: .detail) { msg in
-                PQLog(message: "微信回调Log--\(msg)")
+                BFLog(message: "微信回调Log--\(msg)")
             }
         #endif
         WXApi.registerApp(mAppInfo.appid, universalLink: mAppInfo.universalLink)
         #if DEBUG
             WXApi.checkUniversalLinkReady { step, result in
-                PQLog(message: "微信回调自检--\(step),result = \(result)")
+                BFLog(message: "微信回调自检--\(step),result = \(result)")
             }
         #endif
     }
@@ -176,7 +176,7 @@ class PQSingletoWXApiUtil: NSObject {
                     page = "pages/category"
                     isRhythmVideo = 0
                 }
-                var params = (preParams + "?id=\(videoId)&tp=share&rootPageSource=\(pageSource.rawValue)&shareDepth=1&rootLaunchShareId=\(shareId)&parentShareId=\(shareId)&shareId=\(shareId)&shareAppType=13&mid=\(getMachineCode())&su=\(PQLoginUserInfo.shared.uid)&isRhythmVideo=\(isRhythmVideo)").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
+                var params = (preParams + "?id=\(videoId)&tp=share&rootPageSource=\(pageSource.rawValue)&shareDepth=1&rootLaunchShareId=\(shareId)&parentShareId=\(shareId)&shareId=\(shareId)&shareAppType=13&mid=\(getMachineCode())&su=\(BFLoginUserInfo.shared.uid)&isRhythmVideo=\(isRhythmVideo)").addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
                 ["/", "=", "?", "&"].forEach { char in
                     let custom = CharacterSet(charactersIn: char).inverted
                     params = params?.addingPercentEncoding(withAllowedCharacters: custom) ?? ""
@@ -279,15 +279,15 @@ class PQSingletoWXApiUtil: NSObject {
 
 extension PQSingletoWXApiUtil: WXApiDelegate {
     func onReq(_ req: BaseReq) {
-        PQLog(message: "微信回调拉起 -- \(req)")
+        BFLog(message: "微信回调拉起 -- \(req)")
         if req.isKind(of: LaunchFromWXReq.self) && ((req as! LaunchFromWXReq).message.messageExt?.count ?? 0) > 0 {
-            PQLog(message: "小程序回调数据--\(String(describing: (req as! LaunchFromWXReq).message.messageExt))")
+            BFLog(message: "小程序回调数据--\(String(describing: (req as! LaunchFromWXReq).message.messageExt))")
 //            PQBoardCommandUtil.dealWithPasteboardData(messageExt: (req as! LaunchFromWXReq).message.messageExt)
         }
     }
 
     func onResp(_ resp: BaseResp) {
-        PQLog(message: "微信回调返回 -- \(resp)")
+        BFLog(message: "微信回调返回 -- \(resp)")
 
         if resp.isKind(of: SendAuthResp.self) {
             if (resp as! SendAuthResp).state == mAppInfo.state {
@@ -318,7 +318,7 @@ extension PQSingletoWXApiUtil: WXApiDelegate {
             let data = zoneStr!.data(using: .utf8)
             let dict: [String: Any] = try! JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as! [String: Any]
             self?.openId = "\(dict["openid"] ?? "")"
-            PQLoginUserInfo.shared.openId = self?.openId ?? ""
+            BFLoginUserInfo.shared.openId = self?.openId ?? ""
             let access_token: String = "\(dict["access_token"] ?? "")"
 
             let userUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=\(access_token)&openid=\(self?.openId ?? "")"

+ 1 - 1
BFFramework/Classes/Utils/PQVideoSnapshotUtil.swift

@@ -81,7 +81,7 @@ class PQVideoSnapshotUtil: NSObject {
             for index in 0...count - 1 {
                 let thumbnailCGImage: CGImage?
                 let thumbnailImageTime: CFTimeInterval = ((duration / Double(count)) * Double(index))
-                PQLog(message: "截取视频时长 =(\(videoURL),duration = \(duration),count = \(count),line = \(thumbnailImageTime)")
+                BFLog(message: "截取视频时长 =(\(videoURL),duration = \(duration),count = \(count),line = \(thumbnailImageTime)")
                 do {
                     thumbnailCGImage = try assetImageGenerator.copyCGImage(at: CMTimeMake(value: Int64(thumbnailImageTime), timescale: 1), actualTime: nil)
                     if let cgImage = thumbnailCGImage {

+ 6 - 6
BFFramework/Classes/Utils/SWNetRequest.swift

@@ -65,7 +65,7 @@ class SWNetRequest: NSObject {
     /// - Parameter url: <#url description#>
     /// - Returns: <#description#>
     class func headRequestData(url: String, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) {
-        PQLog(message: "发起head请求 = \(url)")
+        BFLog(message: "发起head请求 = \(url)")
         if !isValidURL(url: url) {
             completionHandler(nil, nil, PQError(msg: "url错误", code: 1001))
             return
@@ -79,7 +79,7 @@ class SWNetRequest: NSObject {
         let session = URLSession.shared
         let headTask = session.dataTask(with: request) { data, response, error in
             completionHandler(data, response, error)
-            PQLog(message: "head请求返回 = \(url),code = \((response as? HTTPURLResponse)?.statusCode ?? 0),response = \(String(describing: response))")
+            BFLog(message: "head请求返回 = \(url),code = \((response as? HTTPURLResponse)?.statusCode ?? 0),response = \(String(describing: response))")
         }
         headTask.resume()
     }
@@ -115,13 +115,13 @@ class SWNetRequest: NSObject {
                 }
             }
         }
-        PQLog(message: "发起请求:\(url),params:\(requestParams)")
+        BFLog(message: "发起请求:\(url),params:\(requestParams)")
         (timeoutInterval <= 5 ? reTrySessionManager : sessionManager).request(url, method: method, parameters: requestParams, encoding: encoding, headers: nil).responseJSON { jsonResponse in
-            PQLog(message: "jsonResponse = \(jsonResponse.timeline)")
+            BFLog(message: "jsonResponse = \(jsonResponse.timeline)")
             /// 返回值
             if jsonResponse.result.isSuccess {
                 let respondDict: [String: Any] = try! JSONSerialization.jsonObject(with: jsonResponse.data!, options: JSONSerialization.ReadingOptions.mutableContainers) as! [String: Any]
-                PQLog(message: "请求成功:\(url),respond:\(respondDict)")
+                BFLog(message: "请求成功:\(url),respond:\(respondDict)")
                 if respondDict.keys.contains("code") && "\(respondDict["code"] ?? "")" == "0" && respondDict.keys.contains("data") {
                     let extData = respondDict["extData"] as? [String: Any]
                     if extData != nil && (extData?.keys.contains("abInfoData") ?? false) {
@@ -134,7 +134,7 @@ class SWNetRequest: NSObject {
                     response(nil, nil, PQError(msg: jsonResponse.result.error?.localizedDescription, code: 10001), jsonResponse.timeline)
                 }
             } else {
-                PQLog(message: "请求失败:\(url),error:\(jsonResponse.result.error?.localizedDescription ?? "")")
+                BFLog(message: "请求失败:\(url),error:\(jsonResponse.result.error?.localizedDescription ?? "")")
                 let code: Int? = (jsonResponse.result.error as NSError?)?.code
                 response(nil, nil, PQError(msg: (code == -1009 || code == -1001) ? "网络不可用" : jsonResponse.result.error?.localizedDescription, code: code ?? 10001), jsonResponse.timeline)
             }

+ 2 - 1
Example/BFFramework/ViewController.swift

@@ -28,11 +28,12 @@ class ViewController: UIViewController {
 
     func next(sender _: AnyObject) {
         print("next is onclick")
+        BFLog(message: "ssssss")
     }
 
     @objc func btnClicked() -> String {
         print("打开界面")
-
+        BFLog(message: "ssssss")
         navigationController?.pushViewController(PQStuckPointMaterialController(), animated: true)
         return "111"
     }