@Override public void OnWorkDone(File file) { MediaScannerManager.ScanMedia(Settings.context.getApplicationContext(), file); if (burstcount == ParameterHandler.Burst.GetValue() - 1) { stopworking(); baseCameraHolder.StartPreview(); } else if (burstcount < ParameterHandler.Burst.GetValue() - 1) burstcount++; }
@Override public void DoWork() { if (!this.isWorking) { startworking(); if (ParameterHandler.Burst != null && ParameterHandler.Burst.IsSupported() && ParameterHandler.Burst.GetValue() > 1) { handler.post( new Runnable() { @Override public void run() { burstcount = 0; baseCameraHolder.TakePicture(null, null, burstCallback); } }); } else { final String picFormat = baseCameraHolder.ParameterHandler.PictureFormat.GetValue(); if (picFormat.equals("jpeg")) { final JpegSaver jpegSaver = new JpegSaver(baseCameraHolder, this, handler, Settings.GetWriteExternal()); jpegSaver.TakePicture(); } else if (picFormat.equals("jps")) { final JpsSaver jpsSaver = new JpsSaver(baseCameraHolder, this, handler, Settings.GetWriteExternal()); jpsSaver.TakePicture(); } else if (ParameterHandler.IsDngActive() && (picFormat.contains("bayer") || picFormat.contains("raw"))) { DngSaver dngSaver = new DngSaver(baseCameraHolder, this, handler, Settings.GetWriteExternal()); dngSaver.TakePicture(); } else if (ParameterHandler.IsDngActive() == false && (picFormat.contains("bayer") || picFormat.contains("raw") || !DeviceUtils.isMediaTekDevice())) { final RawSaver rawSaver = new RawSaver(baseCameraHolder, this, handler, Settings.GetWriteExternal()); rawSaver.TakePicture(); } } } }