diff options
author | Nicolas Catania <niko@google.com> | 2009-07-08 08:57:42 -0700 |
---|---|---|
committer | Nicolas Catania <niko@google.com> | 2009-07-09 11:46:02 -0700 |
commit | b2c693919be966f179080a9ec70a7a82dbf57627 (patch) | |
tree | bc67f2a85c74a41a2151950b6393e6a291aeaa5c /media/libmedia/IMediaPlayer.cpp | |
parent | 3ff23c46978adfb691507baa3d2bf04b3f5ca001 (diff) | |
download | frameworks_base-b2c693919be966f179080a9ec70a7a82dbf57627.zip frameworks_base-b2c693919be966f179080a9ec70a7a82dbf57627.tar.gz frameworks_base-b2c693919be966f179080a9ec70a7a82dbf57627.tar.bz2 |
Implemented the metadata changed notification filters.
IMediaPlayer:
new setMetadataFilter method so set a filter (2 lists of allowed and blocked metadata type)
serialized in a Parcel.
MediaPlayer.java/android_media_MediaPlayer.cpp/mediaplayer.cpp
new setMetadataFilter that passes the filter down to the MediaPlayerService's binder interface.
MediaPlayerService.cpp
The Client inner class holds the allowed and blocked metadata types.
These are in 2 vectors that get populated in the setMetadataFilter.
A new shourldDropMetadata method returns true if a type of metadata should be dropped according
to the filters.
The notify method in run the metadata update notifications thru the filter and possibly drop them.
Diffstat (limited to 'media/libmedia/IMediaPlayer.cpp')
-rw-r--r-- | media/libmedia/IMediaPlayer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index 3f278f4..131e510 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -41,6 +41,7 @@ enum { SET_LOOPING, SET_VOLUME, INVOKE, + SET_METADATA_FILTER, }; class BpMediaPlayer: public BpInterface<IMediaPlayer> @@ -178,6 +179,15 @@ public: status_t retcode = remote()->transact(INVOKE, request, reply); return retcode; } + + status_t setMetadataFilter(const Parcel& request) + { + Parcel reply; + // Avoid doing any extra copy of the request. The interface + // descriptor should have been set by MediaPlayer.java. + remote()->transact(SET_METADATA_FILTER, request, &reply); + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(MediaPlayer, "android.media.IMediaPlayer"); @@ -273,6 +283,11 @@ status_t BnMediaPlayer::onTransact( invoke(data, reply); return NO_ERROR; } break; + case SET_METADATA_FILTER: { + CHECK_INTERFACE(IMediaPlayer, data, reply); + reply->writeInt32(setMetadataFilter(data)); + return NO_ERROR; + } break; default: return BBinder::onTransact(code, data, reply, flags); } |