is there a way to derectly save camera pictures in NV21 format android -


I want to know a way to save a camera photo directly on the yuv (NV21) format (on SD card or buffer) processing . I can save it in jpeg format already, but I think it is slow to convert to NV 21. In my application, it is unnecessary to show the picture taken back to the user. Here's the part where I save the photo as JPEG. Obviously I'm missing something here.

  shuttercollback shuttercollback = new shuttercollback () {public zero} on shutter {log d. (Tag, "onshooted"); }}; / ** Handles data for raw image / / imagebackback rawcolbackback = new imagecollegeback () {portraying at public zero (byte [] data, camera camera) {log d. ("On the tag" - "raw");}}; / ** JPEG handles the data for the picture / imageCollectionbackJPGColbackBack = new imageColBlock () {picturecute (byte [] data, camera camera at public zero {FileOutputStream Outstream = null; Try {// Directory String Status = Environment.GetxAnalStorage Directory (). GetPath () + "/ CamOverlay"; File Folder = New File (State); Boolean Success = True; if (! Folder.exists (! )) {Success = folder.mkdirs ();} If (! Success) log D. (tag, "no Index creation failed "); // Write sdcard string name = string format (" /% d. ", System.currentTimeMillis ()) Outstream = new file output stream (state + name +" JPG "); outstream Write (data); outstream.close (); log d. (Tag, "on picturecuton - bytes written:" + data. Lamps);} hold (FileNotFoundException e) {e.printStackTrace ();} hold (IOException e } {E.printStackTrace ();} Finally {} Log D. (Tag, "On PictureTouch - JPEG"); safeToTakePicture = true preview.camera.startPreview ();}}}}  

And here is the camera setting.

  myParamet Ers.setPictureFormat (ImageFormat.YV12);  

Setting it below did not work

  myParameters.setPictureFormat (ImageFormat.NV21);  

I am new to Android, this code has been created using many examples on the Internet. So if there is a mistake, please point it out. In Advanced.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -