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(); dev->unlockDevice();
} }
// Fire onClosed callback // Fire onClosed callback
(*mUserSessionCallback.onClosed)(mUserSessionCallback.context, this); if (mUserSessionCallback.onClosed != nullptr) {
(*mUserSessionCallback.onClosed)(mUserSessionCallback.context, this);
}
ALOGV("~ACameraCaptureSession: %p is deleted", this); ALOGV("~ACameraCaptureSession: %p is deleted", this);
} }

@ -253,21 +253,9 @@ class CameraHelper {
return true; 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: private:
ACameraDevice_StateCallbacks mDeviceCb{this, onDeviceDisconnected, ACameraDevice_StateCallbacks mDeviceCb{this, nullptr, nullptr};
onDeviceError}; ACameraCaptureSession_stateCallbacks mSessionCb{ this, nullptr, nullptr, nullptr};
ACameraCaptureSession_stateCallbacks mSessionCb{
this, onSessionClosed, onSessionReady, onSessionActive};
native_handle_t* mImgReaderAnw = nullptr; // not owned by us. native_handle_t* mImgReaderAnw = nullptr; // not owned by us.

Loading…
Cancel
Save