Search code examples
javamobilejava-menokia

What do realize() and prefetch() mean exactly?


What do realize() and prefetch() mean exactly?

for Audio files:

InputStream is = getClass().getResourceAsStream("/SMS.mp3");
player = Manager.createPlayer(is,"audio/mpeg")
player.realize();
player.prefetch();
player.start();

for Camera...

player = Manager.createPlayer("capture://video");
player.realize();
videoControl = (VideoControl)player.getControl("VideoControl");
Canvas canvas = new VLCCanvas( videoControl);
d.setCurrent(canvas);
player.start();

so here in the above code some times it uses only realize() and some times prefetch() too. But what does that mean?


Solution

  • You should probably look at the API docs which talk about exactly this. I imagine that the API is flexible and can execute uncalled state transitions when a later one is specified to be executed (i.e., realisation without prefetch being called first).