public void hm_pu_close_videoTest()
        {
            UInt32 iResult = 0;

            Init();
            if (!GetNode_ByIndex(iRootNode, 3))
            {
                Release();
                Assert.Fail();
            }
            if (!LoginDev())
            {
                Release();
                Assert.Fail();
            }
            if (!OpenRealVideo())
            {
                Release();
                Assert.Fail();
            }
            videoRes = new OPEN_VIDEO_RES();
            iResult  = SDK_HuaMai.hm_pu_start_video(iOpenVideo, ref videoRes);
            iResult  = SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
            iResult  = SDK_HuaMai.hm_pu_close_video(iOpenVideo);
            Release();
            Assert.AreEqual(Convert.ToUInt32(0), iResult);
        }
 private void button1_Click(object sender, EventArgs e)
 {
     SDK_HuaMai.hm_video_display_close_port(iPort);
     iPort = IntPtr.Zero;
     SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
     SDK_HuaMai.hm_pu_close_video(iOpenVideo);
     SDK_HuaMai.hm_pu_logout(iDev);
 }
Beispiel #3
0
 public bool VideoClose()
 {
     SDK_HuaMai.hm_video_display_close_port(iPort);
     iPort = IntPtr.Zero;
     SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
     SDK_HuaMai.hm_pu_close_video(iOpenVideo);
     iOpenVideo = IntPtr.Zero;
     SDK_HuaMai.hm_pu_logout(iDev);
     iDev           = IntPtr.Zero;
     VideoPlayState = Enum_VideoPlayState.NotInPlayState;
     VideoPlayCallback(new VideoPlayCallbackValue {
         evType = Enum_VideoPlayEventType.VideoClose
     });
     return(true);
 }
        private void Frm_Temp_TestVideoPlay_ResizeBegin(object sender, EventArgs e)
        {
            return;

            SDK_HuaMai.hm_video_display_close_port(iPort);
            iPort = IntPtr.Zero;
            SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
            SDK_HuaMai.hm_pu_close_video(iOpenVideo);
            SDK_HuaMai.hm_pu_logout(iDev);
            return;

            //SDK_HuaMai.hm_video_display_stop(iPort);
            intCountResizeBegin++;
            label3.Text = intCountResizeBegin.ToString();
        }
        private void pictureBox1_SizeChanged(object sender, EventArgs e)
        {
            intCountt++;
            label1.Text = "SizeChanged" + intCountt.ToString();
            return;

            Size Temp_s = pictureBox1.Size;

            if (Math.Abs(s.Width - Temp_s.Width) > 100 || Math.Abs(s.Height - Temp_s.Height) > 100)
            {
                s = Temp_s;
                SDK_HuaMai.hm_video_display_close_port(iPort);
                SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
                SDK_HuaMai.hm_pu_close_video(iOpenVideo);
                SDK_HuaMai.hm_pu_logout(iDev);
                pictureBox1.BackColor = Color.Black;
                if (!GetNode_BySN("E322213C04245"))
                {
                    Release();
                    return;
                }
                if (!LoginDev())
                {
                    Release();
                    return;
                }
                if (!OpenRealVideo())
                {
                    Release();
                    return;
                }
                if (!StartVideo())
                {
                    Release();
                }
                SDK_HuaMai.DISPLAY_OPTION disp_op = new SDK_HuaMai.DISPLAY_OPTION();
                disp_op.dm = SDK_HuaMai.DISPLAY_MODE.HME_DM_DX;
                disp_op.pq = SDK_HuaMai.PIC_QUALITY.HME_PQ_HIGHT;
                //IntPtr iWnd = pictureBox1.Handle;
                iPort = IntPtr.Zero;
                SDK_HuaMai.hm_video_display_open_port(pictureBox1.Handle, ref disp_op, ref iPort);
                SDK_HuaMai.hm_video_display_start(iPort, videoRes.image_width, videoRes.image_height, videoRes.fps);
                intCountt = 0;
                listBox1.Items.Add(iPort.ToString());
            }
            return;

            if (bolFlag)
            {
                bolFlag = false;
                SDK_HuaMai.hm_video_display_stop(iPort);
                SDK_HuaMai.hm_video_display_close_port(iPort);
                //StartOpenVideo();
                SDK_HuaMai.DISPLAY_OPTION disp_op = new SDK_HuaMai.DISPLAY_OPTION();
                disp_op.dm = SDK_HuaMai.DISPLAY_MODE.HME_DM_DX;
                disp_op.pq = SDK_HuaMai.PIC_QUALITY.HME_PQ_HIGHT;
                ////IntPtr iWnd = pictureBox1.Handle;
                SDK_HuaMai.hm_video_display_open_port(pictureBox1.Handle, ref disp_op, ref iPort);
                SDK_HuaMai.hm_video_display_start(iPort, 0, 0, 25);
                bolFlag = true;
            }
        }