updateConfiguration no work sometimes

I'm using screenCaptureKit for winodow capture.

I build a filter like follow code, (I'm not usng independent window filter, because sometime I need capture multi windows in the same time)

filter = [[SCContentFilter alloc] initWithDisplay:displayID includingWindows:includingWindows];

At begining, the capture works OK.

When the target window's size or position changed, my code monitored this change and called updateConfiguration like below , I got completionHandler without error.

[streamConfiguration setSourceRect:newRect];
[streamConfiguration setWidth:newWidth];
[streamConfiguration setHeight:newHeight];
[scStream updateConfiguration:streamConfiguration
                     completionHandler:^(NSError *_Nullable error) {
            if (error) {
                // some error log
            } else {
                // update done
            }
        }];

But sometimes, it still output frame with old size, and the rect is still the old.

And int some other cases, it works fine.....

Is there any special work before call updateConfiguration to make it work ?

updateConfiguration no work sometimes
 
 
Q