mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 23:10:33 +02:00
The camera delivers frames in the sensor's landscape orientation however the phone is held, so in portrait the picture was 90 degrees off. Rotate the capture connection: on iOS 17+ with a rotation coordinator, which keeps the picture level with the horizon, and before that to match the interface orientation. A portrait frame doesn't fit the landscape size the game asks for, so scale frames to cover it and crop the rest, rather than stretching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
620 B
Objective-C
20 lines
620 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#import <AVFoundation/AVFoundation.h>
|
|
#import <UIKit/UIKit.h>
|
|
|
|
@protocol CameraFrameDelegate <NSObject>
|
|
@required
|
|
- (void) PushCameraImageIOS:(long long)len buffer:(unsigned char*)data;
|
|
@end
|
|
|
|
@interface CameraHelper : NSObject<AVCaptureVideoDataOutputSampleBufferDelegate>
|
|
|
|
@property (nonatomic, strong) id<CameraFrameDelegate> delegate;
|
|
|
|
- (void) startVideo:(int)width h:(int)height;
|
|
- (void) stopVideo;
|
|
// Below iOS 17, frames are rotated to match this. From 17, they're kept level with the horizon instead.
|
|
- (void) setInterfaceOrientation:(UIInterfaceOrientation)orientation;
|
|
|
|
@end
|