summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-02-20 19:15:15 -0800
committerIgor Murashkin <iam@google.com>2013-02-22 10:50:14 -0800
commit5494cdc67b541034c963919aef8acb8b665e4dde (patch)
treecdffd46bace86e756bc6448028007db8e2fe74a0 /services/camera
parent9fb7fa159b2a47d6a7c0e9ef323b23298cdc7cb9 (diff)
downloadframeworks_av-5494cdc67b541034c963919aef8acb8b665e4dde.zip
frameworks_av-5494cdc67b541034c963919aef8acb8b665e4dde.tar.gz
frameworks_av-5494cdc67b541034c963919aef8acb8b665e4dde.tar.bz2
Camera: Change ProCamera to take IGraphicBufferProducer
Change-Id: Iec62eead6d179aa5486f7719143340976bb76e7d
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/ProCamera2Client.cpp12
-rw-r--r--services/camera/libcameraservice/ProCamera2Client.h6
2 files changed, 13 insertions, 5 deletions
diff --git a/services/camera/libcameraservice/ProCamera2Client.cpp b/services/camera/libcameraservice/ProCamera2Client.cpp
index 5ebe713..aa02f10 100644
--- a/services/camera/libcameraservice/ProCamera2Client.cpp
+++ b/services/camera/libcameraservice/ProCamera2Client.cpp
@@ -238,7 +238,7 @@ status_t ProCamera2Client::cancelStream(int streamId) {
}
status_t ProCamera2Client::createStream(int width, int height, int format,
- const sp<Surface>& surface,
+ const sp<IGraphicBufferProducer>& bufferProducer,
/*out*/
int* streamId)
{
@@ -254,7 +254,15 @@ status_t ProCamera2Client::createStream(int width, int height, int format,
Mutex::Autolock icl(mIProCameraUserLock);
- return mDevice->createStream(surface, width, height, format, /*size*/1, streamId);
+ sp<IBinder> binder;
+ sp<ANativeWindow> window;
+ if (bufferProducer != 0) {
+ binder = bufferProducer->asBinder();
+ window = new Surface(bufferProducer);
+ }
+
+ return mDevice->createStream(window, width, height, format, /*size*/1,
+ streamId);
}
// Create a request object from a template.
diff --git a/services/camera/libcameraservice/ProCamera2Client.h b/services/camera/libcameraservice/ProCamera2Client.h
index ed42e22..b72fd63 100644
--- a/services/camera/libcameraservice/ProCamera2Client.h
+++ b/services/camera/libcameraservice/ProCamera2Client.h
@@ -53,9 +53,9 @@ public:
virtual status_t cancelStream(int streamId);
virtual status_t createStream(int width, int height, int format,
- const sp<Surface>& surface,
- /*out*/
- int* streamId);
+ const sp<IGraphicBufferProducer>& bufferProducer,
+ /*out*/
+ int* streamId);
// Create a request object from a template.
// -- Caller owns the newly allocated metadata