17 海思Hi3518的OSD实现

 

代码框架:

SAMPLE_VENC_720P_CLASSIC
	SAMPLE_RGN_CreateVideoRegion//用图片的方式创建所有区域
		SAMPLE_RGN_CreateOverlayForVenc//左下角的区域
			HI_MPI_RGN_Create
			HI_MPI_RGN_AttachToChn
		SAMPLE_RGN_Add
			HI_MPI_RGN_GetAttr
			HI_MPI_RGN_GetCanvasInfo
			SAMPLE_RGN_UpdateCanvas
				SAMPLE_RGN_CreateSurfaceByCanvas
					SAMPLE_RGN_LoadCanvasEx
						SAMPLE_RGN_LoadBMPCanvas_Logo  //if(Type == VENC_RECORD_LOGO_OSD_HANDLE)
						SAMPLE_RGN_LoadBMPCanvas_TimeSmap//else
							SAMPLE_RGN_GetBMPSrc  //得到文件名
			HI_MPI_RGN_UpdateCanvas
		SAMPLE_RGN_CreateOverlayForVenc//右下角的区域
			HI_MPI_RGN_Create
			HI_MPI_RGN_AttachToChn
			
		pthread_create(&osd_ThreadId, NULL, SAMPLE_RGN_AddVideoTimestamp, NULL);
			SAMPLE_RGN_Add
				HI_MPI_RGN_GetAttr
				HI_MPI_RGN_GetCanvasInfo
				SAMPLE_RGN_UpdateCanvas
				  SAMPLE_RGN_CreateSurfaceByCanvas
				      SAMPLE_RGN_LoadCanvasEx
						  SAMPLE_RGN_LoadBMPCanvas_Logo  //if(Type == VENC_RECORD_LOGO_OSD_HANDLE)
						  SAMPLE_RGN_LoadBMPCanvas_TimeSmap//else
							SAMPLE_RGN_GetBMPSrc
				HI_MPI_RGN_UpdateCanvas
	//用字库的方式创建所有区域
	HH_OSD_Init
		HH_OSD_SetOsdPosDefault
		HH_OSD_GetOrg
		HH_OSD_GetColor
		HH_OSD_GetTitle
			HH_OSD_GetTimeTitle//if (nOsdType == HH_OSD_TYPE_TIME)
			HH_OSD_GetChNameTitleelse// if (nOsdType == HH_OSD_TYPE_TITLE)
		HI_Create_Osd
			HI_OSD_Build
				HI_OSD_Parse_OsdTitle
				HI_OSD_Get_BmpSize
					HI_OSD_Get_ImaSize
				HI_Create_Osd_Reg//创建区域
					HI_MPI_RGN_Create
					HI_MPI_RGN_AttachToChn
				HI_OSD_Create_Bitmap//创建bmp
					HI_OSD_CreateBMP
						HI_OSD_GetCharBit
						HI_OSD_DrawBitmapBit32//if 将汉字的点阵转换为bmp写入缓冲区
						HI_OSD_DrawBitmapBit//else 将汉字的点阵转换为bmp写入缓冲区
					HI_MPI_RGN_SetBitMap
				HI_OSD_Set_Show//显示OSD
					HI_MPI_RGN_GetDisplayAttr
					HI_MPI_RGN_SetDisplayAttr
	

	HH_OSD_All_Refresh
		HH_OSD_AllTime_Refresh//时间osd
			HH_OSD_ChnTime_Refresh
				HH_OSD_ChName_Refresh
					HH_OSD_GetLogoHandle
					HH_OSD_GetTitle
						HH_OSD_GetTimeTitle//if (nOsdType == HH_OSD_TYPE_TIME)
						HH_OSD_GetChNameTitleelse// if (nOsdType == HH_OSD_TYPE_TITLE)
					HI_OSD_Check_ImaSizeChange
						HI_OSD_Get_ImaSize
					HI_OSD_Parse_OsdTitle
					HI_OSD_Get_BmpSize
					//if 要销毁
						HI_OSD_Destroy
							HI_MPI_RGN_Destroy
						HI_Create_Osd_Reg
							HI_MPI_RGN_Create
							HI_MPI_RGN_AttachToChn
						HI_OSD_Refresh_Org
							HI_MPI_RGN_GetDisplayAttr
							HI_MPI_RGN_SetDisplayAttr
					HI_OSD_Create_Bitmap
						HI_OSD_CreateBMP
							HI_OSD_GetCharBit
							HI_OSD_DrawBitmapBit32//if 将汉字的点阵转换为bmp写入缓冲区
							HI_OSD_DrawBitmapBit//else 将汉字的点阵转换为bmp写入缓冲区
						HI_MPI_RGN_SetBitMap
					HH_OSD_Show_Refresh
						HH_OSD_GetLogoHandle
						HH_OSD_GetShow
						HI_OSD_Set_Show
							HI_MPI_RGN_GetDisplayAttr
							HI_MPI_RGN_SetDisplayAttr
					
		HH_OSD_AllName_Refresh//姓名osd
			HH_OSD_ChnAllName_Refresh
				HH_OSD_ChName_Refresh

 

 

 

 

 

 

 

 

 

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值