Files
ppsspp/ios/CameraHelper.h
T
Henrik RydgårdandClaude Opus 5.5 6fab39ebb4 iOS: Keep camera frames upright in portrait
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>
2026-10-10 16:42:25 +02:00

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