Example #1
0
 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);
 }
Example #2
0
 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);
 }
Example #3
0
        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); }
        }
Example #4
0
        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");
            }
        }
Example #5
0
        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));
                }
            });
        }
Example #6
0
 public void SetFocusMode(int camera, int state)
 {
     Util.LogError("Focus mode is not supported on legacy");
 }
Example #7
0
 public void SetExposureMode(int camera, int state)
 {
     Util.LogError("Exposure mode is not supported on legacy");
 }
Example #8
0
 public float GetExposure(int camera)
 {
     Util.LogError("Exposure is not supported on legacy");
     return(0f);
 }
Example #9
0
 public float VerticalFOV(int camera)
 {
     Util.LogError("Field of view is not supported on legacy");
     return(0f);
 }
Example #10
0
 public void SetZoom(int camera, float ratio)
 {
     Util.LogError("Zoom is not supported on legacy");
 }
Example #11
0
 public int GetFlash(int camera)
 {
     Util.LogError("Flash is not supported on legacy");
     return(0);
 }
Example #12
0
 public int GetFocusMode(int camera)
 {
     Util.LogError("Focus mode is not supported on legacy");
     return(0);
 }
Example #13
0
 public void StopRecording()
 {
     Util.LogError("Recording is not supported on legacy");
 }
Example #14
0
 public void StartRecording(Configuration configuration, SaveCallback callback)
 {
     Util.LogError("Recording is not supported on legacy");
 }
Example #15
0
 public void SetFlash(int camera, int state)
 {
     Util.LogError("Flash is not supported on legacy");
 }
Example #16
0
 public void SetTorch(int camera, int state)
 {
     Util.LogError("Torch is not supported on legacy");
 }
Example #17
0
 public int GetTorch(int camera)
 {
     Util.LogError("Torch is not supported on legacy");
     return(0);
 }
Example #18
0
 public bool IsTorchSupported(int camera)
 {
     Util.LogError("Torch is not supported on legacy");
     return(false);
 }
Example #19
0
 public float GetZoom(int camera)
 {
     Util.LogError("Zoom is not supported on legacy");
     return(0f);
 }
Example #20
0
 public float MaxZoomRatio(int camera)
 {
     Util.LogError("Zoom is not supported on legacy");
     return(1f);
 }
Example #21
0
 public void SetPhotoResolution(int camera, int width, int height)
 {
     Util.LogError("Photo resolution is not supported on legacy");
 }
Example #22
0
 public int GetExposureMode(int camera)
 {
     Util.LogError("Exposure mode is not supported on legacy");
     return(0);
 }
Example #23
0
 public void SetFocus(int camera, float x, float y)
 {
     Util.LogError("Focus is not supported on legacy");
 }
Example #24
0
 public void SetExposure(int camera, float bias)
 {
     Util.LogError("Exposure is not supported on legacy");
 }
Example #25
0
 public void StartRecording(SaveCallback callback)
 {
     Util.LogError("Recording is not supported on legacy");
 }