diff options
author | Nicolas Catania <niko@google.com> | 2009-07-09 09:21:33 -0700 |
---|---|---|
committer | Nicolas Catania <niko@google.com> | 2009-07-10 11:00:42 -0700 |
commit | 5d55c7119820ee9bb06fc072e416fe98ba77cd28 (patch) | |
tree | 4f461a51f26fc221f4e9c7c660c6b6680ff072d7 /include | |
parent | 2eedb2515b733aaba0a92944def8156ef379e0da (diff) | |
download | frameworks_base-5d55c7119820ee9bb06fc072e416fe98ba77cd28.zip frameworks_base-5d55c7119820ee9bb06fc072e416fe98ba77cd28.tar.gz frameworks_base-5d55c7119820ee9bb06fc072e416fe98ba77cd28.tar.bz2 |
Basic plumbing to retrieve metadata from the native player.
IMediaPlayer.h
Added a getMetadata method that mirrors the on in MediaPlayer.java.
MediaPlayer.java
Added a native method to get the metadata from the native player.
Parse the parcel into a Metadata object.
Metadata.java
Added a stub to parse the Parcel returned by the native player into
a set of metadata.
android_media_MediaPlayer.cpp
JNI call to forward the getMetadata call.
MediaPlayerService.cpp
MediaPlayerService::Client implements the new getMetadata method added in IMediaPlayer.h
Diffstat (limited to 'include')
-rw-r--r-- | include/media/IMediaPlayer.h | 17 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 074125f..b6f654f 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -59,6 +59,23 @@ public: // @param filter A set of allow and drop rules serialized in a Parcel. // @return OK if the invocation was made successfully. virtual status_t setMetadataFilter(const Parcel& filter) = 0; + + // Retrieve a set of metadata. + // @param update_only Include only the metadata that have changed + // since the last invocation of getMetadata. + // The set is built using the unfiltered + // notifications the native player sent to the + // MediaPlayerService during that period of + // time. If false, all the metadatas are considered. + // @param apply_filter If true, once the metadata set has been built based + // on the value update_only, the current filter is + // applied. + // @param[out] metadata On exit contains a set (possibly empty) of metadata. + // Valid only if the call returned OK. + // @return OK if the invocation was made successfully. + virtual status_t getMetadata(bool update_only, + bool apply_filter, + Parcel *metadata) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 8326a21..26b054bd 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -155,6 +155,7 @@ public: static sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); status_t invoke(const Parcel& request, Parcel *reply); status_t setMetadataFilter(const Parcel& filter); + status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); private: void clear_l(); status_t seekTo_l(int msec); |