Explorar el Código

Merge branch 'master' of https://git.yishihui.com/iOS/BFFramework

wenweiwei hace 3 años
padre
commit
e53bbb1eb6

+ 2 - 1
BFFramework/Classes/Enums/Enums.swift

@@ -247,7 +247,7 @@ public  enum  objectType: String {
     case ot_click_selectRhythm = "shanyinApp_clickButton_selectRhythm" // 点击上报:选择节奏
     case ot_click_dragFront = "shanyinApp_clickButton_dragFront" // 点击上报:拖动拖拽条(左部分)
     case ot_click_dragBehind = "shanyinApp_clickButton_dragBehind" // 点击上报:拖动拖拽条(右部分)
-    case ot_click_commit = "sppedApp_clickButton_commit" // 点击上报:去合成
+    case ot_click_commit = "shanyinApp_clickButton_commit" // 点击上报:去合成
     case ot_view_searchSyncedUpMusic = "shanyinApp_viewWindow_searchSyncedUpMusic" // 曝光上报:音乐素材搜索页
     case ot_click_searchSyncedUpMusic = "shanyinApp_clickButton_searchSyncedUpMusic" // 点击上报:用户在搜索框输入文字然后按回车
     case ot_view_searchMusic = "shanyinApp_viewButton_searchMusic" // 曝光上报:搜索结果音乐素材曝光
@@ -270,6 +270,7 @@ public  enum  objectType: String {
     //页面曝光上报:“我的”页面曝光
     case ot_shanyinApp_viewPage_mineTab = "shanyinApp_viewPage_mineTab"
 
+
 }
 
 // MARK: - 视频上报类型

+ 7 - 7
BFFramework/Classes/PQGPUImage/akfilters/PQMovieFilter.swift

@@ -146,9 +146,9 @@ class PQMovieFilter: PQBaseFilter {
         do {
             // 测试代码
             //            try  loadAsset(url:URL(fileURLWithPath:"22222.MP4", relativeTo:Bundle.main.resourceURL!), videoComposition: nil)
-            // locationPath 有可能直接使用系统相册地址 e.g.视频地址 var/mobile/Media/DCIM/125APPLE/IMG_5189.MOV 就不用拼接沙盒地址了
+            // locationPath 有可能直接使用系统相册地址  处理不同 IOS 版本 路径有所区别 e.g.视频地址 var/mobile/Media/DCIM/125APPLE/IMG_5189.MOV 就不用拼接沙盒地址了
             var videoFilePath = movieSticker.locationPath
-            if !videoFilePath.contains("var/mobile/Media/DCIM/") {
+            if !videoFilePath.contains("var/mobile/Media") {
                 videoFilePath = documensDirectory + videoFilePath
             }
             FilterLog(message: "视频地址 \(String(describing: videoFilePath))")
@@ -347,6 +347,7 @@ class PQMovieFilter: PQBaseFilter {
         
         BFLog(message: "查找的帧时间为:\(CMTimeGetSeconds(showTimeStamp))")
         
+        let beginDecoderTime: TimeInterval = Date().timeIntervalSince1970
         if assetReader == nil {
             FilterLog(message: "assetReader is error 出现严重错误!!!!!!!!!!!!!!")
             return nil
@@ -362,7 +363,6 @@ class PQMovieFilter: PQBaseFilter {
         
         while assetReader?.status == .reading {
   
-            let beginDecoderTime: TimeInterval = Date().timeIntervalSince1970
             targetSampleBuffer = videoTrackOutput!.copyNextSampleBuffer()
             if(targetSampleBuffer == nil){
                 BFLog(message: " copyNextSampleBuffer is nil error!!!")
@@ -372,13 +372,13 @@ class PQMovieFilter: PQBaseFilter {
             
             //目标帧 时间
             if targetSampleBuffer != nil && CMTimeGetSeconds(targetTimeStamp) > CMTimeGetSeconds(showTimeStamp){
-                FilterLog(message: "查找的帧时间为:\(CMTimeGetSeconds(showTimeStamp))  命中时间为: \(CMTimeGetSeconds(targetTimeStamp))")
-                
+                let endDecoderTime: TimeInterval = Date().timeIntervalSince1970
+                FilterLog(message: "查找的帧时间为:\(CMTimeGetSeconds(showTimeStamp))  命中时间为: \(CMTimeGetSeconds(targetTimeStamp))  查找时长为\(TimeInterval(endDecoderTime - beginDecoderTime)))")
+  
                 return targetSampleBuffer
 
             }
-            let endDecoderTime: TimeInterval = Date().timeIntervalSince1970
-            FilterLog(message: "\(beginDecoderTime) \(endDecoderTime)解帧时长  \(TimeInterval(endDecoderTime - beginDecoderTime))")
+          
         }
         
         return nil

+ 1 - 1
BFFramework/Classes/PQGPUImage/akfilters/PQMoveInput.swift → BFFramework/Classes/PQGPUImage/akfilters/PQMovieInput.swift

@@ -13,7 +13,7 @@ public protocol PQMovieInputDelegate: AnyObject {
     func didFinishMovie()
 }
 
-public class PQMoveInput: ImageSource {
+public class PQMovieInput: ImageSource {
     public func transmitPreviousImage(to _: ImageConsumer, atIndex _: UInt) {}
 
     public let targets = TargetContainer()

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

@@ -24,7 +24,7 @@ public class PQCompositionExporter {
     public let animationTool: AVVideoCompositionCoreAnimationTool?
     public let exportURL: URL
 
-    public var input: PQMoveInput?
+    public var input: PQMovieInput?
     public var output: MovieOutput?
 
     public let tmpExportURL: URL?
@@ -85,9 +85,9 @@ public class PQCompositionExporter {
 
         do {
             if audioMix != nil {
-                try input = PQMoveInput(asset: asset, videoComposition: nil, audioMix: audioMix, playAtActualSpeed: true, loop: false, audioSettings: audioDecodingSettings)
+                try input = PQMovieInput(asset: asset, videoComposition: nil, audioMix: audioMix, playAtActualSpeed: true, loop: false, audioSettings: audioDecodingSettings)
             } else {
-                try input = PQMoveInput(asset: asset, videoComposition: nil, audioMix: nil, playAtActualSpeed: false, loop: false, audioSettings: audioDecodingSettings)
+                try input = PQMovieInput(asset: asset, videoComposition: nil, audioMix: nil, playAtActualSpeed: false, loop: false, audioSettings: audioDecodingSettings)
             }
 
             input?.mShowVidoSize = videoSize

+ 6 - 4
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -744,7 +744,7 @@ extension PQStuckPointEditerController {
             }
 
             for photo in selectedPhotoData! {
-                if photo.asset != nil, photo.asset?.mediaType == .video, photo.locationPath.count <= 0 {
+                if photo.asset != nil, photo.asset?.mediaType == .video{
                     if !isHaveVideo {
                         isHaveVideo = true
                     }
@@ -785,9 +785,11 @@ extension PQStuckPointEditerController {
     /// 处理所有数据完成
     /// - Returns: <#description#>
     func dealWithDataSuccess() {
-//        if !isSynchroMusicInfoSuccess  || !isStuckPointDataSuccess {
-//            return
-//        }
+        
+        BFLog(message: "三组参数:\(isSynchroMusicInfoSuccess)  \(isStuckPointDataSuccess) \(isExportVideosSuccess)")
+        if !isSynchroMusicInfoSuccess  || !isStuckPointDataSuccess || !isExportVideosSuccess {
+            return
+        }
         playeTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Int64((stuckPointMusicData?.startTime ?? 0) * 600)), timescale: 600), end: CMTime(value: CMTimeValue(Int64((stuckPointMusicData?.endTime ?? 0) * 600)), timescale: 600))
         createPorjectData()
         settingPlayerView()

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

@@ -125,7 +125,7 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
     /// Add filters to this array and call updateAsset(_:) method
     public var filters: [ImageProcessingOperation] = []
 
-   public var movie: PQMoveInput?
+   public var movie: PQMovieInput?
 
     public var speaker: SpeakerOutput?
 
@@ -357,9 +357,9 @@ public class PQGPUImagePlayerView: UIView, RenderViewDelegate {
         do {
             if composition != nil {
                 BFLog(message: "composition 方式初始化")
-                movie = try PQMoveInput(asset: composition!, videoComposition: videoComposition, audioMix: audioMix, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
+                movie = try PQMovieInput(asset: composition!, videoComposition: videoComposition, audioMix: audioMix, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
             } else {
-                movie = try PQMoveInput(url: url, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
+                movie = try PQMovieInput(url: url, playAtActualSpeed: true, loop: isLoop, audioSettings: audioSettings)
 
                 /* 测试代码
                  let audioDecodeSettings = [AVFormatIDKey:kAudioFormatLinearPCM]