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 /camera | |
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 'camera')
-rw-r--r-- | camera/IProCameraUser.cpp | 11 | ||||
-rw-r--r-- | camera/ProCamera.cpp | 9 |
2 files changed, 12 insertions, 8 deletions
diff --git a/camera/IProCameraUser.cpp b/camera/IProCameraUser.cpp index cd7bf5c..e60cfe5 100644 --- a/camera/IProCameraUser.cpp +++ b/camera/IProCameraUser.cpp @@ -219,7 +219,7 @@ public: } virtual status_t createStream(int width, int height, int format, - const sp<Surface>& surface, + const sp<IGraphicBufferProducer>& bufferProducer, /*out*/ int* streamId) { @@ -229,7 +229,9 @@ public: data.writeInt32(height); data.writeInt32(format); - Surface::writeToParcel(surface, &data); + sp<IBinder> b(bufferProducer->asBinder()); + data.writeStrongBinder(b); + remote()->transact(CREATE_STREAM, data, &reply); int sId = reply.readInt32(); @@ -340,11 +342,12 @@ status_t BnProCameraUser::onTransact( height = data.readInt32(); format = data.readInt32(); - sp<Surface> surface = Surface::readFromParcel(data); + sp<IGraphicBufferProducer> bp = + interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); int streamId = -1; status_t ret; - ret = createStream(width, height, format, surface, &streamId); + ret = createStream(width, height, format, bp, &streamId); reply->writeInt32(streamId); reply->writeInt32(ret); diff --git a/camera/ProCamera.cpp b/camera/ProCamera.cpp index 92ec9d6..8fd08f4 100644 --- a/camera/ProCamera.cpp +++ b/camera/ProCamera.cpp @@ -278,7 +278,8 @@ status_t ProCamera::createStream(int width, int height, int format, sp <IProCameraUser> c = mCamera; if (c == 0) return NO_INIT; - return c->createStream(width, height, format, surface, streamId); + return c->createStream(width, height, format, surface->getIGraphicBufferProducer(), + streamId); } status_t ProCamera::createStream(int width, int height, int format, @@ -293,10 +294,10 @@ status_t ProCamera::createStream(int width, int height, int format, status_t stat = INVALID_OPERATION; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + sp <IProCameraUser> c = mCamera; + if (c == 0) return NO_INIT; - ALOGV("%s: createStreamT END (%d), StreamID = %d", __FUNCTION__, stat, - *streamId); + return c->createStream(width, height, format, bufferProducer, streamId); } else { *streamId = -1; |