Example #1
0
void CWndMovie::NextMovie ()
{

	if (m_mciDevID != 0)
		CloseMovie ();

	// start the next movie
	if ( m_lstFiles.GetCount () > 0 )
		{
		try
			{
			theApp.Log ( "Play movie" );
			char * pFile = m_lstFiles.RemoveHead ();

			OpenMovie ( pFile );
			delete [] pFile;
			}
		catch (...)
			{
			Quit ();
			}
		}
	else
		Quit ();
}
FMediaFoundationMovieStreamer::~FMediaFoundationMovieStreamer()
{
	CloseMovie();
	CleanupRenderingResources();

	TextureFreeList.Empty();
}
Example #3
0
void CWndMovie::OnDestroy()
{

	if (theApp.m_wndMain.GetProgPos () == CWndMain::movie)
		theApp.m_wndMain.SetProgPos ( CWndMain::playing );

	m_bInDestroy = TRUE;

	if (m_mciDevID != 0)
		CloseMovie ();

	if ( m_MainmciDevID != 0 )
		{
		MCI_GENERIC_PARMS mgp;
		memset (&mgp, 0, sizeof (mgp) );
		mciSendCommand (m_MainmciDevID, MCI_CLOSE, 0, (DWORD) &mgp );
		}
}
Example #4
0
LRESULT CWndMovie::OnMMMsg (WPARAM wParam, LPARAM lParam)
{

	switch ( wParam )
	  {
		case MCI_NOTIFY_SUCCESSFUL :
			theApp.Log ( "Movie ended" );
			CloseMovie ();
			if ( m_lstFiles.GetCount () > 0 )
				{
				NextMovie ();
				break;
				}

			Quit ();
			break;
	  }

	return (0);
}
Example #5
0
void CWndMovie::Quit ()
{

	theApp.Log ( "Ending movie player" );
	m_bInDestroy = TRUE;

	if (m_mciDevID != 0)
		CloseMovie ();

	if ( m_MainmciDevID != 0 )
		{
		MCI_GENERIC_PARMS mgp;
		memset (&mgp, 0, sizeof (mgp) );
		mciSendCommand (m_MainmciDevID, MCI_CLOSE, 0, (DWORD) &mgp );
		}

	theApp.m_wndMain.SetProgPos ( CWndMain::playing );
	theApp.m_wndMain.ShowWindow (SW_SHOW);
	theApp.m_wndMain.InvalidateRect (NULL);

	if ( m_bStartMusic )
		{
		m_bStartMusic = FALSE;
		theMusicPlayer.OnActivate ( TRUE );
		}

	if ( m_hWnd == NULL )
		{
		ShowCursor ( TRUE );
		theApp.PostIntro ();
		}
	else
		DestroyWindow ();

#ifdef BUGBUG
	if ( ( ! m_bShowLic ) || theApp.IsShareware () )
		theApp.PostIntro ();
#endif

	theApp.Log ( "Exiting movie player" );
}
bool FMediaFoundationMovieStreamer::Tick(float DeltaTime)
{
    FSlateTexture2DRHIRef* CurrentTexture = Texture.Get();

    if ((CurrentTexture != nullptr) && SampleGrabberCallback->GetIsSampleReadyToUpdate())
    {
        check( IsInRenderingThread() );

        if( !CurrentTexture->IsInitialized() )
        {
            CurrentTexture->InitResource();
        }

        uint32 Stride;
        uint8* DestTextureData = (uint8*)RHILockTexture2D( CurrentTexture->GetTypedResource(), 0, RLM_WriteOnly, Stride, false );
        FMemory::Memcpy( DestTextureData, TextureData.GetData(), TextureData.Num() );
        RHIUnlockTexture2D( CurrentTexture->GetTypedResource(), 0, false );

        SampleGrabberCallback->SetNeedNewSample();
    }

    if (!VideoPlayer->MovieIsRunning())
    {
        CloseMovie();
        if (StoredMoviePaths.Num() > 0)
        {
            OpenNextMovie();
        }
        else
        {
            return true;
        }
    }

    return false;
}
void FMediaFoundationMovieStreamer::ForceCompletion()
{
    CloseMovie();
}