void MPEG::Seek(int position) { int was_playing = 0; /* Cannot seek past end of file */ if((Uint32)position > system->TotalSize()) return; /* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ /* get info whrether we need to restart playing at the end */ if( GetStatus() == MPEG_PLAYING ) was_playing = 1; if(!seekIntoStream(position)) return; /* If we were playing and not rewind then play again */ if (was_playing) Play(); if (VideoEnabled() && !was_playing) videoaction->RenderFrame(0); if ( pause && VideoEnabled() ) { videoaction->Pause(); } if ( pause && AudioEnabled() ) { audioaction->Pause(); } }
/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ MPEGstatus MPEG::GetStatus(void) { MPEGstatus status; status = MPEG_STOPPED; if ( VideoEnabled() ) { /* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ switch (videoaction->GetStatus()) { case MPEG_PLAYING: status = MPEG_PLAYING; break; default: break; } } if ( AudioEnabled() ) { /* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ switch (audioaction->GetStatus()) { case MPEG_PLAYING: status = MPEG_PLAYING; break; default: break; } } if(status == MPEG_STOPPED && loop && !pause) { /* Here we go again */ Rewind(); Play(); if ( VideoEnabled() ) { /* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ switch (videoaction->GetStatus()) { case MPEG_PLAYING: status = MPEG_PLAYING; break; default: break; } } if ( AudioEnabled() ) { /* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */ switch (audioaction->GetStatus()) { case MPEG_PLAYING: status = MPEG_PLAYING; break; default: break; } } } return(status); }
SMPEG_Filter * MPEG::Filter(SMPEG_Filter * filter) { if ( VideoEnabled() ) { return(videoaction->Filter(filter)); } return 0; }
bool MPEG::SetDisplay(SDL_Surface *dst, SDL_mutex *lock, MPEG_DisplayCallback callback) { if ( VideoEnabled() ) { return(videoaction->SetDisplay(dst, lock, callback)); } return(false); }
void MPEG::RenderFinal(SDL_Surface *dst, int x, int y) { Stop(); if ( VideoEnabled() ) { videoaction->RenderFinal(dst, x, y); } Rewind(); }
void MPEG::Stop(void) { if ( VideoEnabled() ) { videoaction->Stop(); } if ( AudioEnabled() ) { audioaction->Stop(); } }
void MPEG::Play(void) { if ( AudioEnabled() ) { audioaction->Play(); } if ( VideoEnabled() ) { videoaction->Play(); } }
void MPEG::RenderFinal() { Stop(); if ( VideoEnabled() ) { videoaction->RenderFinal(); } Rewind(); }
void MPEG::Pause(void) { pause = !pause; if ( VideoEnabled() ) { videoaction->Pause(); } if ( AudioEnabled() ) { audioaction->Pause(); } }
void MPEG::Skip(float seconds) { if(system->get_stream(SYSTEM_STREAMID)) { system->Skip(seconds); } else { /* No system information in MPEG */ if( VideoEnabled() ) videoaction->Skip(seconds); if( AudioEnabled() ) audioaction->Skip(seconds); } }
void MPEG::RenderFrame(int frame) { if ( VideoEnabled() ) { videoaction->RenderFrame(frame); } }
void MPEG::SetDisplayRegion(int x, int y, int w, int h) { if ( VideoEnabled() ) { videoaction->SetDisplayRegion(x, y, w, h); } }
void MPEG::ScaleDisplayXY(int w, int h) { if ( VideoEnabled() ) { videoaction->ScaleDisplayXY(w, h); } }
void MPEG::MoveDisplay(int x, int y) { if ( VideoEnabled() ) { videoaction->MoveDisplay(x, y); } }
/* MPEG video actions */ bool MPEG::GetVideoInfo(MPEG_VideoInfo *info) { if ( VideoEnabled() ) { return(videoaction->GetVideoInfo(info)); } return(false); }
bool MPEG::SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock) { if ( VideoEnabled() ) { return(videoaction->SetDisplay(callback, data, lock)); } return(false); }