Loading services/camera/libcameraservice/device3/Camera3Device.cpp +23 −4 Original line number Diff line number Diff line Loading @@ -2173,8 +2173,14 @@ status_t Camera3Device::setConsumerSurfaces(int streamId, res = stream->finishConfiguration(); if (res != OK) { // If finishConfiguration fails due to abandoned surface, do not set // device to error state. bool isSurfaceAbandoned = (res == NO_INIT || res == DEAD_OBJECT) && stream->isAbandoned(); if (!isSurfaceAbandoned) { SET_ERR_L("Can't finish configuring output stream %d: %s (%d)", stream->getId(), strerror(-res), res); } return res; } } Loading Loading @@ -2391,9 +2397,16 @@ bool Camera3Device::reconfigureCamera(const CameraMetadata& sessionParams) { //present streams end up with outstanding buffers that will //not get drained. internalUpdateStatusLocked(STATUS_ACTIVE); } else if (rc == DEAD_OBJECT) { // DEAD_OBJECT can be returned if either the consumer surface is // abandoned, or the HAL has died. // - If the HAL has died, configureStreamsLocked call will set // device to error state, // - If surface is abandoned, we should not set device to error // state. ALOGE("Failed to re-configure camera due to abandoned surface"); } else { setErrorStateLocked("%s: Failed to re-configure camera: %d", __FUNCTION__, rc); SET_ERR_L("Failed to re-configure camera: %d", rc); } } else { ALOGE("%s: Failed to pause streaming: %d", __FUNCTION__, rc); Loading Loading @@ -2527,6 +2540,9 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode, CLOGE("Can't finish configuring input stream %d: %s (%d)", mInputStream->getId(), strerror(-res), res); cancelStreamsConfigurationLocked(); if ((res == NO_INIT || res == DEAD_OBJECT) && mInputStream->isAbandoned()) { return DEAD_OBJECT; } return BAD_VALUE; } } Loading @@ -2540,6 +2556,9 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode, CLOGE("Can't finish configuring output stream %d: %s (%d)", outputStream->getId(), strerror(-res), res); cancelStreamsConfigurationLocked(); if ((res == NO_INIT || res == DEAD_OBJECT) && outputStream->isAbandoned()) { return DEAD_OBJECT; } return BAD_VALUE; } } Loading services/camera/libcameraservice/device3/Camera3Stream.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -331,7 +331,14 @@ status_t Camera3Stream::finishConfiguration() { status_t res; res = configureQueueLocked(); if (res != OK) { // configureQueueLocked could return error in case of abandoned surface. // Treat as non-fatal error. if (res == NO_INIT || res == DEAD_OBJECT) { ALOGE("%s: Unable to configure stream %d queue (non-fatal): %s (%d)", __FUNCTION__, mId, strerror(-res), res); mState = STATE_ABANDONED; return res; } else if (res != OK) { ALOGE("%s: Unable to configure stream %d queue: %s (%d)", __FUNCTION__, mId, strerror(-res), res); mState = STATE_ERROR; Loading services/camera/libcameraservice/device3/Camera3Stream.h +1 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,7 @@ class Camera3Stream : // after the HAL has provided usage and max_buffers values. After this call, // the stream must be ready to produce all buffers for registration with // HAL. // Returns NO_INIT or DEAD_OBJECT if the queue has been abandoned. virtual status_t configureQueueLocked() = 0; // Get the total number of buffers in the queue Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +23 −4 Original line number Diff line number Diff line Loading @@ -2173,8 +2173,14 @@ status_t Camera3Device::setConsumerSurfaces(int streamId, res = stream->finishConfiguration(); if (res != OK) { // If finishConfiguration fails due to abandoned surface, do not set // device to error state. bool isSurfaceAbandoned = (res == NO_INIT || res == DEAD_OBJECT) && stream->isAbandoned(); if (!isSurfaceAbandoned) { SET_ERR_L("Can't finish configuring output stream %d: %s (%d)", stream->getId(), strerror(-res), res); } return res; } } Loading Loading @@ -2391,9 +2397,16 @@ bool Camera3Device::reconfigureCamera(const CameraMetadata& sessionParams) { //present streams end up with outstanding buffers that will //not get drained. internalUpdateStatusLocked(STATUS_ACTIVE); } else if (rc == DEAD_OBJECT) { // DEAD_OBJECT can be returned if either the consumer surface is // abandoned, or the HAL has died. // - If the HAL has died, configureStreamsLocked call will set // device to error state, // - If surface is abandoned, we should not set device to error // state. ALOGE("Failed to re-configure camera due to abandoned surface"); } else { setErrorStateLocked("%s: Failed to re-configure camera: %d", __FUNCTION__, rc); SET_ERR_L("Failed to re-configure camera: %d", rc); } } else { ALOGE("%s: Failed to pause streaming: %d", __FUNCTION__, rc); Loading Loading @@ -2527,6 +2540,9 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode, CLOGE("Can't finish configuring input stream %d: %s (%d)", mInputStream->getId(), strerror(-res), res); cancelStreamsConfigurationLocked(); if ((res == NO_INIT || res == DEAD_OBJECT) && mInputStream->isAbandoned()) { return DEAD_OBJECT; } return BAD_VALUE; } } Loading @@ -2540,6 +2556,9 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode, CLOGE("Can't finish configuring output stream %d: %s (%d)", outputStream->getId(), strerror(-res), res); cancelStreamsConfigurationLocked(); if ((res == NO_INIT || res == DEAD_OBJECT) && outputStream->isAbandoned()) { return DEAD_OBJECT; } return BAD_VALUE; } } Loading
services/camera/libcameraservice/device3/Camera3Stream.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -331,7 +331,14 @@ status_t Camera3Stream::finishConfiguration() { status_t res; res = configureQueueLocked(); if (res != OK) { // configureQueueLocked could return error in case of abandoned surface. // Treat as non-fatal error. if (res == NO_INIT || res == DEAD_OBJECT) { ALOGE("%s: Unable to configure stream %d queue (non-fatal): %s (%d)", __FUNCTION__, mId, strerror(-res), res); mState = STATE_ABANDONED; return res; } else if (res != OK) { ALOGE("%s: Unable to configure stream %d queue: %s (%d)", __FUNCTION__, mId, strerror(-res), res); mState = STATE_ERROR; Loading
services/camera/libcameraservice/device3/Camera3Stream.h +1 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,7 @@ class Camera3Stream : // after the HAL has provided usage and max_buffers values. After this call, // the stream must be ready to produce all buffers for registration with // HAL. // Returns NO_INIT or DEAD_OBJECT if the queue has been abandoned. virtual status_t configureQueueLocked() = 0; // Get the total number of buffers in the queue Loading