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

App: Add asset streaming #8

Closed
FlorianUekermann opened this issue Aug 15, 2017 · 3 comments
Closed

App: Add asset streaming #8

FlorianUekermann opened this issue Aug 15, 2017 · 3 comments

Comments

@FlorianUekermann
Copy link
Contributor

App should offer something like GetAssetReader(name string) io.ReadCloser to allow streaming large assets. The NDK functions work like that way anyway. See #7 for why this may not be trivial.

@xlab
Copy link
Owner

xlab commented Aug 15, 2017

Seems to be trivial, we should acquire AssetManager and wrap it within AssetReader that will manage locking (locking mux is located in nativeActivity though, called activityMux) and chunked reads (see the final version of #7).

@FlorianUekermann
Copy link
Contributor Author

Ah, now I get why you added that. The AssetManager is actually thread safe according to the docs. The problem is AAsset. The mutex should be in the io.ReadCloser that contains the reference to AAsset (assuming that this is indeed trivial, I'm not 100% sure about that, because I can't wrap my head around the panic I got).

@xlab
Copy link
Owner

xlab commented Aug 15, 2017

@MaVo159
As long as

AssetManager is actually thread safe

This is ok:

The mutex should be in the io.ReadCloser

I'll leave the implementation up to you, I have nothing to test..

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

No branches or pull requests

2 participants