diff options
author | Marco Nelissen <marcone@google.com> | 2009-09-20 10:42:13 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2009-10-06 08:51:16 -0700 |
commit | 10dbb8e97e7a81ca4867663b5517f048820b3094 (patch) | |
tree | 8a85a3f2c3547afc82a7ab1f92bed562ab980102 /media/libmedia/IMediaPlayerService.cpp | |
parent | defd1bd08aaf7edc1918108419cf3f9d185c22f9 (diff) | |
download | frameworks_av-10dbb8e97e7a81ca4867663b5517f048820b3094.zip frameworks_av-10dbb8e97e7a81ca4867663b5517f048820b3094.tar.gz frameworks_av-10dbb8e97e7a81ca4867663b5517f048820b3094.tar.bz2 |
Music visualizer support hack.
This currently assumes 44k stereo (won't crash on other formats, but won't give the correct results either), and links statically with libspeex to get FFT data, increasing the size of libmedia by about 45kb.
Diffstat (limited to 'media/libmedia/IMediaPlayerService.cpp')
-rw-r--r-- | media/libmedia/IMediaPlayerService.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 8d2c360..98f7ef1 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -36,6 +36,7 @@ enum { CREATE_MEDIA_RECORDER, CREATE_METADATA_RETRIEVER, CREATE_OMX, + SNOOP }; class BpMediaPlayerService: public BpInterface<IMediaPlayerService> @@ -114,6 +115,14 @@ public: return interface_cast<IMemory>(reply.readStrongBinder()); } + virtual sp<IMemory> snoop() + { + Parcel data, reply; + data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); + remote()->transact(SNOOP, data, &reply); + return interface_cast<IMemory>(reply.readStrongBinder()); + } + virtual sp<IOMX> createOMX() { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); @@ -178,6 +187,12 @@ status_t BnMediaPlayerService::onTransact( reply->writeStrongBinder(player->asBinder()); return NO_ERROR; } break; + case SNOOP: { + CHECK_INTERFACE(IMediaPlayerService, data, reply); + sp<IMemory> snooped_audio = snoop(); + reply->writeStrongBinder(snooped_audio->asBinder()); + return NO_ERROR; + } break; case CREATE_MEDIA_RECORDER: { CHECK_INTERFACE(IMediaPlayerService, data, reply); pid_t pid = data.readInt32(); |