2#include "libmythbase/mythconfig.h"
7#import <IOKit/graphics/IOGraphicsLib.h>
8#include <AvailabilityMacros.h>
11#define kIOMainPortDefault kIOMasterPortDefault
16 NSView *thisview =
static_cast<NSView *
>(View);
19 NSScreen *screen = [[thisview window] screen];
22 NSDictionary* desc = [screen deviceDescription];
23 return (CGDirectDisplayID)[[desc objectForKey:
@"NSScreenNumber"] intValue];
28 if (Number ==
nullptr)
31 if (!CFNumberGetValue(Number, kCFNumberSInt64Type, &Int64))
33 return Int64 == Uint32;
42 uint32_t vendor = CGDisplayVendorNumber(Display);
43 uint32_t model = CGDisplayModelNumber(Display);
44 uint32_t serial = CGDisplaySerialNumber(Display);
45 CFMutableDictionaryRef matching = IOServiceMatching(
"IODisplayConnect");
51 io_service_t service = 0;
52 while ((service = IOIteratorNext(iter)) != 0)
54 CFDictionaryRef
info = IODisplayCreateInfoDictionary(service, kIODisplayOnlyPreferredName);
55 CFNumberRef vendorID =
static_cast<CFNumberRef
>(CFDictionaryGetValue(
info, CFSTR(kDisplayVendorID)));
56 CFNumberRef productID =
static_cast<CFNumberRef
>(CFDictionaryGetValue(
info, CFSTR(kDisplayProductID)));
57 CFNumberRef serialNumber =
static_cast<CFNumberRef
>(CFDictionaryGetValue(
info, CFSTR(kDisplaySerialNumber)));
63 CFDataRef edid =
static_cast<CFDataRef
>(CFDictionaryGetValue(
info, CFSTR(kIODisplayEDIDKey)));
66 const char* data =
reinterpret_cast<const char*
>(CFDataGetBytePtr(edid));
67 int length = CFDataGetLength(edid);
68 result = QByteArray(data, length);
75 IOObjectRelease(iter);
CGDirectDisplayID GetOSXCocoaDisplay(void *View)
#define kIOMainPortDefault
static Boolean CFNumberEqualsUInt32(CFNumberRef Number, uint32_t Uint32)
QByteArray GetOSXEDID(CGDirectDisplayID Display)