Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ndk/image_reader: Don't special-case
ImgreaderNoBufferAvailable
in …
…non-async functions Both async and non-async `acquire_next/latest_image()` functions will return `ImgreaderNoBufferAvailable` when the producer has not provided a buffer that is either ready for consumption or that can be blocked on (either inside a non-async method, or by returning the accompanying fence file descriptor). After all, if there's no buffer submitted by a producer, there is no fence to wait on. Hence the current API signatures create the false assumption that only non-async functions can "not have a buffer available at all", when the exact same is true for `_async()` functions, in order to provide an image buffer with a fence that is signalled when it is ready for reading. Instead of special-casing this error in the `_async()` functions, make all functions return a flat `Result` and remove the `Option`, while documenting that this is a common error for the caller to handle gracefully.
- Loading branch information