A handle to a single camera input or output stream. A stream is defined by the framework by its buffer resolution and format, and additionally by the HAL with the gralloc usage flags and the maximum in-flight buffer count.
The stream structures are owned by the framework, but pointers to a camera3_stream passed into the HAL by configure_streams() are valid until the end of the first subsequent configure_streams() call that does not include that camera3_stream as an argument, or until the end of the close() call.
All camera3_stream framework-controlled members are immutable once the camera3_stream is passed into configure_streams(). The HAL may only change the HAL-controlled parameters during a configure_streams() call, except for the contents of the private pointer.
If a configure_streams() call returns a non-fatal error, all active streams remain valid as if configure_streams() had not been called.
The endpoint of the stream is not visible to the camera HAL device. In DEVICE_API_VERSION_3_1, this was changed to share consumer usage flags on streams where the camera is a producer (OUTPUT and BIDIRECTIONAL stream types) see the usage field below.
The pixel format for the buffers in this stream. Format is a value from the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or from device-specific headers.
If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform gralloc module will select a format based on the usage flags provided by the camera device and the other endpoint of the stream.
The camera HAL device must inspect the buffers handed to it in the subsequent register_stream_buffers() call to obtain the implementation-specific format details, if necessary.
register_stream_buffers() won't be called by the framework, so the HAL should configure the ISP and sensor pipeline based purely on the sizes, usage flags, and formats for the configured streams.
The gralloc usage flags for this stream, as needed by the HAL. The usage flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific headers.
For output streams, these are the HAL's producer usage flags. For input streams, these are the HAL's consumer usage flags. The usage flags from the producer and the consumer will be combined together and then passed to the platform gralloc HAL module for allocating the gralloc buffers for each stream.
No initial value guaranteed when passed via configure_streams(). HAL may not use this field as input, and must write over this field with its usage flags.
For stream_type OUTPUT and BIDIRECTIONAL, when passed via configure_streams(), the initial value of this is the consumer's usage flags. The HAL may use these consumer flags to decide stream configuration. For stream_type INPUT, when passed via configure_streams(), the initial value of this is 0. For all streams passed via configure_streams(), the HAL must write over this field with its usage flags.