public void SurfaceCreated(ISurfaceHolder holder)
 {
     holder.SetType(SurfaceType.Gpu);
     holder.SetKeepScreenOn(true);
     if (mPlayer != null)
     {
         mPlayer.SetVideoSurface(mSurfaceView.Holder.Surface);
     }
 }
Exemplo n.º 2
0
        // Start recognition
        public void startRecognition()
        {
            // Do not switch off the screen while text capture service is running
            previewSurfaceHolder.SetKeepScreenOn(true);
            // Get area of interest (in coordinates of preview frames)
            Rect areaOfInterest = new Rect(surfaceViewWithOverlay.getAreaOfInterest());

            // Clear error message
            errorTextView.Text = "";
            // Start the service
            textCaptureService.Start(cameraPreviewSize.Width, cameraPreviewSize.Height, orientation, areaOfInterest);
            // Change the text on the start button to 'Stop'
            startButton.Text    = BUTTON_TEXT_STOP;
            startButton.Enabled = true;
        }