/// <summary> /// 把消息体中的osd信息转换成EasyPlayer的osd结构体 /// </summary> /// <param name="videoOsd"></param> /// <returns></returns> public PlayerSdk.EASY_PALYER_OSD messageOsd2Osd(OSD videoOsd) { Position position = videoOsd.position; int x; int y; if (null != position.right) { x = (int)position.right; } else { x = rtspPanel.Width - (int)position.left; } if (null != position.top) { y = (int)position.top; } else { y = rtspPanel.Height - (int)position.bottom; } PlayerSdk.tagRECT rect = new PlayerSdk.tagRECT { left = x, bottom = videoOsd.height, right = videoOsd.width, top = y }; PlayerSdk.EASY_PALYER_OSD osd = new PlayerSdk.EASY_PALYER_OSD { rect = rect, stOSD = videoOsd.stOSD, alpha = (uint)videoOsd.alpha, size = videoOsd.size, shadowcolor = (uint)videoOsd.shadowcolor }; osd.color = (uint)(videoOsd.blue << 16 | videoOsd.green << 8 | videoOsd.red); return(osd); }
public int showOSD(OSD messageOsd) { PlayerSdk.EASY_PALYER_OSD osd = messageOsd2Osd(messageOsd); return(PlayerSdk.EasyPlayer_ShowOSD(channelId, 1, osd)); }