Class AndroidVideoApi5JniWrapper
java.lang.Object
org.linphone.mediastream.video.capture.AndroidVideoApi5JniWrapper
Wrapper for Android Camera API. Used by Mediastreamer to record
video from webcam.
This file depends only on Android SDK superior or egal to 5
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
activateAutoFocus
(Object cam) protected static void
applyCameraParameters
(android.hardware.Camera camera, int width, int height, int requestedFps) static int
detectCameras
(int[] indexes, int[] frontFacing, int[] orientation) static int
static void
putImage
(long nativePtr, byte[] buffer) static int[]
selectNearestResolutionAvailable
(int cameraId, int requestedW, int requestedH) Return the hw-available available resolution best matching the requested one.protected static int[]
selectNearestResolutionAvailableForCamera
(int id, int requestedW, int requestedH) static void
setPreviewDisplaySurface
(Object cam, Object surf) static Object
startRecording
(int cameraId, int width, int height, int fps, int rotation, long nativePtr) static void
stopRecording
(Object cam)
-
Field Details
-
isRecording
public static boolean isRecording
-
-
Constructor Details
-
AndroidVideoApi5JniWrapper
public AndroidVideoApi5JniWrapper()
-
-
Method Details
-
putImage
public static void putImage(long nativePtr, byte[] buffer) -
detectCamerasCount
public static int detectCamerasCount() -
detectCameras
public static int detectCameras(int[] indexes, int[] frontFacing, int[] orientation) -
selectNearestResolutionAvailable
public static int[] selectNearestResolutionAvailable(int cameraId, int requestedW, int requestedH) Return the hw-available available resolution best matching the requested one. Best matching meaning : - try to find the same one - try to find one just a little bigger (ex: CIF when asked QVGA) - as a fallback the nearest smaller one- Parameters:
cameraId
- Camera idrequestedW
- Requested video size widthrequestedH
- Requested video size height- Returns:
- int[width, height] of the chosen resolution, may be null if no resolution can possibly match the requested one
-
activateAutoFocus
-
startRecording
public static Object startRecording(int cameraId, int width, int height, int fps, int rotation, long nativePtr) -
stopRecording
-
setPreviewDisplaySurface
-
selectNearestResolutionAvailableForCamera
protected static int[] selectNearestResolutionAvailableForCamera(int id, int requestedW, int requestedH) -
applyCameraParameters
protected static void applyCameraParameters(android.hardware.Camera camera, int width, int height, int requestedFps)
-