diff options
author | Igor Murashkin <iam@google.com> | 2013-02-20 19:15:15 -0800 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2013-02-22 10:50:14 -0800 |
commit | 76f8b43909817179b317880202360863b8f976d0 (patch) | |
tree | 2d845b0c60925c6af6d77ec167366140e4843ea6 /services | |
parent | 3261fd3f1d8f798fab2f1b3efaa92d5a35cd42e7 (diff) | |
download | frameworks_av-76f8b43909817179b317880202360863b8f976d0.zip frameworks_av-76f8b43909817179b317880202360863b8f976d0.tar.gz frameworks_av-76f8b43909817179b317880202360863b8f976d0.tar.bz2 |
Camera: Change ProCamera to take IGraphicBufferProducer
Change-Id: Iec62eead6d179aa5486f7719143340976bb76e7d
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/ProCamera2Client.cpp | 12 | ||||
-rw-r--r-- | services/camera/libcameraservice/ProCamera2Client.h | 6 |
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 |