summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorniko <niko@google.com>2009-07-16 16:39:53 -0700
committerniko <niko@google.com>2009-07-17 11:31:11 -0700
commit8994837f27e783a10f5cc038a7ae7595aabffdb6 (patch)
treeeb1a0cbb9e4d3c99f65a093574522e0016595046 /include
parent3720cf2de9a86b4fb5583f190b183498f0ad3fc0 (diff)
downloadframeworks_base-8994837f27e783a10f5cc038a7ae7595aabffdb6.zip
frameworks_base-8994837f27e783a10f5cc038a7ae7595aabffdb6.tar.gz
frameworks_base-8994837f27e783a10f5cc038a7ae7595aabffdb6.tar.bz2
Added method to get metadata out of the player.
The method passes a list of metadata ids to be retrieved and a parcel where the metadata records should be appended. If the list of ids is empty, all the metadata should be returned.
Diffstat (limited to 'include')
-rw-r--r--include/media/MediaPlayerInterface.h18
-rw-r--r--include/media/PVPlayer.h2
2 files changed, 18 insertions, 2 deletions
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 9102b40..97d55aa 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -29,7 +29,10 @@
namespace android {
+typedef int32_t MetadataType;
+
class Parcel;
+template<typename T> class SortedVector;
enum player_type {
PV_PLAYER = 1,
@@ -112,12 +115,23 @@ public:
mCookie = cookie; mNotify = notifyFunc; }
// Invoke a generic method on the player by using opaque parcels
// for the request and reply.
+ //
// @param request Parcel that is positioned at the start of the
// data sent by the java layer.
// @param[out] reply Parcel to hold the reply data. Cannot be null.
- // @return OK if the invocation was made successfully. A player
- // not supporting the direct API should return INVALID_OPERATION.
+ // @return OK if the call was successful.
virtual status_t invoke(const Parcel& request, Parcel *reply) = 0;
+
+ // The Client in the MetadataPlayerService calls this method on
+ // the native player to retrieve all or a subset of metadata.
+ //
+ // @param ids SortedList of metadata ID to be fetch. If empty, all
+ // the known metadata should be returned.
+ // @param[inout] records Parcel where the player appends its metadata.
+ // @return OK if the call was successful.
+ virtual status_t getMetadata(const SortedVector<MetadataType>& ids,
+ Parcel *records) = 0;
+
protected:
virtual void sendEvent(int msg, int ext1=0, int ext2=0) { if (mNotify) mNotify(mCookie, msg, ext1, ext2); }
diff --git a/include/media/PVPlayer.h b/include/media/PVPlayer.h
index d8a677f..40ccc14 100644
--- a/include/media/PVPlayer.h
+++ b/include/media/PVPlayer.h
@@ -53,6 +53,8 @@ public:
virtual status_t setLooping(int loop);
virtual player_type playerType() { return PV_PLAYER; }
virtual status_t invoke(const Parcel& request, Parcel *reply);
+ virtual status_t getMetadata(const SortedVector<MetadataType>& ids,
+ Parcel *records);
// make available to PlayerDriver
void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); }