Interface CameraController
-
public interface CameraController
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCameraController.ErrorInfoThis class is used to store information about an error occurred in the camera controller.static interfaceCameraController.FpsListenerThis class can be used to listen for FPS change events.static interfaceCameraController.ListenerThis class can be used to listen for camera controller events.static classCameraController.ParametersThis class contains the parameters that can be used to configure the camera controller.static interfaceCameraController.RecordingListenerThis class can be used to listen for recording events.static classCameraController.RecordingStopReasonA reason for stopping video recording.static interfaceCameraController.SnapshotListenerThis class can be used to listen for snapshot events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFpsListener(CameraController.FpsListener listener)Adds a listener that will be notified when FPS changes.voidaddListener(CameraController.Listener listener)Adds a listener that will be notified about camera events.voidaddRecordingListener(CameraController.RecordingListener listener)Adds a listener that will be notified about video recording events.voidaddSnapshotListener(CameraController.SnapshotListener listener)Adds a listener that will be notified when a snapshot is taken.intgetCurrentFragmentDuration()longgetCurrentFragmentSize()CameraController.ParametersgetParameters()Returns current parameters used by the camera controller.java.util.List<android.util.Size>getSupportedVideoSizes()Returns the list of supported video resolutions for the device.booleanisRecording()voidremoveFpsListener(CameraController.FpsListener listener)Removes the specified FPS listener.voidremoveListener(CameraController.Listener listener)Removes the specified camera listener.voidremoveRecordingListener(CameraController.RecordingListener listener)Removes the specified recording listener.voidremoveSnapshotListener(CameraController.SnapshotListener listener)Removes the specified snapshot listener.voidsetParameters(CameraController.Parameters parameters)Sets the parameters for the camera controller.voidstartPreview(android.view.Surface previewSurface)Starts the video preview.voidstartPreview(android.view.Surface previewSurface, int fpsLimit)Starts the video preview.voidstartRecording(VideoConfiguration configuration)Starts a video recording session based on the specified configuration.voidstopPreview()Stops the video preview.voidstopRecording()Stops current video recording session.voidtakeSnapshot()Creates a new snapshot (image) and a new associated library item.
-
-
-
Method Detail
-
addListener
void addListener(CameraController.Listener listener)
Adds a listener that will be notified about camera events.- Parameters:
listener- The listener.
-
removeListener
void removeListener(CameraController.Listener listener)
Removes the specified camera listener.- Parameters:
listener- The listener.
-
addSnapshotListener
void addSnapshotListener(CameraController.SnapshotListener listener)
Adds a listener that will be notified when a snapshot is taken.- Parameters:
listener- The listener.
-
removeSnapshotListener
void removeSnapshotListener(CameraController.SnapshotListener listener)
Removes the specified snapshot listener.- Parameters:
listener- The listener.
-
addRecordingListener
void addRecordingListener(CameraController.RecordingListener listener)
Adds a listener that will be notified about video recording events.- Parameters:
listener- The listener.
-
removeRecordingListener
void removeRecordingListener(CameraController.RecordingListener listener)
Removes the specified recording listener.- Parameters:
listener- The listener.
-
addFpsListener
void addFpsListener(CameraController.FpsListener listener)
Adds a listener that will be notified when FPS changes.- Parameters:
listener- The listener.
-
removeFpsListener
void removeFpsListener(CameraController.FpsListener listener)
Removes the specified FPS listener.- Parameters:
listener- The listener.
-
getParameters
CameraController.Parameters getParameters()
Returns current parameters used by the camera controller.- Returns:
- The parameters.
- See Also:
setParameters(Parameters)
-
setParameters
void setParameters(CameraController.Parameters parameters)
Sets the parameters for the camera controller.- Parameters:
parameters- The parameters.- See Also:
getParameters()
-
startPreview
void startPreview(android.view.Surface previewSurface)
Starts the video preview.- Parameters:
previewSurface- The surface where the video will be rendered.- See Also:
stopPreview()
-
startPreview
void startPreview(android.view.Surface previewSurface, int fpsLimit)Starts the video preview.- Parameters:
previewSurface- The surface where the video will be rendered.fpsLimit- The maximum number of frames rendered to the surface per second (must be positive).- See Also:
stopPreview()
-
stopPreview
void stopPreview()
Stops the video preview.- See Also:
startPreview(Surface)
-
startRecording
void startRecording(VideoConfiguration configuration)
Starts a video recording session based on the specified configuration.- Parameters:
configuration- The configuration for video recording.- See Also:
stopRecording()
-
stopRecording
void stopRecording()
Stops current video recording session.- See Also:
startRecording(VideoConfiguration)
-
isRecording
boolean isRecording()
- Returns:
- True if a recording session is in progress, false otherwise.
- See Also:
startRecording(VideoConfiguration),stopRecording()
-
getCurrentFragmentDuration
int getCurrentFragmentDuration()
- Returns:
- Current duration of the fragment being recorded or 0 if recording is stopped.
-
getCurrentFragmentSize
long getCurrentFragmentSize()
- Returns:
- Current size in bytes of the fragment being recorded or 0 if recording is stopped.
-
takeSnapshot
void takeSnapshot()
Creates a new snapshot (image) and a new associated library item.
-
getSupportedVideoSizes
java.util.List<android.util.Size> getSupportedVideoSizes()
Returns the list of supported video resolutions for the device.- Returns:
- The list of resolutions.
-
-