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

Commit 5b9e9b17 authored by Igor Murashkin's avatar Igor Murashkin Committed by Android Git Automerger
Browse files

am 1da8c89a: Merge "camera: Configure streams immediately when API2 does...

am 1da8c89a: Merge "camera: Configure streams immediately when API2 does configuration" into lmp-dev

* commit '1da8c89a':
  camera: Configure streams immediately when API2 does configuration
parents c2b66c72 1da8c89a
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -254,9 +254,17 @@ status_t CameraDeviceClient::beginConfigure() {
}

status_t CameraDeviceClient::endConfigure() {
    // TODO: Implement this.
    ALOGE("%s: Not implemented yet.", __FUNCTION__);
    return OK;
    ALOGV("%s: ending configure (%zu streams)",
            __FUNCTION__, mStreamMap.size());

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

    Mutex::Autolock icl(mBinderSerializationLock);

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

    return mDevice->configureStreams();
}

status_t CameraDeviceClient::deleteStream(int streamId) {
+12 −0
Original line number Diff line number Diff line
@@ -140,6 +140,18 @@ class CameraDeviceBase : public virtual RefBase {
     */
    virtual status_t deleteReprocessStream(int id) = 0;

    /**
     * Take the currently-defined set of streams and configure the HAL to use
     * them. This is a long-running operation (may be several hundered ms).
     *
     * The device must be idle (see waitUntilDrained) before calling this.
     *
     * Returns OK on success; otherwise on error:
     * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes)
     * - INVALID_OPERATION if the device was in the wrong state
     */
    virtual status_t configureStreams() = 0;

    /**
     * Create a metadata buffer with fields that the HAL device believes are
     * best for the given use case
+13 −0
Original line number Diff line number Diff line
@@ -415,6 +415,19 @@ status_t Camera2Device::deleteReprocessStream(int id) {
    return OK;
}

status_t Camera2Device::configureStreams() {
    ATRACE_CALL();
    ALOGV("%s: E", __FUNCTION__);

    /**
     * HAL2 devices do not need to configure streams;
     * streams are created on the fly.
     */
    ALOGW("%s: No-op for HAL2 devices", __FUNCTION__);

    return OK;
}


status_t Camera2Device::createDefaultRequest(int templateId,
        CameraMetadata *request) {
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ class Camera2Device: public CameraDeviceBase {
    virtual status_t setStreamTransform(int id, int transform);
    virtual status_t deleteStream(int id);
    virtual status_t deleteReprocessStream(int id);
    // No-op on HAL2 devices
    virtual status_t configureStreams();
    virtual status_t createDefaultRequest(int templateId, CameraMetadata *request);
    virtual status_t waitUntilDrained();
    virtual status_t setNotifyCallback(NotificationListener *listener);
+9 −0
Original line number Diff line number Diff line
@@ -1000,6 +1000,15 @@ status_t Camera3Device::deleteReprocessStream(int id) {
    return INVALID_OPERATION;
}

status_t Camera3Device::configureStreams() {
    ATRACE_CALL();
    ALOGV("%s: E", __FUNCTION__);

    Mutex::Autolock il(mInterfaceLock);
    Mutex::Autolock l(mLock);

    return configureStreamsLocked();
}

status_t Camera3Device::createDefaultRequest(int templateId,
        CameraMetadata *request) {
Loading