Hi
In the AOSP based platform specific solution, we used ANativeWindow APIs (dequeue-queue) available in android source for video display.
But when we move to NDK, I do not find any suitable API for display.
If we want to use our custom soft codec implementation, the only native API available is lock()-unlockandpost() pair, which is not suited for use as decoder buffers because the design seems to be more suited for displaying graphics/UI kind of stuff. Decoders typically need to hold multiple reference frames and since lock()-unlockandpost() allows lock-ing only a single buffer at a time, this cannot be used straight away by the decoders.
We will need to have a different set of buffers for decoding data and then, copy from this set to the "lock"ed buffer for displaying the content. (Refer to the attached doc to get an idea of this design)
Some of my queries regarding such a use-case.
- I have provided a potential design - do you notice any flaw in this design?
- This design is not optimal on performance because of the additional copies involved. Any alternatives that I could explore?
- Can I instead use the dequeue-queue APIs, include necessary libraries and headers from android-source for building and be sure that the solution will work on all Android devices that run the Android version used for building?
- Is there any way for me to plugin my custom codec into stagefright without depending on android-source, so that I can let stage-fright take care of the buffer handling for me?
Regards
ABS