当我想通过使用VTCompressionSessionCreate创建一个VTCompressionSessionRef时会崩溃,他可以告诉我为什么?????
dispatch_sync(aQueue, ^{
// Create the compression session
OSStatus status = VTCompressionSessionCreate(NULL, width, height, kCMVideoCodecType_H264, NULL, NULL, NULL, didCompressH264, (__bridge void *)(self), &EncodingSession);
NSLog(@"H264: VTCompressionSessionCreate %d", (int)status);
if (status != 0)
{
NSLog(@"H264: Unable to create a H264 session");
error = @"H264: Unable to create a H264 session";
return ;
}
}
崩溃时,状态总是-12912。
答案 0 :(得分:0)
根据VideoToolbox / VTErrors.h:
kVTVideoEncoderMalfunctionErr = -12912,
您的硬件编码器可能出现故障吗?