summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/Camera.cpp4
-rw-r--r--camera/CameraBase.cpp4
-rw-r--r--camera/ICamera.cpp8
-rw-r--r--camera/ICameraClient.cpp4
-rw-r--r--camera/ICameraRecordingProxy.cpp4
-rw-r--r--camera/ICameraRecordingProxyListener.cpp2
-rw-r--r--camera/ICameraService.cpp20
-rw-r--r--camera/IProCameraUser.cpp4
-rw-r--r--camera/camera2/CaptureRequest.cpp2
-rw-r--r--camera/camera2/ICameraDeviceUser.cpp2
-rw-r--r--camera/tests/Android.mk10
-rw-r--r--camera/tests/main.cpp27
12 files changed, 28 insertions, 63 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp
index 85f44f0..3a9fb4c 100644
--- a/camera/Camera.cpp
+++ b/camera/Camera.cpp
@@ -55,7 +55,7 @@ sp<Camera> Camera::create(const sp<ICamera>& camera)
if (camera->connect(c) == NO_ERROR) {
c->mStatus = NO_ERROR;
c->mCamera = camera;
- camera->asBinder()->linkToDeath(c);
+ IInterface::asBinder(camera)->linkToDeath(c);
return c;
}
return 0;
@@ -93,7 +93,7 @@ status_t Camera::connectLegacy(int cameraId, int halVersion,
clientUid, /*out*/c->mCamera);
}
if (status == OK && c->mCamera != 0) {
- c->mCamera->asBinder()->linkToDeath(c);
+ IInterface::asBinder(c->mCamera)->linkToDeath(c);
c->mStatus = NO_ERROR;
camera = c;
} else {
diff --git a/camera/CameraBase.cpp b/camera/CameraBase.cpp
index 04694cd..65a1a47 100644
--- a/camera/CameraBase.cpp
+++ b/camera/CameraBase.cpp
@@ -107,7 +107,7 @@ sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,
/*out*/ c->mCamera);
}
if (status == OK && c->mCamera != 0) {
- c->mCamera->asBinder()->linkToDeath(c);
+ IInterface::asBinder(c->mCamera)->linkToDeath(c);
c->mStatus = NO_ERROR;
} else {
ALOGW("An error occurred while connecting to camera: %d", cameraId);
@@ -122,7 +122,7 @@ void CameraBase<TCam, TCamTraits>::disconnect()
ALOGV("%s: disconnect", __FUNCTION__);
if (mCamera != 0) {
mCamera->disconnect();
- mCamera->asBinder()->unlinkToDeath(this);
+ IInterface::asBinder(mCamera)->unlinkToDeath(this);
mCamera = 0;
}
ALOGV("%s: disconnect (done)", __FUNCTION__);
diff --git a/camera/ICamera.cpp b/camera/ICamera.cpp
index 8c6e1f7..9943be6 100644
--- a/camera/ICamera.cpp
+++ b/camera/ICamera.cpp
@@ -75,7 +75,7 @@ public:
ALOGV("setPreviewTarget");
Parcel data, reply;
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
- sp<IBinder> b(bufferProducer->asBinder());
+ sp<IBinder> b(IInterface::asBinder(bufferProducer));
data.writeStrongBinder(b);
remote()->transact(SET_PREVIEW_TARGET, data, &reply);
return reply.readInt32();
@@ -98,7 +98,7 @@ public:
ALOGV("setPreviewCallbackTarget");
Parcel data, reply;
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
- sp<IBinder> b(callbackProducer->asBinder());
+ sp<IBinder> b(IInterface::asBinder(callbackProducer));
data.writeStrongBinder(b);
remote()->transact(SET_PREVIEW_CALLBACK_TARGET, data, &reply);
return reply.readInt32();
@@ -147,7 +147,7 @@ public:
ALOGV("releaseRecordingFrame");
Parcel data, reply;
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
- data.writeStrongBinder(mem->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(mem));
remote()->transact(RELEASE_RECORDING_FRAME, data, &reply);
}
@@ -250,7 +250,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
- data.writeStrongBinder(cameraClient->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraClient));
remote()->transact(CONNECT, data, &reply);
return reply.readInt32();
}
diff --git a/camera/ICameraClient.cpp b/camera/ICameraClient.cpp
index 205c8ba..179a341 100644
--- a/camera/ICameraClient.cpp
+++ b/camera/ICameraClient.cpp
@@ -58,7 +58,7 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor());
data.writeInt32(msgType);
- data.writeStrongBinder(imageData->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(imageData));
if (metadata) {
data.writeInt32(metadata->number_of_faces);
data.write(metadata->faces, sizeof(camera_face_t) * metadata->number_of_faces);
@@ -74,7 +74,7 @@ public:
data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor());
data.writeInt64(timestamp);
data.writeInt32(msgType);
- data.writeStrongBinder(imageData->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(imageData));
remote()->transact(DATA_CALLBACK_TIMESTAMP, data, &reply, IBinder::FLAG_ONEWAY);
}
};
diff --git a/camera/ICameraRecordingProxy.cpp b/camera/ICameraRecordingProxy.cpp
index 7223b6d..3dc0ffb 100644
--- a/camera/ICameraRecordingProxy.cpp
+++ b/camera/ICameraRecordingProxy.cpp
@@ -45,7 +45,7 @@ public:
ALOGV("startRecording");
Parcel data, reply;
data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(START_RECORDING, data, &reply);
return reply.readInt32();
}
@@ -63,7 +63,7 @@ public:
ALOGV("releaseRecordingFrame");
Parcel data, reply;
data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor());
- data.writeStrongBinder(mem->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(mem));
remote()->transact(RELEASE_RECORDING_FRAME, data, &reply);
}
};
diff --git a/camera/ICameraRecordingProxyListener.cpp b/camera/ICameraRecordingProxyListener.cpp
index cb17f19..cf848fc 100644
--- a/camera/ICameraRecordingProxyListener.cpp
+++ b/camera/ICameraRecordingProxyListener.cpp
@@ -42,7 +42,7 @@ public:
data.writeInterfaceToken(ICameraRecordingProxyListener::getInterfaceDescriptor());
data.writeInt64(timestamp);
data.writeInt32(msgType);
- data.writeStrongBinder(imageData->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(imageData));
remote()->transact(DATA_CALLBACK_TIMESTAMP, data, &reply, IBinder::FLAG_ONEWAY);
}
};
diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp
index 5485205..fc3e437 100644
--- a/camera/ICameraService.cpp
+++ b/camera/ICameraService.cpp
@@ -172,7 +172,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(cameraClient->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraClient));
data.writeInt32(cameraId);
data.writeString16(clientPackageName);
data.writeInt32(clientUid);
@@ -194,7 +194,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(cameraClient->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraClient));
data.writeInt32(cameraId);
data.writeInt32(halVersion);
data.writeString16(clientPackageName);
@@ -217,7 +217,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(cameraCb->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraCb));
data.writeInt32(cameraId);
data.writeString16(clientPackageName);
data.writeInt32(clientUid);
@@ -242,7 +242,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(cameraCb->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraCb));
data.writeInt32(cameraId);
data.writeString16(clientPackageName);
data.writeInt32(clientUid);
@@ -260,7 +260,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(BnCameraService::ADD_LISTENER, data, &reply);
if (readExceptionCode(reply)) return -EPROTO;
@@ -271,7 +271,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(BnCameraService::REMOVE_LISTENER, data, &reply);
if (readExceptionCode(reply)) return -EPROTO;
@@ -384,7 +384,7 @@ status_t BnCameraService::onTransact(
reply->writeInt32(status);
if (camera != NULL) {
reply->writeInt32(1);
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(camera));
} else {
reply->writeInt32(0);
}
@@ -404,7 +404,7 @@ status_t BnCameraService::onTransact(
reply->writeInt32(status);
if (camera != NULL) {
reply->writeInt32(1);
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(camera));
} else {
reply->writeInt32(0);
}
@@ -424,7 +424,7 @@ status_t BnCameraService::onTransact(
reply->writeInt32(status);
if (camera != NULL) {
reply->writeInt32(1);
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(camera));
} else {
reply->writeInt32(0);
}
@@ -484,7 +484,7 @@ status_t BnCameraService::onTransact(
reply->writeInt32(status);
if (camera != NULL) {
reply->writeInt32(1);
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(camera));
} else {
reply->writeInt32(0);
}
diff --git a/camera/IProCameraUser.cpp b/camera/IProCameraUser.cpp
index 8f22124..9bd7597 100644
--- a/camera/IProCameraUser.cpp
+++ b/camera/IProCameraUser.cpp
@@ -65,7 +65,7 @@ public:
{
Parcel data, reply;
data.writeInterfaceToken(IProCameraUser::getInterfaceDescriptor());
- data.writeStrongBinder(cameraClient->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(cameraClient));
remote()->transact(CONNECT, data, &reply);
return reply.readInt32();
}
@@ -150,7 +150,7 @@ public:
data.writeInt32(height);
data.writeInt32(format);
- sp<IBinder> b(bufferProducer->asBinder());
+ sp<IBinder> b(IInterface::asBinder(bufferProducer));
data.writeStrongBinder(b);
remote()->transact(CREATE_STREAM, data, &reply);
diff --git a/camera/camera2/CaptureRequest.cpp b/camera/camera2/CaptureRequest.cpp
index fb74c8d..66d6913 100644
--- a/camera/camera2/CaptureRequest.cpp
+++ b/camera/camera2/CaptureRequest.cpp
@@ -106,7 +106,7 @@ status_t CaptureRequest::writeToParcel(Parcel* parcel) const {
sp<IBinder> binder;
if (surface != 0) {
- binder = surface->getIGraphicBufferProducer()->asBinder();
+ binder = IInterface::asBinder(surface->getIGraphicBufferProducer());
}
// not sure if readParcelableArray does this, hard to tell from source
diff --git a/camera/camera2/ICameraDeviceUser.cpp b/camera/camera2/ICameraDeviceUser.cpp
index ff4a0c2..35345d2 100644
--- a/camera/camera2/ICameraDeviceUser.cpp
+++ b/camera/camera2/ICameraDeviceUser.cpp
@@ -219,7 +219,7 @@ public:
data.writeInt32(1); // marker that bufferProducer is not null
data.writeString16(String16("unknown_name")); // name of surface
- sp<IBinder> b(bufferProducer->asBinder());
+ sp<IBinder> b(IInterface::asBinder(bufferProducer));
data.writeStrongBinder(b);
remote()->transact(CREATE_STREAM, data, &reply);
diff --git a/camera/tests/Android.mk b/camera/tests/Android.mk
index 61385e5..2db4c14 100644
--- a/camera/tests/Android.mk
+++ b/camera/tests/Android.mk
@@ -14,16 +14,15 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SRC_FILES:= \
- main.cpp \
ProCameraTests.cpp \
VendorTagDescriptorTests.cpp
LOCAL_SHARED_LIBRARIES := \
libutils \
libcutils \
- libstlport \
libcamera_metadata \
libcamera_client \
libgui \
@@ -32,14 +31,7 @@ LOCAL_SHARED_LIBRARIES := \
libdl \
libbinder
-LOCAL_STATIC_LIBRARIES := \
- libgtest
-
LOCAL_C_INCLUDES += \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
system/media/camera/include \
system/media/private/camera/include \
system/media/camera/tests \
diff --git a/camera/tests/main.cpp b/camera/tests/main.cpp
deleted file mode 100644
index 8c8c515..0000000
--- a/camera/tests/main.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <gtest/gtest.h>
-
-
-int main(int argc, char **argv) {
-
- ::testing::InitGoogleTest(&argc, argv);
-
- int ret = RUN_ALL_TESTS();
-
- return ret;
-}