Re: [osg-users] memory leak with streaming texture

2008-05-09 Thread Robert Osfield
Hi Alexandre,

Doing a texture-setImage(image) will do unref the old image before
assigning and ref'ing the new one, so memory management should work
just fine.  The memory leak you are percieving is almost certainly not
down to the core OSG code like Texutre::setImage.  I'd recommend that
you double check you own code, and also how you are monitoring the
memory leak, as sometime the memory tracking tools produce false
positives.

As a general comment, I'd also recommend use osg::ImageStream (as
subclass from osg::Image) as a base for streamed images, the xine and
quicktime plugins both have movie reading code that provide their own
subclass from osg:::ImageStream so have a look at these for
inspiration.

Robert.

On Fri, May 9, 2008 at 6:34 PM, alexandre amyot murray
[EMAIL PROTECTED] wrote:
 Hi,

 please forgive my english...

 I'm developping an interractive application where people's movement affect
 the content of a 3D scene. Somewhere in the appication, when people move,
 planty of small insects appears and follow their hands. I modelized these
 insects by a small square plane on wich I apply a sequence of PNG image to
 give them life. I use texture rectangle to display the images. I made my own
 class that manage the sequence of PNG images. So when I make a call to
 MyOwnStreamingClass.getNextFrameToDisplay(), it returns me the next image to
 display.

 To change the image of the textureRectangle of each insect, I do the
 following :

 --   AInsectTextureRectangle.setImage(
 MyOwnStreamingClass.getNextFrameToDisplay() );

 But this way, I got a memory leak. I tought that a call to texture.setImage
 would delete the last image and replace it by the new one., but it don't
 seems to.
 So I try another way to change the image :

 --   osg::Image* nextImage = MyOwnStreamingClass.getNextFrameToDisplay();

 --   osg::Image* textureImage = AInsectTextureRectangle.getImage();
 --   textureImage.setImage( ...,   ...,  nextImage .data(), ... );

 But it doesn't work either, in fact I got a runtime error this way.

 So I would like too know how I should proceed ?

 The PNG images are of size 40x40 and a sequence is made of 100 images. I can
 have like 50 insects at the same time in the scene.

 Thanks in advance

 Alexandre

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] memory leak with streaming texture

2008-05-09 Thread alexandre amyot murray
Hi,

can you give me the procedure to install quicktime plugins for window XP.

I try to generate the project with CMake and the quicktime sdk for windows,
but the project did not generate. I used the QTMLClient.lib in the section
QUICKTIME_LIBRARY.

thanks

Alex

2008/5/9 Robert Osfield [EMAIL PROTECTED]:

 Hi Alexandre,

 Doing a texture-setImage(image) will do unref the old image before
 assigning and ref'ing the new one, so memory management should work
 just fine.  The memory leak you are percieving is almost certainly not
 down to the core OSG code like Texutre::setImage.  I'd recommend that
 you double check you own code, and also how you are monitoring the
 memory leak, as sometime the memory tracking tools produce false
 positives.

 As a general comment, I'd also recommend use osg::ImageStream (as
 subclass from osg::Image) as a base for streamed images, the xine and
 quicktime plugins both have movie reading code that provide their own
 subclass from osg:::ImageStream so have a look at these for
 inspiration.

 Robert.

 On Fri, May 9, 2008 at 6:34 PM, alexandre amyot murray
 [EMAIL PROTECTED] wrote:
  Hi,
 
  please forgive my english...
 
  I'm developping an interractive application where people's movement
 affect
  the content of a 3D scene. Somewhere in the appication, when people move,
  planty of small insects appears and follow their hands. I modelized these
  insects by a small square plane on wich I apply a sequence of PNG image
 to
  give them life. I use texture rectangle to display the images. I made my
 own
  class that manage the sequence of PNG images. So when I make a call to
  MyOwnStreamingClass.getNextFrameToDisplay(), it returns me the next image
 to
  display.
 
  To change the image of the textureRectangle of each insect, I do the
  following :
 
  --   AInsectTextureRectangle.setImage(
  MyOwnStreamingClass.getNextFrameToDisplay() );
 
  But this way, I got a memory leak. I tought that a call to
 texture.setImage
  would delete the last image and replace it by the new one., but it don't
  seems to.
  So I try another way to change the image :
 
  --   osg::Image* nextImage = MyOwnStreamingClass.getNextFrameToDisplay();
 
  --   osg::Image* textureImage = AInsectTextureRectangle.getImage();
  --   textureImage.setImage( ...,   ...,  nextImage .data(), ... );
 
  But it doesn't work either, in fact I got a runtime error this way.
 
  So I would like too know how I should proceed ?
 
  The PNG images are of size 40x40 and a sequence is made of 100 images. I
 can
  have like 50 insects at the same time in the scene.
 
  Thanks in advance
 
  Alexandre
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] memory leak with streaming texture

2008-05-09 Thread Jean-Sébastien Guay

Hello Alex,


can you give me the procedure to install quicktime plugins for window XP.

I try to generate the project with CMake and the quicktime sdk for 
windows, but the project did not generate. I used the QTMLClient.lib in 
the section QUICKTIME_LIBRARY.


I did this a while ago, with the QT 7.1 SDK, as is outlined on the page 
at the following link:

http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio/VisualStudioPlugins

Download [this package] (or the QuickTime SDK from [this page]). 
Install it wherever you want, and then in CMakeSetup specify the 
...\QuickTimeSDK\CIncludes directory in QUICKTIME_INCLUDE_DIR, and 
...\QuickTimeSDK\Libraries\QTMLClient.lib in QUICKTIME_LIBRARY. 
Configure, Generate and build.


It was really that simple. But the QT SDK has probably bumped up a few 
versions since then, so perhaps there are some tweaks that need to be 
done to get it to work well now. I don't know.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org