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

Commit e07f5372 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Add flush support" into klp-dev

parents 8271f1a2 abaa51d3
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ enum {
    CREATE_DEFAULT_REQUEST,
    GET_CAMERA_INFO,
    WAIT_UNTIL_IDLE,
    FLUSH
};

namespace {
@@ -196,6 +197,16 @@ public:
        return reply.readInt32();
    }

    virtual status_t flush()
    {
        ALOGV("flush");
        Parcel data, reply;
        data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor());
        remote()->transact(FLUSH, data, &reply);
        reply.readExceptionCode();
        return reply.readInt32();
    }

private:


@@ -325,6 +336,12 @@ status_t BnCameraDeviceUser::onTransact(
            reply->writeInt32(waitUntilIdle());
            return NO_ERROR;
        } break;
        case FLUSH: {
            CHECK_INTERFACE(ICameraDeviceUser, data, reply);
            reply->writeNoException();
            reply->writeInt32(flush());
            return NO_ERROR;
        }
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ public:

    // Wait until all the submitted requests have finished processing
    virtual status_t        waitUntilIdle() =  0;

    // Flush all pending and in-progress work as quickly as possible.
    virtual status_t        flush() = 0;
};

// ----------------------------------------------------------------------------
+14 −0
Original line number Diff line number Diff line
@@ -436,6 +436,20 @@ status_t CameraDeviceClient::waitUntilIdle()
    return res;
}

status_t CameraDeviceClient::flush() {
    ATRACE_CALL();
    ALOGV("%s", __FUNCTION__);

    status_t res = OK;
    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;

    Mutex::Autolock icl(mBinderSerializationLock);

    if (!mDevice.get()) return DEAD_OBJECT;

    return mDevice->flush();
}

status_t CameraDeviceClient::dump(int fd, const Vector<String16>& args) {
    String8 result;
    result.appendFormat("CameraDeviceClient[%d] (%p) PID: %d, dump:\n",
+4 −0
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ public:

    // Wait until all the submitted requests have finished processing
    virtual status_t      waitUntilIdle();

    // Flush all active and pending requests as fast as possible
    virtual status_t      flush();

    /**
     * Interface used by CameraService
     */
+7 −0
Original line number Diff line number Diff line
@@ -209,6 +209,13 @@ class CameraDeviceBase : public virtual RefBase {
     */
    virtual status_t pushReprocessBuffer(int reprocessStreamId,
            buffer_handle_t *buffer, wp<BufferReleasedListener> listener) = 0;

    /**
     * Flush all pending and in-flight requests. Blocks until flush is
     * complete.
     */
    virtual status_t flush() = 0;

};

}; // namespace android
Loading