From ff2dc46c121c166f10684da069d07ae11d4f9b9a Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Mon, 20 Dec 2010 11:51:31 -0800 Subject: Add camera service support for SurfaceTexture. This change enables the use of a SurfaceTexture in place of a Surface as the destination of camera preview frames. Change-Id: Ic70d404c8fe261e9d5da6f1de93d6babb5b191cb --- libs/camera/Camera.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libs/camera/Camera.cpp') diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp index ab626ad4c9e0..907f119b8174 100644 --- a/libs/camera/Camera.cpp +++ b/libs/camera/Camera.cpp @@ -182,6 +182,20 @@ status_t Camera::setPreviewDisplay(const sp& surface) } } +// pass the buffered ISurfaceTexture to the camera service +status_t Camera::setPreviewTexture(const sp& surfaceTexture) +{ + LOGV("setPreviewTexture(%p)", surfaceTexture.get()); + sp c = mCamera; + if (c == 0) return NO_INIT; + if (surfaceTexture != 0) { + return c->setPreviewTexture(surfaceTexture); + } else { + LOGD("app passed NULL surface"); + return c->setPreviewTexture(0); + } +} + // start preview mode status_t Camera::startPreview() { -- cgit v1.2.3-59-g8ed1b