Direct api to the native media player.
MediaPlayer.java has 3 new methods:
* newRequest creates a Parcel that can be used to send data to the
native player using invoke.
* invoke issues synchronous calls to the native player using opaque
parcels for the request and reply.
IMediaPlayer.h has 1 new abstract method:
* invoke
The Midi and Vorbis players have a stub for these. So far only PV
makes use of that new feature.
To avoid any copy overhead, the JNI interface uses Parcel as a java
object (no serialization/copy happens at the JNI layer).
The remote interface token is inserted when the Parcel is constructed
in java. That way the parcel is already routable when it reaches
IMediaPlayer.cpp (proxy). No extra copy is needed there.
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index 5a296bf..12f2231 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -187,6 +187,7 @@
virtual status_t setAudioStreamType(int type);
virtual status_t setLooping(int loop);
virtual status_t setVolume(float leftVolume, float rightVolume);
+ virtual status_t invoke(const Parcel& request, Parcel *reply);
sp<MediaPlayerBase> createPlayer(player_type playerType);
status_t setDataSource(const char *url);
@@ -238,4 +239,3 @@
}; // namespace android
#endif // ANDROID_MEDIAPLAYERSERVICE_H
-