fix: Rename parsers/ to types/ (#2021)

chore: Rename `parsers/` to `types/`
This commit is contained in:
Marc Rousavy 2023-10-17 11:49:04 +02:00 committed by GitHub
parent 3b1d8353a5
commit 4e1a1fd68b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 62 additions and 62 deletions

View File

@ -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()")

View File

@ -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.*

View File

@ -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

View File

@ -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

View File

@ -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>() {

View File

@ -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

View File

@ -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

View File

@ -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(
/**

View File

@ -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

View File

@ -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 {

View File

@ -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")

View File

@ -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(

View File

@ -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
/**

View File

@ -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(

View File

@ -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:

View File

@ -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

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.hardware.camera2.CameraDevice

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import com.mrousavy.camera.core.InvalidTypeScriptUnionError

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.hardware.camera2.CameraCharacteristics

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
interface JSUnionValue {
val unionValue: String

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.hardware.camera2.CameraCharacteristics

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.hardware.camera2.CameraCharacteristics

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.content.pm.PackageManager

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.graphics.ImageFormat
import com.mrousavy.camera.core.PixelFormatNotSupportedError

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
enum class QualityPrioritization(override val unionValue: String) : JSUnionValue {
SPEED("speed"),

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
enum class ResizeMode(override val unionValue: String) : JSUnionValue {
COVER("cover"),

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
enum class Torch(override val unionValue: String) : JSUnionValue {
OFF("off"),

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import android.media.MediaRecorder

View File

@ -1,4 +1,4 @@
package com.mrousavy.camera.parsers
package com.mrousavy.camera.types
import com.mrousavy.camera.core.InvalidTypeScriptUnionError

View File

@ -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