public static StreamPacket[] Recorder(string path) { FolderManager.DeleteDirectoryInfo(path); StreamPacket[] sPackets = GetStreamPackets(); DownloadRecorder recorder = new DownloadRecorder(path, TimeSpan.FromMinutes(15)); for (int i = 0; i < sPackets.Length; i++) { recorder.Set(sPackets[i]); } recorder.FinishPackage(sPackets.Last().Time.AddSeconds(1)); return(sPackets); }
public void TestStorageSearcher_Search() { string videoId = "dateTimeNow"; int streamId = 2; string path = System.IO.Path.Combine(GlobalData.Path, $"{videoId}_{streamId}"); FolderManager.DeleteDirectoryInfo(path); GlobalData.FileLengthSup = new TimeSpan(0, 15, 0); DateTime beginTime = DateTime.Now.Date; testVideoTimePeriodsPacket(videoId, streamId, 0); BaseInfo.addData(path, beginTime, 0, 600); testVideoTimePeriodsPacket(videoId, streamId, 1, 600); using (RecorderBase recorder = new DownloadRecorder(Path.Combine(path, $"{DateTime.Now.Year}\\{DateTime.Now.Month.ToString("00")}\\{DateTime.Now.Day.ToString("00")}"), GlobalData.FileLengthSup)) { BaseInfo.recordAddSeconds(recorder, beginTime, 0, DataType.SysHead); //new BaseInfo.fillRecordBySeconds(recorder, beginTime, 600, 1200); } testVideoTimePeriodsPacket(videoId, streamId, 1, 1200); FolderManager.DeleteDirectoryInfo(path); }