fix: Rename parsers/
to types/
(#2021)
chore: Rename `parsers/` to `types/`
This commit is contained in:
parent
3b1d8353a5
commit
4e1a1fd68b
@ -9,7 +9,7 @@ import com.google.mlkit.vision.barcode.common.Barcode
|
|||||||
import com.mrousavy.camera.core.CameraError
|
import com.mrousavy.camera.core.CameraError
|
||||||
import com.mrousavy.camera.core.UnknownCameraError
|
import com.mrousavy.camera.core.UnknownCameraError
|
||||||
import com.mrousavy.camera.core.code
|
import com.mrousavy.camera.core.code
|
||||||
import com.mrousavy.camera.parsers.CodeType
|
import com.mrousavy.camera.types.CodeType
|
||||||
|
|
||||||
fun CameraView.invokeOnInitialized() {
|
fun CameraView.invokeOnInitialized() {
|
||||||
Log.i(CameraView.TAG, "invokeOnInitialized()")
|
Log.i(CameraView.TAG, "invokeOnInitialized()")
|
||||||
|
@ -9,9 +9,9 @@ import com.mrousavy.camera.core.MicrophonePermissionError
|
|||||||
import com.mrousavy.camera.core.RecorderError
|
import com.mrousavy.camera.core.RecorderError
|
||||||
import com.mrousavy.camera.core.RecordingSession
|
import com.mrousavy.camera.core.RecordingSession
|
||||||
import com.mrousavy.camera.core.code
|
import com.mrousavy.camera.core.code
|
||||||
import com.mrousavy.camera.parsers.Torch
|
import com.mrousavy.camera.types.Torch
|
||||||
import com.mrousavy.camera.parsers.VideoCodec
|
import com.mrousavy.camera.types.VideoCodec
|
||||||
import com.mrousavy.camera.parsers.VideoFileType
|
import com.mrousavy.camera.types.VideoFileType
|
||||||
import com.mrousavy.camera.utils.makeErrorMap
|
import com.mrousavy.camera.utils.makeErrorMap
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ import com.facebook.react.bridge.Arguments
|
|||||||
import com.facebook.react.bridge.ReadableMap
|
import com.facebook.react.bridge.ReadableMap
|
||||||
import com.facebook.react.bridge.WritableMap
|
import com.facebook.react.bridge.WritableMap
|
||||||
import com.mrousavy.camera.core.CameraSession
|
import com.mrousavy.camera.core.CameraSession
|
||||||
import com.mrousavy.camera.parsers.Flash
|
import com.mrousavy.camera.types.Flash
|
||||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
import com.mrousavy.camera.types.QualityPrioritization
|
||||||
import com.mrousavy.camera.utils.*
|
import com.mrousavy.camera.utils.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
|
@ -26,12 +26,12 @@ import com.mrousavy.camera.extensions.getPreviewTargetSize
|
|||||||
import com.mrousavy.camera.extensions.installHierarchyFitter
|
import com.mrousavy.camera.extensions.installHierarchyFitter
|
||||||
import com.mrousavy.camera.extensions.smaller
|
import com.mrousavy.camera.extensions.smaller
|
||||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
import com.mrousavy.camera.types.CodeScannerOptions
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.PixelFormat
|
import com.mrousavy.camera.types.PixelFormat
|
||||||
import com.mrousavy.camera.parsers.ResizeMode
|
import com.mrousavy.camera.types.ResizeMode
|
||||||
import com.mrousavy.camera.parsers.Torch
|
import com.mrousavy.camera.types.Torch
|
||||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
@ -5,12 +5,12 @@ import com.facebook.react.common.MapBuilder
|
|||||||
import com.facebook.react.uimanager.ThemedReactContext
|
import com.facebook.react.uimanager.ThemedReactContext
|
||||||
import com.facebook.react.uimanager.ViewGroupManager
|
import com.facebook.react.uimanager.ViewGroupManager
|
||||||
import com.facebook.react.uimanager.annotations.ReactProp
|
import com.facebook.react.uimanager.annotations.ReactProp
|
||||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
import com.mrousavy.camera.types.CodeScannerOptions
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.PixelFormat
|
import com.mrousavy.camera.types.PixelFormat
|
||||||
import com.mrousavy.camera.parsers.ResizeMode
|
import com.mrousavy.camera.types.ResizeMode
|
||||||
import com.mrousavy.camera.parsers.Torch
|
import com.mrousavy.camera.types.Torch
|
||||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
class CameraViewManager : ViewGroupManager<CameraView>() {
|
class CameraViewManager : ViewGroupManager<CameraView>() {
|
||||||
|
@ -13,7 +13,7 @@ import com.mrousavy.camera.core.CameraError
|
|||||||
import com.mrousavy.camera.core.ViewNotFoundError
|
import com.mrousavy.camera.core.ViewNotFoundError
|
||||||
import com.mrousavy.camera.frameprocessor.VisionCameraInstaller
|
import com.mrousavy.camera.frameprocessor.VisionCameraInstaller
|
||||||
import com.mrousavy.camera.frameprocessor.VisionCameraProxy
|
import com.mrousavy.camera.frameprocessor.VisionCameraProxy
|
||||||
import com.mrousavy.camera.parsers.*
|
import com.mrousavy.camera.types.*
|
||||||
import com.mrousavy.camera.utils.*
|
import com.mrousavy.camera.utils.*
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.resumeWithException
|
import kotlin.coroutines.resumeWithException
|
||||||
|
@ -14,11 +14,11 @@ import com.facebook.react.bridge.ReadableMap
|
|||||||
import com.mrousavy.camera.extensions.bigger
|
import com.mrousavy.camera.extensions.bigger
|
||||||
import com.mrousavy.camera.extensions.getPhotoSizes
|
import com.mrousavy.camera.extensions.getPhotoSizes
|
||||||
import com.mrousavy.camera.extensions.getVideoSizes
|
import com.mrousavy.camera.extensions.getVideoSizes
|
||||||
import com.mrousavy.camera.parsers.HardwareLevel
|
import com.mrousavy.camera.types.HardwareLevel
|
||||||
import com.mrousavy.camera.parsers.LensFacing
|
import com.mrousavy.camera.types.LensFacing
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.PixelFormat
|
import com.mrousavy.camera.types.PixelFormat
|
||||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
import kotlin.math.atan
|
import kotlin.math.atan
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.mrousavy.camera.core
|
package com.mrousavy.camera.core
|
||||||
|
|
||||||
import com.mrousavy.camera.core.outputs.CameraOutputs
|
import com.mrousavy.camera.core.outputs.CameraOutputs
|
||||||
import com.mrousavy.camera.parsers.CameraDeviceError
|
import com.mrousavy.camera.types.CameraDeviceError
|
||||||
|
|
||||||
abstract class CameraError(
|
abstract class CameraError(
|
||||||
/**
|
/**
|
||||||
|
@ -24,12 +24,12 @@ import com.mrousavy.camera.extensions.createPhotoCaptureRequest
|
|||||||
import com.mrousavy.camera.extensions.openCamera
|
import com.mrousavy.camera.extensions.openCamera
|
||||||
import com.mrousavy.camera.extensions.setZoom
|
import com.mrousavy.camera.extensions.setZoom
|
||||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||||
import com.mrousavy.camera.parsers.Flash
|
import com.mrousavy.camera.types.Flash
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
import com.mrousavy.camera.types.QualityPrioritization
|
||||||
import com.mrousavy.camera.parsers.VideoCodec
|
import com.mrousavy.camera.types.VideoCodec
|
||||||
import com.mrousavy.camera.parsers.VideoFileType
|
import com.mrousavy.camera.types.VideoFileType
|
||||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.util.concurrent.CancellationException
|
import java.util.concurrent.CancellationException
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
|
@ -8,7 +8,7 @@ import com.google.mlkit.vision.barcode.BarcodeScannerOptions
|
|||||||
import com.google.mlkit.vision.barcode.BarcodeScanning
|
import com.google.mlkit.vision.barcode.BarcodeScanning
|
||||||
import com.google.mlkit.vision.common.InputImage
|
import com.google.mlkit.vision.common.InputImage
|
||||||
import com.mrousavy.camera.core.outputs.CameraOutputs
|
import com.mrousavy.camera.core.outputs.CameraOutputs
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
class CodeScannerPipeline(val size: Size, val format: Int, val output: CameraOutputs.CodeScannerOutput) : Closeable {
|
class CodeScannerPipeline(val size: Size, val format: Int, val output: CameraOutputs.CodeScannerOutput) : Closeable {
|
||||||
|
@ -7,7 +7,7 @@ import android.util.Size
|
|||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import android.view.SurfaceHolder
|
import android.view.SurfaceHolder
|
||||||
import android.view.SurfaceView
|
import android.view.SurfaceView
|
||||||
import com.mrousavy.camera.parsers.ResizeMode
|
import com.mrousavy.camera.types.ResizeMode
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
@SuppressLint("ViewConstructor")
|
@SuppressLint("ViewConstructor")
|
||||||
|
@ -7,9 +7,9 @@ import android.os.Build
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.util.Size
|
import android.util.Size
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.VideoCodec
|
import com.mrousavy.camera.types.VideoCodec
|
||||||
import com.mrousavy.camera.parsers.VideoFileType
|
import com.mrousavy.camera.types.VideoFileType
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class RecordingSession(
|
class RecordingSession(
|
||||||
|
@ -11,8 +11,8 @@ import android.view.Surface
|
|||||||
import com.facebook.jni.HybridData
|
import com.facebook.jni.HybridData
|
||||||
import com.mrousavy.camera.frameprocessor.Frame
|
import com.mrousavy.camera.frameprocessor.Frame
|
||||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.PixelFormat
|
import com.mrousavy.camera.types.PixelFormat
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,8 +18,8 @@ import com.mrousavy.camera.extensions.getPhotoSizes
|
|||||||
import com.mrousavy.camera.extensions.getPreviewTargetSize
|
import com.mrousavy.camera.extensions.getPreviewTargetSize
|
||||||
import com.mrousavy.camera.extensions.getVideoSizes
|
import com.mrousavy.camera.extensions.getVideoSizes
|
||||||
import com.mrousavy.camera.extensions.smaller
|
import com.mrousavy.camera.extensions.smaller
|
||||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
import com.mrousavy.camera.types.CodeScannerOptions
|
||||||
import com.mrousavy.camera.parsers.PixelFormat
|
import com.mrousavy.camera.types.PixelFormat
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
class CameraOutputs(
|
class CameraOutputs(
|
||||||
|
@ -5,9 +5,9 @@ import android.hardware.camera2.CameraDevice
|
|||||||
import android.hardware.camera2.CameraManager
|
import android.hardware.camera2.CameraManager
|
||||||
import android.hardware.camera2.CaptureRequest
|
import android.hardware.camera2.CaptureRequest
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import com.mrousavy.camera.parsers.Flash
|
import com.mrousavy.camera.types.Flash
|
||||||
import com.mrousavy.camera.parsers.Orientation
|
import com.mrousavy.camera.types.Orientation
|
||||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
import com.mrousavy.camera.types.QualityPrioritization
|
||||||
|
|
||||||
private fun supportsSnapshotCapture(cameraCharacteristics: CameraCharacteristics): Boolean {
|
private fun supportsSnapshotCapture(cameraCharacteristics: CameraCharacteristics): Boolean {
|
||||||
// As per CameraDevice.TEMPLATE_VIDEO_SNAPSHOT in documentation:
|
// As per CameraDevice.TEMPLATE_VIDEO_SNAPSHOT in documentation:
|
||||||
|
@ -8,7 +8,7 @@ import android.util.Log
|
|||||||
import com.mrousavy.camera.core.CameraCannotBeOpenedError
|
import com.mrousavy.camera.core.CameraCannotBeOpenedError
|
||||||
import com.mrousavy.camera.core.CameraDisconnectedError
|
import com.mrousavy.camera.core.CameraDisconnectedError
|
||||||
import com.mrousavy.camera.core.CameraQueues
|
import com.mrousavy.camera.core.CameraQueues
|
||||||
import com.mrousavy.camera.parsers.CameraDeviceError
|
import com.mrousavy.camera.types.CameraDeviceError
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.resumeWithException
|
import kotlin.coroutines.resumeWithException
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
|
@ -5,8 +5,8 @@ import android.media.Image;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import com.facebook.proguard.annotations.DoNotStrip;
|
import com.facebook.proguard.annotations.DoNotStrip;
|
||||||
import com.mrousavy.camera.core.HardwareBuffersNotAvailableError;
|
import com.mrousavy.camera.core.HardwareBuffersNotAvailableError;
|
||||||
import com.mrousavy.camera.parsers.PixelFormat;
|
import com.mrousavy.camera.types.PixelFormat;
|
||||||
import com.mrousavy.camera.parsers.Orientation;
|
import com.mrousavy.camera.types.Orientation;
|
||||||
|
|
||||||
public class Frame {
|
public class Frame {
|
||||||
private final Image image;
|
private final Image image;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.hardware.camera2.CameraDevice
|
import android.hardware.camera2.CameraDevice
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import com.facebook.react.bridge.ReadableMap
|
import com.facebook.react.bridge.ReadableMap
|
||||||
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import com.google.mlkit.vision.barcode.common.Barcode
|
import com.google.mlkit.vision.barcode.common.Barcode
|
||||||
import com.mrousavy.camera.core.CodeTypeNotSupportedError
|
import com.mrousavy.camera.core.CodeTypeNotSupportedError
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.hardware.camera2.CameraCharacteristics
|
import android.hardware.camera2.CameraCharacteristics
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
interface JSUnionValue {
|
interface JSUnionValue {
|
||||||
val unionValue: String
|
val unionValue: String
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.hardware.camera2.CameraCharacteristics
|
import android.hardware.camera2.CameraCharacteristics
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.hardware.camera2.CameraCharacteristics
|
import android.hardware.camera2.CameraCharacteristics
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.graphics.ImageFormat
|
import android.graphics.ImageFormat
|
||||||
import com.mrousavy.camera.core.PixelFormatNotSupportedError
|
import com.mrousavy.camera.core.PixelFormatNotSupportedError
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
enum class QualityPrioritization(override val unionValue: String) : JSUnionValue {
|
enum class QualityPrioritization(override val unionValue: String) : JSUnionValue {
|
||||||
SPEED("speed"),
|
SPEED("speed"),
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
enum class ResizeMode(override val unionValue: String) : JSUnionValue {
|
enum class ResizeMode(override val unionValue: String) : JSUnionValue {
|
||||||
COVER("cover"),
|
COVER("cover"),
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
enum class Torch(override val unionValue: String) : JSUnionValue {
|
enum class Torch(override val unionValue: String) : JSUnionValue {
|
||||||
OFF("off"),
|
OFF("off"),
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.media.MediaRecorder
|
import android.media.MediaRecorder
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
import com.mrousavy.camera.core.InvalidTypeScriptUnionError
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.mrousavy.camera.parsers
|
package com.mrousavy.camera.types
|
||||||
|
|
||||||
import android.hardware.camera2.CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_OFF
|
import android.hardware.camera2.CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_OFF
|
||||||
import android.hardware.camera2.CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_ON
|
import android.hardware.camera2.CameraMetadata.CONTROL_VIDEO_STABILIZATION_MODE_ON
|
Loading…
Reference in New Issue
Block a user