1、问题现象:
在playback采取硬解码播放时,多次返回进入,playback画面会一直是黑屏;
2、问题分析:
创建VTDecompressionSessionRef时,返回 -12913时,未及时释放资源导致;
3、问题解决:
Camera.m: doDecodeVideo方法中添加以下code,
if (channel.videoDecSession) {
VTDecompressionSessionInvalidate(channel.videoDecSession);
CFRelease(channel.videoDecSession);
channel.videoDecSession = NULL;
}
if (channel.videoFormatDescr) {
CFRelease(channel.videoFormatDescr);
channel.videoFormatDescr = NULL;
}
channel.spsData = 0;
channel.ppsData = 0.
本文介绍了解决在使用硬解码时遇到的画面黑屏问题。通过在Camera.m文件的doDecodeVideo方法中添加资源释放代码,确保了在创建VTDecompressionSessionRef失败时能够正确地释放资源。
1万+

被折叠的 条评论
为什么被折叠?



