0

I'm using the cwac camera android library in my app. I'm using single shot mode, so when I call 'takePicture' the preview freezes as it should. However when the fragment is paused (I've extended cameraFragment), and resumed, the preview is restarted.

I understand that is an intended feature, and that the camera does need to be given up in these situations, but I have cases where when the fragment is resumed, I want the frozen preview to still be there.

Things I've tried :

  • waiting for saveImage to be called, where I'm given the bytes of the captured image, and then I populate an image view. - works but there is significant delay between freezing the image and when saveImage Is called, making it very unattractive feeling.

  • capturing the preview screen as a bitmap (or other data format) and showing that in an image view immediately so that it appears the preview is frozen but it's just a image view. - mechanism is in place but I cannot for the life of me get the preview image (in another post, it was said that the preview frames are not exposed).

I was wondering if anyone had suggestions on how to tackle this issue? I've been at this for a while. Thanks!

trflach
  • 98
  • 1
  • 8
  • "but I have cases where when the fragment is resumed, I want the frozen preview to still be there" -- why does it have to be this fragment? The camera preview fragment is for camera previews. Why not show the frozen stuff in another fragment/activity, as the demo app does? – CommonsWare Nov 08 '14 at 14:49
  • Wouldn't that require me to wait until 'saveImage' is called? Then starting a new fragment? There is a very noticeable delay between calling takePicture and getting the real data in saveImage that I really want to eliminate. Please correct me if my understanding of the work flow is wrong. – trflach Nov 08 '14 at 15:00
  • "There is a very noticeable delay between calling takePicture and getting the real data in saveImage that I really want to eliminate" -- then the library is not what you want. You will be better served working directly with `Camera` and `Camera2`. – CommonsWare Nov 08 '14 at 15:18

0 Answers0