Loading app/src/main/java/net/sourceforge/opencamera/Preview/Preview.java +33 −13 Original line number Diff line number Diff line Loading @@ -4283,7 +4283,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu /** Start video recording. */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) private void startVideoRecording(boolean max_filesize_restart) { private void startVideoRecording(final boolean max_filesize_restart) { focus_success = FOCUS_DONE; // clear focus rectangle (don't do for taking photos yet) // initialise just in case: boolean created_video_file = false; Loading Loading @@ -4505,9 +4505,39 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu camera_controller.initVideoRecorderPostPrepare(video_recorder); if( MyDebug.LOG ) Log.d(TAG, "about to start video recorder"); try { video_recorder.start(); videoRecordingStarted(max_filesize_restart); } catch(RuntimeException e) { // needed for emulator at least - although MediaRecorder not meant to work with emulator, it's good to fail gracefully if( MyDebug.LOG ) Log.e(TAG, "runtime exception starting video recorder"); e.printStackTrace(); // told_app_starting must be true if we're here applicationInterface.stoppingVideo(); failedToStartVideoRecorder(profile); } /*new AsyncTask<Void, Void, Void>() { private static final String TAG = "video_recorder.start"; @Override protected Void doInBackground(Void... voids) { if( MyDebug.LOG ) Log.d(TAG, "doInBackground, async task: " + this); video_recorder.start(); return null; } protected void onPostExecute(Void param) { if( MyDebug.LOG ) Log.d(TAG, "onPostExecute, async task: " + this); videoRecordingStarted(max_filesize_restart); } }.execute();*/ } catch(IOException e) { if( MyDebug.LOG ) Log.e(TAG, "failed to save video"); Loading @@ -4523,16 +4553,6 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu applicationInterface.cameraInOperation(false, true); this.reconnectCamera(true); } catch(RuntimeException e) { // needed for emulator at least - although MediaRecorder not meant to work with emulator, it's good to fail gracefully if( MyDebug.LOG ) Log.e(TAG, "runtime exception starting video recorder"); e.printStackTrace(); if( told_app_starting ) { applicationInterface.stoppingVideo(); } failedToStartVideoRecorder(profile); } catch(CameraControllerException e) { if( MyDebug.LOG ) Log.e(TAG, "camera exception starting video recorder"); Loading Loading
app/src/main/java/net/sourceforge/opencamera/Preview/Preview.java +33 −13 Original line number Diff line number Diff line Loading @@ -4283,7 +4283,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu /** Start video recording. */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) private void startVideoRecording(boolean max_filesize_restart) { private void startVideoRecording(final boolean max_filesize_restart) { focus_success = FOCUS_DONE; // clear focus rectangle (don't do for taking photos yet) // initialise just in case: boolean created_video_file = false; Loading Loading @@ -4505,9 +4505,39 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu camera_controller.initVideoRecorderPostPrepare(video_recorder); if( MyDebug.LOG ) Log.d(TAG, "about to start video recorder"); try { video_recorder.start(); videoRecordingStarted(max_filesize_restart); } catch(RuntimeException e) { // needed for emulator at least - although MediaRecorder not meant to work with emulator, it's good to fail gracefully if( MyDebug.LOG ) Log.e(TAG, "runtime exception starting video recorder"); e.printStackTrace(); // told_app_starting must be true if we're here applicationInterface.stoppingVideo(); failedToStartVideoRecorder(profile); } /*new AsyncTask<Void, Void, Void>() { private static final String TAG = "video_recorder.start"; @Override protected Void doInBackground(Void... voids) { if( MyDebug.LOG ) Log.d(TAG, "doInBackground, async task: " + this); video_recorder.start(); return null; } protected void onPostExecute(Void param) { if( MyDebug.LOG ) Log.d(TAG, "onPostExecute, async task: " + this); videoRecordingStarted(max_filesize_restart); } }.execute();*/ } catch(IOException e) { if( MyDebug.LOG ) Log.e(TAG, "failed to save video"); Loading @@ -4523,16 +4553,6 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu applicationInterface.cameraInOperation(false, true); this.reconnectCamera(true); } catch(RuntimeException e) { // needed for emulator at least - although MediaRecorder not meant to work with emulator, it's good to fail gracefully if( MyDebug.LOG ) Log.e(TAG, "runtime exception starting video recorder"); e.printStackTrace(); if( told_app_starting ) { applicationInterface.stoppingVideo(); } failedToStartVideoRecorder(profile); } catch(CameraControllerException e) { if( MyDebug.LOG ) Log.e(TAG, "camera exception starting video recorder"); Loading