Coder Social home page Coder Social logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024

Original comment by tdomhan on 29 Apr 2010 at 8:12

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

from andar.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.