Problem with camera takePicture

All your problems with Audio, Video and Images.

Problem with camera takePicture

Postby andruud » Wed Feb 10, 2010 3:53 pm

I try to make an application which records video from the camera, so I'll start with a test taking a simple picture.

The shuttercallback is called, but after that the program crashes.
In the logs I find:
copyBits failed (invalid argument)
copybit failed (unknown error -22)

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     void TakePicture()
  2.     {
  3.                 Log.i(TAG, "Try to take picture");
  4.                 try
  5.                 {
  6.                         mCamera.stopPreview();
  7.                         mCamera.takePicture(mShutterCallback, mRawCallback, mPictureCallback);
  8.                         mCamera.startPreview();
  9.                 }
  10.                 catch (Exception e)
  11.                 {
  12.                         Log.e(TAG, e.getCause() + " - "+ e.getMessage());
  13.                 }
  14.     }
Parsed in 0.014 seconds, using GeSHi

Can somebody help me?

I use the HTC Tattoo with Android 1.6.
Once Poster
Once Poster
Posts: 1
Joined: Wed Feb 10, 2010 3:37 pm


Postby eyurdakul » Thu Mar 04, 2010 1:47 pm

you have to create a picturecallback class and implement it's methods and create an instance or create an instance of existing picturecallback with your own onpicturetaken method. To preview, you need to create a surface view and ofcourse with its own surface listener so you have to create surface listener and implement the needed methods like surface created or surface destroy. once the surface is created, you can put the preview on this surface. after that when you call take picture, the camera will take the picture and call the callbacks with this data which are mShutterCallback, mRawCallback, mPictureCallback in your case.
Junior Developer
Junior Developer
Posts: 13
Joined: Thu Mar 04, 2010 1:19 pm


Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 5 guests