* StartPreview() * Toggle preview start/stop */
| 381 | * Toggle preview start/stop |
| 382 | */ |
| 383 | void NDKCamera::StartPreview(bool start) { |
| 384 | if (start) { |
| 385 | CALL_SESSION(setRepeatingRequest(captureSession_, nullptr, 1, |
| 386 | &requests_[PREVIEW_REQUEST_IDX].request_, |
| 387 | nullptr)); |
| 388 | } else if (!start && captureSessionState_ == CaptureSessionState::ACTIVE) { |
| 389 | ACameraCaptureSession_stopRepeating(captureSession_); |
| 390 | } else { |
| 391 | ASSERT(false, "Conflict states(%s, %d)", (start ? "true" : "false"), |
| 392 | static_cast<int>(captureSessionState_)); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Capture one jpg photo into |