Package com.appliedrec.verid.ui2
Class SessionVideoRecorder
- java.lang.Object
-
- com.appliedrec.verid.ui2.SessionVideoRecorder
-
- All Implemented Interfaces:
android.media.MediaRecorder.OnErrorListener,androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver,ISessionVideoRecorder
public class SessionVideoRecorder extends java.lang.Object implements ISessionVideoRecorder, android.media.MediaRecorder.OnErrorListener
Session video recorder- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description SessionVideoRecorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<android.view.Surface>getSurface()Get surfacejava.util.Optional<java.io.File>getVideoFile()Get a file in which to save the videovoidonDestroy(androidx.lifecycle.LifecycleOwner owner)voidonError(android.media.MediaRecorder mediaRecorder, int i, int i1)Called when an error occurs while recording.voidsetup(android.util.Size videoSize, int rotationDegrees)Set up the video recordervoidstart()Start recording videovoidstop()Stop recording video
-
-
-
Method Detail
-
getSurface
public java.util.Optional<android.view.Surface> getSurface()
Description copied from interface:ISessionVideoRecorderGet surface- Specified by:
getSurfacein interfaceISessionVideoRecorder- Returns:
- Surface on which to render video
-
setup
public void setup(android.util.Size videoSize, int rotationDegrees)Description copied from interface:ISessionVideoRecorderSet up the video recorder- Specified by:
setupin interfaceISessionVideoRecorder- Parameters:
videoSize- Size of the raw video framesrotationDegrees- Rotation of the video in degrees
-
start
public void start()
Description copied from interface:ISessionVideoRecorderStart recording video- Specified by:
startin interfaceISessionVideoRecorder
-
stop
public void stop()
Description copied from interface:ISessionVideoRecorderStop recording video- Specified by:
stopin interfaceISessionVideoRecorder
-
getVideoFile
public java.util.Optional<java.io.File> getVideoFile()
Description copied from interface:ISessionVideoRecorderGet a file in which to save the video- Specified by:
getVideoFilein interfaceISessionVideoRecorder- Returns:
- File in which to save the video
-
onDestroy
public void onDestroy(@NonNull androidx.lifecycle.LifecycleOwner owner)- Specified by:
onDestroyin interfaceandroidx.lifecycle.DefaultLifecycleObserver
-
onError
public void onError(android.media.MediaRecorder mediaRecorder, int i, int i1)Description copied from interface:android.media.MediaRecorder.OnErrorListenerCalled when an error occurs while recording.- Specified by:
onErrorin interfaceandroid.media.MediaRecorder.OnErrorListener- Parameters:
mediaRecorder- the MediaRecorder that encountered the errori- the type of error that has occurred:MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWNMediaRecorder.MEDIA_ERROR_SERVER_DIED
i1- an extra code, specific to the error type
-
-