I'm newbie in c++ and try to implement a native library for my android app to encode and decode audio using NDK and FFmpeg, during the implementation process I noticed that I quite often use pointers to std::pair<uint_8t *, int>
to storing audio samples data and data length in it.
Also i can create a struct with the same types of variables that my pair has and use this struct instead of the pairs, but since I don't have much knowledge in c++ I'd like to know which type is more suitable in my work, which is more fast and has low memory usage and also might there are more effective types in c++ that i don't know?
As for my native library it just encodes/decodes and resamples audio and it doesn't have async functions, threads and so on and executes in the same thread that called it's methods from java/kotlin layer.