Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ class Camera
* Takes an input/output surface and orients the recording correctly. This is needed because
* switching cameras while recording causes the wrong orientation.
*/
private VideoRenderer videoRenderer;
@VisibleForTesting
VideoRenderer videoRenderer;

/**
* Whether or not the camera aligns with the initial way the camera was facing if the camera was
* flipped.
*/
private int initialCameraFacing;
@VisibleForTesting
int initialCameraFacing;

private final SurfaceTextureEntry flutterTexture;
@VisibleForTesting
final SurfaceTextureEntry flutterTexture;
private final VideoCaptureSettings videoCaptureSettings;
private final Context applicationContext;
final DartMessenger dartMessenger;
Expand All @@ -130,16 +133,19 @@ class Camera

CameraDeviceWrapper cameraDevice;
CameraCaptureSession captureSession;
private ImageReader pictureImageReader;
@VisibleForTesting
ImageReader pictureImageReader;
ImageStreamReader imageStreamReader;
/** {@link CaptureRequest.Builder} for the camera preview */
CaptureRequest.Builder previewRequestBuilder;

private MediaRecorder mediaRecorder;
@VisibleForTesting
MediaRecorder mediaRecorder;
/** True when recording video. */
boolean recordingVideo;
/** True when the preview is paused. */
private boolean pausedPreview;
@VisibleForTesting
boolean pausedPreview;

private File captureFile;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import io.flutter.embedding.engine.systemchannels.PlatformChannel;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
Expand All @@ -36,7 +38,8 @@ final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler {
private final TextureRegistry textureRegistry;
private final MethodChannel methodChannel;
private final EventChannel imageStreamChannel;
private @Nullable Camera camera;
@VisibleForTesting
@Nullable Camera camera;

MethodCallHandlerImpl(
Activity activity,
Expand Down
Loading