diff options
author | Eric Laurent <elaurent@google.com> | 2010-06-21 09:27:30 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-06-22 17:14:04 -0700 |
commit | a514bdb58b5de4986679f72b7204b4764f7a2778 (patch) | |
tree | 84b1ebf0c2b500bfb4995e373f8fee5b63b6c9fd /media/libmedia/IMediaPlayerService.cpp | |
parent | 58ae9c530247668f8af36e30d228c716c226b3d4 (diff) | |
download | frameworks_av-a514bdb58b5de4986679f72b7204b4764f7a2778.zip frameworks_av-a514bdb58b5de4986679f72b7204b4764f7a2778.tar.gz frameworks_av-a514bdb58b5de4986679f72b7204b4764f7a2778.tar.bz2 |
Added support for audio sessions in MediaPlayer and AudioTrack.
Audio sessions are used to associate audio effects to particular instances (or groups) of MediaPlayers or AudioTracks.
Change-Id: Ib94eec43241cfcb416590f435ddce7ab39a07640
Diffstat (limited to 'media/libmedia/IMediaPlayerService.cpp')
-rw-r--r-- | media/libmedia/IMediaPlayerService.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 71c5f86..1ae222e 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -58,7 +58,7 @@ public: virtual sp<IMediaPlayer> create( pid_t pid, const sp<IMediaPlayerClient>& client, - const char* url, const KeyedVector<String8, String8> *headers) { + const char* url, const KeyedVector<String8, String8> *headers, int audioSessionId) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); data.writeInt32(pid); @@ -75,8 +75,10 @@ public: data.writeString8(headers->valueAt(i)); } } + data.writeInt32(audioSessionId); remote()->transact(CREATE_URL, data, &reply); + return interface_cast<IMediaPlayer>(reply.readStrongBinder()); } @@ -89,7 +91,8 @@ public: return interface_cast<IMediaRecorder>(reply.readStrongBinder()); } - virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) + virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, + int64_t offset, int64_t length, int audioSessionId) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); @@ -98,8 +101,11 @@ public: data.writeFileDescriptor(fd); data.writeInt64(offset); data.writeInt64(length); + data.writeInt32(audioSessionId); + remote()->transact(CREATE_FD, data, &reply); - return interface_cast<IMediaPlayer>(reply.readStrongBinder()); + + return interface_cast<IMediaPlayer>(reply.readStrongBinder());; } virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) @@ -166,9 +172,10 @@ status_t BnMediaPlayerService::onTransact( String8 value = data.readString8(); headers.add(key, value); } + int audioSessionId = data.readInt32(); sp<IMediaPlayer> player = create( - pid, client, url, numHeaders > 0 ? &headers : NULL); + pid, client, url, numHeaders > 0 ? &headers : NULL, audioSessionId); reply->writeStrongBinder(player->asBinder()); return NO_ERROR; @@ -180,7 +187,9 @@ status_t BnMediaPlayerService::onTransact( int fd = dup(data.readFileDescriptor()); int64_t offset = data.readInt64(); int64_t length = data.readInt64(); - sp<IMediaPlayer> player = create(pid, client, fd, offset, length); + int audioSessionId = data.readInt32(); + + sp<IMediaPlayer> player = create(pid, client, fd, offset, length, audioSessionId); reply->writeStrongBinder(player->asBinder()); return NO_ERROR; } break; |