private void UserControl1_Load(object sender, EventArgs e) { //HwndSource hs = (HwndSource)PresentationSource.FromDependencyObject(asd); //IntPtr ip = hs.Handle; PlayerSdk.EPInit(); int channelID = PlayerSdk.EasyPlayer_OpenStream("rtsp://*****:*****@172.16.21.80:554/h264/ch1/main/av_stream", panel1.Handle, PlayerSdk.RENDER_FORMAT.DISPLAY_FORMAT_RGB24_GDI, 1, "admin", "itc123456", PlayerSdk.EPcallBack, IntPtr.Zero, false); if (channelID > 0) { PlayerSdk.EasyPlayer_SetFrameCache(channelID, 3); } }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { PlayerSdk.EPInit(); //IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(VideoPictureBox)).Handle; HwndSource hs1 = (HwndSource)PresentationSource.FromDependencyObject(gg1); HwndSource hs2 = (HwndSource)PresentationSource.FromDependencyObject(gg2); IntPtr ip = hs2.Handle; //IntPtr ip1 = hs1.Handle; int channelID = PlayerSdk.EasyPlayer_OpenStream("rtsp://172.16.21.209:554/1", VideoPictureBox.Handle, PlayerSdk.RENDER_FORMAT.DISPLAY_FORMAT_RGB24_GDI, 1, "", "", PlayerSdk.EPcallBack, IntPtr.Zero, false); if (channelID > 0) { PlayerSdk.EasyPlayer_SetFrameCache(channelID, 3); } }