bool MythDVDPlayer::HasReachedEof(void) const { EofState eof = GetEof(); if (eof != kEofStateNone && !allpaused) return true; // DeleteMap and EditMode from the parent MythPlayer should not be // relevant here. return false; }
const char *MIDDATAFile::GetLastLine() { // Return NULL if EOF if(GetEof()) { return NULL; } else if (m_eAccessMode == TABRead) { // printf("%s\n",m_szLastRead); return m_szLastRead; } // We should never get here (Read/Write mode not implemented) CPLAssert(FALSE); return NULL; }
void main(void) { uint8_t i = 0; uint8_t c = 0; uint8_t d = 0; P0 = 0xAA; SetId(HOST, 0xDD); SendEof(HOST, T51_READY); ResetRx(HOST); SetId(PICC, 0xEE); ResetRx(PICC); while(1) { if(GetEof(PICC)) { c = GetRxCount(PICC); MifareProcessCmd(); SendEof(HOST,0xAE); ResetRx(PICC); } } }
bool MythCommFlagPlayer::RebuildSeekTable( bool showPercentage, StatusCallback cb, void* cbData) { int percentage = 0; uint64_t myFramesPlayed = 0, pmap_first = 0, pmap_last = 0; killdecoder = false; framesPlayed = 0; using_null_videoout = true; // clear out any existing seektables player_ctx->LockPlayingInfo(__FILE__, __LINE__); if (player_ctx->playingInfo) { player_ctx->playingInfo->ClearPositionMap(MARK_KEYFRAME); player_ctx->playingInfo->ClearPositionMap(MARK_GOP_START); player_ctx->playingInfo->ClearPositionMap(MARK_GOP_BYFRAME); } player_ctx->UnlockPlayingInfo(__FILE__, __LINE__); if (OpenFile() < 0) return false; SetPlaying(true); if (!InitVideo()) { VERBOSE(VB_IMPORTANT, LOC_ERR + "RebuildSeekTable unable to initialize video"); SetPlaying(false); return false; } ClearAfterSeek(); int save_timeout = 1001; MythTimer flagTime, ui_timer, inuse_timer, save_timer; flagTime.start(); ui_timer.start(); inuse_timer.start(); save_timer.start(); DecoderGetFrame(kDecodeNothing,true); if (showPercentage) { if (totalFrames) printf(" "); else printf(" "); fflush( stdout ); } int prevperc = -1; while (!GetEof()) { if (inuse_timer.elapsed() > 2534) { inuse_timer.restart(); player_ctx->LockPlayingInfo(__FILE__, __LINE__); if (player_ctx->playingInfo) player_ctx->playingInfo->UpdateInUseMark(); player_ctx->UnlockPlayingInfo(__FILE__, __LINE__); } if (save_timer.elapsed() > save_timeout) { // Give DB some breathing room if it gets far behind.. if (myFramesPlayed - pmap_last > 5000) usleep(200 * 1000); // If we're already saving, just save a larger block next time.. if (RebuildSaver::GetCount(decoder) < 1) { pmap_last = myFramesPlayed; QThreadPool::globalInstance()->start( new RebuildSaver(decoder, pmap_first, pmap_last)); pmap_first = pmap_last + 1; } save_timer.restart(); } if (ui_timer.elapsed() > 98) { ui_timer.restart(); if (totalFrames) { float elapsed = flagTime.elapsed() * 0.001f; int flagFPS = (elapsed > 0.0f) ? (int)(myFramesPlayed / elapsed) : 0; percentage = myFramesPlayed * 100 / totalFrames; if (cb) (*cb)(percentage, cbData); if (showPercentage) { printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b" ); printf( "%3d%%/%5dfps", percentage, flagFPS ); fflush( stdout ); } if (percentage % 10 == 0 && prevperc != percentage) { prevperc = percentage; VERBOSE(VB_GENERAL, QString("%1%/%2""fps") .arg(percentage).arg(flagFPS)); } } else { if (showPercentage) { printf( "\b\b\b\b\b\b" ); printf( "%6lld", (long long)myFramesPlayed ); fflush( stdout ); } if (myFramesPlayed % 1000 == 0) VERBOSE(VB_GENERAL, QString("%1").arg(myFramesPlayed)); } } if (DecoderGetFrame(kDecodeNothing,true)) myFramesPlayed = decoder->GetFramesRead(); } if (showPercentage) { if (totalFrames) printf( "\b\b\b\b\b\b\b" ); printf( "\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b" ); fflush( stdout ); } SaveTotalDuration(); SetPlaying(false); killdecoder = true; QThreadPool::globalInstance()->start( new RebuildSaver(decoder, pmap_first, myFramesPlayed)); RebuildSaver::Wait(decoder); return true; }