From 8dc8dcb95f3650fc1007ed836290b4f99be6df10 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 12 Sep 2005 19:42:36 +0000 Subject: [PATCH] Added querry of video size during open() call and associated allocImage to ensure that the imagestream passed back is of a valid size. --- src/osgPlugins/xine/ReaderWriterXine.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/xine/ReaderWriterXine.cpp b/src/osgPlugins/xine/ReaderWriterXine.cpp index 083829994..1475d6668 100644 --- a/src/osgPlugins/xine/ReaderWriterXine.cpp +++ b/src/osgPlugins/xine/ReaderWriterXine.cpp @@ -79,8 +79,15 @@ class XineImageStream : public osg::ImageStream close(); return false; } - + + _ready = false; + + int width = xine_get_stream_info(_stream,XINE_STREAM_INFO_VIDEO_WIDTH); + int height = xine_get_stream_info(_stream,XINE_STREAM_INFO_VIDEO_HEIGHT); + allocateImage(width,height,1,GL_RGB,GL_UNSIGNED_BYTE,1); + + osg::notify(osg::INFO)<<"XineImageStream::open() size "<data(),data,imageStream->getTotalSizeInBytes()); - osg::notify(osg::NOTICE)<<"image memcpy size="<getTotalSizeInBytes()<<" time="<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<dirty();