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.UnknownCameraError
|
||||
import com.mrousavy.camera.core.code
|
||||
import com.mrousavy.camera.parsers.CodeType
|
||||
import com.mrousavy.camera.types.CodeType
|
||||
|
||||
fun CameraView.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.RecordingSession
|
||||
import com.mrousavy.camera.core.code
|
||||
import com.mrousavy.camera.parsers.Torch
|
||||
import com.mrousavy.camera.parsers.VideoCodec
|
||||
import com.mrousavy.camera.parsers.VideoFileType
|
||||
import com.mrousavy.camera.types.Torch
|
||||
import com.mrousavy.camera.types.VideoCodec
|
||||
import com.mrousavy.camera.types.VideoFileType
|
||||
import com.mrousavy.camera.utils.makeErrorMap
|
||||
import java.util.*
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.facebook.react.bridge.Arguments
|
||||
import com.facebook.react.bridge.ReadableMap
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.mrousavy.camera.core.CameraSession
|
||||
import com.mrousavy.camera.parsers.Flash
|
||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
||||
import com.mrousavy.camera.types.Flash
|
||||
import com.mrousavy.camera.types.QualityPrioritization
|
||||
import com.mrousavy.camera.utils.*
|
||||
import java.io.File
|
||||
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.smaller
|
||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.PixelFormat
|
||||
import com.mrousavy.camera.parsers.ResizeMode
|
||||
import com.mrousavy.camera.parsers.Torch
|
||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
||||
import com.mrousavy.camera.types.CodeScannerOptions
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.PixelFormat
|
||||
import com.mrousavy.camera.types.ResizeMode
|
||||
import com.mrousavy.camera.types.Torch
|
||||
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
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.ViewGroupManager
|
||||
import com.facebook.react.uimanager.annotations.ReactProp
|
||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.PixelFormat
|
||||
import com.mrousavy.camera.parsers.ResizeMode
|
||||
import com.mrousavy.camera.parsers.Torch
|
||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
||||
import com.mrousavy.camera.types.CodeScannerOptions
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.PixelFormat
|
||||
import com.mrousavy.camera.types.ResizeMode
|
||||
import com.mrousavy.camera.types.Torch
|
||||
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||
|
||||
@Suppress("unused")
|
||||
class CameraViewManager : ViewGroupManager<CameraView>() {
|
||||
|
@ -13,7 +13,7 @@ import com.mrousavy.camera.core.CameraError
|
||||
import com.mrousavy.camera.core.ViewNotFoundError
|
||||
import com.mrousavy.camera.frameprocessor.VisionCameraInstaller
|
||||
import com.mrousavy.camera.frameprocessor.VisionCameraProxy
|
||||
import com.mrousavy.camera.parsers.*
|
||||
import com.mrousavy.camera.types.*
|
||||
import com.mrousavy.camera.utils.*
|
||||
import kotlin.coroutines.resume
|
||||
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.getPhotoSizes
|
||||
import com.mrousavy.camera.extensions.getVideoSizes
|
||||
import com.mrousavy.camera.parsers.HardwareLevel
|
||||
import com.mrousavy.camera.parsers.LensFacing
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.PixelFormat
|
||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
||||
import com.mrousavy.camera.types.HardwareLevel
|
||||
import com.mrousavy.camera.types.LensFacing
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.PixelFormat
|
||||
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.atan
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.mrousavy.camera.core
|
||||
|
||||
import com.mrousavy.camera.core.outputs.CameraOutputs
|
||||
import com.mrousavy.camera.parsers.CameraDeviceError
|
||||
import com.mrousavy.camera.types.CameraDeviceError
|
||||
|
||||
abstract class CameraError(
|
||||
/**
|
||||
|
@ -24,12 +24,12 @@ import com.mrousavy.camera.extensions.createPhotoCaptureRequest
|
||||
import com.mrousavy.camera.extensions.openCamera
|
||||
import com.mrousavy.camera.extensions.setZoom
|
||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||
import com.mrousavy.camera.parsers.Flash
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
||||
import com.mrousavy.camera.parsers.VideoCodec
|
||||
import com.mrousavy.camera.parsers.VideoFileType
|
||||
import com.mrousavy.camera.parsers.VideoStabilizationMode
|
||||
import com.mrousavy.camera.types.Flash
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.QualityPrioritization
|
||||
import com.mrousavy.camera.types.VideoCodec
|
||||
import com.mrousavy.camera.types.VideoFileType
|
||||
import com.mrousavy.camera.types.VideoStabilizationMode
|
||||
import java.io.Closeable
|
||||
import java.util.concurrent.CancellationException
|
||||
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.common.InputImage
|
||||
import com.mrousavy.camera.core.outputs.CameraOutputs
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import java.io.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.SurfaceHolder
|
||||
import android.view.SurfaceView
|
||||
import com.mrousavy.camera.parsers.ResizeMode
|
||||
import com.mrousavy.camera.types.ResizeMode
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@SuppressLint("ViewConstructor")
|
||||
|
@ -7,9 +7,9 @@ import android.os.Build
|
||||
import android.util.Log
|
||||
import android.util.Size
|
||||
import android.view.Surface
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.VideoCodec
|
||||
import com.mrousavy.camera.parsers.VideoFileType
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.VideoCodec
|
||||
import com.mrousavy.camera.types.VideoFileType
|
||||
import java.io.File
|
||||
|
||||
class RecordingSession(
|
||||
|
@ -11,8 +11,8 @@ import android.view.Surface
|
||||
import com.facebook.jni.HybridData
|
||||
import com.mrousavy.camera.frameprocessor.Frame
|
||||
import com.mrousavy.camera.frameprocessor.FrameProcessor
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.PixelFormat
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.PixelFormat
|
||||
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.getVideoSizes
|
||||
import com.mrousavy.camera.extensions.smaller
|
||||
import com.mrousavy.camera.parsers.CodeScannerOptions
|
||||
import com.mrousavy.camera.parsers.PixelFormat
|
||||
import com.mrousavy.camera.types.CodeScannerOptions
|
||||
import com.mrousavy.camera.types.PixelFormat
|
||||
import java.io.Closeable
|
||||
|
||||
class CameraOutputs(
|
||||
|
@ -5,9 +5,9 @@ import android.hardware.camera2.CameraDevice
|
||||
import android.hardware.camera2.CameraManager
|
||||
import android.hardware.camera2.CaptureRequest
|
||||
import android.view.Surface
|
||||
import com.mrousavy.camera.parsers.Flash
|
||||
import com.mrousavy.camera.parsers.Orientation
|
||||
import com.mrousavy.camera.parsers.QualityPrioritization
|
||||
import com.mrousavy.camera.types.Flash
|
||||
import com.mrousavy.camera.types.Orientation
|
||||
import com.mrousavy.camera.types.QualityPrioritization
|
||||
|
||||
private fun supportsSnapshotCapture(cameraCharacteristics: CameraCharacteristics): Boolean {
|
||||
// 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.CameraDisconnectedError
|
||||
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.resumeWithException
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
|
@ -5,8 +5,8 @@ import android.media.Image;
|
||||
import android.os.Build;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.mrousavy.camera.core.HardwareBuffersNotAvailableError;
|
||||
import com.mrousavy.camera.parsers.PixelFormat;
|
||||
import com.mrousavy.camera.parsers.Orientation;
|
||||
import com.mrousavy.camera.types.PixelFormat;
|
||||
import com.mrousavy.camera.types.Orientation;
|
||||
|
||||
public class Frame {
|
||||
private final Image image;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
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.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.mrousavy.camera.core.CodeTypeNotSupportedError
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
interface JSUnionValue {
|
||||
val unionValue: String
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
import android.hardware.camera2.CameraCharacteristics
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
import android.hardware.camera2.CameraCharacteristics
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
import android.content.pm.PackageManager
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
import android.graphics.ImageFormat
|
||||
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 {
|
||||
SPEED("speed"),
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
enum class ResizeMode(override val unionValue: String) : JSUnionValue {
|
||||
COVER("cover"),
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
enum class Torch(override val unionValue: String) : JSUnionValue {
|
||||
OFF("off"),
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
import android.media.MediaRecorder
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.mrousavy.camera.parsers
|
||||
package com.mrousavy.camera.types
|
||||
|
||||
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_ON
|
Loading…
Reference in New Issue
Block a user