expo-camera 16.0.11 → 16.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,11 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.0.12 — 2025-01-19
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 16.0.11 — 2025-01-10
14
18
 
15
19
  ### 🐛 Bug fixes
16
20
 
17
21
  - [iOS] Fix setting `videoQuality` prop. ([#34082](https://github.com/expo/expo/pull/34082) by [@alanjhughes](https://github.com/alanjhughes))
22
+ - [Android] Fix an issue where the camera image is pixelated when using the gl integration. ([#34174](https://github.com/expo/expo/pull/34174) by [@alanjhughes](https://github.com/alanjhughes))
18
23
 
19
24
  ## 16.0.10 — 2024-12-16
20
25
 
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '16.0.11'
4
+ version = '16.0.12'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.camera"
15
15
  defaultConfig {
16
16
  versionCode 32
17
- versionName "16.0.11"
17
+ versionName "16.0.12"
18
18
  }
19
19
  }
20
20
 
@@ -7,7 +7,6 @@ import android.content.pm.PackageManager
7
7
  import android.graphics.Color
8
8
  import android.graphics.ImageFormat
9
9
  import android.graphics.SurfaceTexture
10
- import android.graphics.drawable.ColorDrawable
11
10
  import android.hardware.camera2.CameraCharacteristics
12
11
  import android.media.AudioManager
13
12
  import android.media.MediaActionSound
@@ -50,6 +49,7 @@ import androidx.camera.video.VideoRecordEvent
50
49
  import androidx.camera.view.PreviewView
51
50
  import androidx.core.app.ActivityCompat
52
51
  import androidx.core.content.ContextCompat
52
+ import androidx.core.graphics.drawable.toDrawable
53
53
  import expo.modules.camera.analyzers.BarcodeAnalyzer
54
54
  import expo.modules.camera.analyzers.toByteArray
55
55
  import expo.modules.camera.common.BarcodeScannedEvent
@@ -117,7 +117,7 @@ class ExpoCameraView(
117
117
  }
118
118
 
119
119
  var camera: Camera? = null
120
- var activeRecording: Recording? = null
120
+ private var activeRecording: Recording? = null
121
121
 
122
122
  private var cameraProvider: ProcessCameraProvider? = null
123
123
  private val providerFuture = ProcessCameraProvider.getInstance(context)
@@ -125,7 +125,8 @@ class ExpoCameraView(
125
125
  private var imageAnalysisUseCase: ImageAnalysis? = null
126
126
  private var recorder: Recorder? = null
127
127
  private var barcodeFormats: List<BarcodeType> = emptyList()
128
- private var glSurface: SurfaceTexture? = null
128
+ private var glSurfaceTexture: SurfaceTexture? = null
129
+
129
130
 
130
131
  private var previewView = PreviewView(context).apply {
131
132
  elevation = 0f
@@ -233,12 +234,10 @@ class ExpoCameraView(
233
234
  }
234
235
 
235
236
  override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
236
- if (!changed) {
237
- return
238
- }
239
237
  val width = right - left
240
238
  val height = bottom - top
241
239
  previewView.layout(0, 0, width, height)
240
+ glSurfaceTexture?.setDefaultBufferSize(width, height)
242
241
  }
243
242
 
244
243
  override fun onViewAdded(child: View?) {
@@ -267,7 +266,7 @@ class ExpoCameraView(
267
266
  return
268
267
  }
269
268
  rootView.postDelayed({
270
- rootView.foreground = ColorDrawable(Color.WHITE)
269
+ rootView.foreground = Color.WHITE.toDrawable()
271
270
  rootView.postDelayed(
272
271
  { rootView.foreground = null },
273
272
  ANIMATION_FAST_MILLIS
@@ -386,11 +385,9 @@ class ExpoCameraView(
386
385
  val preview = Preview.Builder()
387
386
  .setResolutionSelector(resolutionSelector)
388
387
  .build()
389
- .also {
390
- it.surfaceProvider = previewView.surfaceProvider
391
- }
392
388
 
393
- glSurface?.let {
389
+ glSurfaceTexture?.let {
390
+ it.setDefaultBufferSize(previewView.width, previewView.height)
394
391
  preview.setSurfaceProvider { request ->
395
392
  val surface = Surface(it)
396
393
  request.provideSurface(surface, ContextCompat.getMainExecutor(context)) {
@@ -683,7 +680,7 @@ class ExpoCameraView(
683
680
  }
684
681
 
685
682
  override fun setPreviewTexture(surfaceTexture: SurfaceTexture?) {
686
- glSurface = surfaceTexture
683
+ glSurfaceTexture = surfaceTexture
687
684
  shouldCreateCamera = true
688
685
  createCamera()
689
686
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-camera",
3
- "version": "16.0.11",
3
+ "version": "16.0.12",
4
4
  "description": "A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With expo-camera, one can also take photos and record videos that are saved to the app's cache. Morever, the component is also capable of detecting faces and bar codes appearing on the preview.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "optional": true
51
51
  }
52
52
  },
53
- "gitHead": "986a4689b91f3efc527f7178a320b987c0005842"
53
+ "gitHead": "0a0c6d35a691fc59c0d94675d159ac9e3dfd6f26"
54
54
  }