public override bool PB_Step(VideoControl vc)
        {
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }
            int ret = Hik_Open8200API.Std_StreamReplayControl((int)cm.PlayHandle, Hik_Open8200API.ReplayMode.PLAYMODE_ONEBYONE);

            return(ret >= 0 ? true : false);
        }
        public override bool StopPlayback(VideoControl vc)
        {
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }
            Hik_Open8200API.Std_StopStreamReplay((int)cm.PlayHandle);
            this.m_ControlTable[vc] = null;
            cm.Running = false;
            return(true);
        }
        public override bool PB_Fast(VideoControl vc)
        {
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }
            Hik_Open8200API.ReplayMode newMode = Hik_Open8200API.ReplayMode.PLAYMODE_1_FORWARD;
            switch ((Hik_Open8200API.ReplayMode)cm.Speed)
            {
            case Hik_Open8200API.ReplayMode.PLAYMODE_1_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_2_FORWARD;
                break;

            case Hik_Open8200API.ReplayMode.PLAYMODE_2_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_4_FORWARD;
                break;

            case Hik_Open8200API.ReplayMode.PLAYMODE_4_FORWARD:
            case Hik_Open8200API.ReplayMode.PLAYMODE_8_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_8_FORWARD;
                break;

            //case Hik_Open8200API.ReplayMode.PLAYMODE_8_FORWARD:
            //case Hik_Open8200API.ReplayMode.PLAYMODE_16_FORWARD:
            //    newMode = Hik_Open8200API.ReplayMode.PLAYMODE_16_FORWARD;
            //    break;
            case Hik_Open8200API.ReplayMode.PLAYMODE_Eighth_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_QUARTER_FORWARD;
                break;

            case Hik_Open8200API.ReplayMode.PLAYMODE_QUARTER_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_HALF_FORWARD;
                break;

            case Hik_Open8200API.ReplayMode.PLAYMODE_HALF_FORWARD:
                newMode = Hik_Open8200API.ReplayMode.PLAYMODE_1_FORWARD;
                break;
            }
            int ret = Hik_Open8200API.Std_StreamReplayControl((int)cm.PlayHandle, newMode);

            cm.Speed = (int)newMode;
            return(ret >= 0 ? true : false);
        }
        public override bool PB_GetPos(VideoControl vc, out int pos)
        {
            pos = default;
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }
            int seconds = 0;
            int ret     = Hik_Open8200API.Std_GetFileReplayPos((int)cm.PlayHandle, ref seconds);

            if (ret < 0)
            {
                return(false);
            }
            pos = (int)(seconds * 100 / (cm.End - cm.Start).TotalSeconds);
            return(true);
        }
        public override bool PB_SetPos(VideoControl vc, int pos)
        {
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }

            DateTime time    = new DateTime();
            long     allTick = cm.End.Ticks - cm.Start.Ticks;

            time = cm.Start + new TimeSpan(allTick * pos / 100);

            int seconds = (int)((time - cm.Start).TotalSeconds);
            int ret     = Hik_Open8200API.Std_SetStreamReplayPos((int)cm.PlayHandle, seconds);

            return(ret >= 0 ? true : false);
        }
        public override bool PB_GetCurTime(VideoControl vc, out DateTime dateTime)
        {
            dateTime = default;
            ControlInfo_Playback cm = this.m_ControlTable[vc] as ControlInfo_Playback;

            if (cm == null)
            {
                return(false);
            }
            dateTime = cm.Start;
            int seconds = 0;
            int ret     = Hik_Open8200API.Std_GetFileReplayPos((int)cm.PlayHandle, ref seconds);

            if (ret < 0)
            {
                return(false);
            }
            dateTime = cm.Start.AddSeconds(seconds);
            return(true);
        }
        public override bool StartPlaybackByTime(CameraInfo camera, VideoControl vc, DateTime Start, DateTime End)
        {
            VideoSourceInfo videoSourceInfo = camera.VideoSourceInfo;
            int             loginID         = Hik_Open8200API.GetLoginID(videoSourceInfo.IP, (int)videoSourceInfo.Port, videoSourceInfo.User, videoSourceInfo.Password);

            if (loginID < 0)
            {
                string error = Hik_Open8200API.GetLastError();
                vc.ErrorMessage = $"初始化登录服务器失败, 错误码:{error}, 设备{videoSourceInfo.IP}:{videoSourceInfo.Port} ";
                this.LogModule.Error(vc.ErrorMessage);
                return(false);
            }
            int playHandle = Hik_Open8200API.Std_StreamReplayByTime(loginID, camera.CameraCode, this.getTimeString(Start), this.getTimeString(End), 0, vc.VControl.Handle, null, IntPtr.Zero);

            if (playHandle < 0)
            {
                string error = Hik_Open8200API.GetLastError();
                vc.ErrorMessage = $"回放图像失败: 错误码:{error}, 摄像机标识: {camera.CameraCode}";
                this.LogModule.Error(vc.ErrorMessage);
                return(false);
            }

            ControlInfo_Playback cm = new ControlInfo_Playback()
            {
                Camera      = camera,
                VideoSource = videoSourceInfo,
                Start       = Start,
                End         = End,
                LoginHandle = loginID,
                PlayHandle  = playHandle,
                VC          = vc, Speed = (int)Hik_Open8200API.ReplayMode.PLAYMODE_1_FORWARD, Running = true
            };

            this.m_ControlTable[vc] = cm;
            return(true);
        }