diff options
-rw-r--r-- | camera/camera2/ICameraDeviceCallbacks.cpp | 15 | ||||
-rw-r--r-- | services/camera/libcameraservice/common/FrameProcessorBase.cpp | 8 |
2 files changed, 14 insertions, 9 deletions
diff --git a/camera/camera2/ICameraDeviceCallbacks.cpp b/camera/camera2/ICameraDeviceCallbacks.cpp index 188bd8e..3cec1f4 100644 --- a/camera/camera2/ICameraDeviceCallbacks.cpp +++ b/camera/camera2/ICameraDeviceCallbacks.cpp @@ -57,11 +57,12 @@ public: data.writeNoException(); } - void onResultReceived(int32_t frameId, const CameraMetadata& result) { + void onResultReceived(int32_t requestId, const CameraMetadata& result) { ALOGV("onResultReceived"); Parcel data, reply; data.writeInterfaceToken(ICameraDeviceCallbacks::getInterfaceDescriptor()); - data.writeInt32(frameId); + data.writeInt32(requestId); + data.writeInt32(1); // to mark presence of metadata object result.writeToParcel(&data); remote()->transact(RESULT_RECEIVED, data, &reply, IBinder::FLAG_ONEWAY); data.writeNoException(); @@ -91,10 +92,14 @@ status_t BnCameraDeviceCallbacks::onTransact( case RESULT_RECEIVED: { ALOGV("RESULT_RECEIVED"); CHECK_INTERFACE(ICameraDeviceCallbacks, data, reply); - int32_t frameId = data.readInt32(); + int32_t requestId = data.readInt32(); CameraMetadata result; - result.readFromParcel(const_cast<Parcel*>(&data)); - onResultReceived(frameId, result); + if (data.readInt32() != 0) { + result.readFromParcel(const_cast<Parcel*>(&data)); + } else { + ALOGW("No metadata object is present in result"); + } + onResultReceived(requestId, result); data.readExceptionCode(); return NO_ERROR; break; diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.cpp b/services/camera/libcameraservice/common/FrameProcessorBase.cpp index 10bc6ea..e7b440a 100644 --- a/services/camera/libcameraservice/common/FrameProcessorBase.cpp +++ b/services/camera/libcameraservice/common/FrameProcessorBase.cpp @@ -143,7 +143,7 @@ status_t FrameProcessorBase::processListeners(const CameraMetadata &frame, __FUNCTION__, device->getId()); return BAD_VALUE; } - int32_t frameId = entry.data.i32[0]; + int32_t requestId = entry.data.i32[0]; List<sp<FilteredListener> > listeners; { @@ -151,8 +151,8 @@ status_t FrameProcessorBase::processListeners(const CameraMetadata &frame, List<RangeListener>::iterator item = mRangeListeners.begin(); while (item != mRangeListeners.end()) { - if (frameId >= item->minId && - frameId < item->maxId) { + if (requestId >= item->minId && + requestId < item->maxId) { sp<FilteredListener> listener = item->listener.promote(); if (listener == 0) { item = mRangeListeners.erase(item); @@ -167,7 +167,7 @@ status_t FrameProcessorBase::processListeners(const CameraMetadata &frame, ALOGV("Got %d range listeners out of %d", listeners.size(), mRangeListeners.size()); List<sp<FilteredListener> >::iterator item = listeners.begin(); for (; item != listeners.end(); item++) { - (*item)->onFrameAvailable(frameId, frame); + (*item)->onFrameAvailable(requestId, frame); } return OK; } |