//private FileStream fs = new FileStream(@"D:\cgwVideoAfter3.264", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
//private int wCount = 0;
void namePipeDataCheck_Elapsed(object sender, ElapsedEventArgs e)
{
//namedPipeHasVideoDataTimer.Enabled = false;
NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
try
{
//uint compareSize = mediaData.Size;
uint compareSize = mediaDataSize;
Thread.Sleep(1500);
//uint size = mediaData.Size;
uint size = mediaDataSize;
//if (compareSize != size && mediaData.Size != 0)
if (compareSize != size && size != 0)
{
iCount = 0;
}
else
{
iCount++;
}
if (iCount == iNullCount)
{
logEx.Debug("VideoPipe.Timer Data end,iCount={0},cameraNo={1}.", iCount, cameraNo);
namedPipeHasVideoDataTimer.Enabled = false;
logEx.Info("STOP namedPipeHasVideoDataTimer.");
VideoPipeManage.Instance().DeleteVideoPipe(cameraNo);
Stop();
VideoPipeManage.Instance().DeleteNoDataVideoPipe(cameraNo);
}
//else
//{
// namedPipeHasVideoDataTimer.Enabled = true;
//}
}
catch (System.Exception ex)
{
logEx.Error("VideoPipe.Timer.delete(cameraNo{0}) catch() failed ,ex={1}", cameraNo, ex.ToString());
}
}