summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioEffect.cpp4
-rw-r--r--media/libmedia/AudioRecord.cpp6
-rw-r--r--media/libmedia/AudioTrack.cpp6
-rw-r--r--media/libmedia/IAudioFlinger.cpp18
-rw-r--r--media/libmedia/IAudioPolicyService.cpp2
-rw-r--r--media/libmedia/IAudioTrack.cpp6
-rw-r--r--media/libmedia/IDrm.cpp2
-rw-r--r--media/libmedia/IEffect.cpp2
-rw-r--r--media/libmedia/IHDCP.cpp2
-rw-r--r--media/libmedia/IMediaDeathNotifier.cpp2
-rw-r--r--media/libmedia/IMediaLogService.cpp4
-rw-r--r--media/libmedia/IMediaMetadataRetriever.cpp6
-rw-r--r--media/libmedia/IMediaPlayer.cpp8
-rw-r--r--media/libmedia/IMediaPlayerService.cpp28
-rw-r--r--media/libmedia/IMediaRecorder.cpp10
-rw-r--r--media/libmedia/IOMX.cpp8
-rw-r--r--media/libmedia/IRemoteDisplayClient.cpp2
-rw-r--r--media/libmedia/IStreamSource.cpp4
-rw-r--r--media/libmedia/mediametadataretriever.cpp2
19 files changed, 60 insertions, 62 deletions
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp
index 0d5d7e4..af103c1 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -150,7 +150,7 @@ status_t AudioEffect::set(const effect_uuid_t *type,
int bufOffset = ((sizeof(effect_param_cblk_t) - 1) / sizeof(int) + 1) * sizeof(int);
mCblk->buffer = (uint8_t *)mCblk + bufOffset;
- iEffect->asBinder()->linkToDeath(mIEffectClient);
+ IInterface::asBinder(iEffect)->linkToDeath(mIEffectClient);
mClientPid = IPCThreadState::self()->getCallingPid();
ALOGV("set() %p OK effect: %s id: %d status %d enabled %d pid %d", this, mDescriptor.name, mId,
mStatus, mEnabled, mClientPid);
@@ -173,7 +173,7 @@ AudioEffect::~AudioEffect()
}
if (mIEffect != NULL) {
mIEffect->disconnect();
- mIEffect->asBinder()->unlinkToDeath(mIEffectClient);
+ IInterface::asBinder(mIEffect)->unlinkToDeath(mIEffectClient);
}
IPCThreadState::self()->flushCommands();
}
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 9e7ba88..9d92cfe 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -105,7 +105,7 @@ AudioRecord::~AudioRecord()
mAudioRecordThread->requestExitAndWait();
mAudioRecordThread.clear();
}
- mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioRecord)->unlinkToDeath(mDeathNotifier, this);
mAudioRecord.clear();
mCblkMemory.clear();
mBufferMemory.clear();
@@ -516,7 +516,7 @@ status_t AudioRecord::openRecord_l(size_t epoch)
// invariant that mAudioRecord != 0 is true only after set() returns successfully
if (mAudioRecord != 0) {
- mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioRecord)->unlinkToDeath(mDeathNotifier, this);
mDeathNotifier.clear();
}
mAudioRecord = record;
@@ -566,7 +566,7 @@ status_t AudioRecord::openRecord_l(size_t epoch)
mProxy->setMinimum(mNotificationFramesAct);
mDeathNotifier = new DeathNotifier(this);
- mAudioRecord->asBinder()->linkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioRecord)->linkToDeath(mDeathNotifier, this);
return NO_ERROR;
}
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 2f57b9d..b45a420 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -193,7 +193,7 @@ AudioTrack::~AudioTrack()
mAudioTrackThread->requestExitAndWait();
mAudioTrackThread.clear();
}
- mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioTrack)->unlinkToDeath(mDeathNotifier, this);
mAudioTrack.clear();
mCblkMemory.clear();
mSharedBuffer.clear();
@@ -1123,7 +1123,7 @@ status_t AudioTrack::createTrack_l()
}
// invariant that mAudioTrack != 0 is true only after set() returns successfully
if (mAudioTrack != 0) {
- mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioTrack)->unlinkToDeath(mDeathNotifier, this);
mDeathNotifier.clear();
}
mAudioTrack = track;
@@ -1226,7 +1226,7 @@ status_t AudioTrack::createTrack_l()
mProxy->setMinimum(mNotificationFramesAct);
mDeathNotifier = new DeathNotifier(this);
- mAudioTrack->asBinder()->linkToDeath(mDeathNotifier, this);
+ IInterface::asBinder(mAudioTrack)->linkToDeath(mDeathNotifier, this);
return NO_ERROR;
}
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index 6099a05..8e3b633 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -119,7 +119,7 @@ public:
// haveSharedBuffer
if (sharedBuffer != 0) {
data.writeInt32(true);
- data.writeStrongBinder(sharedBuffer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(sharedBuffer));
} else {
data.writeInt32(false);
}
@@ -419,7 +419,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
- data.writeStrongBinder(client->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(client));
remote()->transact(REGISTER_CLIENT, data, &reply);
}
@@ -716,7 +716,7 @@ public:
data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
data.write(pDesc, sizeof(effect_descriptor_t));
- data.writeStrongBinder(client->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(client));
data.writeInt32(priority);
data.writeInt32((int32_t) output);
data.writeInt32(sessionId);
@@ -939,7 +939,7 @@ status_t BnAudioFlinger::onTransact(
reply->writeInt32(flags);
reply->writeInt32(sessionId);
reply->writeInt32(status);
- reply->writeStrongBinder(track->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(track));
return NO_ERROR;
} break;
case OPEN_RECORD: {
@@ -966,11 +966,9 @@ status_t BnAudioFlinger::onTransact(
reply->writeInt32(sessionId);
reply->writeInt64(notificationFrames);
reply->writeInt32(status);
- reply->writeStrongBinder(record != NULL ? record->asBinder()
- : NULL);
- reply->writeStrongBinder(cblk != NULL ? cblk->asBinder() : NULL);
- reply->writeStrongBinder(buffers != NULL ? buffers->asBinder()
- : NULL);
+ reply->writeStrongBinder(IInterface::asBinder(record));
+ reply->writeStrongBinder(IInterface::asBinder(cblk));
+ reply->writeStrongBinder(IInterface::asBinder(buffers));
return NO_ERROR;
} break;
case SAMPLE_RATE: {
@@ -1256,7 +1254,7 @@ status_t BnAudioFlinger::onTransact(
reply->writeInt32(status);
reply->writeInt32(id);
reply->writeInt32(enabled);
- reply->writeStrongBinder(effect->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(effect));
reply->write(&desc, sizeof(effect_descriptor_t));
return NO_ERROR;
} break;
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp
index 89178f1..9349662 100644
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -572,7 +572,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
- data.writeStrongBinder(client->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(client));
remote()->transact(REGISTER_CLIENT, data, &reply);
}
diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp
index 265bb1b..df209fd 100644
--- a/media/libmedia/IAudioTrack.cpp
+++ b/media/libmedia/IAudioTrack.cpp
@@ -137,7 +137,7 @@ public:
int64_t pts) {
Parcel data, reply;
data.writeInterfaceToken(IAudioTrack::getInterfaceDescriptor());
- data.writeStrongBinder(buffer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(buffer));
data.writeInt64(pts);
status_t status = remote()->transact(QUEUE_TIMED_BUFFER,
data, &reply);
@@ -207,7 +207,7 @@ status_t BnAudioTrack::onTransact(
switch (code) {
case GET_CBLK: {
CHECK_INTERFACE(IAudioTrack, data, reply);
- reply->writeStrongBinder(getCblk()->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(getCblk()));
return NO_ERROR;
} break;
case START: {
@@ -241,7 +241,7 @@ status_t BnAudioTrack::onTransact(
status_t status = allocateTimedBuffer(data.readInt64(), &buffer);
reply->writeInt32(status);
if (status == NO_ERROR) {
- reply->writeStrongBinder(buffer->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(buffer));
}
return NO_ERROR;
} break;
diff --git a/media/libmedia/IDrm.cpp b/media/libmedia/IDrm.cpp
index 7e74de9..b08fa82 100644
--- a/media/libmedia/IDrm.cpp
+++ b/media/libmedia/IDrm.cpp
@@ -450,7 +450,7 @@ struct BpDrm : public BpInterface<IDrm> {
virtual status_t setListener(const sp<IDrmClient>& listener) {
Parcel data, reply;
data.writeInterfaceToken(IDrm::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(SET_LISTENER, data, &reply);
return reply.readInt32();
}
diff --git a/media/libmedia/IEffect.cpp b/media/libmedia/IEffect.cpp
index b94012a..c2fff78 100644
--- a/media/libmedia/IEffect.cpp
+++ b/media/libmedia/IEffect.cpp
@@ -190,7 +190,7 @@ status_t BnEffect::onTransact(
case GET_CBLK: {
CHECK_INTERFACE(IEffect, data, reply);
- reply->writeStrongBinder(getCblk()->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(getCblk()));
return NO_ERROR;
} break;
diff --git a/media/libmedia/IHDCP.cpp b/media/libmedia/IHDCP.cpp
index 1cf987a..9122f75 100644
--- a/media/libmedia/IHDCP.cpp
+++ b/media/libmedia/IHDCP.cpp
@@ -65,7 +65,7 @@ struct BpHDCP : public BpInterface<IHDCP> {
virtual status_t setObserver(const sp<IHDCPObserver> &observer) {
Parcel data, reply;
data.writeInterfaceToken(IHDCP::getInterfaceDescriptor());
- data.writeStrongBinder(observer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(observer));
remote()->transact(HDCP_SET_OBSERVER, data, &reply);
return reply.readInt32();
}
diff --git a/media/libmedia/IMediaDeathNotifier.cpp b/media/libmedia/IMediaDeathNotifier.cpp
index 10b4934..38e9ca0 100644
--- a/media/libmedia/IMediaDeathNotifier.cpp
+++ b/media/libmedia/IMediaDeathNotifier.cpp
@@ -104,7 +104,7 @@ IMediaDeathNotifier::DeathNotifier::~DeathNotifier()
Mutex::Autolock _l(sServiceLock);
sObitRecipients.clear();
if (sMediaPlayerService != 0) {
- sMediaPlayerService->asBinder()->unlinkToDeath(this);
+ IInterface::asBinder(sMediaPlayerService)->unlinkToDeath(this);
}
}
diff --git a/media/libmedia/IMediaLogService.cpp b/media/libmedia/IMediaLogService.cpp
index 8a66c7c..a4af7b7 100644
--- a/media/libmedia/IMediaLogService.cpp
+++ b/media/libmedia/IMediaLogService.cpp
@@ -42,7 +42,7 @@ public:
virtual void registerWriter(const sp<IMemory>& shared, size_t size, const char *name) {
Parcel data, reply;
data.writeInterfaceToken(IMediaLogService::getInterfaceDescriptor());
- data.writeStrongBinder(shared->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(shared));
data.writeInt64((int64_t) size);
data.writeCString(name);
status_t status = remote()->transact(REGISTER_WRITER, data, &reply);
@@ -52,7 +52,7 @@ public:
virtual void unregisterWriter(const sp<IMemory>& shared) {
Parcel data, reply;
data.writeInterfaceToken(IMediaLogService::getInterfaceDescriptor());
- data.writeStrongBinder(shared->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(shared));
status_t status = remote()->transact(UNREGISTER_WRITER, data, &reply);
// FIXME ignores status
}
diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp
index 38f717c..aa2665a 100644
--- a/media/libmedia/IMediaMetadataRetriever.cpp
+++ b/media/libmedia/IMediaMetadataRetriever.cpp
@@ -95,7 +95,7 @@ public:
data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor());
data.writeInt32(httpService != NULL);
if (httpService != NULL) {
- data.writeStrongBinder(httpService->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(httpService));
}
data.writeCString(srcUrl);
@@ -246,7 +246,7 @@ status_t BnMediaMetadataRetriever::onTransact(
sp<IMemory> bitmap = getFrameAtTime(timeUs, option);
if (bitmap != 0) { // Don't send NULL across the binder interface
reply->writeInt32(NO_ERROR);
- reply->writeStrongBinder(bitmap->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(bitmap));
} else {
reply->writeInt32(UNKNOWN_ERROR);
}
@@ -263,7 +263,7 @@ status_t BnMediaMetadataRetriever::onTransact(
sp<IMemory> albumArt = extractAlbumArt();
if (albumArt != 0) { // Don't send NULL across the binder interface
reply->writeInt32(NO_ERROR);
- reply->writeStrongBinder(albumArt->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(albumArt));
} else {
reply->writeInt32(UNKNOWN_ERROR);
}
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 6e0ec83..7f3e5cc 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -85,7 +85,7 @@ public:
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
data.writeInt32(httpService != NULL);
if (httpService != NULL) {
- data.writeStrongBinder(httpService->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(httpService));
}
data.writeCString(url);
if (headers == NULL) {
@@ -115,7 +115,7 @@ public:
status_t setDataSource(const sp<IStreamSource> &source) {
Parcel data, reply;
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
- data.writeStrongBinder(source == NULL ? NULL : source->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(source));
remote()->transact(SET_DATA_SOURCE_STREAM, data, &reply);
return reply.readInt32();
}
@@ -125,7 +125,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
- sp<IBinder> b(bufferProducer == NULL ? NULL : bufferProducer->asBinder());
+ sp<IBinder> b(IInterface::asBinder(bufferProducer));
data.writeStrongBinder(b);
remote()->transact(SET_VIDEO_SURFACETEXTURE, data, &reply);
return reply.readInt32();
@@ -323,7 +323,7 @@ public:
status_t setNextPlayer(const sp<IMediaPlayer>& player) {
Parcel data, reply;
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
- sp<IBinder> b(player == NULL ? NULL : player->asBinder());
+ sp<IBinder> b(IInterface::asBinder(player));
data.writeStrongBinder(b);
remote()->transact(SET_NEXT_PLAYER, data, &reply);
return reply.readInt32();
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp
index 2e02d17..a7568b9 100644
--- a/media/libmedia/IMediaPlayerService.cpp
+++ b/media/libmedia/IMediaPlayerService.cpp
@@ -73,7 +73,7 @@ public:
const sp<IMediaPlayerClient>& client, int audioSessionId) {
Parcel data, reply;
data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
- data.writeStrongBinder(client->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(client));
data.writeInt32(audioSessionId);
remote()->transact(CREATE, data, &reply);
@@ -101,10 +101,10 @@ public:
data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
data.writeInt32(httpService != NULL);
if (httpService != NULL) {
- data.writeStrongBinder(httpService->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(httpService));
}
data.writeCString(url);
- data.writeStrongBinder(heap->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(heap));
status_t status = remote()->transact(DECODE_URL, data, &reply);
if (status == NO_ERROR) {
status = (status_t)reply.readInt32();
@@ -127,7 +127,7 @@ public:
data.writeFileDescriptor(fd);
data.writeInt64(offset);
data.writeInt64(length);
- data.writeStrongBinder(heap->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(heap));
status_t status = remote()->transact(DECODE_FD, data, &reply);
if (status == NO_ERROR) {
status = (status_t)reply.readInt32();
@@ -188,7 +188,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
- data.writeStrongBinder(client->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(client));
data.writeString8(iface);
remote()->transact(LISTEN_FOR_REMOTE_DISPLAY, data, &reply);
return interface_cast<IRemoteDisplay>(reply.readStrongBinder());
@@ -216,7 +216,7 @@ status_t BnMediaPlayerService::onTransact(
interface_cast<IMediaPlayerClient>(data.readStrongBinder());
int audioSessionId = data.readInt32();
sp<IMediaPlayer> player = create(client, audioSessionId);
- reply->writeStrongBinder(player->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(player));
return NO_ERROR;
} break;
case DECODE_URL: {
@@ -273,38 +273,38 @@ status_t BnMediaPlayerService::onTransact(
case CREATE_MEDIA_RECORDER: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<IMediaRecorder> recorder = createMediaRecorder();
- reply->writeStrongBinder(recorder->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(recorder));
return NO_ERROR;
} break;
case CREATE_METADATA_RETRIEVER: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<IMediaMetadataRetriever> retriever = createMetadataRetriever();
- reply->writeStrongBinder(retriever->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(retriever));
return NO_ERROR;
} break;
case GET_OMX: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<IOMX> omx = getOMX();
- reply->writeStrongBinder(omx->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(omx));
return NO_ERROR;
} break;
case MAKE_CRYPTO: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<ICrypto> crypto = makeCrypto();
- reply->writeStrongBinder(crypto->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(crypto));
return NO_ERROR;
} break;
case MAKE_DRM: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<IDrm> drm = makeDrm();
- reply->writeStrongBinder(drm->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(drm));
return NO_ERROR;
} break;
case MAKE_HDCP: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
bool createEncryptionModule = data.readInt32();
sp<IHDCP> hdcp = makeHDCP(createEncryptionModule);
- reply->writeStrongBinder(hdcp->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(hdcp));
return NO_ERROR;
} break;
case ADD_BATTERY_DATA: {
@@ -324,13 +324,13 @@ status_t BnMediaPlayerService::onTransact(
interface_cast<IRemoteDisplayClient>(data.readStrongBinder()));
String8 iface(data.readString8());
sp<IRemoteDisplay> display(listenForRemoteDisplay(client, iface));
- reply->writeStrongBinder(display->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(display));
return NO_ERROR;
} break;
case GET_CODEC_LIST: {
CHECK_INTERFACE(IMediaPlayerService, data, reply);
sp<IMediaCodecList> mcl = getCodecList();
- reply->writeStrongBinder(mcl->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(mcl));
return NO_ERROR;
} break;
default:
diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp
index 95af006..a733b68 100644
--- a/media/libmedia/IMediaRecorder.cpp
+++ b/media/libmedia/IMediaRecorder.cpp
@@ -70,8 +70,8 @@ public:
ALOGV("setCamera(%p,%p)", camera.get(), proxy.get());
Parcel data, reply;
data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor());
- data.writeStrongBinder(camera->asBinder());
- data.writeStrongBinder(proxy->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(camera));
+ data.writeStrongBinder(IInterface::asBinder(proxy));
remote()->transact(SET_CAMERA, data, &reply);
return reply.readInt32();
}
@@ -94,7 +94,7 @@ public:
ALOGV("setPreviewSurface(%p)", surface.get());
Parcel data, reply;
data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor());
- data.writeStrongBinder(surface->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(surface));
remote()->transact(SET_PREVIEW_SURFACE, data, &reply);
return reply.readInt32();
}
@@ -215,7 +215,7 @@ public:
ALOGV("setListener(%p)", listener.get());
Parcel data, reply;
data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(SET_LISTENER, data, &reply);
return reply.readInt32();
}
@@ -468,7 +468,7 @@ status_t BnMediaRecorder::onTransact(
int returnedNull= (surfaceMediaSource == NULL) ? 1 : 0 ;
reply->writeInt32(returnedNull);
if (!returnedNull) {
- reply->writeStrongBinder(surfaceMediaSource->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(surfaceMediaSource));
}
return NO_ERROR;
} break;
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index c583d32..e208df9 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -100,7 +100,7 @@ public:
Parcel data, reply;
data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
data.writeCString(name);
- data.writeStrongBinder(observer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(observer));
remote()->transact(ALLOCATE_NODE, data, &reply);
status_t err = reply.readInt32();
@@ -248,7 +248,7 @@ public:
data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
data.writeInt32((int32_t)node);
data.writeInt32(port_index);
- data.writeStrongBinder(params->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(params));
remote()->transact(USE_BUFFER, data, &reply);
status_t err = reply.readInt32();
@@ -418,7 +418,7 @@ public:
data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
data.writeInt32((int32_t)node);
data.writeInt32(port_index);
- data.writeStrongBinder(params->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(params));
remote()->transact(ALLOC_BUFFER_WITH_BACKUP, data, &reply);
status_t err = reply.readInt32();
@@ -775,7 +775,7 @@ status_t BnOMX::onTransact(
reply->writeInt32(err);
if (err == OK) {
- reply->writeStrongBinder(bufferProducer->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(bufferProducer));
}
return NO_ERROR;
diff --git a/media/libmedia/IRemoteDisplayClient.cpp b/media/libmedia/IRemoteDisplayClient.cpp
index 7190879..9d63bc9 100644
--- a/media/libmedia/IRemoteDisplayClient.cpp
+++ b/media/libmedia/IRemoteDisplayClient.cpp
@@ -42,7 +42,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IRemoteDisplayClient::getInterfaceDescriptor());
- data.writeStrongBinder(bufferProducer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(bufferProducer));
data.writeInt32(width);
data.writeInt32(height);
data.writeInt32(flags);
diff --git a/media/libmedia/IStreamSource.cpp b/media/libmedia/IStreamSource.cpp
index fe2cc61..d480aef 100644
--- a/media/libmedia/IStreamSource.cpp
+++ b/media/libmedia/IStreamSource.cpp
@@ -55,7 +55,7 @@ struct BpStreamSource : public BpInterface<IStreamSource> {
virtual void setListener(const sp<IStreamListener> &listener) {
Parcel data, reply;
data.writeInterfaceToken(IStreamSource::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(SET_LISTENER, data, &reply);
}
@@ -64,7 +64,7 @@ struct BpStreamSource : public BpInterface<IStreamSource> {
data.writeInterfaceToken(IStreamSource::getInterfaceDescriptor());
data.writeInt64(static_cast<int64_t>(buffers.size()));
for (size_t i = 0; i < buffers.size(); ++i) {
- data.writeStrongBinder(buffers.itemAt(i)->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(buffers.itemAt(i)));
}
remote()->transact(SET_BUFFERS, data, &reply);
}
diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp
index 39a239d..8e8a1ed 100644
--- a/media/libmedia/mediametadataretriever.cpp
+++ b/media/libmedia/mediametadataretriever.cpp
@@ -172,7 +172,7 @@ MediaMetadataRetriever::DeathNotifier::~DeathNotifier()
{
Mutex::Autolock lock(sServiceLock);
if (sService != 0) {
- sService->asBinder()->unlinkToDeath(this);
+ IInterface::asBinder(sService)->unlinkToDeath(this);
}
}