camera2 ndk: Allow nullptr for ACameraCaptureSession_captureCallbacks.onClosed.

Bug: 134680093

Test: AImageReaderVendorTest

Change-Id: I8d365b434c257e949496d9495d0fa31a18a2e068
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
gugelfrei
Jayant Chowdhary 5 years ago
parent b535c8d620
commit 9da975d887

@ -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