|
如题,本人根据mpp例程【mpi_dec_test.c】中的流程进行编写C++程序,但是在mpp初始化过程中出现了以下报错
- 0x55a58ed4a0 failed to get decoder dec_cfg ret -2
代码如下
- //mpp dec init
- ret = mpp_packet_init(&mpp_dec_packet, av_packet->data, av_packet->size);
- if (ret) {
- printf("failed to exec mpp_packet_init ret %d", ret);
- exit(1);
- }
- ret=mpp_create(&dec_ctx, &dec_mpi);
- if(ret){
- printf("mpp_create failed\n");
- exit(1);
- }
- // printf("<<<<<< mpi decoder w %d h %d type %d\n", input_rtsp_width, input_rtsp_height, dec_type);
- ret=mpp_init(dec_ctx, MPP_CTX_DEC, dec_type);
- if(ret){
- printf("%p mpp_init failed\n", dec_ctx);
- exit(1);
- }
- mpp_dec_cfg_init(&dec_ctx);
- ret=dec_mpi->control(dec_ctx, MPP_DEC_GET_CFG, dec_cfg);//获取配置,这个语句会报错
- if(ret){
- printf("%p failed to get decoder dec_cfg ret %d\n", dec_ctx, ret);
- exit(1);
- }
- ret = mpp_dec_cfg_set_u32(dec_cfg, "base:split_parse", 1);//内部分帧器
- if (ret) {
- printf("%p failed to set split_parse ret %d\n", dec_ctx, ret);
- exit(1);
- }
- ret = dec_mpi->control(dec_ctx, MPP_DEC_SET_CFG, dec_cfg);
- if (ret) {
- printf("%p failed to set cfg %p ret %d\n", dec_ctx, dec_cfg, ret);
- exit(1);
- }
- printf(">>> mpp init OK !!! >>>\n\r");
看报错代码,是MPP_ERR_UNKNOW 未知错误,请大佬解惑一下是本人的步骤有问题还是配置没有配置完?
|
|