|
@@ -72,7 +72,8 @@ open class PQImageFilter: PQBaseFilter {
|
|
|
}
|
|
|
|
|
|
if newImage != nil {
|
|
|
- BFLog(message: "提前加载图片。。。。timelineIn : \(String(describing: mSticker?.timelineIn)) timelineOut :\(mSticker?.timelineOut) \(mSticker?.locationPath)")
|
|
|
+ BFLog(message: "提前加载图片。。。。timelineIn : \(String(describing: mSticker?.timelineIn)) timelineOut :\(String(describing: mSticker?.timelineOut)) \(String(describing: mSticker?.locationPath))")
|
|
|
+
|
|
|
imageTexture = PQGPUImageTools.setupTexture(image: newImage!.cgImage!)
|
|
|
|
|
|
} else { FilterLog(message: "image filter init error image data is nil!") }
|
|
@@ -115,13 +116,19 @@ open class PQImageFilter: PQBaseFilter {
|
|
|
|
|
|
FilterLog(message: " image filter 当前时间: \(currTime) \(newImage!.size)")
|
|
|
|
|
|
- if currTime >= mSticker!.timelineIn && currTime <= mSticker!.timelineOut {
|
|
|
+// if currTime >= mSticker!.timelineIn && currTime <= mSticker!.timelineOut {
|
|
|
FilterLog(message: " 显示图片当前时间: \(currTime) 开始时间:\(mSticker!.timelineIn) 结束时间:\(mSticker!.timelineOut) \(String(describing: newImage?.size))")
|
|
|
// 取纹理坐标
|
|
|
let textureCoordinates = PQGPUImageTools.getTextureCoordinates(sticker: mSticker!, textureSize: newImage!.size, cannvasSize: inputSize)
|
|
|
|
|
|
FilterLog(message: "textureCoordinates is \(textureCoordinates)")
|
|
|
-
|
|
|
+
|
|
|
+ //imageTexture 有可能被析构导致黑屏
|
|
|
+ if(imageTexture == 0){
|
|
|
+ FilterLog(message: "imageTexture is error !!!!!")
|
|
|
+ imageTexture = PQGPUImageTools.setupTexture(image: newImage!.cgImage!)
|
|
|
+ }
|
|
|
+
|
|
|
let texturePropertiesimagetwo = InputTextureProperties(textureCoordinates: textureCoordinates, texture: imageTexture)
|
|
|
|
|
|
let verticesPoint: [GLfloat] = PQGPUImageTools.getVerticesPoint(sticker: mSticker!, textureSize: newImage!.size, cannvasSize: inputSize)
|
|
@@ -131,8 +138,6 @@ open class PQImageFilter: PQBaseFilter {
|
|
|
|
|
|
inputTextures: [texturePropertiesimagetwo])
|
|
|
releaseIncomingFramebuffers()
|
|
|
- } else {
|
|
|
-// imageTexture = 0
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|