/* 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 ();
}
/* 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 ();
}
Example #3
0
	bool DirectShowMovieTexture::isPlayingMovie()
	{
		OAFilterState pfs;
		HRESULT hr;

		if (dsdata->pEvent!=NULL){
			long ev, p1, p2;


			while (E_ABORT!=dsdata->pEvent->GetEvent(&ev, &p1, &p2, 0)){
				// check for completion
				if (ev==EC_COMPLETE)
				{
					pauseMovie();
					return false;
				}

				// release event params
				hr=dsdata->pEvent->FreeEventParams(ev, p1, p2);
				if (FAILED(hr))
				{
					pauseMovie();
					return false;
				}
			}
		}

		// get the running state!
		if (dsdata->pControl!=NULL)
		{
			hr=dsdata->pControl->GetState(0, &pfs);
			if (FAILED(hr))
			{
				pauseMovie();
				return false;
			}

			return pfs==State_Running;
		}

		// it hasn't even been initialized!
		return false;
	}