Merge "camera2 ndk: Allow nullptr for ACameraCaptureSession_captureCallbacks.onClosed." into qt-qpr1-dev am: 9ed54cdf4d am: 826e5c01ed

Change-Id: I33107fb888e664a1d80fba26dd8645991863115e
gugelfrei
Automerger Merge Worker 5 years ago
commit 1f338c87f8

@ -33,7 +33,9 @@ ACameraCaptureSession::~ACameraCaptureSession() {
dev->unlockDevice();
}
// Fire onClosed callback
(*mUserSessionCallback.onClosed)(mUserSessionCallback.context, this);
if (mUserSessionCallback.onClosed != nullptr) {
(*mUserSessionCallback.onClosed)(mUserSessionCallback.context, this);
}
ALOGV("~ACameraCaptureSession: %p is deleted", this);
}

@ -253,21 +253,9 @@ class CameraHelper {
return true;
}
static void onDeviceDisconnected(void* /*obj*/, ACameraDevice* /*device*/) {}
static void onDeviceError(void* /*obj*/, ACameraDevice* /*device*/, int /*errorCode*/) {}
static void onSessionClosed(void* /*obj*/, ACameraCaptureSession* /*session*/) {}
static void onSessionReady(void* /*obj*/, ACameraCaptureSession* /*session*/) {}
static void onSessionActive(void* /*obj*/, ACameraCaptureSession* /*session*/) {}
private:
ACameraDevice_StateCallbacks mDeviceCb{this, onDeviceDisconnected,
onDeviceError};
ACameraCaptureSession_stateCallbacks mSessionCb{
this, onSessionClosed, onSessionReady, onSessionActive};
ACameraDevice_StateCallbacks mDeviceCb{this, nullptr, nullptr};
ACameraCaptureSession_stateCallbacks mSessionCb{ this, nullptr, nullptr, nullptr};
native_handle_t* mImgReaderAnw = nullptr; // not owned by us.

Loading…
Cancel
Save