feat: add media access APIs for macOS Mojave (#15624)
This commit is contained in:
parent
aa2b2f7c8f
commit
c31629ad98
6 changed files with 121 additions and 2 deletions
|
@ -6,7 +6,9 @@
|
|||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_sending_event.h"
|
||||
|
||||
// Forward Declare Appareance APIs
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
// Forward Declare Appearance APIs
|
||||
@interface NSApplication (HighSierraSDK)
|
||||
@property(copy, readonly)
|
||||
NSAppearance* effectiveAppearance API_AVAILABLE(macosx(10.14));
|
||||
|
@ -14,6 +16,27 @@
|
|||
- (void)setAppearance:(NSAppearance*)appearance API_AVAILABLE(macosx(10.14));
|
||||
@end
|
||||
|
||||
// forward declare Access APIs
|
||||
typedef NSString* AVMediaType NS_EXTENSIBLE_STRING_ENUM;
|
||||
|
||||
AVF_EXPORT AVMediaType const AVMediaTypeVideo;
|
||||
AVF_EXPORT AVMediaType const AVMediaTypeAudio;
|
||||
|
||||
typedef NS_ENUM(NSInteger, AVAuthorizationStatusMac) {
|
||||
AVAuthorizationStatusNotDeterminedMac = 0,
|
||||
AVAuthorizationStatusRestrictedMac = 1,
|
||||
AVAuthorizationStatusDeniedMac = 2,
|
||||
AVAuthorizationStatusAuthorizedMac = 3,
|
||||
};
|
||||
|
||||
@interface AVCaptureDevice (MojaveSDK)
|
||||
+ (void)requestAccessForMediaType:(AVMediaType)mediaType
|
||||
completionHandler:(void (^)(BOOL granted))handler
|
||||
API_AVAILABLE(macosx(10.14));
|
||||
+ (AVAuthorizationStatusMac)authorizationStatusForMediaType:
|
||||
(AVMediaType)mediaType API_AVAILABLE(macosx(10.14));
|
||||
@end
|
||||
|
||||
extern "C" {
|
||||
#if !defined(MAC_OS_X_VERSION_10_14) || \
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue