Example #1
0
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();
  }
}
Example #2
0
/* 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);
}
Example #3
0
SMPEG_Filter * MPEG::Filter(SMPEG_Filter * filter)
{
  if ( VideoEnabled() ) {
    return(videoaction->Filter(filter));
  }
  return 0;
}
Example #4
0
bool MPEG::SetDisplay(SDL_Surface *dst, SDL_mutex *lock,
		MPEG_DisplayCallback callback) {
  if ( VideoEnabled() ) {
    return(videoaction->SetDisplay(dst, lock, callback));
  }
  return(false);
}
Example #5
0
void MPEG::RenderFinal(SDL_Surface *dst, int x, int y)
{
    Stop();
    if ( VideoEnabled() ) {
        videoaction->RenderFinal(dst, x, y);
    }
    Rewind();
}
Example #6
0
void MPEG::Stop(void) {
  if ( VideoEnabled() ) {
    videoaction->Stop();
  }
  if ( AudioEnabled() ) {
    audioaction->Stop();
  }
}
Example #7
0
void MPEG::Play(void) {
  if ( AudioEnabled() ) {
    audioaction->Play();
  }
  if ( VideoEnabled() ) {
    videoaction->Play();
  }
}
Example #8
0
void MPEG::RenderFinal()
{
    Stop();
    if ( VideoEnabled() ) {
        videoaction->RenderFinal();
    }
    Rewind();
}
Example #9
0
void MPEG::Pause(void) {
  pause = !pause;

  if ( VideoEnabled() ) {
    videoaction->Pause();
  }
  if ( AudioEnabled() ) {
    audioaction->Pause();
  }
}
Example #10
0
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);
  }
}
Example #11
0
void MPEG::RenderFrame(int frame)
{
    if ( VideoEnabled() ) {
        videoaction->RenderFrame(frame);
    }
}
Example #12
0
void MPEG::SetDisplayRegion(int x, int y, int w, int h) {
  if ( VideoEnabled() ) {
    videoaction->SetDisplayRegion(x, y, w, h);
  }
}
Example #13
0
void MPEG::ScaleDisplayXY(int w, int h) {
  if ( VideoEnabled() ) {
    videoaction->ScaleDisplayXY(w, h);
  }
}
Example #14
0
void MPEG::MoveDisplay(int x, int y) {
  if ( VideoEnabled() ) {
    videoaction->MoveDisplay(x, y);
  }
}
Example #15
0
/* MPEG video actions */
bool MPEG::GetVideoInfo(MPEG_VideoInfo *info) {
  if ( VideoEnabled() ) {
    return(videoaction->GetVideoInfo(info));
  }
  return(false);
}
Example #16
0
bool MPEG::SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock) {
  if ( VideoEnabled() ) {
    return(videoaction->SetDisplay(callback, data, lock));
  }
  return(false);
}