rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

ndk/media_format: Implement `Debug` in terms of `Display` #450

Closed MarijnS95 closed 9 months ago

MarijnS95 commented 9 months ago

CC @zarik5 @spencercw

Currently Debug only prints a raw pointer which is rather useless to look at. In addition to the pointer, also print the Display representation of MediaFormat which uses Android's toString() function to create a human-readable string of the various fields set inside of it.

On a side-note it is "great" to see that toString() is not currently available as a user function via a lifetimed CStr as it is invalidated in a nontrivial way (e.g. when toString() is called again, and possibly also when set_() functions are called which are not currently borrowing it mutably).