Loading camera/IProCameraUser.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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(); Loading Loading @@ -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); Loading camera/ProCamera.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; Loading include/camera/IProCameraUser.h +5 −4 Original line number Diff line number Diff line Loading @@ -63,8 +63,9 @@ public: virtual status_t requestStream(int streamId) = 0; virtual status_t cancelStream(int streamId) = 0; virtual status_t createStream(int width, int height, int format, const sp<Surface>& surface, virtual status_t createStream( int width, int height, int format, const sp<IGraphicBufferProducer>& bufferProducer, /*out*/ int* streamId) = 0; Loading services/camera/libcameraservice/ProCamera2Client.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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. Loading services/camera/libcameraservice/ProCamera2Client.h +3 −3 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public: virtual status_t cancelStream(int streamId); virtual status_t createStream(int width, int height, int format, const sp<Surface>& surface, const sp<IGraphicBufferProducer>& bufferProducer, /*out*/ int* streamId); Loading Loading
camera/IProCameraUser.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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(); Loading Loading @@ -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); Loading
camera/ProCamera.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; Loading
include/camera/IProCameraUser.h +5 −4 Original line number Diff line number Diff line Loading @@ -63,8 +63,9 @@ public: virtual status_t requestStream(int streamId) = 0; virtual status_t cancelStream(int streamId) = 0; virtual status_t createStream(int width, int height, int format, const sp<Surface>& surface, virtual status_t createStream( int width, int height, int format, const sp<IGraphicBufferProducer>& bufferProducer, /*out*/ int* streamId) = 0; Loading
services/camera/libcameraservice/ProCamera2Client.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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. Loading
services/camera/libcameraservice/ProCamera2Client.h +3 −3 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public: virtual status_t cancelStream(int streamId); virtual status_t createStream(int width, int height, int format, const sp<Surface>& surface, const sp<IGraphicBufferProducer>& bufferProducer, /*out*/ int* streamId); Loading