From b7848f1c442bc8c71020957948d1b003a62a25b7 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Thu, 4 Dec 2014 08:57:56 -0800 Subject: Remove MediaPlayerService::decode() and make SoundPool use MediaCodec for decoding files to PCM. Bug: 18239054 Change-Id: Ia144fc1bbb0d2787638ee972e2224339b4965310 --- media/libmedia/IMediaPlayerService.cpp | 107 --------------------------------- 1 file changed, 107 deletions(-) (limited to 'media/libmedia/IMediaPlayerService.cpp') diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 4d33d40..feea267 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -39,8 +39,6 @@ namespace android { enum { CREATE = IBinder::FIRST_CALL_TRANSACTION, - DECODE_URL, - DECODE_FD, CREATE_MEDIA_RECORDER, CREATE_METADATA_RETRIEVER, GET_OMX, @@ -88,59 +86,6 @@ public: return interface_cast(reply.readStrongBinder()); } - virtual status_t decode( - const sp &httpService, - const char* url, - uint32_t *pSampleRate, - int* pNumChannels, - audio_format_t* pFormat, - const sp& heap, - size_t *pSize) - { - Parcel data, reply; - data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); - data.writeInt32(httpService != NULL); - if (httpService != NULL) { - data.writeStrongBinder(IInterface::asBinder(httpService)); - } - data.writeCString(url); - data.writeStrongBinder(IInterface::asBinder(heap)); - status_t status = remote()->transact(DECODE_URL, data, &reply); - if (status == NO_ERROR) { - status = (status_t)reply.readInt32(); - if (status == NO_ERROR) { - *pSampleRate = uint32_t(reply.readInt32()); - *pNumChannels = reply.readInt32(); - *pFormat = (audio_format_t)reply.readInt32(); - *pSize = (size_t)reply.readInt32(); - } - } - return status; - } - - virtual status_t decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, - int* pNumChannels, audio_format_t* pFormat, - const sp& heap, size_t *pSize) - { - Parcel data, reply; - data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); - data.writeFileDescriptor(fd); - data.writeInt64(offset); - data.writeInt64(length); - data.writeStrongBinder(IInterface::asBinder(heap)); - status_t status = remote()->transact(DECODE_FD, data, &reply); - if (status == NO_ERROR) { - status = (status_t)reply.readInt32(); - if (status == NO_ERROR) { - *pSampleRate = uint32_t(reply.readInt32()); - *pNumChannels = reply.readInt32(); - *pFormat = (audio_format_t)reply.readInt32(); - *pSize = (size_t)reply.readInt32(); - } - } - return status; - } - virtual sp getOMX() { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); @@ -219,58 +164,6 @@ status_t BnMediaPlayerService::onTransact( reply->writeStrongBinder(IInterface::asBinder(player)); return NO_ERROR; } break; - case DECODE_URL: { - CHECK_INTERFACE(IMediaPlayerService, data, reply); - sp httpService; - if (data.readInt32()) { - httpService = - interface_cast(data.readStrongBinder()); - } - const char* url = data.readCString(); - sp heap = interface_cast(data.readStrongBinder()); - uint32_t sampleRate; - int numChannels; - audio_format_t format; - size_t size; - status_t status = - decode(httpService, - url, - &sampleRate, - &numChannels, - &format, - heap, - &size); - reply->writeInt32(status); - if (status == NO_ERROR) { - reply->writeInt32(sampleRate); - reply->writeInt32(numChannels); - reply->writeInt32((int32_t)format); - reply->writeInt32((int32_t)size); - } - return NO_ERROR; - } break; - case DECODE_FD: { - CHECK_INTERFACE(IMediaPlayerService, data, reply); - int fd = dup(data.readFileDescriptor()); - int64_t offset = data.readInt64(); - int64_t length = data.readInt64(); - sp heap = interface_cast(data.readStrongBinder()); - uint32_t sampleRate; - int numChannels; - audio_format_t format; - size_t size; - status_t status = decode(fd, offset, length, &sampleRate, &numChannels, &format, - heap, &size); - ::close(fd); - reply->writeInt32(status); - if (status == NO_ERROR) { - reply->writeInt32(sampleRate); - reply->writeInt32(numChannels); - reply->writeInt32((int32_t)format); - reply->writeInt32((int32_t)size); - } - return NO_ERROR; - } break; case CREATE_MEDIA_RECORDER: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp recorder = createMediaRecorder(); -- cgit v1.1