summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/api1/CameraClient.cpp
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2013-08-21 13:57:21 -0700
committerEino-Ville Talvala <etalvala@google.com>2013-08-21 14:35:48 -0700
commit1ce7c34e67c2cf58dd88c31f36f4bd62e375f7f0 (patch)
tree4febd2dd2325c391977d64c9d78a8ee955277e80 /services/camera/libcameraservice/api1/CameraClient.cpp
parent99ad37a47628b1ea1f8981bf974de38a49c653a0 (diff)
downloadframeworks_av-1ce7c34e67c2cf58dd88c31f36f4bd62e375f7f0.zip
frameworks_av-1ce7c34e67c2cf58dd88c31f36f4bd62e375f7f0.tar.gz
frameworks_av-1ce7c34e67c2cf58dd88c31f36f4bd62e375f7f0.tar.bz2
Camera1: Set preview to be asynchronous, and remove dead code
- Use the controlledByApp flag to make sure application-bound preview buffer queue is asynchronous as before - Remove setPreviewDisplay in service, since it is no longer in the binder interface - Rename setPreviewTexture to setPreviewTarget, to make it clear it's the only game in town now. Rename only on the binder level and service for now. Bug: 10312644 Change-Id: Icd33a462022f9729a63dc65c69b755cb7969857e
Diffstat (limited to 'services/camera/libcameraservice/api1/CameraClient.cpp')
-rw-r--r--services/camera/libcameraservice/api1/CameraClient.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp
index ad8856b..bd6805d 100644
--- a/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -308,26 +308,20 @@ status_t CameraClient::setPreviewWindow(const sp<IBinder>& binder,
return result;
}
-// set the Surface that the preview will use
-status_t CameraClient::setPreviewDisplay(const sp<Surface>& surface) {
- LOG1("setPreviewDisplay(%p) (pid %d)", surface.get(), getCallingPid());
-
- sp<IBinder> binder(surface != 0 ? surface->getIGraphicBufferProducer()->asBinder() : 0);
- sp<ANativeWindow> window(surface);
- return setPreviewWindow(binder, window);
-}
-
-// set the SurfaceTextureClient that the preview will use
-status_t CameraClient::setPreviewTexture(
+// set the buffer consumer that the preview will use
+status_t CameraClient::setPreviewTarget(
const sp<IGraphicBufferProducer>& bufferProducer) {
- LOG1("setPreviewTexture(%p) (pid %d)", bufferProducer.get(),
+ LOG1("setPreviewTarget(%p) (pid %d)", bufferProducer.get(),
getCallingPid());
sp<IBinder> binder;
sp<ANativeWindow> window;
if (bufferProducer != 0) {
binder = bufferProducer->asBinder();
- window = new Surface(bufferProducer);
+ // Using controlledByApp flag to ensure that the buffer queue remains in
+ // async mode for the old camera API, where many applications depend
+ // on that behavior.
+ window = new Surface(bufferProducer, /*controlledByApp*/ true);
}
return setPreviewWindow(binder, window);
}