Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c89a2e9 authored by Igor Murashkin's avatar Igor Murashkin Committed by Android (Google) Code Review
Browse files

Merge "camera3: Don't try to disconnect stream native windows more than once" into jb-mr2-dev

parents 6f6b31da e2172bed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -677,6 +677,8 @@ status_t Camera3Device::deleteStream(int id) {
    Mutex::Autolock l(mLock);
    status_t res;

    ALOGV("%s: Camera %d: Deleting stream %d", __FUNCTION__, mId, id);

    // CameraDevice semantics require device to already be idle before
    // deleteStream is called, unlike for createStream.
    if (mStatus != STATUS_IDLE) {
+3 −1
Original line number Diff line number Diff line
@@ -159,7 +159,9 @@ status_t Camera3IOStreamBase::disconnectLocked() {
            break;
        default:
            // No connection, nothing to do
            return OK;
            ALOGV("%s: Stream %d: Already disconnected",
                  __FUNCTION__, mId);
            return -ENOTCONN;
    }

    if (mDequeuedBufferCount > 0) {
+9 −1
Original line number Diff line number Diff line
@@ -258,7 +258,15 @@ bool Camera3Stream::hasOutstandingBuffers() const {
status_t Camera3Stream::disconnect() {
    ATRACE_CALL();
    Mutex::Autolock l(mLock);
    return disconnectLocked();
    ALOGV("%s: Stream %d: Disconnecting...", __FUNCTION__, mId);
    status_t res = disconnectLocked();

    if (res == -ENOTCONN) {
        // "Already disconnected" -- not an error
        return OK;
    } else {
        return res;
    }
}

status_t Camera3Stream::registerBuffersLocked(camera3_device *hal3Device) {
+1 −0
Original line number Diff line number Diff line
@@ -251,6 +251,7 @@ class Camera3Stream :
    virtual status_t returnInputBufferLocked(
            const camera3_stream_buffer &buffer);
    virtual bool     hasOutstandingBuffersLocked() const = 0;
    // Can return -ENOTCONN when we are already disconnected (not an error)
    virtual status_t disconnectLocked() = 0;

    // Configure the buffer queue interface to the other end of the stream,