Remove a redundant function

This commit is contained in:
Henrik Rydgård 2024-05-22 16:02:13 +02:00
parent cc37476c79
commit 538cc62f16
5 changed files with 8 additions and 19 deletions

View File

@ -10,8 +10,7 @@
@property (nonatomic, strong) id<CameraFrameDelegate> delegate; @property (nonatomic, strong) id<CameraFrameDelegate> delegate;
- (void) setCameraSize:(int)width h:(int)height; - (void) startVideo:(int)width h:(int)height;
- (void) startVideo;
- (void) stopVideo; - (void) stopVideo;
@end @end

View File

@ -37,7 +37,7 @@ NSString *getSelectedCamera() {
if (granted) { if (granted) {
NSLog(@"camera permission granted"); NSLog(@"camera permission granted");
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self startVideo]; [self startVideo:mWidth h:mHeight];
}); });
} else { } else {
NSLog(@"camera permission denied"); NSLog(@"camera permission denied");
@ -56,14 +56,10 @@ NSString *getSelectedCamera() {
} }
} }
-(void) setCameraSize: (int)width h:(int)height { -(void) startVideo: (int)width h:(int)height {
NSLog(@"CameraHelper::setCameraSize %dx%d", width, height); NSLog(@"CameraHelper::startVideo %dx%d", width, height);
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
}
-(void) startVideo {
NSLog(@"CameraHelper::startVideo");
if ([self checkPermission]) { if ([self checkPermission]) {
return; return;
} }

View File

@ -16,6 +16,5 @@
extern id <PPSSPPViewController> sharedViewController; extern id <PPSSPPViewController> sharedViewController;
void setCameraSize(int width, int height); void startVideo(int width, int height);
void startVideo();
void stopVideo(); void stopVideo();

View File

@ -382,12 +382,8 @@ extern float g_safeInsetBottom;
} }
} }
void setCameraSize(int width, int height) { void startVideo(int width, int height) {
[cameraHelper setCameraSize: width h:height]; [cameraHelper startVideo: width h:height];
}
void startVideo() {
[cameraHelper startVideo];
} }
void stopVideo() { void stopVideo() {

View File

@ -429,8 +429,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
if (!strncmp(param1.c_str(), "startVideo", 10)) { if (!strncmp(param1.c_str(), "startVideo", 10)) {
int width = 0, height = 0; int width = 0, height = 0;
sscanf(param1.c_str(), "startVideo_%dx%d", &width, &height); sscanf(param1.c_str(), "startVideo_%dx%d", &width, &height);
setCameraSize(width, height); startVideo(width, height);
startVideo();
} else if (!strcmp(param1.c_str(), "stopVideo")) { } else if (!strcmp(param1.c_str(), "stopVideo")) {
stopVideo(); stopVideo();
} }