mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 04:39:45 +00:00
Updates to C++ typing, integrate movie playing into plClient.
This version compiles, but does not render movies. WIP. (Has some rearranged message registration in StartInit() for testing)
This commit is contained in:
@ -245,8 +245,10 @@ bool plMoviePlayer::ILoadAudio()
|
||||
{
|
||||
#ifdef PLASMA_USE_WEBM
|
||||
// Fetch audio track information
|
||||
if (!fAudioTrack.get())
|
||||
if (!fAudioTrack.get()) {
|
||||
hsStatusMessage("Movie ILoadAudio fAudioTrack NIL\n");
|
||||
return false;
|
||||
}
|
||||
const mkvparser::AudioTrack* audio = static_cast<const mkvparser::AudioTrack*>(fAudioTrack->GetTrack());
|
||||
plWAVHeader header;
|
||||
header.fFormatTag = plWAVHeader::kPCMFormatTag;
|
||||
@ -346,6 +348,7 @@ bool plMoviePlayer::Start()
|
||||
if (!IOpenMovie())
|
||||
return false;
|
||||
hsAssert(fVideoTrack, "nil video track -- expect bad things to happen!");
|
||||
hsStatusMessageF("Opened movie %s\n", fMoviePath);
|
||||
|
||||
// Initialize VPX
|
||||
const mkvparser::VideoTrack* video = static_cast<const mkvparser::VideoTrack*>(fVideoTrack->GetTrack());
|
||||
@ -353,19 +356,26 @@ bool plMoviePlayer::Start()
|
||||
plStatusLog::AddLineS("movie.log", "%s: Not a VP9 video track!", fMoviePath);
|
||||
return false;
|
||||
}
|
||||
hsStatusMessageF("... movie track selected, codec: %s\n", video->GetCodecId());
|
||||
|
||||
if (VPX* vpx = VPX::Create())
|
||||
fVpx.reset(vpx);
|
||||
else
|
||||
return false;
|
||||
|
||||
// Decode the audio track and load it into a sound buffer
|
||||
if (!ILoadAudio())
|
||||
if (!ILoadAudio()) {
|
||||
hsStatusMessage("... movie audio track load failed\n");
|
||||
return false;
|
||||
}
|
||||
hsStatusMessage("... movie audio track buffered\n");
|
||||
|
||||
|
||||
fLastFrameTime = static_cast<Int64>(hsTimer::GetMilliSeconds());
|
||||
fAudioSound->Play();
|
||||
fPlaying = true;
|
||||
|
||||
hsStatusMessage("... plMoviePlayer::Start() returns\n");
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user