Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

MarijnS95
Copy link
Member

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).

@MarijnS95 MarijnS95 force-pushed the media-format-debug branch 2 times, most recently from 28de788 to 4218769 Compare November 20, 2023 12:08
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).
@MarijnS95 MarijnS95 merged commit 2d269e1 into master Nov 22, 2023
38 checks passed
@MarijnS95 MarijnS95 deleted the media-format-debug branch November 22, 2023 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant