fix: match paused scope samples at timeline frame cadence

这个提交包含在:
mac 于 2026-11-08 16:48:43 +08:00 提交
1 父节点 8a434b8e40
当前提交 c791ddcb76
8 个文件已更改
+21 -9

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

+6
查看文件
@@ -36,6 +36,12 @@
- (NSView*)createViewForParameterID:(UInt32)pid {
[self scheduleToolCanvasRegistration];
if(pid!=DYInspectorParameterID)return [[NSView alloc]initWithFrame:NSZeroRect];
id<FxTimingAPI_v4> timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];
if([timing respondsToSelector:@selector(timelineFpsNumeratorForEffect:)]&&[timing respondsToSelector:@selector(timelineFpsDenominatorForEffect:)]){
NSUInteger numerator=[timing timelineFpsNumeratorForEffect:self],denominator=[timing timelineFpsDenominatorForEffect:self];
if(numerator>0&&numerator<=INT32_MAX&&denominator>0&&denominator<=INT64_MAX)
[_renderer setScopeProjectFrameDuration:CMTimeMake(denominator,(int32_t)numerator)];
}
return [[DYInspector alloc]initWithAPIManager:_apiManager renderer:_renderer];
}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==DYToolsParameterID)[self adoptToolCanvasDocument:DYReadTools(_apiManager,t).document];if(pid==DYToolsParameterID||pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];// Many parameter callbacks arrive in one host transaction. Refresh the native
+1
查看文件
@@ -31,6 +31,7 @@
/// Conversion/statistics run while visible; retain one small final-output
/// sample per instance so opening a paused workspace needs no parameter edit.
- (BOOL)scopeEnabled;
- (void)setScopeProjectFrameDuration:(CMTime)duration;
- (void)setScopeEnabled:(BOOL)enabled;
- (void)setScopeEnabled:(BOOL)enabled atTime:(CMTime)time frameDuration:(CMTime)frameDuration;
/// Call after the final destination render succeeds, while the tile is valid.
+1 -1
查看文件
@@ -150,7 +150,7 @@ struct DYScopeReadback {
uint64_t _spiderScopeSerial;
NSUInteger _scopeGeneration;
DYScopeSample *_scopePending,*_scopeLatest;
uint64_t _scopeCaptureSerial,_scopeLatestSerial;CMTime _scopeRequestedTime,_scopeRequestedFrameDuration;
uint64_t _scopeCaptureSerial,_scopeLatestSerial;CMTime _scopeRequestedTime,_scopeRequestedFrameDuration,_scopeProjectFrameDuration;
FxImageTile *_scopeDestination; // borrowed for one locked host render
CMTime _scopeRenderTime;
BOOL _scopeCaptured;
+5 -1
查看文件
@@ -1,10 +1,14 @@
// Included in DYRenderer's implementation; final destination sampling is kept
// separate from the earlier input-analysis thumbnail used by auto-grade/LUTs.
- (void)setScopeProjectFrameDuration:(CMTime)duration{@synchronized(_previewLock){_scopeProjectFrameDuration=duration;}}
- (BOOL)scopeEnabled{@synchronized(_previewLock){return _scopeEnabled;}}
- (void)setScopeEnabled:(BOOL)enabled{[self setScopeEnabled:enabled atTime:kCMTimeInvalid frameDuration:kCMTimeInvalid];}
- (void)setScopeEnabled:(BOOL)enabled atTime:(CMTime)time frameDuration:(CMTime)frameDuration{
BOOL start=NO;@synchronized(_previewLock){if(_scopeEnabled==enabled)return;_scopeEnabled=enabled;_scopeGeneration++;[_scopePending release];_scopePending=nil;
if(enabled){_scopeRequestedTime=time;_scopeRequestedFrameDuration=frameDuration;[_scopePreview release];_scopePreview=nil;[_scopeMetadata release];_scopeMetadata=nil;
if(enabled){
// Viewer output advances at project cadence even when the source is 60p.
if(CMTIME_IS_NUMERIC(_scopeProjectFrameDuration)&&_scopeProjectFrameDuration.value>0)frameDuration=_scopeProjectFrameDuration;
_scopeRequestedTime=time;_scopeRequestedFrameDuration=frameDuration;[_scopePreview release];_scopePreview=nil;[_scopeMetadata release];_scopeMetadata=nil;
CMTime cached=_scopeLatest?CMTimeMakeWithEpoch([_scopeLatest.metadata[@"timeValue"]longLongValue],[_scopeLatest.metadata[@"timeScale"]intValue],[_scopeLatest.metadata[@"timeEpoch"]longLongValue]):kCMTimeInvalid;
BOOL replay=_scopeLatest&&(!CMTIME_IS_NUMERIC(time)||DYScopeFrameContainsTime(cached,time,frameDuration));
os_log(OS_LOG_DEFAULT,"dayu_scope_open requested=%{public}.9f cached=%{public}.9f frame=%{public}.9f replay=%{public}d",CMTimeGetSeconds(time),CMTimeGetSeconds(cached),CMTimeGetSeconds(frameDuration),replay);
@@ -111,8 +111,9 @@
run.record(@"workspace-final-output-worker-publishes-real-scope-rasters",[scopeData[@"waveform"]length]==320*256*4&&[scopeData[@"parade"]length]==3*320*256*4&&[scopeData[@"histogram"]length]==4*256*4&&[scopeData[@"vectorscope"]length]==256*256*4&&[scopeData[@"wholeImage"]boolValue]);
[scopeRenderer setScopeEnabled:NO];[scopeRenderer captureScopeTile:finalTile atTime:CMTimeMake(8,24)];workspaceDrain();DYScopeSample *hiddenSample=[scopeRenderer valueForKey:@"scopeLatest"];
run.record(@"workspace-hidden-scope-retains-only-one-small-final-sample-without-processing",[scopeRenderer.scopeMetadata isEqual:scopeData]&&hiddenSample.pixels.length==320*180*16&&[hiddenSample.metadata[@"timeValue"]longLongValue]==8&&![scopeRenderer valueForKey:@"scopePending"]);
[scopeRenderer setScopeEnabled:YES atTime:CMTimeAdd(CMTimeMake(8,24),CMTimeMake(7,300)) frameDuration:CMTimeMake(1,24)];scopeDeadline=NSProcessInfo.processInfo.systemUptime+5;while(!scopeRenderer.scopeMetadata&&NSProcessInfo.processInfo.systemUptime<scopeDeadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];
run.record(@"workspace-opening-between-frame-boundaries-replays-current-final-output",[scopeRenderer.scopeMetadata[@"timeValue"]longLongValue]==8&&scopeRenderer.scopePreview.length==320*180*16&&[scopeRenderer.scopeMetadata[@"vectorscope"]length]==256*256*4);
[scopeRenderer setScopeProjectFrameDuration:CMTimeMake(1,25)];
[scopeRenderer setScopeEnabled:YES atTime:CMTimeAdd(CMTimeMake(8,24),CMTimeMake(7,300)) frameDuration:CMTimeMake(1,60)];scopeDeadline=NSProcessInfo.processInfo.systemUptime+5;while(!scopeRenderer.scopeMetadata&&NSProcessInfo.processInfo.systemUptime<scopeDeadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];
run.record(@"workspace-opening-uses-project-frame-interval-for-a-faster-source",[scopeRenderer.scopeMetadata[@"timeValue"]longLongValue]==8&&scopeRenderer.scopePreview.length==320*180*16&&[scopeRenderer.scopeMetadata[@"vectorscope"]length]==256*256*4);
[scopeRenderer setScopeEnabled:NO];[scopeRenderer setScopeEnabled:YES atTime:CMTimeMake(9,24) frameDuration:CMTimeMake(1,24)];workspaceDrain();run.record(@"workspace-opening-another-time-never-presents-a-stale-frame",!scopeRenderer.scopeMetadata&&!scopeRenderer.scopePreview);
[scopeRenderer captureScopeTile:finalTile atTime:CMTimeMake(9,24)];scopeDeadline=NSProcessInfo.processInfo.systemUptime+5;while(!scopeRenderer.scopeMetadata&&NSProcessInfo.processInfo.systemUptime<scopeDeadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];run.record(@"workspace-new-live-frame-replaces-rejected-cache",[scopeRenderer.scopeMetadata[@"timeValue"]longLongValue]==9);
DYWorkspaceDiagnosticRenderer *otherScope=[[[DYWorkspaceDiagnosticRenderer alloc]init]autorelease];[otherScope setScopeEnabled:YES atTime:CMTimeMake(9,24) frameDuration:CMTimeMake(1,24)];workspaceDrain();run.record(@"workspace-scope-cache-never-crosses-plugin-instances",!otherScope.scopeMetadata&&!otherScope.scopePreview);
+1 -1
查看文件
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.21.1</string>
<key>CFBundleVersion</key>
<string>115</string>
<string>116</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+1 -1
查看文件
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.21.1</string>
<key>CFBundleVersion</key>
<string>115</string>
<string>116</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>