From 79833fa7045d9438005644fb50e0fe6fa364feec Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 24 Feb 2005 17:07:37 +0000 Subject: [PATCH] Added pause, rewind and play support into xine plugin. --- include/osg/ImageStream | 1 + src/osg/ImageStream.cpp | 2 +- src/osgPlugins/xine/ReaderWriterXine.cpp | 66 +++++++++++++++++++----- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/include/osg/ImageStream b/include/osg/ImageStream index 7f5772afb..5f6f396eb 100644 --- a/include/osg/ImageStream +++ b/include/osg/ImageStream @@ -40,6 +40,7 @@ class SG_EXPORT ImageStream : public Image enum StreamStatus { + INVALID, PLAYING, PAUSED, REWINDING diff --git a/src/osg/ImageStream.cpp b/src/osg/ImageStream.cpp index 841409037..463aa3f16 100644 --- a/src/osg/ImageStream.cpp +++ b/src/osg/ImageStream.cpp @@ -16,7 +16,7 @@ using namespace osg; ImageStream::ImageStream(): - _status(PAUSED), + _status(INVALID), _loopingMode(LOOPING) { setDataVariance(DYNAMIC); diff --git a/src/osgPlugins/xine/ReaderWriterXine.cpp b/src/osgPlugins/xine/ReaderWriterXine.cpp index ac83245ba..4f0f1ca0a 100644 --- a/src/osgPlugins/xine/ReaderWriterXine.cpp +++ b/src/osgPlugins/xine/ReaderWriterXine.cpp @@ -75,24 +75,51 @@ class XineImageStream : public osg::ImageStream virtual void play() { - if (_status!=PLAYING) + if (_status!=PLAYING && _stream) { - osg::notify(osg::NOTICE)<<"XineImageStream::play()"<_ready) { imageStream->allocateImage(width,height,1,pixelFormat,GL_UNSIGNED_BYTE,1); @@ -142,14 +169,22 @@ class XineImageStream : public osg::ImageStream virtual ~XineImageStream() { + osg::notify(osg::NOTICE)<<"Killing XineImageStream"<