diff options
Diffstat (limited to 'services/camera/libcameraservice/device3/Camera3Stream.h')
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Stream.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Stream.h b/services/camera/libcameraservice/device3/Camera3Stream.h index 6eeb721..14f5387 100644 --- a/services/camera/libcameraservice/device3/Camera3Stream.h +++ b/services/camera/libcameraservice/device3/Camera3Stream.h @@ -82,6 +82,23 @@ namespace camera3 { * STATE_CONFIGURED => STATE_CONSTRUCTED: * When disconnect() is called after making sure stream is idle with * waitUntilIdle(). + * + * Status Tracking: + * Each stream is tracked by StatusTracker as a separate component, + * depending on the handed out buffer count. The state must be STATE_CONFIGURED + * in order for the component to be marked. + * + * It's marked in one of two ways: + * + * - ACTIVE: One or more buffers have been handed out (with #getBuffer). + * - IDLE: All buffers have been returned (with #returnBuffer), and their + * respective release_fence(s) have been signaled. + * + * A typical use case is output streams. When the HAL has any buffers + * dequeued, the stream is marked ACTIVE. When the HAL returns all buffers + * (e.g. if no capture requests are active), the stream is marked IDLE. + * In this use case, the app consumer does not affect the component status. + * */ class Camera3Stream : protected camera3_stream, @@ -262,6 +279,12 @@ class Camera3Stream : // Get the total number of buffers in the queue virtual size_t getBufferCountLocked() = 0; + // Get handout output buffer count. + virtual size_t getHandoutOutputBufferCountLocked() = 0; + + // Get handout input buffer count. + virtual size_t getHandoutInputBufferCountLocked() = 0; + // Get the usage flags for the other endpoint, or return // INVALID_OPERATION if they cannot be obtained. virtual status_t getEndpointUsage(uint32_t *usage) = 0; @@ -274,6 +297,9 @@ class Camera3Stream : private: uint32_t oldUsage; uint32_t oldMaxBuffers; + Condition mOutputBufferReturnedSignal; + Condition mInputBufferReturnedSignal; + static const nsecs_t kWaitForBufferDuration = 3000000000LL; // 3000 ms // Gets all buffers from endpoint and registers them with the HAL. status_t registerBuffersLocked(camera3_device *hal3Device); |