fix: Use property accessors on Frame (#2400)

* fix: Use property accessors on `Frame`

* Format

* Use `_Nonnull`

* fix: Assume nonnull

* Use `NS_ASSUME_NONNULL_BEGIN` more

* Format C++
This commit is contained in:
Marc Rousavy
2024-01-16 20:02:03 +01:00
committed by GitHub
parent 9c66a09582
commit 773f278df8
8 changed files with 60 additions and 34 deletions

View File

@@ -11,11 +11,11 @@
#import <Foundation/Foundation.h>
@implementation Frame {
CMSampleBufferRef _Nonnull buffer;
UIImageOrientation orientation;
CMSampleBufferRef _Nonnull _buffer;
UIImageOrientation _orientation;
}
- (instancetype)initWithBuffer:(CMSampleBufferRef _Nonnull)buffer orientation:(UIImageOrientation)orientation {
- (instancetype)initWithBuffer:(CMSampleBufferRef)buffer orientation:(UIImageOrientation)orientation {
self = [super init];
if (self) {
_buffer = buffer;
@@ -29,8 +29,13 @@
CFRelease(_buffer);
}
@synthesize buffer = _buffer;
@synthesize orientation = _orientation;
- (CMSampleBufferRef)buffer {
return _buffer;
}
- (UIImageOrientation)orientation {
return _orientation;
}
- (NSString*)pixelFormat {
CMFormatDescriptionRef format = CMSampleBufferGetFormatDescription(_buffer);