One of the official Google samples for the Camera2 API suffers from the same BufferQueue has been abandoned
problem as is seen in:
Specifically, the sample app calls a closeCamera()
method from onPause()
of a fragment, where closeCamera()
calls close()
on the CameraCaptureSession
, then close()
on the CameraDevice
, then close()
on the ImageReader
(used for actual picture-taking). After the close()
on CameraDevice
is when a few occurrences of the aforementioned BufferQueue has been abandoned
message appears in LogCat, though I only get the message on some Android 5.1 hardware (Nexus 4 and Nexus 7 2013) and not others (Nexus 5 and Nexus 6).
fadden's comment on this was:
If the consumer side is shut down before entering onPause(), the messages would be expected.
When will TextureView
's "consumer side" will be shut down, and why then?
Google's sample code does not proactively do anything to shut down the TextureView
that I can see. And, since the TextureView
could still be visible when paused, I would have expected that the "consumer side" would not be affected at the time of onPause()
, but perhaps later in onStop()
.
While I realize that this message (despite being an error) is benign, I'm trying to figure out how to get rid of it, if for no other reason than to prevent my being asked time and again why code of mine is logging this error. I am hoping that by understanding more about this "consumer side", I can figure out how better to tidy things up when the user exits a Camera2-using activity or fragment and avoid this error.