hi

by checking the code in opencore
if i try to do video playback
MediaPlayer.setDisplay() needs to be called before
MediaPlayer.prepareAsync()

but while playing, if i press HOME key and run the APK again
the surfaceDestroyed() and surfaceCreated() of SurfaceHolder.Callback
will be called respectively
and a new SurfaceHolder has been assigned in last surfaceCreated()
so i need to call setDisplay() and prepareAsync() again to make the
video frame can be displayed on newer LayerBuffer

now comes my question:
what should i call before calling last prepareAsync() ??

refer to the state machine of MediaPlayer,
at least I should call MediaPlayer.stop() to enter STOPPED state
(i try to avoid do 'new MediaPlayer()' here......
basically i try to make the video playback starts from where it left
)

but in the end i found i need to call MediaPlayer.reset() to IDLE
state
(so i need to call setDataSource again)

and it seems it's caused in opencore/android/playerdriver.cpp
mSurface is cleared only in reset()

if not calling reset()
the video frame cannot be displayed
because in SurfaceFlinger,
the SurfaceBuffer of the LayerBuffer cannot update buffer because its
owner(mOwner) has been set to 0


so i would like to ask about the state transition of MediaPlayer when
doing video playback


thanks




-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to