|
|
|
|
|
by allo37
2338 days ago
|
|
On Android, that there hasn't been much love for C/C++ and the NDK is full of interesting pitfalls: Oh your camera gives you NV21 frames, but the hardware VP8 encoder only accepts I420? Makes perfect sense. Oh, we don't actually let you query what format the encoder expects until a later API than you're using. Just try them in a loop until one doesn't fail, makes perfect sense. The camera was a party too, added a listener for Camera session events and the app crashed. Yay. |
|
All of the MediaCodec APIs were quite powerful, but did nothing to "keep the easy things easy" or hide much of the lower level hardware details from your app.
This is kind of a theme in Android (or was... my experience is slightly out of date right now).
As mentioned by "McDev" in what is currently the top post on this thread it is a good idea to use time-tested third party libraries to do things that you'd kinda expect the OS to handle naively because the OS level APIs don't do a great job at abstracting any of the details away even for things that you'd think you shouldn't have to worry about, like basic image loading with caching and resizing. And that's just still images, never mind when you get into video de/compression.
Hopefully this is something the Android team is working on as they shift more effort toward Kotlin and Jetpack but I haven't had enough recent hands-on experience to know if this is better now.