Esempio n. 1
0
/******************************************************************************
* funciton : stop ISP, and stop isp thread
******************************************************************************/
HI_VOID SAMPLE_COMM_ISP_Stop()
{
    ISP_DEV IspDev = 0;
    HI_S32 s32Ret;
    ALG_LIB_S stLib;

    if (!gbIspInited)
    {
        return;
    }

    HI_MPI_ISP_Exit(IspDev);
    if (gs_IspPid)
    {
        pthread_join(gs_IspPid, 0);
        gs_IspPid = 0;
    }
    gbIspInited = HI_FALSE;

    /* unregister hisi af lib */
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AF_LIB_NAME);
    s32Ret = HI_MPI_AF_UnRegister(IspDev, &stLib);
    if (s32Ret != HI_SUCCESS)
    {
        printf("%s: HI_MPI_AF_UnRegister failed!\n", __FUNCTION__);
        return;
    }

    /* unregister hisi awb lib */
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AWB_LIB_NAME);
    s32Ret = HI_MPI_AWB_UnRegister(IspDev, &stLib);
    if (s32Ret != HI_SUCCESS)
    {
        printf("%s: HI_MPI_AWB_UnRegister failed!\n", __FUNCTION__);
        return;
    }

    /* unregister hisi ae lib */
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AE_LIB_NAME);
    s32Ret = HI_MPI_AE_UnRegister(IspDev, &stLib);
    if (s32Ret != HI_SUCCESS)
    {
        printf("%s: HI_MPI_AE_UnRegister failed!\n", __FUNCTION__);
        return;
    }

    /* sensor unregister callback */
    s32Ret = sensor_unregister_callback_fn();
    if (s32Ret != HI_SUCCESS)
    {
        printf("%s: sensor_unregister_callback_fn failed with %#x!\n", \
               __FUNCTION__, s32Ret);
        return;
    }

    return;
}
bool HimppVideoISP::unregisterAlgorithm()
{
	ALG_LIB_S stLib;
	HI_S32 s32Ret;

	stLib.s32Id = 0;
	strcpy(stLib.acLibName, HI_AE_LIB_NAME);
	if ((s32Ret = HI_MPI_AE_UnRegister(&stLib)) != HI_SUCCESS) {
		HIMPP_PRINT("HI_MPI_AE_UnRegister failed [%#x]\n", s32Ret);
		return false;
	}

	stLib.s32Id = 0;
	strcpy(stLib.acLibName, HI_AWB_LIB_NAME);
	if ((s32Ret = HI_MPI_AWB_UnRegister(&stLib)) != HI_SUCCESS) {
		HIMPP_PRINT("HI_MPI_AWB_UnRegister failed [%#x]\n", s32Ret);
		goto err_unreg_ae;
	}

	stLib.s32Id = 0;
	strcpy(stLib.acLibName, HI_AF_LIB_NAME);
	if ((s32Ret = HI_MPI_AF_UnRegister(&stLib)) != HI_SUCCESS) {
		HIMPP_PRINT("HI_MPI_AF_UnRegister failed [%#x]\n", s32Ret);
		goto err_unreg_awb;
	}

	return true;

err_unreg_awb:
	stLib.s32Id = 0;
	strcpy(stLib.acLibName, HI_AWB_LIB_NAME);
	HI_MPI_AWB_UnRegister(&stLib);
err_unreg_ae:
	stLib.s32Id = 0;
	strcpy(stLib.acLibName, HI_AE_LIB_NAME);
	HI_MPI_AE_UnRegister(&stLib);

	return false;
}
Esempio n. 3
0
/******************************************************************************
* funciton : stop ISP, and stop isp thread
******************************************************************************/
HI_VOID SAMPLE_COMM_ISP_Stop()
{
    HI_MPI_ISP_Exit();
#ifdef ISP_V2

    ALG_LIB_S stLib;
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AE_LIB_NAME);
    HI_MPI_AE_UnRegister(&stLib);
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AWB_LIB_NAME);
    HI_MPI_AWB_UnRegister(&stLib);
    stLib.s32Id = 0;
    strcpy(stLib.acLibName, HI_AF_LIB_NAME);
    HI_MPI_AF_UnRegister(&stLib);
    sensor_unregister_callback();

#endif
    pthread_join(gs_IspPid, 0);
    return;
}