diff options
Diffstat (limited to 'media/libmedia/IMediaPlayerService.cpp')
| -rw-r--r-- | media/libmedia/IMediaPlayerService.cpp | 36 | 
1 files changed, 15 insertions, 21 deletions
| diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 71c5f862cdad..4abfa75b3bfc 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -35,8 +35,7 @@ enum {      DECODE_FD,      CREATE_MEDIA_RECORDER,      CREATE_METADATA_RETRIEVER, -    GET_OMX, -    SNOOP +    GET_OMX  };  class BpMediaPlayerService: public BpInterface<IMediaPlayerService> @@ -58,7 +57,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 +74,10 @@ public:                  data.writeString8(headers->valueAt(i));              }          } +        data.writeInt32(audioSessionId);          remote()->transact(CREATE_URL, data, &reply); +          return interface_cast<IMediaPlayer>(reply.readStrongBinder());      } @@ -89,7 +90,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 +100,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) @@ -128,14 +133,6 @@ 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> getOMX() {          Parcel data, reply;          data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); @@ -166,9 +163,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 +178,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; @@ -212,12 +212,6 @@ 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(); | 
