예제 #1
0
EXPORT void CALL RomOpen(void)
{
#ifdef DEBUGON
//	_break();
#endif

   InitConfiguration();

    if( g_CritialSection.IsLocked() )
    {
        g_CritialSection.Unlock();
        TRACE0("g_CritialSection is locked when game is starting, unlock it now.");
    }
    status.bDisableFPS=false;

#if defined(__GX__)
# ifdef USE_EXPANSION
   g_dwRamSize = 0x800000;
# else
   g_dwRamSize = 0x400000;
# endif
#else //__GX__
   g_dwRamSize = 0x800000;
#endif //!__GX__
    
#ifdef _DEBUG
    if( debuggerPause )
    {
        debuggerPause = FALSE;
        usleep(100 * 1000);
    }
#endif

#ifdef USING_THREAD
    uint32 threadID;
    for(int i = 0; i < 5; i++) 
    { 
        threadMsg[i] = CreateEvent( NULL, FALSE, FALSE, NULL );
        if (threadMsg[i] == NULL)
        { 
            ErrorMsg( "Error creating thread message events");
            return;
        } 
    } 
    threadFinished = CreateEvent( NULL, FALSE, FALSE, NULL );
    if (threadFinished == NULL)
    { 
        ErrorMsg( "Error creating video thread finished event");
        return;
    } 
    videoThread = CreateThread( NULL, 4096, VideoThreadProc, NULL, NULL, &threadID );

#else
    StartVideo();
#endif

#ifdef __GX__
	VIDEO_SetPreRetraceCallback(VI_GX_PreRetraceCallback);
#endif // __GX__
}
예제 #2
0
void CKaraokeWindowBackground::StartDefault()
{
  // just in case
  m_ImgControl->SetVisible( false );
  m_VisControl->SetVisible( false );

  switch ( m_defaultMode )
  {
    case BACKGROUND_VISUALISATION:
      StartVisualisation();
      break;

    case BACKGROUND_IMAGE:
      StartImage( m_path );
      break;

    case BACKGROUND_VIDEO:
      StartVideo( m_path, m_videoLastTime );

      if ( m_currentMode == BACKGROUND_VIDEO )
        m_playingDefaultVideo = true;
      break;

    default:
      StartEmpty();
      break;
  }
}
예제 #3
0
j_result_t CRealPlayObj::PlayMedia(j_wnd_t hWnd, j_int32_t nDevid)
{
	StartVideo(nDevid);
	JoPlayerFactory->GetPlayer(m_nSocket, m_playerType.c_str())->Play(hWnd);
	
	return J_OK;
}
예제 #4
0
void CKaraokeWindowBackground::NextVideo()
{
  // This function should not be called directly from the callback! Deadlock!!!
  m_videoPlayer->CloseFile();

  // Only one video selected, restarting
  m_videoLastTime = 0;

  EnterCriticalSection( m_CritSectionVideoEnded );
  m_videoEnded = false;
  LeaveCriticalSection( m_CritSectionVideoEnded );

  StartVideo( m_path, m_videoLastTime );
  CLog::Log( LOGDEBUG, "KaraokeVideoBackground: restarting video from the beginning" );
}
예제 #5
0
//BOOL SwitchToThread(VOID);
uint32 VideoThreadProc( LPVOID lpParameter )
{
    BOOL res;

    StartVideo();
    SetEvent( threadFinished );

    while(true)
    {
        switch (WaitForMultipleObjects( 5, threadMsg, FALSE, INFINITE ))
        {
        case (WAIT_OBJECT_0 + RSPMSG_PROCESSDLIST):
            ProcessDListStep2();
            SetEvent( threadFinished );
            break;
        case (WAIT_OBJECT_0 + RSPMSG_SWAPBUFFERS):
            //res = SwitchToThread();
            //Sleep(1);
            UpdateScreenStep2();
            SetEvent( threadFinished );
            break;
        case (WAIT_OBJECT_0 + RSPMSG_CLOSE):
            StopVideo();
            SetEvent( threadFinished );
            return 1;
        case (WAIT_OBJECT_0 + RSPMSG_CHANGEWINDOW):
            ChangeWindowStep2();
            SetEvent( threadFinished );
            break;
        case (WAIT_OBJECT_0 + RSPMSG_PROCESSRDPLIST):
            try
            {
                RDP_DLParser_Process();
            }
            catch (...)
            {
                ErrorMsg("Unknown Error in ProcessRDPList");
                //TriggerDPInterrupt();
                //TriggerSPInterrupt();
            }
            SetEvent( threadFinished );
            break;
        }
    }
    return 0;
}
예제 #6
0
int CRealMediaObj::Process(J_AsioDataBase &asioData)
{
	int nRet = J_OK;
	J_CommandFilter *videoCommand = dynamic_cast<J_CommandFilter *>(m_pObj);
	if (videoCommand != NULL)
	{
		if (asioData.ioCall == J_AsioDataBase::j_read_e)
		{
			m_resid = videoCommand->GetResid();
			switch (videoCommand->GetCommandType())
			{
			case jo_start_real:
				nRet = StartVideo();
				J_OS::LOGINFO("CRealMediaObj::Process StartVideo socket =  %d ret = %d", m_nSocket.sock, nRet);
				break;
			case jo_stop_real:
			{
				nRet = StopVideo();
				J_OS::LOGINFO("CRealMediaObj::Process StopVideo socket =  %d ret = %d", m_nSocket.sock, nRet);
				break;
			}
			default:
				J_OS::LOGINFO("CRealMediaObj::Process CommandType unkown type =  %d", videoCommand->GetCommandType());
				break;
			}
		}
		else if (asioData.ioCall == J_AsioDataBase::j_write_e)
		{
			if (!m_bStart)
			{
				J_OS::LOGINFO("CRealMediaObj::Process !m_bStart socket = %d", m_nSocket.sock);
				return J_OK;
			}
			return OnWriteData(asioData);
		}
	}

	return nRet;
}
예제 #7
0
int riceRomOpen(void)
{
    /* Read RiceVideoLinux.ini file, set up internal variables by reading values from core configuration API */
    LoadConfiguration();

    status.bDisableFPS=false;

   g_dwRamSize = 0x800000;
    
#ifdef DEBUGGER
    if( debuggerPause )
    {
        debuggerPause = false;
        usleep(100 * 1000);
    }
#endif

    if (!StartVideo())
        return 0;

    return 1;
}