From 33da402287605e40e189289b11a08b8f5d515818 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 12 Mar 2013 18:42:23 -0700 Subject: remove uses of Surface in favor or IGraphicBufferProducer Change-Id: I13d7a9553aa335bca790a3a59d389d7533c83d57 --- camera/Camera.cpp | 22 ++-------------------- camera/ICamera.cpp | 19 ------------------- 2 files changed, 2 insertions(+), 39 deletions(-) (limited to 'camera') diff --git a/camera/Camera.cpp b/camera/Camera.cpp index e8908d2..1b136de 100644 --- a/camera/Camera.cpp +++ b/camera/Camera.cpp @@ -96,32 +96,14 @@ status_t Camera::unlock() return c->unlock(); } -// pass the buffered Surface to the camera service -status_t Camera::setPreviewDisplay(const sp& surface) -{ - ALOGV("setPreviewDisplay(%p)", surface.get()); - sp c = mCamera; - if (c == 0) return NO_INIT; - if (surface != 0) { - return c->setPreviewDisplay(surface); - } else { - ALOGD("app passed NULL surface"); - return c->setPreviewDisplay(0); - } -} - // pass the buffered IGraphicBufferProducer to the camera service status_t Camera::setPreviewTexture(const sp& bufferProducer) { ALOGV("setPreviewTexture(%p)", bufferProducer.get()); sp c = mCamera; if (c == 0) return NO_INIT; - if (bufferProducer != 0) { - return c->setPreviewTexture(bufferProducer); - } else { - ALOGD("app passed NULL surface"); - return c->setPreviewTexture(0); - } + ALOGD_IF(bufferProducer == 0, "app passed NULL surface"); + return c->setPreviewTexture(bufferProducer); } // start preview mode diff --git a/camera/ICamera.cpp b/camera/ICamera.cpp index 5d210e7..8900867 100644 --- a/camera/ICamera.cpp +++ b/camera/ICamera.cpp @@ -29,7 +29,6 @@ namespace android { enum { DISCONNECT = IBinder::FIRST_CALL_TRANSACTION, - SET_PREVIEW_DISPLAY, SET_PREVIEW_TEXTURE, SET_PREVIEW_CALLBACK_FLAG, START_PREVIEW, @@ -68,17 +67,6 @@ public: remote()->transact(DISCONNECT, data, &reply); } - // pass the buffered Surface to the camera service - status_t setPreviewDisplay(const sp& surface) - { - ALOGV("setPreviewDisplay"); - Parcel data, reply; - data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - Surface::writeToParcel(surface, &data); - remote()->transact(SET_PREVIEW_DISPLAY, data, &reply); - return reply.readInt32(); - } - // pass the buffered IGraphicBufferProducer to the camera service status_t setPreviewTexture(const sp& bufferProducer) { @@ -282,13 +270,6 @@ status_t BnCamera::onTransact( disconnect(); return NO_ERROR; } break; - case SET_PREVIEW_DISPLAY: { - ALOGV("SET_PREVIEW_DISPLAY"); - CHECK_INTERFACE(ICamera, data, reply); - sp surface = Surface::readFromParcel(data); - reply->writeInt32(setPreviewDisplay(surface)); - return NO_ERROR; - } break; case SET_PREVIEW_TEXTURE: { ALOGV("SET_PREVIEW_TEXTURE"); CHECK_INTERFACE(ICamera, data, reply); -- cgit v1.1