summaryrefslogtreecommitdiffstats
path: root/camera/Camera.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2010-12-20 11:51:31 -0800
committerJamie Gennis <jgennis@google.com>2011-01-06 13:31:53 -0800
commitbfa33aae4f54c0020a0568b16a3acb7b30b6ca3d (patch)
tree3dae4190516dcddec996a2b7c51b5f192c3ed4ca /camera/Camera.cpp
parent5de2001a5c3f854b63dbcea284e02f930881ca75 (diff)
downloadframeworks_av-bfa33aae4f54c0020a0568b16a3acb7b30b6ca3d.zip
frameworks_av-bfa33aae4f54c0020a0568b16a3acb7b30b6ca3d.tar.gz
frameworks_av-bfa33aae4f54c0020a0568b16a3acb7b30b6ca3d.tar.bz2
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 'camera/Camera.cpp')
-rw-r--r--camera/Camera.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp
index ab626ad..907f119 100644
--- a/camera/Camera.cpp
+++ b/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()
{