public bool ExtractTime(int frameNo, int frameStep, uint[] data, bool debug, out DateTime time) { LastOddFieldOSD = null; LastEvenFieldOSD = null; if (m_VideoController != null) { // Leave this to capture statistics m_VideoController.RegisterExtractingOcrTimestamps(); } m_LatestFrameImage = data; // TODO: Add main OCR Implementation HERE // NOTE: if there is an error extracting the timestamp then call m_VideoController.RegisterOcrError(); for Tangra to show a counter in the status bar with number of errors so far // NOTE: This dummy implementation simply marks all frames as OCR errors if (m_VideoController != null) { m_VideoController.RegisterOcrError(); } // NOTE: See IotaVtiOrcManaged.ExtractDateTime() for ideas about checking incorrectly extracted times and attempting to correct them. time = DateTime.MinValue; return(false); }
public bool ExtractTime(int frameNo, int frameStep, uint[] data, bool debug, out DateTime time) { LastOddFieldOSD = null; if (m_Processor.IsCalibrated && m_TimeStampComposer != null) { if (m_VideoController != null) { m_VideoController.RegisterExtractingOcrTimestamps(); } PrepareOsdVideoFields(data); m_Processor.Process(m_OddFieldPixelsPreProcessed, m_FieldAreaWidth, m_FieldAreaHeight, null, frameNo, true); LastOddFieldOSD = m_Processor.CurrentOcredTimeStamp; m_Processor.Process(m_EvenFieldPixelsPreProcessed, m_FieldAreaWidth, m_FieldAreaHeight, null, frameNo, false); LastEvenFieldOSD = m_Processor.CurrentOcredTimeStamp; string failedReason; if (m_InitializationData.IntegratedAAVFrames > 0) { time = m_TimeStampComposer.ExtractAAVDateTime(frameNo, frameStep, LastOddFieldOSD, LastEvenFieldOSD, out failedReason); LastFailedReason = failedReason; } else { time = m_TimeStampComposer.ExtractDateTime(frameNo, frameStep, LastOddFieldOSD, LastEvenFieldOSD, out failedReason); LastFailedReason = failedReason; } } else { time = DateTime.MinValue; } return(time != DateTime.MinValue); }