Skip to content

Commit

Permalink
fix(macos): wrong type and unnecessary redeclaraton
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazer committed May 13, 2024
1 parent ab75ab0 commit 14828b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/platform/macos/av_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef bool (^FrameCallbackBlock)(CMSampleBufferRef);
@property (nonatomic, assign) NSMapTable<AVCaptureConnection *, dispatch_semaphore_t> *captureSignals;

+ (NSArray<NSDictionary *> *)displayNames;
+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID;
+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID with: (NSArray<NSScreen*>*)screens;

- (id)initWithDisplay:(CGDirectDisplayID)displayID frameRate:(int)frameRate;

Expand Down
6 changes: 3 additions & 3 deletions src/platform/macos/av_video.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ @implementation AVVideo
return [NSArray array];
}

NSArray<NSScreen*> *screens = [NSScreen screens];
NSMutableArray *result = [NSMutableArray array];

for (uint32_t i = 0; i < count; i++) {
[result addObject:@{
@"id": [NSNumber numberWithUnsignedInt:displays[i]],
@"name": [NSString stringWithFormat:@"%d", displays[i]],
@"displayName": [self getDisplayName:displays[i]],
@"displayName": [self getDisplayName:displays[i] with:screens],
}];
}

return [NSArray arrayWithArray:result];
}

+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID {
NSScreen *screens = [NSScreen screens];
+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID with: (NSArray<NSScreen*>*)screens {
for (NSScreen *screen in screens) {
if (screen.deviceDescription[@"NSScreenNumber"] == [NSNumber numberWithUnsignedInt:displayID]) {
return screen.localizedName;
Expand Down

0 comments on commit 14828b7

Please sign in to comment.