瑙嗛杈撳嚭 鑼冧緥

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了瑙嗛杈撳嚭 鑼冧緥相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/lan' title='lan'>lan   ola   ann   浼樺厛   _for   杈撳嚭鍙傛暟   amp   

寮€鍚疺O璁惧

/*********************************
*鍑芥暟鍔熻兘锛氬紑鍚疺O璁惧
*杈撳嚭鍙傛暟锛?*杩斿洖鍊硷細鎴愬姛涓? 澶辫触闈?
*********************************/
HI_S32 enable_VO()
{
    HI_S32 s32Ret;        //杩斿洖鍊?
    VO_DEV VoDev = 0;         //杈撳嚭璁惧鍙?/span>
    VO_PUB_ATTR_S stPubAttr;     //VO鍏叡灞炴€с€?/span>


    s32Ret = HI_MPI_VO_GetPubAttr(VoDev, &stPubAttr);    //鑾峰彇瑙嗛杈撳嚭璁惧鐨勫叕鍏卞睘鎬с€?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Get device attributes failed with error code %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    /*閰嶇疆VO鍏叡灞炴€?/span>*/
    stPubAttr.u32BgColor = 0xff;         //鑳屾櫙鑹?RGB鏍煎紡
    stPubAttr.enIntfType = VO_INTF_VGA;     //VO鎺ュ彛绫诲瀷
    stPubAttr.enIntfSync = VO_OUTPUT_1280x1024_60;         //VO鏃跺簭绫诲瀷
    s32Ret = HI_MPI_VO_SetPubAttr(VoDev, &stPubAttr);     //閰嶇疆瑙嗛杈撳嚭璁惧鐨勫叕鍏卞睘鎬?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Set device attributes failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_Enable(VoDev);     //鍚敤瑙嗛杈撳嚭璁惧
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Enable vo dev %d failed with errno %#x!
", VoDev, s32Ret); 
        return HI_FAILURE; 
    } 

    /*.....*/

    s32Ret = HI_MPI_VO_Disable(VoDev);     //鍏抽棴VO璁惧
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Enable vo dev %d failed with errno %#x!
", VoDev, s32Ret); 
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_CloseFd();     //鍏抽棴VO鏂囦欢鎻忚堪绗?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Some device is not disable with errno %#x!
", VoDev, s32Ret); 
        return HI_FAILURE; 
    }
}

 

 

 

寮€鍚疺O瑙嗛灞?/h2>
/*********************************
*鍑芥暟鍔熻兘锛氬紑鍚棰戝眰
*杈撳嚭鍙傛暟锛?*杩斿洖鍊硷細鎴愬姛涓? 澶辫触闈?
*********************************/
HI_S32 start_VO_Layer()
{
    HI_S32 s32Ret;         //杩斿洖鍊?/span>
    VO_LAYER VoLayer = 0;         //瑙嗛灞傚彿
    RECT_S stRect; 
    VO_VIDEO_LAYER_ATTR_S stLayerAttr;         //瑙嗛灞傚睘鎬?/span>

    s32Ret = HI_MPI_VO_GetVideoLayerAttr(VoLayer, &stLayerAttr);     //鑾峰彇瑙嗛灞傚睘鎬?/span>
    if (s32Ret != HI_SUCCESS)
    { 
        printf("Get video layer attributes failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    /*瀹氫箟瑙嗛灞傚睘鎬?/span>*/  //stDispRect——鏄剧ず鍒嗚鲸鐜?stImageSize——鍥惧儚鍒嗚鲸鐜?/span>
    stLayerAttr.stDispRect.s32X = 0;     //宸︿笂瑙掗《鐐瑰潗鏍?/span>
    stLayerAttr.stDispRect.s32Y = 0; 
    stLayerAttr.stDispRect.u32Width = 720;         //鏄剧ず鍒嗚鲸鐜?/span>
    stLayerAttr.stDispRect.u32Height = 576; 
    stLayerAttr.stImageSize.u32Width = 720;     //鐢诲竷澶у皬(鍥惧儚鍒嗚鲸鐜?
    stLayerAttr.stImageSize.u32Height = 576;     
    stLayerAttr.u32DispFrmRt = 25锛?               //甯х巼
    stLayerAttr.enPixFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_422锛?       //鍍忕礌鏍煎紡
    stLayerAttr.bDoubleFrame = HI_TRUE;             //瑙嗛鏄惁寮€鍚€嶉
    stLayerAttr.bClusterMode = HI_FALSE;             //瑙嗛灞傛槸鍚﹂噰鐢ㄨ仛闆嗙殑鏂瑰紡
    s32Ret = HI_MPI_VO_SetVideoLayerAttr(VoLayer, &stLayerAttr); 
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Set video layer attributes failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_EnableVideoLayer(VoLayer);     //浣胯兘瑙嗛灞?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Enable video layer failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_DisableVideoLayer(VoLayer);     //鍏抽棴瑙嗛灞?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Disable video layer failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    }
}

 

 

 

 

浣胯兘VO閫氶亾

/*********************************
*鍑芥暟鍔熻兘锛氫娇鑳借棰戣緭鍑洪€氶亾
*杈撳嚭鍙傛暟锛?*杩斿洖鍊硷細鎴愬姛涓? 澶辫触闈?
*********************************/
HI_S32 start_VO_chn()
{

    VO_DEV VoDev = 0;         //VO璁惧
    VO_LAYER VoLayer = 0;     //VO瑙嗛杈撳嚭瑙嗛灞傚彿
    VO_CHN VoChn = 0;         //VO瑙嗛杈撳嚭閫氶亾
    VO_CHN_ATTR_S stChnAttr; 

    s32Ret = HI_MPI_VO_GetChnAttr(VoLayer, VoChn, &stChnAttr);         //鑾峰彇VO chn灞炴€?/span>
    if (s32Ret != HI_SUCCESS)     
    { 
        printf("Get channel attr failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    stChnAttr.u32Priority = 0;         //閫氶亾浼樺厛绾?/span>
    stChnAttr.stRect.s32X = 0;         //閫氶亾鏄剧ず鍖哄煙 椤剁偣(宸︿笂瑙?
    stChnAttr.stRect.s32Y = 0; 
    stChnAttr.stRect.u32Width = 720;     //閫氶亾鏄剧ず鍖哄煙澶у皬
    stChnAttr.stRect.u32Height = 576; 
    s32Ret = HI_MPI_VO_SetChnAttr(VoLayer, VoChn, &stChnAttr);         //閰嶇疆鎸囧畾瑙嗛杈撳嚭閫氶亾鐨勫睘鎬?/span>
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Set channel attr failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_EnableChn(VoLayer, VoChn);     //寮€鍚寚瀹氱殑VO閫氶亾
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Enable channel failed with errno %#x!
", s32Ret);
        return HI_FAILURE; 
    } 

    s32Ret = HI_MPI_VO_DisableChn(VoLayer, VoChn);     //鍏抽棴閫氶亾
    if (s32Ret != HI_SUCCESS) 
    { 
        printf("Disable channel failed with errno %#x!
", s32Ret); 
        return HI_FAILURE; 
    }

}

 

以上是关于瑙嗛杈撳嚭 鑼冧緥的主要内容,如果未能解决你的问题,请参考以下文章

CC2530鐨勯€氱敤IO鍙g殑杈撳叆杈撳嚭

Python瀛︿範涔嬭緭鍏ュ拰杈撳嚭

linq to sql 鍜?entity framework 杈撳嚭sql璇彞

瀹屽叏鑳屽寘杈撳嚭鏂规鏁帮紙dp)

涓€瀵逛竴鍏宠仈鏌ヨ鏃朵娇鐢╮elation杩炶疮鎿嶄綔鏌ヨ鍚庯紝璋冪敤getLastSql()鏂规硶杈撳嚭鐨剆ql璇彞

Python鍩虹涔嬫牸寮忓寲杈撳嚭銆佽繍绠楃銆佹暟瀛椾笌甯冨皵鍊间簰鎹互鍙妛hile...else