/* Forks a process to run in background and * * 1) Listen for server broadcasting its play time * * 2) Listen for clients indicating that they are ready to run * */ void OMXPlayerSync::start ( bool m_pause ) { // Pause movie, unpause later via tcp communication if ( syncType == SYNC_SERVER ) { if( m_pause ) { pause = true; printf( "%d: Pause\n", port ); pauseMovie(); } printf("%d: Connect\n", port); setUpConnection (); printf("%d: Sync\n", port); syncServer (); unpauseMovie(); printf("%d: Broadcast\n", port); ServerBcast(); } else { //Client printf("%d: Pause\n", port); pauseMovie (); pause = true; printf("%d: Connect\n", port); setUpConnection (); printf("%d: Sync\n", port); syncClient ( false ); printf("%d: Unpause\n", port); unpauseMovie (); } printf("%d: Go\n", port); displayVerbose (); }
void OMXPlayerSync::update ( int src_alpha ) { if( ( syncType == SYNC_SERVER ) ) { alpha = src_alpha; syncServer(); } if ( updateTicker >= UPDATE_THRESHOLD ) { if( ( syncType == SYNC_CLIENT ) ) { // printf( "\r%d = ", updateTicker ); syncClient( true ); updateJitter (); updateSpeed (); } updateTicker = 0; displayVerbose (); } else { syncClient( false ); updateTicker++; } }
/* Forks a process to run in background and * * 1) Listen for server broadcasting its play time * * 2) Listen for clients indicating that they are ready to run * */ void OMXPlayerSync::start () { // Pause movie, unpause later via tcp communication pauseMovie (); setUpConnection (); syncWithServer (); unpauseMovie (); displayVerbose (); }
void OMXPlayerSync::update () { if ( updateTicker >= UPDATE_THRESHOLD ) { syncWithServer (); if ( syncType == SYNC_CLIENT ) { updateJitter (); updateSpeed (); } updateTicker = 0; displayVerbose (); } else { updateTicker++; } }