I am doing a semester project which requires me to playback videos as defined in a sequence. So i need to playback 7 to 8 different videos one after the other. i have written a standard 2 player code to playback 3gp videos via streaming. The methods involved in the code are as follows:-
load1(){
// This method is used to load player 1. it has code to create a player from a stream like
clean1();
player1= Manager.createPlayer("URI for 3gp file");
//etc
}
clean1(){
player1.stop();
player1.deallocate();
player1=null;
}
play1(){
player1.start();
load2();
}
So when player 1 is playing player 2 is being loaded.
corresponding methods are defined for player 2 viz load2(), clean2() and play2().
The problem is everytime a video is being played back it takes up around 120KB in system memory although the videos are only 50KB each.
So if i play 10 files the total memory being taken up is around 120*10 KB. I am releasing the resources used by each player by calling the corresponding clean methods but somehow the memory is not being released. Hence when running in real devices (Nokia and Sony ericsson) a memory out of bounds exception is thrown and the code hangs. In most devices (N72, N70, 6630 etc) only 2-3 videos are being played and then the code hangs. The code is running fine in Nokia S60emulator though. Is there any way we can force the player to release it resource so that the memory out of bounds exception can be avoided. Is there any other way in which the code can be written to avoid the memory issues. Please kindly help. Any help would be very much appreciated as the project end date is nearing and i am stuck with this. Please kindly help. Thanks in advance.![]()

Reply With Quote

