diff options
author | Matthew Hoops | 2012-07-27 11:32:51 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-07-27 11:32:51 -0400 |
commit | 991710d0a158bfce4e54bd240482a4e3044271d3 (patch) | |
tree | 749555015d23f0d889f2096a98bd31dcb7c593bf /engines | |
parent | 21d3fa71aff686f5b64361ae3410268fc0ab5968 (diff) | |
download | scummvm-rg350-991710d0a158bfce4e54bd240482a4e3044271d3.tar.gz scummvm-rg350-991710d0a158bfce4e54bd240482a4e3044271d3.tar.bz2 scummvm-rg350-991710d0a158bfce4e54bd240482a4e3044271d3.zip |
VIDEO: Adapt QuickTimeDecoder to the AdvancedVideoDecoder API
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/video.cpp | 13 | ||||
-rw-r--r-- | engines/mohawk/video.h | 4 | ||||
-rw-r--r-- | engines/sci/engine/kvideo.cpp | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 18d609c513..3b4e61646d 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -207,7 +207,7 @@ bool VideoManager::updateMovies() { // Remove any videos that are over if (_videoStreams[i].endOfVideo()) { if (_videoStreams[i].loop) { - _videoStreams[i]->seekToTime(_videoStreams[i].start); + _videoStreams[i]->seek(_videoStreams[i].start); } else { // Check the video time one last time before deleting it _vm->doVideoTimer(i, true); @@ -394,6 +394,8 @@ VideoHandle VideoManager::createVideoHandle(uint16 id, uint16 x, uint16 y, bool entry.loop = loop; entry.enabled = true; + entry->start(); + // Search for any deleted videos so we can take a formerly used slot for (uint32 i = 0; i < _videoStreams.size(); i++) if (!_videoStreams[i].video) { @@ -430,6 +432,7 @@ VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint entry->loadStream(file); entry->setVolume(volume); + entry->start(); // Search for any deleted videos so we can take a formerly used slot for (uint32 i = 0; i < _videoStreams.size(); i++) @@ -492,7 +495,7 @@ uint32 VideoManager::getTime(VideoHandle handle) { uint32 VideoManager::getDuration(VideoHandle handle) { assert(handle != NULL_VID_HANDLE); - return _videoStreams[handle]->getDuration(); + return _videoStreams[handle]->getDuration().msecs(); } bool VideoManager::endOfVideo(VideoHandle handle) { @@ -512,13 +515,13 @@ void VideoManager::setVideoBounds(VideoHandle handle, Audio::Timestamp start, Au assert(handle != NULL_VID_HANDLE); _videoStreams[handle].start = start; _videoStreams[handle].end = end; - _videoStreams[handle]->seekToTime(start); + _videoStreams[handle]->seek(start); } void VideoManager::drawVideoFrame(VideoHandle handle, Audio::Timestamp time) { assert(handle != NULL_VID_HANDLE); _videoStreams[handle].end = Audio::Timestamp(0xffffffff, 1); - _videoStreams[handle]->seekToTime(time); + _videoStreams[handle]->seek(time); updateMovies(); delete _videoStreams[handle].video; _videoStreams[handle].clear(); @@ -526,7 +529,7 @@ void VideoManager::drawVideoFrame(VideoHandle handle, Audio::Timestamp time) { void VideoManager::seekToTime(VideoHandle handle, Audio::Timestamp time) { assert(handle != NULL_VID_HANDLE); - _videoStreams[handle]->seekToTime(time); + _videoStreams[handle]->seek(time); } void VideoManager::setVideoLooping(VideoHandle handle, bool loop) { diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index 98bcadfb53..937cd0f2dd 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -45,7 +45,7 @@ struct MLSTRecord { struct VideoEntry { // Playback variables - Video::SeekableVideoDecoder *video; + Video::AdvancedVideoDecoder *video; uint16 x; uint16 y; bool loop; @@ -57,7 +57,7 @@ struct VideoEntry { int id; // Internal Mohawk files // Helper functions - Video::SeekableVideoDecoder *operator->() const { assert(video); return video; } // TODO: Remove this eventually + Video::AdvancedVideoDecoder *operator->() const { assert(video); return video; } // TODO: Remove this eventually void clear(); bool endOfVideo(); }; diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 456f860493..da63aa3a8d 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -170,8 +170,6 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { delete videoDecoder; videoDecoder = 0; } - - ((Video::AdvancedVideoDecoder *)videoDecoder)->start(); // TODO: Remove after new API is complete } } else { // Windows AVI @@ -212,7 +210,6 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { videoDecoder = 0; } else { s->_videoState.fileName = filename; - ((Video::AdvancedVideoDecoder *)videoDecoder)->start(); } break; } @@ -222,6 +219,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { } if (videoDecoder) { + ((Video::AdvancedVideoDecoder *)videoDecoder)->start(); // TODO: Remove after new API is complete playVideo(videoDecoder, s->_videoState); // HACK: Switch back to 8bpp if we played a true color video. |