summaryrefslogtreecommitdiff
path: root/libs/camera/Camera.cpp
diff options
context:
space:
mode:
author Jamie Gennis <jgennis@google.com> 2010-12-20 11:51:31 -0800
committer Jamie Gennis <jgennis@google.com> 2011-01-06 13:31:53 -0800
commitff2dc46c121c166f10684da069d07ae11d4f9b9a (patch)
tree7d0c7c8843a38a3248035893409b7261e93e531f /libs/camera/Camera.cpp
parent68e4a7ac849b681b1fb769857fc04f64262480c4 (diff)
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
Diffstat (limited to 'libs/camera/Camera.cpp')
-rw-r--r--libs/camera/Camera.cpp14
1 files changed, 14 insertions, 0 deletions
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>& surface)
}
}
+// pass the buffered ISurfaceTexture to the camera service
+status_t Camera::setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture)
+{
+ LOGV("setPreviewTexture(%p)", surfaceTexture.get());
+ sp <ICamera> 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()
{