|
@@ -114,6 +114,9 @@ public class PQMovieFilter: PQBaseFilter {
|
|
|
|
|
|
public var imageVertexBuffer: GLuint = 0
|
|
|
|
|
|
+ //临时方案,是否是卡点模式
|
|
|
+ public var isPointModel:Bool = false
|
|
|
+
|
|
|
deinit {
|
|
|
FilterLog(1, message: "movie filter release")
|
|
|
clearData()
|
|
@@ -218,8 +221,7 @@ public class PQMovieFilter: PQBaseFilter {
|
|
|
startTimeStamp = currentTime
|
|
|
}
|
|
|
|
|
|
- if CMTimeGetSeconds(currentTime) >= stickerInfo!.timelineIn && CMTimeGetSeconds(currentTime) <= stickerInfo!.timelineOut {
|
|
|
-
|
|
|
+ if(isPointModel){
|
|
|
//视频素材开始裁剪时间
|
|
|
let stickerModelIn = CMTime(value: Int64((moveSticker?.model_in ?? 0) * Float64(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE)
|
|
|
|
|
@@ -234,7 +236,27 @@ public class PQMovieFilter: PQBaseFilter {
|
|
|
readNextVideoFrame(showTimeStamp: showtimeStamp)
|
|
|
|
|
|
framebufferIndex = framebufferIndex + 1
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if CMTimeGetSeconds(currentTime) >= stickerInfo!.timelineIn && CMTimeGetSeconds(currentTime) <= stickerInfo!.timelineOut {
|
|
|
+
|
|
|
+ //视频素材开始裁剪时间
|
|
|
+ let stickerModelIn = CMTime(value: Int64((moveSticker?.model_in ?? 0) * Float64(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE)
|
|
|
+
|
|
|
+ //要显示的帧时间
|
|
|
+ let targetTime = CMTimeValue(Int(Float( 1.0 / 30.0 * Float64(framebufferIndex) * Float64(BASE_FILTER_TIMESCALE)) * Float(stickerInfo?.speedRate ?? 1.0)))
|
|
|
+
|
|
|
+ //要显示的帧时间戳
|
|
|
+ var showtimeStamp = CMTime(value:targetTime, timescale: BASE_FILTER_TIMESCALE)
|
|
|
+ showtimeStamp = CMTimeAdd(showtimeStamp, stickerModelIn)
|
|
|
+
|
|
|
+ FilterLog(message: "showtimeStamp is \(CMTimeGetSeconds(showtimeStamp))")
|
|
|
+ readNextVideoFrame(showTimeStamp: showtimeStamp)
|
|
|
+
|
|
|
+ framebufferIndex = framebufferIndex + 1
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|