|
@@ -514,6 +514,8 @@ public class PQGPUImagePlayerView: UIView {
|
|
/// 按时间从缓存中取出要显示的filter
|
|
/// 按时间从缓存中取出要显示的filter
|
|
/// - Parameter currTime: 当前播放时间
|
|
/// - Parameter currTime: 当前播放时间
|
|
func changeFilter(currTime: Float64) {
|
|
func changeFilter(currTime: Float64) {
|
|
|
|
+ let starts:CFTimeInterval = CFAbsoluteTimeGetCurrent()
|
|
|
|
+
|
|
FilterLog(message: " 要查找的 currTime is \(currTime)")
|
|
FilterLog(message: " 要查找的 currTime is \(currTime)")
|
|
//1,删除已经显示过的 filter
|
|
//1,删除已经显示过的 filter
|
|
self.cacheFilters.removeAll(where: {(filter) -> Bool in
|
|
self.cacheFilters.removeAll(where: {(filter) -> Bool in
|
|
@@ -528,6 +530,7 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
|
|
|
if(showIndex == nil){
|
|
if(showIndex == nil){
|
|
|
|
|
|
|
|
+ FilterLog(message: "缓存没有查找到?出现数据错误!!!!")
|
|
for (index,bsFilter )in cacheFilters.enumerated() {
|
|
for (index,bsFilter )in cacheFilters.enumerated() {
|
|
print( "22222缓存操作 没要查找到要查找的显示是为:\(currTime) 缓存数据timeline in :\(bsFilter.stickerInfo?.timelineIn ?? 0.0)) timelineOut:\(bsFilter.stickerInfo?.timelineOut ?? 0.0) 缓存数 \(cacheFilters.count) index: \(index)")
|
|
print( "22222缓存操作 没要查找到要查找的显示是为:\(currTime) 缓存数据timeline in :\(bsFilter.stickerInfo?.timelineIn ?? 0.0)) timelineOut:\(bsFilter.stickerInfo?.timelineOut ?? 0.0) 缓存数 \(cacheFilters.count) index: \(index)")
|
|
}
|
|
}
|
|
@@ -537,10 +540,10 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
|
|
|
let showFilter: PQBaseFilter = cacheFilters[showIndex ?? 0]
|
|
let showFilter: PQBaseFilter = cacheFilters[showIndex ?? 0]
|
|
|
|
|
|
- print("缓存操作 查找到命中的显示是为:\(currTime) 缓存数据timeline in :\(showFilter.stickerInfo?.timelineIn ?? 0.0)) timelineOut:\(showFilter.stickerInfo?.timelineOut ?? 0.0) 缓存数 \(cacheFilters.count) index: \(String(describing: showIndex))")
|
|
|
|
|
|
+ FilterLog(message: "缓存操作 查找到命中的显示是为:\(currTime) 缓存数据timeline in :\(showFilter.stickerInfo?.timelineIn ?? 0.0)) timelineOut:\(showFilter.stickerInfo?.timelineOut ?? 0.0) in:\(showFilter.stickerInfo?.model_in ?? 0.0) out:\(showFilter.stickerInfo?.out ?? 0.0) 缓存数 \(cacheFilters.count) index: \(String(describing: showIndex))")
|
|
|
|
|
|
if(!(showFilter.isShow)){
|
|
if(!(showFilter.isShow)){
|
|
- FilterLog(message: "showIndex当前时间为 \(currTime) showIndex is \(String(describing: showIndex)) 显示 filter timein is: \(String(describing: showFilter.stickerInfo?.timelineIn)) timeout is: \(String(describing: showFilter.stickerInfo?.timelineOut))")
|
|
|
|
|
|
+ FilterLog(message: "showIndex当前时间为 \(currTime) showIndex is \(String(describing: showIndex)) 显示 filter timelineIn is: \(String(describing: showFilter.stickerInfo?.timelineIn)) timelineOut is: \(String(describing: showFilter.stickerInfo?.timelineOut))")
|
|
|
|
|
|
showFilter.isShow = true
|
|
showFilter.isShow = true
|
|
|
|
|
|
@@ -568,7 +571,7 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
|
|
|
self.movie?.addTarget(showGaussianFitler, atTargetIndex: 0)
|
|
self.movie?.addTarget(showGaussianFitler, atTargetIndex: 0)
|
|
iosb.addTarget(showFilter)
|
|
iosb.addTarget(showFilter)
|
|
- showFilter.addTarget(self.renderView as! ImageConsumer, atTargetIndex: 0)
|
|
|
|
|
|
+ showFilter.addTarget(self.renderView as ImageConsumer, atTargetIndex: 0)
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -584,6 +587,8 @@ public class PQGPUImagePlayerView: UIView {
|
|
self.createNextFilter()
|
|
self.createNextFilter()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }else{
|
|
|
|
+ FilterLog(message: " 添加过了 currTime is \(currTime) timelineIn:\(showFilter.stickerInfo?.timelineIn ?? 0.0)")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|