mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-10-26 05:50:01 +00:00
Add a basic stats overlay
This commit is contained in:
1 parent
2114e39237
commit
44f713f5c9
5 files changed
+125
-1
No files matched your search
@@ -130,4 +130,25 @@
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (NSString*) getStatsOverlayText {
|
||||
video_stats_t stats;
|
||||
|
||||
if (!_connection) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (![_connection getVideoStats:&stats]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
float interval = stats.endTime - stats.startTime;
|
||||
return [NSString stringWithFormat:@"Video stream: %dx%d %.2f FPS (Codec: %@)\nIncoming frame rate from network: %.2f FPS\nFrames dropped by your network connection: %.2f%%\n",
|
||||
_config.width,
|
||||
_config.height,
|
||||
stats.totalFrames / interval,
|
||||
[_connection getActiveCodecName],
|
||||
stats.receivedFrames / interval,
|
||||
stats.networkDroppedFrames / interval];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user