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

Commit b2f5b19e authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Camera3: Provide consumer usage flags to HAL for each stream

At stream configure time, pass on the stream's consumer usage flags
to the HAL, to speed up final hardware configuration.

Bug: 9592202
Change-Id: Ie467be053be36a09e482f5f05cad65df42d66476
parent 7b82efe7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ class Camera3IOStreamBase :

    virtual size_t   getBufferCountLocked();

    virtual status_t getEndpointUsage(uint32_t *usage) = 0;

    status_t getBufferPreconditionCheckLocked() const;
    status_t returnBufferPreconditionCheckLocked() const;

+6 −0
Original line number Diff line number Diff line
@@ -234,6 +234,12 @@ status_t Camera3InputStream::configureQueueLocked() {
    return OK;
}

status_t Camera3InputStream::getEndpointUsage(uint32_t *usage) {
    // Per HAL3 spec, input streams have 0 for their initial usage field.
    *usage = 0;
    return OK;
}

}; // namespace camera3

}; // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ class Camera3InputStream : public Camera3IOStreamBase {

    virtual status_t configureQueueLocked();

    virtual status_t getEndpointUsage(uint32_t *usage);

}; // class Camera3InputStream

}; // namespace camera3
+11 −0
Original line number Diff line number Diff line
@@ -364,6 +364,17 @@ status_t Camera3OutputStream::disconnectLocked() {
    return OK;
}

status_t Camera3OutputStream::getEndpointUsage(uint32_t *usage) {

    status_t res;
    int32_t u = 0;
    res = mConsumer->query(mConsumer.get(),
            NATIVE_WINDOW_CONSUMER_USAGE_BITS, &u);
    *usage = u;

    return res;
}

}; // namespace camera3

}; // namespace android
+3 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ class Camera3OutputStream :

    virtual status_t configureQueueLocked();
    virtual status_t disconnectLocked();

    virtual status_t getEndpointUsage(uint32_t *usage);

}; // class Camera3OutputStream

} // namespace camera3
Loading