本文整理汇总了C++中video::VideoDecoder::loadStream方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoDecoder::loadStream方法的具体用法?C++ VideoDecoder::loadStream怎么用?C++ VideoDecoder::loadStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video::VideoDecoder
的用法示例。
在下文中一共展示了VideoDecoder::loadStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Video::VideoDecoder *ZVision::loadAnimation(const Common::String &fileName) {
Common::String tmpFileName = fileName;
tmpFileName.toLowercase();
Video::VideoDecoder *animation = NULL;
if (tmpFileName.hasSuffix(".rlf"))
animation = new RLFDecoder();
else if (tmpFileName.hasSuffix(".avi"))
animation = new ZorkAVIDecoder();
#ifdef USE_MPEG2
else if (tmpFileName.hasSuffix(".vob"))
animation = new Video::MPEGPSDecoder();
#endif
else
error("Unknown suffix for animation %s", fileName.c_str());
Common::File *_file = getSearchManager()->openFile(tmpFileName);
if (!_file)
error("Error opening %s", tmpFileName.c_str());
bool loaded = animation->loadStream(_file);
if (!loaded)
error("Error loading animation %s", tmpFileName.c_str());
return animation;
}
示例2: open
VideoEntryPtr VideoManager::open(const Common::String &fileName, Audio::Mixer::SoundType soundType) {
// If this video is already playing, return that entry
VideoEntryPtr oldVideo = findVideo(fileName);
if (oldVideo)
return oldVideo;
// Otherwise, create a new entry
Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(fileName);
if (!stream)
return VideoEntryPtr();
Video::VideoDecoder *video = new Video::QuickTimeDecoder();
video->setSoundType(soundType);
if (!video->loadStream(stream)) {
// FIXME: Better error handling
delete video;
return VideoEntryPtr();
}
// Create the entry
VideoEntryPtr entry(new VideoEntry(video, fileName));
// Enable dither if necessary
checkEnableDither(entry);
// Add it to the video list
_videos.push_back(entry);
return entry;
}