我用 AWVideoInput_SetIrParam 接口切换成黑白模式,能正常切换,但再次切回彩色模式却不起作用。
看demo_video_in.c的代码也是这么用的,请问是哪里没配好吗?
/* 切换 彩色/黑白 模式 */
static RTIrParam pIrParam = {0};
if(res.faces->isLive == 0){
if(pIrParam.grey == 0){
printf("set IR\n");
pIrParam.grey = 1;
pIrParam.ir_on = 1;
pIrParam.ir_flash_on = 1;
int ret = AWVideoInput_SetIrParam(config->channelId, &pIrParam);
if(ret < 0)
printf("set IR error\n");
}
}else{
if(pIrParam.grey == 1 && frame_cnt == 50){
printf("set RGB\n");
pIrParam.grey = 0;
pIrParam.ir_on = 0;
pIrParam.ir_flash_on = 0;
int ret = AWVideoInput_SetIrParam(config->channelId, &pIrParam);
if(ret < 0)
printf("set RGB error\n");
}
}
离线