2013-02-18 15 views
6

Chiamare il numero stop() sul mio MediaRecorder si blocca indefinitamente sulla fotocamera Samsung Galaxy. Anche piazzare questa chiamata in un thread separato non aiuta il problema.MediaRecorder.stop() si blocca su Samsung Galaxy Camera

Logcat non mostra alcun messaggio di errore. Tuttavia, l'esecuzione della stessa app non comporta problemi sul Samsung Galaxy Nexus.

Questo è il codice che circonda la mia chiamata a stop:

View.OnClickListener captureListener = new View.OnClickListener() { 
    @Override 
    public void onClick(View v) { 
     if (isRecording) { 
      // stop recording and release camera 
      mMediaRecorder.stop(); 
      releaseMediaRecorder(); // release the MediaRecorder object 
      mCamera.lock();   // take camera access back from MediaRecorder 
      // inform the user that recording has stopped 
      captureButton.setText("Capture"); 
      isRecording = false; 
     } else { 
      // initialize video camera 
      if (prepareVideoRecorder()) { 
       // Camera is available and unlocked, MediaRecorder is prepared, 
       // now you can start recording 
       mMediaRecorder.start(); 
       // inform the user that recording has started 
       captureButton.setText("Stop"); 
       isRecording = true; 
      } else { 
       // prepare didn't work, release the camera 
       releaseMediaRecorder(); 
       // inform user 
      } 
     } 
    } 
}; 

risposta

0

Una cosa che ho visto è che per alcuni dispositivi MediaRecorder.stop() si blocca se non v'è alcuna anteprima attaccato (cioè hai chiamato Camera.stopPreview () prima o forse non hai mai chiamato startPreview()).

Problemi correlati