public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { try { outerInstance.mCaptureResultQueue.put(result); } catch (InterruptedException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { // Depends on the current state and capture result, app will take next action. switch (outerInstance.State) { case IDLE: case PREVIEW: case CLOSING: // do nothing break; } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { // Depends on the current state and capture result, app will take next action. switch (outerInstance.mState) { case com.samsung.android.sdk.camera.sample.cases.Sample_Panorama.CAMERA_STATE.IDLE: case com.samsung.android.sdk.camera.sample.cases.Sample_Panorama.CAMERA_STATE.PREVIEW: case com.samsung.android.sdk.camera.sample.cases.Sample_Panorama.CAMERA_STATE.TAKE_PICTURE: // do nothing break; // If AF is triggered and AF_STATE indicates AF process is finished, app will lock AE/AWB case com.samsung.android.sdk.camera.sample.cases.Sample_Panorama.CAMERA_STATE.WAIT_AF: { if (outerInstance.isAFTriggered) { int?afState = result.get(SCaptureResult.CONTROL_AF_STATE); if (null == afState || SCaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || SCaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) { // in this way, app will compatible with legacy device outerInstance.lockAEAWB(); outerInstance.isAFTriggered = false; } } break; } // If AE/AWB is locked and AE_STATE/AWB_STATE indicates lock is completed, app will take a picture. case com.samsung.android.sdk.camera.sample.cases.Sample_Panorama.CAMERA_STATE.WAIT_AEAWB_LOCK: { if (outerInstance.isAEAWBLocked) { int?aeState = result.get(SCaptureResult.CONTROL_AE_STATE); int?awbState = result.get(SCaptureResult.CONTROL_AWB_STATE); if (null == aeState || null == awbState || (SCaptureResult.CONTROL_AE_STATE_LOCKED == aeState && (SCaptureResult.CONTROL_AWB_STATE_LOCKED == awbState || SCaptureResult.CONTROL_AWB_STATE_CONVERGED == awbState))) { // in this way, app will compatible with legacy device outerInstance.startTakePicture(); outerInstance.isAEAWBLocked = false; } } break; } } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { outerInstance.mState = CAMERA_STATE.PREVIEW; }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { // Depends on the current state and capture result, app will take next action. switch (outerInstance.State) { case IDLE: case PREVIEW: case CLOSING: // do nothing break; case TAKE_DOF_PICTURE: if (mResultListener != null) { mResultListener.checkPresetResult(result); } break; } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { if (outerInstance.outerInstance.State == CAMERA_STATE.CLOSING) { return; } outerInstance.outerInstance.mSessionCaptureCallback.ResultListener = outerInstance; outerInstance.isAFTriggered = true; }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { outerInstance.mRequestTriggered = true; }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { if (outerInstance.State == CAMERA_STATE.CLOSING) { return; } outerInstance.State = CAMERA_STATE.PREVIEW; }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { if (outerInstance.State == CAMERA_STATE.CLOSING) { return; } if (mResultListener != null) { mResultListener.checkCaptureResult(result); } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { // Depends on the current state and capture result, app will take next action. switch (outerInstance.State) { case IDLE: case PREVIEW: case CLOSING: // do nothing break; case TAKE_HDR_PICTURE: if (mResultListener != null) { mResultListener.checkPresetResult(result); } break; case WAIT_AF: { if (outerInstance.isAFTriggered) { int? afState = result.get(SCaptureResult.CONTROL_AF_STATE); // Check if AF is finished. If finished, take hdr picture. if (null == afState || SCaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || SCaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) { outerInstance.isAFTriggered = false; outerInstance.lockAE(); } } break; } case WAIT_AE_LOCK: { if (result.get(SCaptureResult.CONTROL_AE_STATE) != null && result.get(SCaptureResult.CONTROL_AE_STATE) == SCaptureResult.CONTROL_AE_STATE_LOCKED) { outerInstance.takeHdrPicture(); } break; } } }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { // Remove comment, if you want to check request/result from console log. // dumpCaptureResultToLog(result); // dumpCaptureRequestToLog(request); // Depends on the current state and capture result, app will take next action. switch (outerInstance.State) { case IDLE: case TAKE_PICTURE: case CLOSING: // do nothing break; case PREVIEW: if (result.get(SCaptureResult.STATISTICS_FACES) != null) { outerInstance.processFace(result.get(SCaptureResult.STATISTICS_FACES), result.get(SCaptureResult.SCALER_CROP_REGION)); } break; // If AF is triggered and AF_STATE indicates AF process is finished, app will trigger AE pre-capture. case WAIT_AF: { if (outerInstance.isAFTriggered) { int afState = result.get(SCaptureResult.CONTROL_AF_STATE); // Check if AF is finished. if (SCaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || SCaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) { // If AE mode is off or device is legacy device then skip AE pre-capture. if (result.get(SCaptureResult.CONTROL_AE_MODE) != SCaptureResult.CONTROL_AE_MODE_OFF && outerInstance.mCharacteristics.get(SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL) != SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) { outerInstance.triggerAE(); } else { outerInstance.takePicture(); } outerInstance.isAFTriggered = false; } } break; } // If AE is triggered and AE_STATE indicates AE pre-capture process is finished, app will take a picture. case WAIT_AE: { if (outerInstance.isAETriggered) { int? aeState = result.get(SCaptureResult.CONTROL_AE_STATE); if (null == aeState || SCaptureResult.CONTROL_AE_STATE_CONVERGED == aeState || SCaptureResult.CONTROL_AE_STATE_FLASH_REQUIRED == aeState || SCaptureResult.CONTROL_AE_STATE_LOCKED == aeState) { // Legacy device might have null AE_STATE. However, this should not be happened as we skip triggerAE() for legacy device outerInstance.takePicture(); outerInstance.isAETriggered = false; } } break; } } }
/// <summary> /// Dump <seealso cref="com.samsung.android.sdk.camera.SCaptureRequest"/> to console log. /// </summary> private void dumpCaptureRequestToLog(SCaptureRequest request) { Log.v(TAG, "Dump of SCaptureRequest"); //JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET: //ORIGINAL LINE: for(com.samsung.android.sdk.camera.SCaptureRequest.Key<?> key : request.getKeys()) foreach (SCaptureRequest.Key<?> key in request.Keys) { if (request.get(key) is int[]) { Log.v(TAG, key.Name + ": " + Arrays.ToString((int[]) request.get(key))); } else if (request.get(key) is float[]) { Log.v(TAG, key.Name + ": " + Arrays.ToString((float[]) request.get(key))); } else if (request.get(key) is long[]) { Log.v(TAG, key.Name + ": " + Arrays.ToString((long[]) request.get(key))); } else if (request.get(key) is MeteringRectangle[]) { Log.v(TAG, key.Name + ": " + Arrays.deepToString((MeteringRectangle[]) request.get(key))); } else if (request.get(key) is Rational[]) { Log.v(TAG, key.Name + ": " + Arrays.deepToString((Rational[]) request.get(key))); } else if (request.get(key) is Face[]) { Log.v(TAG, key.Name + ": " + Arrays.deepToString((Face[]) request.get(key))); } else if (request.get(key) is Point[]) { Log.v(TAG, key.Name + ": " + Arrays.deepToString((Point[]) request.get(key))); } else { Log.v(TAG, key.Name + ": " + request.get(key)); } } }
public override void onCaptureFailed(SCameraCaptureSession session, SCaptureRequest request, SCaptureFailure failure) { if (outerInstance.State == CAMERA_STATE.CLOSING) { return; } outerInstance.showAlertDialog("JPEG Capture failed.", false); outerInstance.unlockAF(); }
public override void onCaptureCompleted(SCameraCaptureSession session, SCaptureRequest request, STotalCaptureResult result) { try { outerInstance.mCaptureResultQueue.put(result); } catch (InterruptedException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } if (outerInstance.State == CAMERA_STATE.CLOSING) { return; } outerInstance.unlockAF(); }