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

Add support for DocumentsProvider.openDocumentThumbnail() #113

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

chenxiaolong
Copy link
Owner

This will return a pipe and then spawn a background task to generate a thumbnail and write it to the pipe. Cancellation is supported in between logical operations (eg. parse headers, load frame, etc.). Android has no way to interrupt the parsers in MediaMetadataRetriever and ImageDecoder though, so there will be a delay before cancellation takes effect. This can be noticeable when scrolling quickly, for example through a list of videos, since there is a hard concurrency limit equal to the number of logical cores.

Note that only audio, image, and video formats natively supported by Android can be thumbnailed. We don't bundle any decoders.

@chenxiaolong chenxiaolong self-assigned this Dec 20, 2024
This will return a pipe and then spawn a background task to generate a
thumbnail and write it to the pipe. Cancellation is supported in between
logical operations (eg. parse headers, load frame, etc.). Android has no
way to interrupt the parsers in MediaMetadataRetriever and ImageDecoder
though, so there will be a delay before cancellation takes effect. This
can be noticeable when scrolling quickly, for example through a list of
videos, since there is a hard concurrency limit equal to the number of
logical cores.

Note that only audio, image, and video formats natively supported by
Android can be thumbnailed. We don't bundle any decoders.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
chenxiaolong added a commit that referenced this pull request Dec 20, 2024
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong merged commit 1b41b95 into master Dec 20, 2024
1 check passed
@chenxiaolong chenxiaolong deleted the thumbnail branch December 20, 2024 01:37
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