1

I am new to android development. Here i want to show two camera view in a screen and also want to capture image separately when user tap on camera views.

I am looking for somebody's help..Thanks..

Jeeva S.K
  • 13
  • 1
  • 3
  • check this link : http://stackoverflow.com/questions/11539139/example-of-camera-preview-using-surfacetexture-in-android – Rustam Sep 15 '14 at 06:46

1 Answers1

0

You can only open a given camera (front or back) once, you cannot open the camera multiple times to produce multiple preview streams. In fact, on most devices, you can't open the front and back cameras simultaneously, since the camera processing pipeline is shared between the two cameras.

To do this, you need to only open the camera once, and then split the output preview data into the three parts that you then display.

If you need to run on Android versions before 3.0 (Honeycomb), then you need to use the preview callbacks. With them, you'll get a byte[] array of YUV data for each frame that you can then crop, convert to RGB, and place in an ImageView or SurfaceView.

On Android 3.0 or later, you can use the setPreviewTexture method to pipe the preview data into an OpenGL texture, which you can then render to multiple quads in a GLSurfaceView or equivalent.

Sagar Pilkhwal
  • 3,998
  • 2
  • 25
  • 77
  • Thanks for your response.. Give me some idea to show two preview view for camera.. – Jeeva S.K Sep 15 '14 at 06:47
  • here are some tutorial links which you can go through: [Link 1](http://www.androidzeitgeist.com/2012/10/displaying-camera-preview-instant.html) [Link 2](http://android-er.blogspot.in/2010/12/camera-preview-on-surfaceview.html) [Link 3](http://www.tutorialspoint.com/android/android_camera.htm) [Link 4](http://www.airpair.com/android/android-camera-surface-view-fragment) – Sagar Pilkhwal Sep 15 '14 at 06:52
  • hey Jeeva did you solve your question? – Sagar Pilkhwal Sep 15 '14 at 08:44
  • Not yet solved Sagar.. But link provide by you is helpful to do R&D.. – Jeeva S.K Sep 15 '14 at 08:59
  • Hey Guys i had a same Problem. now i am developing a camera App and i used Surfaceview for My App.also i want to use more Camera Preview on a single activity. that is why i need solution of this Question I Already asked this Question Here,Please Check :- http://stackoverflow.com/questions/41392791/how-to-apply-custom-filters-in-a-camera-surfaceview-preview ..please tell me if anyone know about that.PLEASE. HELP ME Guys..): – Sagar Aghara Jan 03 '17 at 05:48