瑙嗛杈撳嚭 鑼冧緥
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;
}
}
/********************************* *鍑芥暟鍔熻兘锛氬紑鍚棰戝眰 *杈撳嚭鍙傛暟锛?*杩斿洖鍊硷細鎴愬姛涓? 澶辫触闈? *********************************/ 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; } }
以上是关于瑙嗛杈撳嚭 鑼冧緥的主要内容,如果未能解决你的问题,请参考以下文章
linq to sql 鍜?entity framework 杈撳嚭sql璇彞
涓€瀵逛竴鍏宠仈鏌ヨ鏃朵娇鐢╮elation杩炶疮鎿嶄綔鏌ヨ鍚庯紝璋冪敤getLastSql()鏂规硶杈撳嚭鐨剆ql璇彞