Ejemplo n.º 1
0
        private void HandleOnPreviewFrameReady(object sender, FastJavaByteArray fastArray)
        {
            cameraFPSCounter.Report();

            if (!CanAnalyzeFrame)
            {
                return;
            }

            processingFPSCounter.Report();

            processingTask = Task.Run(() =>
            {
                try
                {
                    DecodeFrame(fastArray);
                } catch (Exception ex) {
                    Console.WriteLine(ex);
                }
            }).ContinueWith(task =>
            {
                if (task.IsFaulted)
                {
                    Debug.WriteLine("DecodeFrame exception occurs");
                }
            }, TaskContinuationOptions.OnlyOnFaulted);
        }
Ejemplo n.º 2
0
        private void HandleOnPreviewFrameReady(IntPtr address, int w, int h)
        {
            if (!canAnalyze)
            {
                return;
            }

            processingFPSCounter.Report();
            try
            {
                DecodeFrame(address, w, h);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }