Compare commits
No commits in common. "master" and "0.1.1" have entirely different histories.
|
@ -15,10 +15,9 @@
|
||||||
IOSurfaceRef _staticBuffer;
|
IOSurfaceRef _staticBuffer;
|
||||||
size_t _width;
|
size_t _width;
|
||||||
size_t _height;
|
size_t _height;
|
||||||
BOOL _useCADisplayLink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(instancetype)initWithSurfaceInfo:(IOSurfaceRef)screenSurface rfbScreenInfo:(rfbScreenInfoPtr)rfbScreenInfo accelerator:(IOSurfaceAcceleratorRef)accelerator staticBuffer:(IOSurfaceRef)staticBuffer width:(size_t)width height:(size_t)height useCADisplayLink:(BOOL)useCADisplayLink {
|
-(instancetype)initWithSurfaceInfo:(IOSurfaceRef)screenSurface rfbScreenInfo:(rfbScreenInfoPtr)rfbScreenInfo accelerator:(IOSurfaceAcceleratorRef)accelerator staticBuffer:(IOSurfaceRef)staticBuffer width:(size_t)width height:(size_t)height {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_q = [[NSOperationQueue alloc] init];
|
_q = [[NSOperationQueue alloc] init];
|
||||||
_updatingFrames = NO;
|
_updatingFrames = NO;
|
||||||
|
@ -31,7 +30,6 @@
|
||||||
_staticBuffer = staticBuffer;
|
_staticBuffer = staticBuffer;
|
||||||
_width = width;
|
_width = width;
|
||||||
_height = height;
|
_height = height;
|
||||||
_useCADisplayLink = useCADisplayLink;
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -60,25 +58,17 @@
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
[_updateFrameTimer invalidate];
|
[_updateFrameTimer invalidate];
|
||||||
_updateFrameTimer = nil;
|
|
||||||
_updatingFrames = NO;
|
_updatingFrames = NO;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)startFrameLoop {
|
-(void)startFrameLoop {
|
||||||
|
// if (size_image == 0) VNCSetup();
|
||||||
[self stopFrameLoop];
|
[self stopFrameLoop];
|
||||||
_updatingFrames = YES;
|
_updatingFrames = YES;
|
||||||
|
|
||||||
if (_useCADisplayLink) {
|
|
||||||
CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_updateFrame)];
|
|
||||||
displayLink.preferredFramesPerSecond = 60; // Adjust as needed
|
|
||||||
[displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
|
|
||||||
_updateFrameTimer = (NSTimer *)displayLink;
|
|
||||||
} else {
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
_updateFrameTimer = [NSTimer scheduledTimerWithTimeInterval:1/400 target:self selector:@selector(_updateFrame) userInfo:nil repeats:YES];
|
_updateFrameTimer = [NSTimer scheduledTimerWithTimeInterval:1/400 target:self selector:@selector(_updateFrame) userInfo:nil repeats:YES];
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)dealloc {
|
-(void)dealloc {
|
||||||
|
|
|
@ -142,9 +142,7 @@
|
||||||
|
|
||||||
free(arg0);
|
free(arg0);
|
||||||
|
|
||||||
NSDictionary* defaults = getPrefsForAppId(@"ru.mostmodest.screendump");
|
_frameUpdater = [[FrameUpdater alloc] initWithSurfaceInfo:_screenSurface rfbScreenInfo:_rfbScreenInfo accelerator:_accelerator staticBuffer:_staticBuffer width:_width height:_height];
|
||||||
bool useCADisplayLink = [[defaults objectForKey:@"displaysync"]?:@NO boolValue];
|
|
||||||
_frameUpdater = [[FrameUpdater alloc] initWithSurfaceInfo:_screenSurface rfbScreenInfo:_rfbScreenInfo accelerator:_accelerator staticBuffer:_staticBuffer width:_width height:_height useCADisplayLink:useCADisplayLink];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(rfbBool)handleVNCAuthorization:(rfbClientPtr)client data:(const char *)data size:(int)size {
|
-(rfbBool)handleVNCAuthorization:(rfbClientPtr)client data:(const char *)data size:(int)size {
|
||||||
|
|
|
@ -81,26 +81,6 @@
|
||||||
<key>isNumeric</key>
|
<key>isNumeric</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>cell</key>
|
|
||||||
<string>PSGroupCell</string>
|
|
||||||
<key>label</key>
|
|
||||||
<string>Tuning</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>PostNotification</key>
|
|
||||||
<string>ru.mostmodest.screendump/restart</string>
|
|
||||||
<key>cell</key>
|
|
||||||
<string>PSSwitchCell</string>
|
|
||||||
<key>default</key>
|
|
||||||
<false/>
|
|
||||||
<key>defaults</key>
|
|
||||||
<string>ru.mostmodest.screendump</string>
|
|
||||||
<key>key</key>
|
|
||||||
<string>displaysync</string>
|
|
||||||
<key>label</key>
|
|
||||||
<string>Update screen using CADisplayLink</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
Loading…
Reference in New Issue