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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidactivateAutoFocus(Object cam) protected static voidapplyCameraParameters(android.hardware.Camera camera, int width, int height, int requestedFps) static intdetectCameras(int[] indexes, int[] frontFacing, int[] orientation) static intstatic voidputImage(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 voidsetPreviewDisplaySurface(Object cam, Object surf) static ObjectstartRecording(int cameraId, int width, int height, int fps, int rotation, long nativePtr) static voidstopRecording(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)
-