HarmonyOS 视频解码的时候OH_VideoDecoder_RenderOutputBuffer方法一直返回为2
参考官方案例,使用XComponent渲染解码后的视频,但是解码的方法OH_VideoDecoder_RenderOutputBuffer一直返回2,导致demo没有画面。
代码:
int32_t VideoDecoder::FreeOutputData(uint32_t bufferIndex, bool render)
{
if (decoder == nullptr) {
OH_LOG_ERROR(LOG_APP, "Decoder is null");
return AV_ERR_UNKNOWN;
}
int32_t ret = AV_ERR_OK;
if (render) {
ret = OH_VideoDecoder_RenderOutputBuffer(decoder, bufferIndex);
} else {
ret = OH_VideoDecoder_FreeOutputBuffer(decoder, bufferIndex);
}
if (ret != AV_ERR_OK) {
OH_LOG_ERROR(LOG_APP, "Free output data failed: ret=%{public}d", ret);
return AV_ERR_UNKNOWN;
}
return AV_ERR_OK;
}
int32_t ret = videoDecoder_->FreeOutputData(bufferInfo.bufferIndex, true);
if (ret != AV_ERR_OK) {
OH_LOG_ERROR(LOG_APP, "Decoder output thread out");
break;
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
结果:
07-31 17:36:22.031 55381-55416 C02B30/NativeVideoDecoder pid-55381 E {OH_VideoDecoder_RenderOutputBuffer():637} Video decoder render output data failed!
07-31 17:36:22.031 55381-55416 A00000/VideoDecoder pid-55381 E Free output data failed: ret=2
07-31 17:36:22.031 55381-55416 A00000/player pid-55381 E Decoder output thread out
- 1.
- 2.
- 3.
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS 视频硬解码调用OH_VideoDecoder_PushInputData崩溃
669浏览 • 1回复 待解决
HarmonyOS accessBackward方法一直返回true
778浏览 • 1回复 待解决
HarmonyOS bundleManager.canOpenLink一直返回false
1291浏览 • 1回复 待解决
info 获取是失败 一直为空
2829浏览 • 1回复 待解决
HarmonyOS this.controller.accessBackward() 返回值一直返回false
921浏览 • 1回复 待解决
Siging configs 的时候,一直处于loading状态……,怎么解决?
6629浏览 • 1回复 待解决
HarmonyOS avplayer概率性获取duration和currentTime一直返回-1
499浏览 • 1回复 待解决
HarmonyOS 获取定位一直失败
828浏览 • 1回复 待解决
OH_AVScreenCapture_StartScreenRecording返回失败2
1345浏览 • 1回复 待解决
Hi3861,测温湿度,使用I2c ,2cWrite一直失败
7268浏览 • 2回复 待解决
HarmonyOS 应用上架一直loading
695浏览 • 1回复 待解决
harmonyOS toggle 赋值一直重新触发
482浏览 • 0回复 待解决
HarmonyOS CustomDialogController一直是undefined
1025浏览 • 1回复 待解决
HarmonyOS IDE无法打开,一直崩溃
941浏览 • 1回复 待解决
http 请求一直报 2300058
2540浏览 • 0回复 待解决
HarmonyOS 终端运行ohpm一直报错
1024浏览 • 1回复 待解决
HarmonyOS geoLocationManager.getAddressesFromLocation一直报错
945浏览 • 1回复 待解决
HarmonyOS bundleManager.queryAbilityInfo一直报错17700003
907浏览 • 1回复 待解决
HarmonyOS Profiler TIme 一直是initializing
883浏览 • 1回复 待解决
HarmonyOS TextInput控件onKeyEvent一直无响应
848浏览 • 1回复 待解决
HarmonyOS获取图片旋转值一直报错
1179浏览 • 1回复 待解决
HarmonyOS bundleManager.getProfileByAbility一直报错17700024
749浏览 • 1回复 待解决
HarmonyOS promptAction.openCustomDialog弹窗一直存在
1046浏览 • 1回复 待解决
视频解码可参考以下完整demo示例:https://gitee.com/harmonyos_samples/AVCodecVideo