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_codec: Wrap common dequeued-buffer status codes in enum #401

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Jun 16, 2023

Supersedes #316, CC @zarik5
Closes #316

The dequeue API for output buffers can commonly return AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED or AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED, both of which are not caught in NdkMediaError::from_status() and show up as an "unknown" error. Neither really is an error that the user would want to bubble up from the Result<> via ?, but should rather handle this explicitly.

A similar case already exists for AMEDIACODEC_INFO_TRY_AGAIN_LATER which previously resulted in a None, but is now also encapsuled in a self-documenting manner, for the dequeue_input_buffer()` API as well.

ndk/src/media/media_codec.rs Outdated Show resolved Hide resolved
The dequeue API for output buffers can commonly return
`AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED` or
`AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED`, both of which are not caught
in `NdkMediaError::from_status()` and show up as an "unknown" error.
Neither really is an error that the user would want to bubble up from
the `Result<>` via `?`, but should rather handle this explicitly.

A similar case already exists for `AMEDIACODEC_INFO_TRY_AGAIN_LATER`
which previously resulted in a `None`, but is now also encapsuled in a
self-documenting manner, for the dequeue_input_buffer()` API as well.
@MarijnS95 MarijnS95 force-pushed the ndk-media-codec-rewrap-dequeue-results branch from c6c626c to c95567a Compare June 16, 2023 19:15
@MarijnS95 MarijnS95 requested a review from rib June 16, 2023 19:15
Copy link
Contributor

@rib rib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did all the archaeology for #316 and these issues android/ndk#1768 + https://issuetracker.google.com/u/1/issues/255698045?pli=1

fun :/

I haven't had to use these media APIs but yeah this all seems reasonable to me

@rib
Copy link
Contributor

rib commented Jun 16, 2023

Maybe also add @zarik5 as a reviewer considering they are really depending on this API

@MarijnS95
Copy link
Member Author

We've already bikeshedded this a bit in #316, I cannot assign non-collaborators for reviewers and on a prior occasion their comment was basically that they did not have time to maintain the code they contributed... so I'm not super interested in waiting for that opinion either.

@MarijnS95 MarijnS95 merged commit 54e5bfc into master Jun 16, 2023
@MarijnS95 MarijnS95 deleted the ndk-media-codec-rewrap-dequeue-results branch June 16, 2023 20:06
@zmerp
Copy link
Contributor

zmerp commented Jun 17, 2023

I already discussed these changes in the other PR, and beside the exact naming scheme,this API will suit my needs.

@zmerp
Copy link
Contributor

zmerp commented Jun 21, 2023

I switched to the rust-mobile/ndk git master in production and it works good so far.

@MarijnS95
Copy link
Member Author

@zarik5 thanks for the positive feedback, glad to hear that we might release this soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: breaking API/ABI-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants