Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 自定义iphone摄像头设置_Ios_Objective C_Iphone_Cocoa Touch - Fatal编程技术网

Ios 自定义iphone摄像头设置

Ios 自定义iphone摄像头设置,ios,objective-c,iphone,cocoa-touch,Ios,Objective C,Iphone,Cocoa Touch,此启用UIImagePicker的方法的AVFoundation等效项是什么?我的应用程序使用AVFoundation,我想完全禁用UIImagePicker。此方法在程序中设置UIImagePicker类之后出现。它将用户(实际使用iPhone摄像头界面)拍摄的一张假想图像设置为一张名为photo的IBMOutlet,该图片在应用程序前面声明。摘录自(底部下载) 注意:AVCam方法是AVSession的一部分,Apple将其描述为使用AVFoundation协调媒体捕获的所有数据流的类。这里

此启用UIImagePicker的方法的AVFoundation等效项是什么?我的应用程序使用AVFoundation,我想完全禁用UIImagePicker。此方法在程序中设置UIImagePicker类之后出现。它将用户(实际使用iPhone摄像头界面)拍摄的一张假想图像设置为一张名为photo的IBMOutlet,该图片在应用程序前面声明。摘录自(底部下载)

注意:AVCam方法是AVSession的一部分,Apple将其描述为使用AVFoundation协调媒体捕获的所有数据流的类。这里是苹果公司为AVCam提供的完整官方程序

我碰巧在AVCamViewController中发现了这段摘录。我注意到它看起来很像讨论中的方法。有人能帮助验证它的可伸缩性吗

#pragma mark File Output Delegate
- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error
{
if (error)
    NSLog(@"%@", error);
[self setLockInterfaceRotation:NO];
// Note the backgroundRecordingID for use in the ALAssetsLibrary completion handler to end the background task associated with this recording. This allows a new recording to be started, associated with a new UIBackgroundTaskIdentifier, once the movie file output's -isRecording is back to NO — which happens sometime after this method returns.
UIBackgroundTaskIdentifier backgroundRecordingID = [self backgroundRecordingID];
[self setBackgroundRecordingID:UIBackgroundTaskInvalid];
[[[ALAssetsLibrary alloc] init] writeVideoAtPathToSavedPhotosAlbum:outputFileURL completionBlock:^(NSURL *assetURL, NSError *error) {
    if (error)
        NSLog(@"%@", error);
    [[NSFileManager defaultManager] removeItemAtURL:outputFileURL error:nil];
    if (backgroundRecordingID != UIBackgroundTaskInvalid)
        [[UIApplication sharedApplication] endBackgroundTask:backgroundRecordingID];
}];
}

警告是什么?你能分享这条消息吗?我尝试的方法在那张图片中突出显示。我将重建项目,以获得警告的最新快照。任何想法仍然受到赞赏。谢谢。你包括所有需要的框架吗?当然。我只是简单地复制了iAction,使用这里看到的苹果AVFoundation免费源代码AVcam拍照。我将它改为void,并将其编程为在视图中关闭。我希望使用该图片而不是图像选择器instanceApple来描述摄像头支持的AVFoundation类。到目前为止,结果的伸缩性似乎类似于在这里和那里减去几个关键字……你对伸缩原始方法有什么想法吗?我将尝试重新编译以获得更准确的更新。。。
#pragma mark File Output Delegate
- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error
{
if (error)
    NSLog(@"%@", error);
[self setLockInterfaceRotation:NO];
// Note the backgroundRecordingID for use in the ALAssetsLibrary completion handler to end the background task associated with this recording. This allows a new recording to be started, associated with a new UIBackgroundTaskIdentifier, once the movie file output's -isRecording is back to NO — which happens sometime after this method returns.
UIBackgroundTaskIdentifier backgroundRecordingID = [self backgroundRecordingID];
[self setBackgroundRecordingID:UIBackgroundTaskInvalid];
[[[ALAssetsLibrary alloc] init] writeVideoAtPathToSavedPhotosAlbum:outputFileURL completionBlock:^(NSURL *assetURL, NSError *error) {
    if (error)
        NSLog(@"%@", error);
    [[NSFileManager defaultManager] removeItemAtURL:outputFileURL error:nil];
    if (backgroundRecordingID != UIBackgroundTaskInvalid)
        [[UIApplication sharedApplication] endBackgroundTask:backgroundRecordingID];
}];
}