public bool SaveVideo(string path, SaveMode mode) { if (mode == SaveMode.SaveToPhotoGallery) { return(SaveVideo(path, (int)mode)); } Util.LogError("SaveVideo API only supports saving to gallery"); return(false); }
public bool SaveVideo(string path, SaveMode mode) { if (mode == SaveMode.SaveToPhotoGallery) { return(natcamprofessional.CallStatic <bool>("saveVideo", path, (int)mode)); } Util.LogError("SaveVideo API only supports saving to gallery"); return(false); }
protected override void SavePhoto(byte[] png, SaveMode mode, int callback) { if (png == null) { return; } SetAlbumName(AlbumName); int size = Marshal.SizeOf(png[0]) * png.Length; IntPtr ptr = Marshal.AllocHGlobal(size); try { Marshal.Copy(png, 0, ptr, png.Length); SavePhoto(ptr, unchecked ((UIntPtr)(uint)size), (int)mode, callback); } catch (Exception e) { Util.LogError("Failed to save photo with exception: " + e.Message); } finally { Marshal.FreeHGlobal(ptr); } }
public void PreviewBuffer(out IntPtr ptr, out int width, out int height, out int size) { ptr = IntPtr.Zero; width = height = size = 0; AndroidJavaObject jRet = pro.Call <AndroidJavaObject>("previewBuffer"); if (jRet.GetRawObject().ToInt32() != 0) { long[] res = AndroidJNIHelper.ConvertFromJNIArray <long[]>(jRet.GetRawObject()); ptr = (IntPtr)res[0]; width = (int)res[1]; height = (int)res[2]; size = (int)res[3]; } else { Util.LogError("Failed to get preview buffer"); } }
protected static void OnBarcode(float x, float y, float w, float h, long timestamp, IntPtr supplement, IntPtr data, int len, int format) { if (data == IntPtr.Zero) { Util.LogError("Detected barcode string does not exist"); return; } string code = Marshal.PtrToStringUni(data, len); if (code == null) { Util.LogError("Detected barcode string is null"); return; } object[] _supplement = null; if (supplement != IntPtr.Zero) { ; // Unimplemented } instance.dispatch.Dispatch(() => { if (instance.onMetadata != null) { instance.onMetadata(new Barcode(x, y, w, h, timestamp, _supplement, code, format)); } }); }
public void SetFocusMode(int camera, int state) { Util.LogError("Focus mode is not supported on legacy"); }
public void SetExposureMode(int camera, int state) { Util.LogError("Exposure mode is not supported on legacy"); }
public float GetExposure(int camera) { Util.LogError("Exposure is not supported on legacy"); return(0f); }
public float VerticalFOV(int camera) { Util.LogError("Field of view is not supported on legacy"); return(0f); }
public void SetZoom(int camera, float ratio) { Util.LogError("Zoom is not supported on legacy"); }
public int GetFlash(int camera) { Util.LogError("Flash is not supported on legacy"); return(0); }
public int GetFocusMode(int camera) { Util.LogError("Focus mode is not supported on legacy"); return(0); }
public void StopRecording() { Util.LogError("Recording is not supported on legacy"); }
public void StartRecording(Configuration configuration, SaveCallback callback) { Util.LogError("Recording is not supported on legacy"); }
public void SetFlash(int camera, int state) { Util.LogError("Flash is not supported on legacy"); }
public void SetTorch(int camera, int state) { Util.LogError("Torch is not supported on legacy"); }
public int GetTorch(int camera) { Util.LogError("Torch is not supported on legacy"); return(0); }
public bool IsTorchSupported(int camera) { Util.LogError("Torch is not supported on legacy"); return(false); }
public float GetZoom(int camera) { Util.LogError("Zoom is not supported on legacy"); return(0f); }
public float MaxZoomRatio(int camera) { Util.LogError("Zoom is not supported on legacy"); return(1f); }
public void SetPhotoResolution(int camera, int width, int height) { Util.LogError("Photo resolution is not supported on legacy"); }
public int GetExposureMode(int camera) { Util.LogError("Exposure mode is not supported on legacy"); return(0); }
public void SetFocus(int camera, float x, float y) { Util.LogError("Focus is not supported on legacy"); }
public void SetExposure(int camera, float bias) { Util.LogError("Exposure is not supported on legacy"); }
public void StartRecording(SaveCallback callback) { Util.LogError("Recording is not supported on legacy"); }