Hey experts,
The following issue was in a document by nokia on its forum site,
(document's name: Developer Platform 2.0: Known Issues)
Overview: If you have released resources by using the deallocate()
method, you cannot use the prefetch() method anymore to get the player
to PREFETCHED state.
Reported: against Series 60 Developer Platform 1.0 and 2nd Edition
Date identified: April 21, 2005
Symptoms: -
Detailed description: A Player has five states: UNREALIZED, REALIZED,
PREFETCHED, STARTED, and CLOSED. If the player is in PREFETCHED state,
you can release the reserved resources by calling the deallocate()
method. After that you cannot prefetch the resources anymore. If you
call the prefetch() method after calling the deallocate() method, you
will get MediaException. Note that this concerns Series 60 devices.
Calling prefetch() is working in Series 40 devices with the MMAPI
implementation.
How to reproduce: If your player is in the PREFETCHED state, call
deallocate() and after that call prefetch().
Solution: If your player is in PREFETCHED state, don?t call
deallocate() and after that the prefetch() method.
I had this problem in a MIDlet program, so I removed any call for
deallocate() in the program, but I still had this problem in the
following piece of code:
player = Manager.createPlayer("capture://audio?encoding=amr");
player.realize();
rc = (RecordControl)player.getControl("RecordControl");
output = new ByteArrayOutputStream();
rc.setRecordStream(output);
player.prefetch();
player.start();
rc.startRecord();
A MediaException is occuring in the mobile at the player.preftech()
statement although the flow of the state of the player is as follows:
UNREALIZED->REALIZED
->PREFETCHED (i.e. there is no place where the state goes back from
PREFETCHED to REALIZED), but the problem is still occuring!!..any help
on this??
P.S.: The price of the question can be added upon need |