How to Intercept Data Read/Write from MediaPlayer

113 views
Skip to first unread message

James SDC

unread,
Oct 27, 2009, 2:31:00 PM10/27/09
to android-ndk
Hi,

I am trying to find a way to intercept the data read/write from
MediaPlayer. As what I understand, take a video player as an example,
we can use the Android Widget class "VideoView" to playback a video,
and use MediaPlayer to control the process of the playback. However,
we bascially cannot intercept the data read/write.

My intention is to redirect the MediaPlayer to call my file read/write
for playback.

Is there any way to intercept data read/write from MediaPlayer, or
does NDK provide any APIs for media playback?

Thanks in advance.
James.

Mine

unread,
Oct 29, 2009, 3:45:32 AM10/29/09
to andro...@googlegroups.com
As I know MediaPlayer doesn't provide such read/write method.
For audio, you can use AudioTrack class to play the audio data (which is in PCM format). Typical use case is, application call JNI functions to get the audio data, and write it to AudioTrack to produce sound.

James SDC

unread,
Oct 30, 2009, 6:23:58 PM10/30/09
to android-ndk
Thank you very much for your information, Mine.

James.
> > James.- Hide quoted text -
>
> - Show quoted text -

Kevin

unread,
Nov 20, 2009, 7:19:27 PM11/20/09
to android-ndk
I am pushing for better audio support in the NDK, see Android Bug
3434.
http://code.google.com/p/android/issues/detail?id=3434

Kevin
Reply all
Reply to author
Forward
0 new messages