Comments (10)
i've found problems on other apps with the Nexus One having different preview
sizes
than the one the app was trying to set. Thus the call to set the camera
parameters.setPreviewSize() failed.
Maybe something similar with this bug?
Original comment by [email protected]
on 27 Apr 2010 at 5:14
from andar.
hi, suzyque.
Thanks for helping me with the bugs, I really appreciate that!! :D
when I set the preview size to something strange an Exception will occur.
Nevertheless the
Camera will work with its old preview size after all.
though this might be different on other devices, and probably I can't expect
this to be the
case. The problem is that there was no API for querying the available preview
sizes before
eclair.
The milestone does display a white screen even though setPreviewSize was
commented out. I
attached the new log.
Original comment by tdomhan
on 27 Apr 2010 at 5:47
Attachments:
from andar.
Alright I think I know what the problem is now:
* The main View of AndAR is a GLSurfaceView
* In order to display the camera video stream the byte array from the Camera get's converted to RGB and loaded as a
texture. this texture is drawn upon a rectangle.
* The Camera offers a method called "setPreviewDisplay"
* This method takes a SurfaceHolder. It uses this Holder to draw each preview frame upon it.
* Because of that a camera video stream can be drawn upon a Surface with just a few method calls.
* However, as we want to draw 3D objects we can not use this approach
* You can register a callback, that will be called every time a new preview frame arrives.
* The current approach is(as said) to take this byte array, transform it to a texture and display it on a
GLSurfaceview.
* The camera in android is not designed to supply you a raw videostream
* calling setPreviewDisplay is necessary before you start the preview
* if you don't call setPreviewDisplay the preview callback will never be called, at least on a few phones, like the
droid/milestone
* the G1/N1 don't bother if you called setPreviewDisplay or not
* So what if you call setPreviewDisplay and provide the holder of the glsurfaceview?
* In Android 1.5: this actually works!! not only that but also it has to be done, otherwise the camera will raise an
exception as you try to start the preview
* In every other Android version: the application will freeze! this is probably because both the camera and the OpenGL
thread try to draw something on the same surface
Ok I hope I could describe the problem.
In a nutshell:
* camera.setPreviewDisplay has to be called on some phones, in order to get the raw preview frame stream
* the application will freeze if you call setPreviewDisplay while using a GLSurfaceView
I currently don't know how to solve this!! Any help/ideas are welcome!
The camera API of Android kind of sucks. Why can't it just provide a raw
stream? And why does it allocate a whole
byte[width*height] array for every frame?
Original comment by tdomhan
on 29 Apr 2010 at 8:11
from andar.
Original comment by tdomhan
on 29 Apr 2010 at 8:12
- Added labels: Priority-High
- Removed labels: Priority-Medium
from andar.
could anyone try the attached version , and post the output of adb logcat?
Original comment by tdomhan
on 30 Apr 2010 at 9:48
Attachments:
from andar.
Yay! This APK worked with N1 with SDK 2.1. I've attached the logcat.
Also, I thought you might find this interesting reading....
http://nhenze.net/?p=349
Thx for debugging
Original comment by [email protected]
on 30 Apr 2010 at 12:56
Attachments:
from andar.
alright, great news :D
Thanks for the link.. interesting. I hope the devs will implement this in some
newer
version of android, although this would break backward compatibility, as
synchronization would be needed.
Original comment by tdomhan
on 30 Apr 2010 at 3:43
from andar.
alright seems to work now, fixed by commit 117-120
Original comment by tdomhan
on 30 Apr 2010 at 6:47
- Changed state: Fixed
from andar.
HI,
I found some issues with Milestone with andriod 2.1 (Thailand release). I see
the
white screen and it crashes the camera.. I need to reboot the phone to have
the
camera back. If I run first the ANDAR, see the whitescreen, close ANDAR open
the
camera soft.. I see a black where I should se the picture.
Hope this helps.
Regards,
Fernando.
Original comment by [email protected]
on 7 May 2010 at 1:59
from andar.
Hi tdomhan,Can you put the part of your ,which You explain how to
write(Comment 3)
Original comment by [email protected]
on 17 Sep 2010 at 3:28
from andar.
Related Issues (20)
- Problem with andar HOT 2
- Model viewer doesn't work for Dell Streak, even though the test app does.
- asus prime transformer problem
- Not able to load the obj file HOT 2
- Can't run the AndarSample. Help please! HOT 9
- andAR for beginner
- How to custom load texture images ?
- Possible to load an image format? png? jpet? bmp?
- ClassLoader error on example running. HOT 1
- Does it work with Virtual Devices?
- error in installation in MICROMAX A75
- Zenithink C94 White Screen
- AndroA
- AndroAR Model Viewer does not work on HTC EVO HOT 3
- Error while runnig the AndARSampleProject
- unregisterARObject method raises an exception
- Problem loading a model made in Blender
- How can i touch the 3d object and show a menu please help ?
- Mix AndAR and Min3D Problems
- AndARModelViewer clashes during the 3d model list is selected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from andar.