Both MediaCodec and ImageReader use callbacks, such as set_async_notify_callback, but none of the functions are marked as Send.
The documentation for MediaCodec::set_async_notify_callback specifically states that the callbacks will be invoked on an NDK internal thread, so Send should be mandatory.
For ImageReader::set_image_listener and ImageReader::set_buffer_removed_listener the documentation doesn't say anything, but from the looks of it they must run from an internal thread as well.
And after this we should see if making MediaCodec and ImageReader at least Send would make sense, as they are already internally shared between threads.
EDIT
While looking more thoroughly at the API, it may be necessary to also make Image Send, as the current recommended workflow for ImageReader is to acquire the image in the image_listener callback, and then dispatch it to another thread for processing.
Keeping Image !Send while also making the callback Send basically means that all image processing must be done in the callback, which is not ideal.
Both
MediaCodecandImageReaderuse callbacks, such asset_async_notify_callback, but none of the functions are marked asSend.The documentation for
MediaCodec::set_async_notify_callbackspecifically states that the callbacks will be invoked on an NDK internal thread, soSendshould be mandatory.For
ImageReader::set_image_listenerandImageReader::set_buffer_removed_listenerthe documentation doesn't say anything, but from the looks of it they must run from an internal thread as well.And after this we should see if making
MediaCodecandImageReaderat leastSendwould make sense, as they are already internally shared between threads.EDIT
While looking more thoroughly at the API, it may be necessary to also make
ImageSend, as the current recommended workflow forImageReaderis to acquire the image in theimage_listenercallback, and then dispatch it to another thread for processing.Keeping
Image!Sendwhile also making the callbackSendbasically means that all image processing must be done in the callback, which is not ideal.