Replace legacy automatic stamp keys on the same host analysis frame

这个提交包含在:
mac 于 2026-11-06 00:34:23 +08:00 提交
1 父节点 52a7422004
当前提交 810bbf4dfb
9 个文件已更改
+101 -23

没有与搜索条件相匹配的文件

+7 -1
查看文件
@@ -251,12 +251,18 @@ NSDictionary *DYStampKey(CMTime time,DYMaskParameters p,BOOL manual,float confid
@(motion.sourceScaleY),@(motion.targetScaleX),@(motion.targetScaleY)];
return paired;
}
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples){
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples,CMTime frameDuration){
if(!samples.count)return YES;
NSMutableArray *all=[NSMutableArray array];
NSMutableDictionary *manualByTime=[NSMutableDictionary dictionary];
CMTime lo=keyTime(samples.firstObject),hi=keyTime(samples.lastObject);
if(CMTimeCompare(lo,hi)>0)std::swap(lo,hi);
if(m[@"stampSource"]&&CMTIME_IS_NUMERIC(frameDuration)&&frameDuration.value>0){
// FCP can shift analysis timestamps by a fraction of a frame between passes.
// Replace an older automatic key belonging to the first or last new frame.
CMTime half=CMTimeMultiplyByRatio(frameDuration,1,2);
lo=CMTimeSubtract(lo,half);hi=CMTimeAdd(hi,half);
}
// Normalize equivalent time fractions when preserving authored keys.
auto timeID=[](NSDictionary *key){
CMTime time=keyTime(key);