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

Tell Fresco to use disk cache for thumbnails of local videos #2171

Open
ghost opened this issue Aug 3, 2018 · 2 comments
Open

Tell Fresco to use disk cache for thumbnails of local videos #2171

ghost opened this issue Aug 3, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2018

Description

I'm using version 1.10.0

  • In root application, I call Fresco.initialize(getApplicationContext()).
  • In other UI controls, I pass Uri.fromFile("file://.../sdcard/example-video.mp4") to SimpleDraweeView. The view generates in-memory thumbnail and displays it correctly.
  • I check /data/data/my.app.id/cache/image_cache/ in emulator, no files or directories are in there. Which means for local videos, Fresco does not use disk cache.

Additional Information

  • Fresco version: 1.10.0
  • Platform version: emulator API 23

May I ask if you could consider adding option to tell Fresco to use disk cache for local videos? Normally generating thumbnails takes time, like 1-2 seconds per video (on my real device). So disk cache would help a lot.

Thank you,

====================

P.S: If someone could tell me how to do this hack then it would also help a lot:

Would it be possible to force Fresco to flush the in-memory generated thumbnails to disk cache? Then next time it checks for cache, it can use the cached files.

@lambdapioneer
Copy link
Contributor

Hey @hkcorac, that sounds like a great enhancement. And I'll mark this issue as such.

The thumbnail is created in LocalVideoThumbnailProducer and the step where the images are cached on disk is DiskCacheWriteProducer. The change would require that LocalVideoThumbnailProducer returns an EncodedImage instead of an decoded image.

@ghost
Copy link
Author

ghost commented Aug 6, 2018

@lambdapioneer

Thank you very much. I found LocalVideoThumbnailProducer last some days, but couldn't go anywhere more. Your suggestion will help a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant