Remove a few TODOs
This commit is contained in:
parent
dff8fc7178
commit
89a35812f7
@ -32,7 +32,7 @@ suspend fun CameraView.startRecording(options: ReadableMap, onRecordCallback: Ca
|
|||||||
override fun onVideoSaved(outputFileResults: VideoCapture.OutputFileResults) {
|
override fun onVideoSaved(outputFileResults: VideoCapture.OutputFileResults) {
|
||||||
val map = Arguments.createMap()
|
val map = Arguments.createMap()
|
||||||
map.putString("path", videoFile.absolutePath)
|
map.putString("path", videoFile.absolutePath)
|
||||||
// TODO: duration and size
|
// TODO: duration and size - see https://github.com/cuvent/react-native-vision-camera/issues/77
|
||||||
onRecordCallback(map, null)
|
onRecordCallback(map, null)
|
||||||
|
|
||||||
// reset the torch mode
|
// reset the torch mode
|
||||||
|
@ -22,12 +22,6 @@ suspend fun CameraView.takePhoto(options: ReadableMap): WritableMap = coroutineS
|
|||||||
Log.d(CameraView.REACT_CLASS, "takePhoto() called")
|
Log.d(CameraView.REACT_CLASS, "takePhoto() called")
|
||||||
val imageCapture = imageCapture ?: throw CameraNotReadyError()
|
val imageCapture = imageCapture ?: throw CameraNotReadyError()
|
||||||
|
|
||||||
if (options.hasKey("photoCodec")) {
|
|
||||||
// TODO photoCodec
|
|
||||||
}
|
|
||||||
if (options.hasKey("qualityPrioritization")) {
|
|
||||||
// TODO qualityPrioritization
|
|
||||||
}
|
|
||||||
if (options.hasKey("flash")) {
|
if (options.hasKey("flash")) {
|
||||||
val flashMode = options.getString("flash")
|
val flashMode = options.getString("flash")
|
||||||
imageCapture.flashMode = when (flashMode) {
|
imageCapture.flashMode = when (flashMode) {
|
||||||
@ -37,6 +31,13 @@ suspend fun CameraView.takePhoto(options: ReadableMap): WritableMap = coroutineS
|
|||||||
else -> throw InvalidTypeScriptUnionError("flash", flashMode ?: "(null)")
|
else -> throw InvalidTypeScriptUnionError("flash", flashMode ?: "(null)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// All those options are not yet implemented - see https://github.com/cuvent/react-native-vision-camera/issues/75
|
||||||
|
if (options.hasKey("photoCodec")) {
|
||||||
|
// TODO photoCodec
|
||||||
|
}
|
||||||
|
if (options.hasKey("qualityPrioritization")) {
|
||||||
|
// TODO qualityPrioritization
|
||||||
|
}
|
||||||
if (options.hasKey("enableAutoRedEyeReduction")) {
|
if (options.hasKey("enableAutoRedEyeReduction")) {
|
||||||
// TODO enableAutoRedEyeReduction
|
// TODO enableAutoRedEyeReduction
|
||||||
}
|
}
|
||||||
@ -56,7 +57,7 @@ suspend fun CameraView.takePhoto(options: ReadableMap): WritableMap = coroutineS
|
|||||||
|
|
||||||
val camera2Info = Camera2CameraInfo.from(camera!!.cameraInfo)
|
val camera2Info = Camera2CameraInfo.from(camera!!.cameraInfo)
|
||||||
val lensFacing = camera2Info.getCameraCharacteristic(CameraCharacteristics.LENS_FACING)
|
val lensFacing = camera2Info.getCameraCharacteristic(CameraCharacteristics.LENS_FACING)
|
||||||
// TODO: Flip image if lens is front side
|
// TODO: Flip image if lens is front side - see https://github.com/cuvent/react-native-vision-camera/issues/74
|
||||||
|
|
||||||
val results = awaitAll(
|
val results = awaitAll(
|
||||||
async(coroutineContext) {
|
async(coroutineContext) {
|
||||||
|
@ -31,40 +31,25 @@ import java.util.concurrent.Executors
|
|||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
// CaptureRequest.java
|
|
||||||
// TODO: CONTROL_AE_ANTIBANDING_MODE (60Hz, 50Hz lights)
|
|
||||||
// TODO: CONTROL_AE_MODE for RedEye reduction
|
|
||||||
// TODO: CONTROL_AE_TARGET_FPS_RANGE if FPS changes
|
|
||||||
// TODO: CONTROL_CAPTURE_INTENT for prioritization (Preview, Still Capture, Video recording)
|
|
||||||
// TODO: CONTROL_EFFECT_MODE for color filters/effects
|
|
||||||
// TODO: CONTROL_SCENE_MODE contains HDR, do I need that?
|
|
||||||
// TODO: CONTROL_VIDEO_STABILIZATION_MODE and STATISTICS_OIS_DATA_MODE for stabilization techniques
|
|
||||||
// TODO: CONTROL_ENABLE_ZSL for Zero Shutter Lag (speed prio)
|
|
||||||
// TODO: EDGE_MODE not sure what that is
|
|
||||||
// TODO: JPEG_xxx other JPEG options
|
|
||||||
// TODO: NOISE_REDUCTION_MODE also maybe ZSL
|
|
||||||
// TODO: SCALER_CROP_REGION for digital zoom
|
|
||||||
// TODO: SENSOR_FRAME_DURATION for FPS
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// TODOs for the CameraView which are currently too hard to implement either because of CameraX' limitations, or my brain capacity.
|
// TODOs for the CameraView which are currently too hard to implement either because of CameraX' limitations, or my brain capacity.
|
||||||
//
|
//
|
||||||
// CameraView
|
// CameraView
|
||||||
|
// TODO: Actually use correct sizes for video and photo (currently it's both the video size)
|
||||||
// TODO: Configurable FPS higher than 30
|
// TODO: Configurable FPS higher than 30
|
||||||
// TODO: High-speed video recordings (export in CameraViewModule::getAvailableVideoDevices(), and set in CameraView::configurePreview()) (120FPS+)
|
// TODO: High-speed video recordings (export in CameraViewModule::getAvailableVideoDevices(), and set in CameraView::configurePreview()) (120FPS+)
|
||||||
// TODO: configureSession() Use format (photoWidth/photoHeight)
|
|
||||||
// TODO: configureSession() enableDepthData
|
// TODO: configureSession() enableDepthData
|
||||||
// TODO: configureSession() enableHighResolutionCapture
|
// TODO: configureSession() enableHighResolutionCapture
|
||||||
// TODO: configureSession() enablePortraitEffectsMatteDelivery
|
// TODO: configureSession() enablePortraitEffectsMatteDelivery
|
||||||
// TODO: configureSession() scannableCodes | onCodeScanned
|
|
||||||
// TODO: configureSession() colorSpace
|
// TODO: configureSession() colorSpace
|
||||||
|
|
||||||
// CameraView+RecordVideo
|
// CameraView+RecordVideo
|
||||||
// TODO: Better startRecording()/stopRecording() (promise + callback, wait for TurboModules/JSI)
|
// TODO: Better startRecording()/stopRecording() (promise + callback, wait for TurboModules/JSI)
|
||||||
// TODO: videoStabilizationMode
|
// TODO: videoStabilizationMode
|
||||||
// TODO: Video HDR
|
// TODO: Return Video size/duration
|
||||||
|
|
||||||
// CameraView+TakePhoto
|
// CameraView+TakePhoto
|
||||||
|
// TODO: Mirror selfie images
|
||||||
// TODO: takePhoto() depth data
|
// TODO: takePhoto() depth data
|
||||||
// TODO: takePhoto() raw capture
|
// TODO: takePhoto() raw capture
|
||||||
// TODO: takePhoto() photoCodec ("hevc" | "jpeg" | "raw")
|
// TODO: takePhoto() photoCodec ("hevc" | "jpeg" | "raw")
|
||||||
|
@ -99,7 +99,6 @@ class CameraViewManager : SimpleViewManager<CameraView>() {
|
|||||||
fun setTorch(view: CameraView, torch: String) {
|
fun setTorch(view: CameraView, torch: String) {
|
||||||
if (view.torch != torch)
|
if (view.torch != torch)
|
||||||
addChangedPropToTransaction(view, "torch")
|
addChangedPropToTransaction(view, "torch")
|
||||||
// TODO: why THE FUCK is this not being called?
|
|
||||||
view.torch = torch
|
view.torch = torch
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +106,6 @@ class CameraViewManager : SimpleViewManager<CameraView>() {
|
|||||||
fun setZoom(view: CameraView, zoom: Double) {
|
fun setZoom(view: CameraView, zoom: Double) {
|
||||||
if (view.zoom != zoom)
|
if (view.zoom != zoom)
|
||||||
addChangedPropToTransaction(view, "zoom")
|
addChangedPropToTransaction(view, "zoom")
|
||||||
// TODO: why THE FUCK is this not being called?
|
|
||||||
view.zoom = zoom
|
view.zoom = zoom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,10 +223,10 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
|||||||
val colorSpaces = Arguments.createArray()
|
val colorSpaces = Arguments.createArray()
|
||||||
colorSpaces.pushString("yuv")
|
colorSpaces.pushString("yuv")
|
||||||
|
|
||||||
// TODO Revisit getAvailableCameraDevices (more accurate video stabilization modes)
|
|
||||||
val videoStabilizationModes = Arguments.createArray()
|
val videoStabilizationModes = Arguments.createArray()
|
||||||
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_OFF))
|
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_OFF)) {
|
||||||
videoStabilizationModes.pushString("off")
|
videoStabilizationModes.pushString("off")
|
||||||
|
}
|
||||||
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_ON)) {
|
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_ON)) {
|
||||||
videoStabilizationModes.pushString("auto")
|
videoStabilizationModes.pushString("auto")
|
||||||
videoStabilizationModes.pushString("standard")
|
videoStabilizationModes.pushString("standard")
|
||||||
|
@ -15,9 +15,6 @@ import UIKit
|
|||||||
//
|
//
|
||||||
// TODOs for the CameraView which are currently too hard to implement either because of AVFoundation's limitations, or my brain capacity
|
// TODOs for the CameraView which are currently too hard to implement either because of AVFoundation's limitations, or my brain capacity
|
||||||
//
|
//
|
||||||
// CameraView
|
|
||||||
// TODO: enableSmoothAutoFocus
|
|
||||||
|
|
||||||
// CameraView+RecordVideo
|
// CameraView+RecordVideo
|
||||||
// TODO: Better startRecording()/stopRecording() (promise + callback, wait for TurboModules/JSI)
|
// TODO: Better startRecording()/stopRecording() (promise + callback, wait for TurboModules/JSI)
|
||||||
// TODO: videoStabilizationMode
|
// TODO: videoStabilizationMode
|
||||||
|
@ -138,12 +138,12 @@ export interface CameraProps extends ViewProps {
|
|||||||
|
|
||||||
// TODO: Remove once frameProcessors land
|
// TODO: Remove once frameProcessors land
|
||||||
/**
|
/**
|
||||||
* Specify the code types this camera can scan.
|
* Specify the code types this camera can scan. Will be removed with the addition of Frame Processors.
|
||||||
*/
|
*/
|
||||||
scannableCodes?: CodeType[];
|
scannableCodes?: CodeType[];
|
||||||
// TODO: Remove once frameProcessors land
|
// TODO: Remove once frameProcessors land
|
||||||
/**
|
/**
|
||||||
* Called when one or multiple codes have been scanned.
|
* Called when one or multiple codes have been scanned. Will be removed with the addition of Frame Processors.
|
||||||
*/
|
*/
|
||||||
onCodeScanned?: (codes: Code[]) => void;
|
onCodeScanned?: (codes: Code[]) => void;
|
||||||
//#endregion
|
//#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user