private void initCmd() { _downCmd = new VideoDownloadCmd(DownloadInfo); _downCmd.BytesLengthEvent += onBytes; _downCmd.ErrorEvent += onErrorStatus; _downCmd.VideoTimePeriodsEvent += onVideoTimePeriodsReceived; _downCmd.VideoBaseEvent += onVideoBasePacketReceived; _downCmd.VideoStreamEvent += onVideoStream; }
private void readVideoTimePeriodsPacket(ISourceInfo source, ITimePeriod tp, IVideoInfo vi) { try { VideoDownloadCmd cmd = new VideoDownloadCmd(new DownloadInfoParam(source, tp, vi, null)); cmd.VideoTimePeriodsEvent += onVideoTimePeriodsEvent; cmd.GetTimePeriods(); } catch (Exception ex) { Console.WriteLine("Read Video Time Periods Packet Error! {0}({1}) - {2} : {3}", vi.VideoName, vi.VideoId, vi.StreamId, ex.ToString()); } }
private void disposeCmd() { if (_downCmd != null) { _downCmd.BytesLengthEvent -= onBytes; _downCmd.ErrorEvent -= onErrorStatus; _downCmd.VideoTimePeriodsEvent -= onVideoTimePeriodsReceived; _downCmd.VideoBaseEvent -= onVideoBasePacketReceived; _downCmd.VideoStreamEvent -= onVideoStream; _downCmd.Dispose(); } _downCmd = null; }
private void onVideoTimePeriodsEvent(VideoDownloadCmd vd, VideoTimePeriodsPacket packet) { send(ParamCode.TimePeriods, VideoTimePeriodsPacket.Encode(packet)); vd.Dispose(); }
private void onVideoTimePeriodsReceived(VideoDownloadCmd vd, VideoTimePeriodsPacket packet) { _baseRec.UpdateTimePeriods(packet); loadRecorder(); }