Ios linphone\u呼叫\u拍摄\u视频\u快照已保存空文件
我正在从事一个基于Linphone iPhone的项目,该项目需要拍摄当前视频流的快照(输入和输出) 我在liblinphone中找到了这个“linphone\u call\u take\u video\u snapshot”,并尝试了一下。 代码很简单,运行时没有任何错误,但保存的文件大小始终为0 kb 代码如下:Ios linphone\u呼叫\u拍摄\u视频\u快照已保存空文件,ios,linphone,Ios,Linphone,我正在从事一个基于Linphone iPhone的项目,该项目需要拍摄当前视频流的快照(输入和输出) 我在liblinphone中找到了这个“linphone\u call\u take\u video\u snapshot”,并尝试了一下。 代码很简单,运行时没有任何错误,但保存的文件大小始终为0 kb 代码如下: - (void)capture { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirec
- (void)capture {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *file_path = [documentsDirectory stringByAppendingPathComponent:@"snapshot.jpeg"];
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
const char *c_file_path = [file_path cStringUsingEncoding:NSUTF8StringEncoding];
int ret = linphone_call_take_video_snapshot(call, c_file_path);
if (ret >= 0 && [[NSFileManager defaultManager] fileExistsAtPath:file_path]) {
UIImageWriteToSavedPhotosAlbum([UIImage imageWithContentsOfFile:file_path], nil,nil,nil);
}
}
linphone\u call\u take\u video\u snapshot真的有用吗?如果是,我做错了什么 视频通话有效吗?我有一个更有趣的问题,它返回-1视频通话,我不明白原因。