summaryrefslogtreecommitdiffstats
path: root/camera/ICamera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'camera/ICamera.cpp')
-rw-r--r--camera/ICamera.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/camera/ICamera.cpp b/camera/ICamera.cpp
index 8d8408c..8900867 100644
--- a/camera/ICamera.cpp
+++ b/camera/ICamera.cpp
@@ -22,14 +22,13 @@
#include <sys/types.h>
#include <binder/Parcel.h>
#include <camera/ICamera.h>
-#include <gui/ISurfaceTexture.h>
+#include <gui/IGraphicBufferProducer.h>
#include <gui/Surface.h>
namespace android {
enum {
DISCONNECT = IBinder::FIRST_CALL_TRANSACTION,
- SET_PREVIEW_DISPLAY,
SET_PREVIEW_TEXTURE,
SET_PREVIEW_CALLBACK_FLAG,
START_PREVIEW,
@@ -68,24 +67,13 @@ public:
remote()->transact(DISCONNECT, data, &reply);
}
- // pass the buffered Surface to the camera service
- status_t setPreviewDisplay(const sp<Surface>& 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 SurfaceTexture to the camera service
- status_t setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture)
+ // pass the buffered IGraphicBufferProducer to the camera service
+ status_t setPreviewTexture(const sp<IGraphicBufferProducer>& bufferProducer)
{
ALOGV("setPreviewTexture");
Parcel data, reply;
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
- sp<IBinder> b(surfaceTexture->asBinder());
+ sp<IBinder> b(bufferProducer->asBinder());
data.writeStrongBinder(b);
remote()->transact(SET_PREVIEW_TEXTURE, data, &reply);
return reply.readInt32();
@@ -282,17 +270,11 @@ 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 = Surface::readFromParcel(data);
- reply->writeInt32(setPreviewDisplay(surface));
- return NO_ERROR;
- } break;
case SET_PREVIEW_TEXTURE: {
ALOGV("SET_PREVIEW_TEXTURE");
CHECK_INTERFACE(ICamera, data, reply);
- sp<ISurfaceTexture> st = interface_cast<ISurfaceTexture>(data.readStrongBinder());
+ sp<IGraphicBufferProducer> st =
+ interface_cast<IGraphicBufferProducer>(data.readStrongBinder());
reply->writeInt32(setPreviewTexture(st));
return NO_ERROR;
} break;