I want to find out the way that MMAPI play media through InputStream.
So I made an adapter to wrap the real InputStream:
InputStream is = getClass().getResourceAsStream("x.mpg");
mis = new MyInputStream(is);
p = Manager.createPlayer(mis, "video/mpeg");
I run the code on Emulator.
class MyInputStream simply wraps InputStream and make some output to help me find which InputStream method is called and when called.
When p.realize() is called, as a result, the InputStream.read() is called many times, and I find that all data in x.mpg is read. After realize returned , no more stream method called.
There must be a large buffer to hold the data, but on real device, its imposible.
So I'm wondering what happens on real device. Will the data be read only when needed? Read some data, play it , then read more, then play?
And how about CreatePlayer through http?