here the code i use to test the leak (the movies and font are under data switching) switching between movies lead to "out of memory":
import processing.opengl.*;
import codeanticode.glgraphics.*;
import javax.media.opengl.*;
import codeanticode.gsvideo.*;
char inChar = '1';
char pre_inChar = '1';
PFont fnt;
GSMovie myMovie;
GLTexture tex;
void setup()
{
size(800, 600, GLConstants.GLGRAPHICS);
// frame.setLocation(0,0);
fnt = loadFont("Alba-48.vlw");
tex = new GLTexture(this);
myMovie = new GSMovie(this, dataPath("") + "4.mov");
myMovie.loop();
}
void draw()
{
background(0);
// println("frameRate: " + frameRate);
if(inChar == '0') {
if(pre_inChar != inChar) {
if(myMovie != null) {
myMovie.stop();
myMovie.delete();
System.gc();
}
}
pre_inChar = inChar;
}
if(inChar == '1') {
if(pre_inChar != inChar) {
if(myMovie != null) {
myMovie.stop();
myMovie.delete();
System.gc();
}
myMovie = new GSMovie(this, dataPath("") + "1.mov");
myMovie.loop();
}
pre_inChar = inChar;
}
if(inChar == '2') {
if(pre_inChar != inChar) {
if(myMovie != null) {
myMovie.stop();
myMovie.delete();
System.gc();
}
myMovie = new GSMovie(this, dataPath("") + "2.mov");
myMovie.loop();
}
pre_inChar = inChar;
}
if(inChar == '3') {
if(pre_inChar != inChar) {
if(myMovie != null) {
myMovie.stop();
myMovie.delete();
System.gc();
}
myMovie = new GSMovie(this, dataPath("") + "3.mov");
myMovie.loop();
}
pre_inChar = inChar;
}
if(myMovie.available()) {
myMovie.read();
// tex = new GLTexture(this);
tex.putPixelsIntoTexture(myMovie);
}
image(tex,0,0);
textFont(fnt,90);
text(inChar,width/2,height/2);
}
void keyPressed() {
inChar = char(key);
}
i tested this code under linux..but the video crash very often with(maybe a gstreamer for linux and movie format):
GSVideo VERSION: 20110203
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb75d89c4, pid=8515, tid=1851718512
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Server VM (14.2-b01 mixed mode linux-x86 )
# Problematic frame:
# C [libc.so.6+0x7b9c4] memcpy+0x34
#
here the full log:
i am running slackware current with gstreamer-0.10.32-i486-1