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 videovoid
onDestroy(androidx.lifecycle.LifecycleOwner owner)
void
onError(android.media.MediaRecorder mediaRecorder, int i, int i1)
Called when an error occurs while recording.void
setup(android.util.Size videoSize, int rotationDegrees)
Set up the video recordervoid
start()
Start recording videovoid
stop()
Stop recording video
-
-
-
Method Detail
-
getSurface
public java.util.Optional<android.view.Surface> getSurface()
Description copied from interface:ISessionVideoRecorder
Get surface- Specified by:
getSurface
in interfaceISessionVideoRecorder
- Returns:
- Surface on which to render video
-
setup
public void setup(android.util.Size videoSize, int rotationDegrees)
Description copied from interface:ISessionVideoRecorder
Set up the video recorder- Specified by:
setup
in interfaceISessionVideoRecorder
- Parameters:
videoSize
- Size of the raw video framesrotationDegrees
- Rotation of the video in degrees
-
start
public void start()
Description copied from interface:ISessionVideoRecorder
Start recording video- Specified by:
start
in interfaceISessionVideoRecorder
-
stop
public void stop()
Description copied from interface:ISessionVideoRecorder
Stop recording video- Specified by:
stop
in interfaceISessionVideoRecorder
-
getVideoFile
public java.util.Optional<java.io.File> getVideoFile()
Description copied from interface:ISessionVideoRecorder
Get a file in which to save the video- Specified by:
getVideoFile
in interfaceISessionVideoRecorder
- Returns:
- File in which to save the video
-
onDestroy
public void onDestroy(@NonNull androidx.lifecycle.LifecycleOwner owner)
- Specified by:
onDestroy
in interfaceandroidx.lifecycle.DefaultLifecycleObserver
-
onError
public void onError(android.media.MediaRecorder mediaRecorder, int i, int i1)
Description copied from interface:android.media.MediaRecorder.OnErrorListener
Called when an error occurs while recording.- Specified by:
onError
in interfaceandroid.media.MediaRecorder.OnErrorListener
- Parameters:
mediaRecorder
- the MediaRecorder that encountered the errori
- the type of error that has occurred:MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN
MediaRecorder.MEDIA_ERROR_SERVER_DIED
i1
- an extra code, specific to the error type
-
-