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

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(海思学习)