-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
getBitmapWithFilterApplied() hangs my mobile. #19
Comments
I'm not 100% sure, but I've been looking into how to do live processing of images, using the pixel buffers. As I've been looking into it, several people have said that doing offscreen rendering can not work on certain devices. This is because some devices (I believe it was pre android 3.0) drivers do not support multiple active GL contexts across processes. I would try your code on a newer android phone and see if it works. If so, there might not be anyway to fix this for now, unless a better algoritm is suggested. Otherwise, perhaps there is an underlying issue |
I have solved it creating a Bitmap from GLSurface in "onDrawFrame". But I have discover another problem, the resulting Bitmap depends on GLSurfaceView width and height. On my Samsung Galaxy Ace the resulting Bitmap is 320x240, but in my LG Optimus 3D is 800x480. I have solved the last problem forcing "onMeasure" to be 800x800. Sorry about my english. |
Thank you for opening this issue. This was something that was concerning me when I built GPUImage for Android. Reading it in onDrawFrame seemed the nicer way, but I did not like the low quality it will return on some phones. the onMeasure solution seems to be an interesting way. Maybe have it normal size, then quickly measure it with different size when storing. Sadly loaded image is pretty small too. I resized it to screen size to make sure there won't be memory problems. That needs to be done nicer. I do not know when I will have time to fix this. But if anyone sends a pull request, that would be the fastest way :) |
Thank you pboos, setting onMeasure in 800x800 (and 800x800 in layout too) my images with a resolution of 800x600 are working perfectly. I can save it in Bitmap and upload to a server, with perfect quality. But is a very dirty solution and very slow, I hope that you can find a solution to this problem. Thank you. |
Would you mind posting some of your code? I believe I am trying to solve a very similar problem |
Hello Jamie, I don't know how to make a gist. I could send you a copy of my code to your email. |
Sure, that would be awesome. Jmatthews08@gmail.com . If I come up with any optimizations, I will post them here! |
I have send you and email with the code and an example code. |
Could you share it as a gist? Just go to https://gist.github.com/, login with github, share and post url here :). Really easy :). Than I will try to find a way to integrate it :) |
Ok, here is a gist with his updates. I copied over some stuff that I didn't have about scaletype, but in retrospect I dont think that had anything to do with this particular change. @javierpuntonet I also changed the name of the callback class, to be in english. https://gist.github.com/jamieomatthews/5216018#file-gpuimagechanges |
Ok, no problem Jamie. |
Thank you very much for the code provided above. With the given idea i now changed the saving process to getting the Bitmap from the same gl context through during onDrawFrame. As well I added resizing in there. Became kind of ugly, but it works fine so far. I hope this solves the problems :) |
Brilliant work pboos, works perfectly! |
I think this issue can be closed. The new capture method works perfectly. |
…. Resize view for capturing picture of bigger size. Closes cats-oss#19 References cats-oss#31
I tested the latest code pulled from the master branch, and found My testing code is,
|
Hi,
getBitmapWithFilterApplied() hangs my Samsung Galaxy Ace after called.
The text was updated successfully, but these errors were encountered: