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/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h
index 207e4e7..f6faf14 100644
--- a/include/media/IMediaPlayerService.h
+++ b/include/media/IMediaPlayerService.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_IMEDIAPLAYERSERVICE_H
#define ANDROID_IMEDIAPLAYERSERVICE_H
+#include <utils/Errors.h> // for status_t
#include <utils/RefBase.h>
#include <binder/IInterface.h>
#include <binder/Parcel.h>
@@ -36,7 +37,6 @@
virtual sp<IMediaRecorder> createMediaRecorder(pid_t pid) = 0;
virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0;
-
virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, const char* url) = 0;
virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) = 0;
virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;