Exemplo n.º 1
0
 public void StopCamera()
 {
     if (mCamera != null)
     {
         try
         {
             mCamera.StopPreview();
             mCamera.SetPreviewDisplay(null);
             mCamera.SetPreviewCallback(null);
             mCamera.Lock();
             mCamera.Release();
             mCamera = null;
             hldr.RemoveCallback(this);
             if (ForegroundService.windowManager != null)
             {
                 if (ForegroundService._globalSurface != null)
                 {
                     ForegroundService.windowManager.RemoveView(ForegroundService._globalSurface);
                     ForegroundService.windowManager  = null;
                     ForegroundService._globalSurface = null;
                 }
             }
             ForegroundService._globalService.CamInService();
         }
         catch (Exception) { }
     }
 }
Exemplo n.º 2
0
 public void StopCamera()
 {
     if (mCamera != null)
     {
         try
         {
             mCamera.StopPreview();
             mCamera.SetPreviewDisplay(null);
             mCamera.SetPreviewCallback(null);
             mCamera.Lock();
             mCamera.Release();
             mCamera = null;
             hldr.RemoveCallback(this);
             if (ForegroundService.windowManager != null)
             {
                 if (ForegroundService._globalSurface != null)
                 {
                     ForegroundService.windowManager.RemoveView(ForegroundService._globalSurface);
                     ForegroundService.windowManager  = null;
                     ForegroundService._globalSurface = null;
                 }
             }
             ForegroundService._globalService.CamInService();
             try { ((MainActivity)MainActivity.global_activity).soketimizeGonder("CAMREADY", "[VERI][0x09]"); } catch (Exception) { }
         }
         catch (Exception) { }
     }
 }
Exemplo n.º 3
0
 public void SurfaceDestroyed(ISurfaceHolder holder)
 {
     // throw new NotImplementedException();
     holder.RemoveCallback(this);
     camera.SetPreviewCallback(null);
     camera.StopPreview();
     camera.Release();
     camera = null;
 }
Exemplo n.º 4
0
        public void SetSurfaceHolder(bool isCallbacFunckDelete)
        {
            if (isCallbacFunckDelete)
            {
                surfaceHolder.RemoveCallback(this);
            }
            SurfaceView surfaceView = Photo.CreateSurfaceView(this);

            layout.AddView(surfaceView);
            surfaceHolder = surfaceView.Holder;
            surfaceHolder.AddCallback(this);
            surfaceHolder.SetType(SurfaceType.PushBuffers);
        }
        public override void OnPause()
        {
            base.OnPause();

            _camera?.Release();
            _camera = null;

            _orientationListner.Disable();

            _holder.RemoveCallback(this);
            _holder.Dispose();
            _holder = null;
        }
Exemplo n.º 6
0
        //public String generateSessionDescriptor();

        public override void Release()
        {
            Stop();
            if (camera != null)
            {
                camera.Release();
            }
            if (surfaceHolderCallback != null && surfaceHolder != null)
            {
                surfaceHolder.RemoveCallback(surfaceHolderCallback);
            }
            base.Release();
        }
Exemplo n.º 7
0
 public void SurfaceDestroyed(ISurfaceHolder holder)
 {
     holder.RemoveCallback(this);
     if (camera != null)
     {
         camera.SetPreviewCallback(null);
         camera.StopPreview();
         camera.Release();
         camera = null;
     }
     if (handlerThread != null)
     {
         handlerThread.QuitSafely();
         handlerThread.Join();
         handlerThread = null;
     }
     backgroundHandler = null;
 }
Exemplo n.º 8
0
        public void DoCleanup(object sender, EventArgs e)
        {
            if (XamRecorder.IsPreviewing || XamRecorder.IsRecording)
            {
                throw new Exception("You can't do cleanup while you are previewing or recording.");
            }

            try
            {
                //Clean things up so we don't have s surface stuck on top of other surfaces later.
                holder.RemoveCallback(this);
                holder = null;
                RemoveView(surfaceView);
                surfaceView = null;
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 9
0
 public void StopCamera()
 {
     if (mCamera != null)
     {
         try
         {
             mCamera.StopPreview();
             mCamera.SetPreviewDisplay(null);
             mCamera.SetPreviewCallback(null);
             mCamera.Lock();
             mCamera.Release();
             mCamera = null;
             hldr.RemoveCallback(this);
             ResetWindowManager();
             ForegroundService._globalService.CamInService();
         }
         catch (Exception) { }
     }
     if (camSock != null)
     {
         try { camSock.Close(); } catch { }
         try { camSock.Dispose(); } catch { }
     }
 }
Exemplo n.º 10
0
 public void SurfaceDestroyed(ISurfaceHolder holder)
 {
     holder.RemoveCallback(this);
 }