Rename video recorders

pull/360/head
Mattia Iavarone 6 years ago
parent 2999e9aa65
commit f7cf379966
  1. 5
      cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java
  2. 9
      cameraview/src/main/java/com/otaliastudios/cameraview/FullVideoRecorder.java
  3. 8
      cameraview/src/main/java/com/otaliastudios/cameraview/SnapshotVideoRecorder.java

@ -12,7 +12,6 @@ import android.location.Location;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.annotation.WorkerThread;
import android.support.media.ExifInterface;
import android.view.SurfaceHolder;
@ -692,7 +691,7 @@ class Camera1 extends CameraController implements Camera.PreviewCallback, Camera
// Initialize the media recorder
mCamera.unlock();
mVideoRecorder = new MediaRecorderVideoRecorder(videoResult, Camera1.this, mCamera, mCameraId);
mVideoRecorder = new FullVideoRecorder(videoResult, Camera1.this, mCamera, mCameraId);
mVideoRecorder.start();
}
});
@ -758,7 +757,7 @@ class Camera1 extends CameraController implements Camera.PreviewCallback, Camera
videoResult.maxDuration = mVideoMaxDuration;
GLCameraPreview cameraPreview = (GLCameraPreview) mPreview;
mVideoRecorder = new MediaCodecVideoRecorder(videoResult, Camera1.this, cameraPreview, mCameraId);
mVideoRecorder = new SnapshotVideoRecorder(videoResult, Camera1.this, cameraPreview);
mVideoRecorder.start();
}
});

@ -7,18 +7,16 @@ import android.media.MediaRecorder;
/**
* A {@link VideoRecorder} that uses {@link android.media.MediaRecorder} APIs.
*/
class MediaRecorderVideoRecorder extends VideoRecorder {
class FullVideoRecorder extends VideoRecorder {
private static final String TAG = MediaRecorderVideoRecorder.class.getSimpleName();
private static final String TAG = FullVideoRecorder.class.getSimpleName();
private static final CameraLogger LOG = CameraLogger.create(TAG);
private MediaRecorder mMediaRecorder;
private CamcorderProfile mProfile;
private Mapper mMapper;
MediaRecorderVideoRecorder(VideoResult stub, VideoResultListener listener, Camera camera, int cameraId) {
FullVideoRecorder(VideoResult stub, VideoResultListener listener, Camera camera, int cameraId) {
super(stub, listener);
mMapper = new Mapper1();
mMediaRecorder = new MediaRecorder();
mMediaRecorder.setCamera(camera);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
@ -102,7 +100,6 @@ class MediaRecorderVideoRecorder extends VideoRecorder {
}
mProfile = null;
mMediaRecorder = null;
mMapper = null;
dispatchResult();
}
}

@ -1,8 +1,6 @@
package com.otaliastudios.cameraview;
import android.graphics.SurfaceTexture;
import android.media.CamcorderProfile;
import android.media.MediaFormat;
import android.opengl.EGL14;
import android.os.Build;
import android.os.Handler;
@ -16,9 +14,9 @@ import android.support.annotation.RequiresApi;
* TODO when cropping is huge, the first frame of the video result, noticeably, has no transformation applied. Don't know why.
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
class MediaCodecVideoRecorder extends VideoRecorder implements GLCameraPreview.RendererFrameCallback {
class SnapshotVideoRecorder extends VideoRecorder implements GLCameraPreview.RendererFrameCallback {
private static final String TAG = MediaCodecVideoRecorder.class.getSimpleName();
private static final String TAG = SnapshotVideoRecorder.class.getSimpleName();
private static final CameraLogger LOG = CameraLogger.create(TAG);
private static final int STATE_RECORDING = 0;
@ -31,7 +29,7 @@ class MediaCodecVideoRecorder extends VideoRecorder implements GLCameraPreview.R
private int mDesiredState = STATE_NOT_RECORDING;
private int mTextureId = 0;
MediaCodecVideoRecorder(VideoResult stub, VideoResultListener listener, GLCameraPreview preview, int cameraId) {
SnapshotVideoRecorder(VideoResult stub, VideoResultListener listener, GLCameraPreview preview) {
super(stub, listener);
mEncoder = new VideoTextureEncoder();
mPreview = preview;
Loading…
Cancel
Save