Exemplo n.º 1
0
 public void Pause()
 {
     #if NATCAM_EXTENDED
     onMetadata = null;
     #endif
     NatCamNative.Pause();
 }
Exemplo n.º 2
0
 public void Play()
 {
     dispatch = dispatch ?? new MainDispatch();
     #if NATCAM_EXTENDED
     SetDetection(onMetadata != null, UseCoreImageMetadataBackend);
     #endif
     OnOrient(DispatchUtility.Orientation);
     NatCamNative.Play();
 }
Exemplo n.º 3
0
 private void OnPause(bool paused)
 {
     #if NATCAM_PROFESSIONAL
     if (IsRecording)
     {
         Utilities.LogError("Suspending app while recording. Ending recording");
         StopRecording();
     }
     #endif
     NatCamNative.OnPause(paused);
 }
Exemplo n.º 4
0
 public NatCamiOS()
 {
     DispatchUtility.onPause  += OnPause;
     DispatchUtility.onOrient += OnOrient;
     NatCamNative.RegisterCoreCallbacks(INatCamBase.OnStart, INatCamBase.OnFrame, INatCamBase.OnPhoto);
     #if NATCAM_EXTENDED
     NatCamNative.RegisterExtendedCallbacks(OnBarcode, OnFace, OnText, OnSave);
     #endif
     #if NATCAM_PROFESSIONAL
     SetBitrate(VideoBitrate);
     SetRecordAudio(RecordAudio);
     NatCamNative.RegisterProfessionalCallbacks(OnVideo);
     #endif
 }
Exemplo n.º 5
0
 public NatCamAndroid()
 {
     natcam                    = new AndroidJavaClass("com.yusufolokoba.natcam.NatCam");
     renderDispatch            = new RenderDispatch();
     DispatchUtility.onPause  += OnPause;
     DispatchUtility.onOrient += OnOrient;
     Native.RegisterCoreCallbacks(INatCamBase.OnStart, INatCamBase.OnFrame, INatCamBase.OnPhoto);
     #if NATCAM_EXTENDED
     natcamextended = new AndroidJavaClass("com.yusufolokoba.natcamextended.NatCamExtended");
     Native.RegisterExtendedCallbacks(OnBarcode, OnFace, OnText, OnSave);
     #endif
     #if NATCAM_PROFESSIONAL
     natcamprofessional = new AndroidJavaClass("com.yusufolokoba.natcamprofessional.NatCamProfessional");
     natcamprofessional.CallStatic("setBitrate", VideoBitrate);
     natcamprofessional.CallStatic("setRecordAudio", RecordAudio);
     Native.RegisterProfessionalCallbacks(OnVideo);
     #endif
 }
Exemplo n.º 6
0
 public void Release()
 {
     onStart     =
         onFrame = null;
     #if NATCAM_EXTENDED
     onMetadata = null;
     #endif
     #if NATCAM_PROFESSIONAL
     ReleasePreviewBuffer();
     #endif
     NatCamNative.Release();
     if (preview != null)
     {
         MonoBehaviour.Destroy(preview);
     }
     preview = null;
     if (dispatch != null)
     {
         dispatch.Release();
     }
     dispatch = null;
 }
Exemplo n.º 7
0
 private void OnOrient(Orientation orientation)
 {
     NatCamNative.SetOrientation((byte)orientation);
 }
Exemplo n.º 8
0
 public void SetFlipy(bool ifenable)
 {
     NatCamNative.SetFlipy(ifenable);
 }
Exemplo n.º 9
0
 public void CapturePhoto(PhotoCallback callback)
 {
     photoCallback = callback;
     NatCamNative.CapturePhoto();
 }
Exemplo n.º 10
0
 public static int GetCameraDeviceCount()
 {
     return(NatCamNative.GetCameraDeviceCount());
 }
Exemplo n.º 11
0
 private void ReleasePreviewBuffer()
 {
     NatCamNative.ReleasePreviewBuffer();
 }
Exemplo n.º 12
0
 protected override void InitializePreviewBuffer()
 {
     NatCamNative.InitializePreviewBuffer();
 }
Exemplo n.º 13
0
 public void StopRecording()
 {
     NatCamNative.StopRecording();
 }
Exemplo n.º 14
0
 public void StartRecording(SaveCallback callback)
 {
     recordingCallback = callback;
     NatCamNative.StartRecording();
 }
Exemplo n.º 15
0
 public void PreviewBuffer(out IntPtr ptr, out int width, out int height, out int size)
 {
     NatCamNative.PreviewBuffer(out ptr, out width, out height, out size);
 }