示例#1
0
        private void FrmSKVideoSDKTest_Load(object sender, EventArgs e)
        {
            CurrentVideoInfo = TestDataSource.TestDataSource.GetSKDVSData3();

            p_msg_demo_callback = new CallBack(callback);
            SDK_SKVideoSDK.p_sdkc_reg_msg_callback(p_msg_demo_callback);

            SDK_SKVideoSDK.p_sdkc_init_client("Admin", "192.168.2.19", 47624, 47724, 47824, @"d:\");
            while (SDK_SKVideoSDK.p_sdkc_get_online() == 0)
            {
                Common.Delay_Second(1);
            }
            DateTime timStart     = DateTime.Now.AddSeconds(-3000);
            DateTime timEnd       = DateTime.Now.AddSeconds(-2700);
            long     intStartTime = ConvertClass.DateTimeToUnixTimestamp(timStart);
            long     intEndTimt   = ConvertClass.DateTimeToUnixTimestamp(timEnd);

            //SDK_SKVideoSDK.p_sdkc_start_playback_av(CurrentVideoInfo.DVSAddress, 0, Convert.ToUInt32(intStartTime), pictureBox1.Handle);

            p_vsdk_reg_dl_video_data_callback = new p_dl_video_data_callback(callback_download);
            SDK_SKVideoSDK.p_vsdk_reg_dl_video_data_callback(p_vsdk_reg_dl_video_data_callback);
            //string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest\" + timStart.ToString("yyyy_MM_dd_HH_mm_ss") + ".H264";
            //string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest";
            //int intResult = SDK_SKVideoSDK.p_sdkc_request_download_video(CurrentVideoInfo.DVSAddress, 0, (int)intStartTime, (int)intEndTimt, Temp_strDownPath);
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //DateTime timStart = DateTime.Now.AddSeconds(-3000);
            //DateTime timEnd = DateTime.Now.AddSeconds(-2700);
            DateTime timStart = DateTime.Parse("2019-09-06 12:33:00");
            DateTime timEnd   = DateTime.Parse("2019-09-06 12:35:01");
            //DateTime timStart = DateTime.Now.AddSeconds(-3000);
            //DateTime timEnd = DateTime.Now.AddSeconds(-2700);
            long start_time = ConvertClass.DateTimeToUnixTimestamp(timStart);
            long stop_time  = ConvertClass.DateTimeToUnixTimestamp(timEnd);

            //long start_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Parse("2019-06-05 17:01:38"));
            //long stop_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Parse("2019-06-05 17:03:34"));
            //long start_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Parse("2019-06-05 15:04:13"));
            //long stop_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Parse("2019-06-05 15:50:03"));
            //long start_time = 1559802091;
            //long stop_time = 1559802199;
            int intCount = 0;

            while (SDK_SKVideoSDK.p_sdkc_get_online() == 0 && intCount < 10)
            {
                Common.Delay_Second(1);
                intCount++;
            }
            //string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest\" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".H264";

            Temp_strName = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss");
            //string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest";
            string Temp_strDownPath = Path + "\\" + Temp_strName + "_Temp.h264";
            int    intResult        = SDK_SKVideoSDK.p_sdkc_request_download_video("72-00F51F0150E8-35B7", 0, (int)start_time, (int)stop_time, Temp_strDownPath);

            intCount         = 0;
            timDownLoadStart = DateTime.Now;
        }
        public void DateTimeToUnixTimestampTest()
        {
            //long l = 1526886082;
            long     l         = 1569218833000;
            DateTime timResult = ConvertClass.UnixTimestampToDateTime(l);
            long     lResult   = ConvertClass.DateTimeToUnixTimestamp(timResult);

            Assert.AreEqual(l, lResult);
            //ch01_00000000001041800
        }
        public void p_sdkc_get_record_time_mapTest()
        {
            //1.注册回调
            //2.创建线程
            //3.触发回调事件

            p_msg_demo_callback = new CallBack(callback);
            p_sdkc_reg_msg_callback(p_msg_demo_callback);
            while (SDK_SKVideoSDK.p_sdkc_get_online() == 0)
            {
                Common.Delay_Second(1);
            }
            long start_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Now.AddDays(-1));
            long stop_time  = ConvertClass.DateTimeToUnixTimestamp(DateTime.Now);

            SDK_SKVideoSDK.p_sdkc_get_record_time_map("72-00F51F01580D-46E5", (byte)0, (int)start_time, (int)stop_time);
            Common.Delay_Second(10);
            Assert.Fail();
        }
        public void p_sdkc_request_download_videoTest()
        {
            DateTime timStart   = DateTime.Now.AddSeconds(-2000);
            DateTime timEnd     = DateTime.Now.AddSeconds(-1700);
            long     start_time = ConvertClass.DateTimeToUnixTimestamp(timStart);
            long     stop_time  = ConvertClass.DateTimeToUnixTimestamp(timEnd);
            int      intCount   = 0;

            while (SDK_SKVideoSDK.p_sdkc_get_online() == 0 && intCount < 10)
            {
                Common.Delay_Second(1);
                intCount++;
            }
            p_msg_demo_callback = new CallBack(callback);
            p_sdkc_reg_msg_callback(p_msg_demo_callback);
            string Temp_strDownPath = @"C:\SHIKE_Video\" + timStart.ToString("yyyy_MM_dd_HH_mm_ss") + ".H264";
            //string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest";
            int intResult = SDK_SKVideoSDK.p_sdkc_request_download_video("72-00F51F817E16-D210", 0, (int)start_time, (int)stop_time, Temp_strDownPath);

            intCount = 0;
            Common.Delay_Second(30);
            Assert.AreEqual(intResult, 1);
        }
        public void DownLoadRemoteRecordDataTest()
        {
            string Temp_strDownPath = @"C:\SHIKE_Video\0138\DownloadTest";

            p_msg_demo_callback = new CallBack(callback);
            p_sdkc_reg_msg_callback(p_msg_demo_callback);
            while (SDK_SKVideoSDK.p_sdkc_get_online() == 0)
            {
                Common.Delay_Second(1);
            }
            long start_time = ConvertClass.DateTimeToUnixTimestamp(DateTime.Now.AddHours(-1));
            long stop_time  = ConvertClass.DateTimeToUnixTimestamp(DateTime.Now);

            SDK_SKVideoSDK.p_sdkc_get_record_time_map("61-57354AA60831-3136", (byte)8, (int)start_time, (int)stop_time);
            Common.Delay_Second(5);
            if (lRemoteVideoRecord != null && lRemoteVideoRecord.Count > 0)
            {
                foreach (RemoteVideoRecordInfo v in lRemoteVideoRecord)
                {
                    SDK_SKVideoSDK.DownLoadRemoteRecord(v, Temp_strDownPath + "/" + v.RemoteVidoRecordName);
                }
            }
            Assert.Fail();
        }